How can I center a screen at the end of the desktop?
Posted: Fri Apr 06, 2018 11:06 am
Hi Roger
How can I center a screen at the end of the desktop?
How can I center a screen at the end of the desktop?
Donnay Software Web Forums
http://bb.mobile.donnay-software.com/Donnay/
http://bb.mobile.donnay-software.com/Donnay/viewtopic.php?f=2&t=2376
rdonnay wrote:I don't understand the question.
What do you mean by the "end of the desktop" ?
Do you want a dialog centered vertically but aligned to the right?
Do you want a dialog centered horizontally but aligned to the bottom?
Or am I on the wrong track here?
Code: Select all
#INCLUDE "dcdialog.CH"
FUNCTION Main()
LOCAL GetList[0]
FOR i := 1 TO 10
@ i,1 DCSAY 'This is line ' + Alltrim(Str(i)) SAYSIZE 100
NEXT
DCREAD GUI FIT EVAL {|o|AlignWindow(o)}
RETURN nil
* ---------
FUNCTION AlignWindow( oDlg )
LOCAL aCoords := DC_GetWorkArea(), nBottom, nLeft
nBottom := AppDeskTop():currentSize()[2] - aCoords[4]
nLeft := AppDeskTop():currentSize()[1]/2 - oDlg:currentSize()[1]/2
oDlg:setPos({nLeft,nBottom})
RETURN nil
* ---------
PROC appsys
rdonnay wrote:Here is a sample test program:Code: Select all
#INCLUDE "dcdialog.CH" FUNCTION Main() LOCAL GetList[0] FOR i := 1 TO 10 @ i,1 DCSAY 'This is line ' + Alltrim(Str(i)) SAYSIZE 100 NEXT DCREAD GUI FIT EVAL {|o|AlignWindow(o)} RETURN nil * --------- FUNCTION AlignWindow( oDlg ) LOCAL aCoords := DC_GetWorkArea(), nBottom, nLeft nBottom := AppDeskTop():currentSize()[2] - aCoords[4] nLeft := AppDeskTop():currentSize()[1]/2 - oDlg:currentSize()[1]/2 oDlg:setPos({nLeft,nBottom}) RETURN nil * --------- PROC appsys
digitsoft wrote:Thank you
rdonnay wrote:Here is a sample test program:Code: Select all
#INCLUDE "dcdialog.CH" FUNCTION Main() LOCAL GetList[0] FOR i := 1 TO 10 @ i,1 DCSAY 'This is line ' + Alltrim(Str(i)) SAYSIZE 100 NEXT DCREAD GUI FIT EVAL {|o|AlignWindow(o)} RETURN nil * --------- FUNCTION AlignWindow( oDlg ) LOCAL aCoords := DC_GetWorkArea(), nBottom, nLeft nBottom := AppDeskTop():currentSize()[2] - aCoords[4] nLeft := AppDeskTop():currentSize()[1]/2 - oDlg:currentSize()[1]/2 oDlg:setPos({nLeft,nBottom}) RETURN nil * --------- PROC appsys