Page 1 of 2

Fulls screen toggle

Posted: Sun Jan 11, 2015 3:33 pm
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

Re: Fulls screen toggle

Posted: Sun Jan 11, 2015 9:33 pm
by rdonnay
I think I may know what is happening. Are you using the FIT clause in your DCREAD GUI command?

Re: Fulls screen toggle

Posted: Sun Jan 11, 2015 11:57 pm
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


Re: Fulls screen toggle

Posted: Mon Jan 12, 2015 7:28 am
by rdonnay
Then I don't think I know without more I fo. Do you have a sample program I can compile and run?

Re: Fulls screen toggle

Posted: Mon Jan 12, 2015 4:03 pm
by jdsoft
Hello Roger,

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

Jack

Re: Fulls screen toggle

Posted: Mon Jan 12, 2015 5:36 pm
by rdonnay
I requires ot2xb to get the desktop size.
Couldn't you get that from DC_GetWorkArea()?

Re: Fulls screen toggle

Posted: Tue Jan 13, 2015 12:15 am
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)

Re: Fulls screen toggle

Posted: Tue Jan 13, 2015 7:17 am
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.

Re: Fulls screen toggle

Posted: Tue Jan 13, 2015 8:28 am
by rdonnay
Jack -

I ran your sample program and don't know how to reproduce your problem.
What do I do?

Re: Fulls screen toggle

Posted: Tue Jan 13, 2015 8:53 am
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.