Fulls screen toggle

This forum is for eXpress++ general support.
Message
Author
User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Fulls screen toggle

#1 Post by jdsoft »

Hello,

I need my Express application to fill the complete screen (cash-register application).
To titlebar, Windows startmenu is hidden under the application.
So a real full-screen.
I almost got it right, but I get a grey-space in the top of the dialog, just between the menubar and the red button. :(
The red button should be just 5 pixles below the menubar.
In "Normal" mode, the resize option takes care of resize a toolbar and other controls without problems..
What is my mistake?

See attached 2 screen shots.
The first is full screen with the grey-space in the top. (Light-grey, you need to look carefully)
The second is the normal dialog


Regards,
Jack Duijf

Code: Select all

Procedure ToggleFullScreen()
LOCAL oDlg           := GetApplication():MainForm  (Dc_Dialog1, main app dialog)
LOCAL oRect          := nil
If oDlg:TitleBar
   oDlg:TitleBar     := FALSE
   oDlg:Border       := XBPDLG_NO_BORDER
   oRect             := GetDesktopRect()  // Get screen dimensions  (1920 x 1200)
   oDlg:SetPosAndSize({0,0},{oRect:Right,oRect:Bottom})  // Set full screen
   oDlg:Configure() // Removes titlebar and borders
Else
   oDlg:Border       := XBPDLG_SIZEBORDER
   oDlg:TitleBar     := TRUE
   oDlg:Configure() // Titlebar and border are back again.
Endif
Return
Attachments
Full screen dialog, notice there is no titlebar, but extra space between the menubar and the the red button.
Full screen dialog, notice there is no titlebar, but extra space between the menubar and the the red button.
FullScreenDialog.jpg (120.58 KiB) Viewed 12984 times
Normal dialog, notice there is a  titlebar, and no extra space between the menubar and the re d button.
Normal dialog, notice there is a titlebar, and no extra space between the menubar and the re d button.
NormalDialog.jpg (172.64 KiB) Viewed 12984 times
Regards,
Jack Duijf

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Fulls screen toggle

#2 Post by rdonnay »

I think I may know what is happening. Are you using the FIT clause in your DCREAD GUI command?
The eXpress train is coming - and it has more cars.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: Fulls screen toggle

#3 Post by jdsoft »

Hello Roger,

No FIT clause is used.

Regards,
Jack Duijf

Code: Select all

DCGETOPTIONS ;
   NAME SalonNet_AppNaam() + " " ;
   WINDOWHEIGHT aSize[2]-20;
   WINDOWWIDTH aSize[1] ;
   HELPFILE (CurDrive() + ":" + CurDir() + "\DOC\") ;
   COLOR Sy_DC_READ_BgColor()                   ;
   BITMAP nBitmap ;
   NOBUSY ;
   NOESCAPEKEY ;
   TOOLTIPCOLOR GRA_CLR_BLACK, GRA_CLR_YELLOW ;
   ABORTQUERY MSG {||oData:CloseDialog()} ;
   CLOSEQUERY MSG {||oData:CloseDialog()} ;
   EVAL {|o|SetAppWindow(o),GetApplication():SetMainForm(o),_SetDialogColour(),GetApplication():Cargo := oData}

DC_BitMapTransparentColor(GraMakeRGBColor( { 255,255, 255}))

dcread gui ;
   TITLE cAppName;
      options getoptions;
      setappwindow ;
      EVAL oData:bMainEval

Regards,
Jack Duijf

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Fulls screen toggle

#4 Post by rdonnay »

Then I don't think I know without more I fo. Do you have a sample program I can compile and run?
The eXpress train is coming - and it has more cars.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: Fulls screen toggle

#5 Post by jdsoft »

Hello Roger,

Attached you find a sample program.
I requires ot2xb to get the desktop size.

Jack
Attachments
FullScreen.zip
Sample programm fullscreen
(70.42 KiB) Downloaded 688 times
Regards,
Jack Duijf

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Fulls screen toggle

#6 Post by rdonnay »

I requires ot2xb to get the desktop size.
Couldn't you get that from DC_GetWorkArea()?
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1421
Joined: Wed Feb 24, 2010 3:44 pm

Re: Fulls screen toggle

#7 Post by Auge_Ohr »

jdsoft wrote:To titlebar, Windows startmenu is hidden under the application.
So a real full-screen.

Code: Select all

   oRect             := GetDesktopRect()  // Get screen dimensions  (1920 x 1200)
   oDlg:SetPosAndSize({0,0},{oRect:Right,oRect:Bottom})  // Set full screen
why Windows API ?

Code: Select all

PROCEDURE MAIN
   ? Var2Char( AppDeskTop():CurrentSize() ) // primary Monitor
   ? Var2Char( DC_GetWorkArea() )           // use SystemParametersInfoA( SPI_GETWORKAREA )
you will get diffent Result when Windows Startmenu Taskbar is shown (default)
greetings by OHR
Jimmy

User avatar
Tom
Posts: 1185
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Fulls screen toggle

#8 Post by Tom »

Hi, Jack.

Let's check if I understand what you're talking about. A dialog is created (and shown?) - with titlebar. You change the attributes (remove the titlebar) and resize the dialog. Now, there's a space added between menu bar and the buttons. That's the problem. Correct?

There is a repos missing for all dialog elements. Since you add a border when changing the size by removing the title bar, this space is added on top of the drawingarea. Your buttons are created and positioned from bottom to top. Position 1,600 is still 600 pixels from the bottom. You need to shift all elements up by the space added when removing the titlebar.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4745
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Fulls screen toggle

#9 Post by rdonnay »

Jack -

I ran your sample program and don't know how to reproduce your problem.
What do I do?
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1185
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Fulls screen toggle

#10 Post by Tom »

The problem is the button "Toggle Dialog" staying at it's position. Jack wants it to move up when the border is removed.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply