Page 1 of 1

How can I center a screen at the end of the desktop?

Posted: Fri Apr 06, 2018 11:06 am
by digitsoft
Hi Roger
How can I center a screen at the end of the desktop?

Re: How can I center a screen at the end of the desktop?

Posted: Fri Apr 06, 2018 11:24 am
by rdonnay
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?

Re: How can I center a screen at the end of the desktop?

Posted: Fri Apr 06, 2018 11:31 am
by digitsoft
I'm sending you a photo as I want it to fit on any pc screen.
It's for use on a pc touch tablet.


I'm sending you a photo as I want it to fit on any pc screen


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?

Re: How can I center a screen at the end of the desktop?

Posted: Fri Apr 06, 2018 12:08 pm
by rdonnay
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

Re: How can I center a screen at the end of the desktop?

Posted: Fri Apr 06, 2018 12:25 pm
by digitsoft
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

Re: How can I center a screen at the end of the desktop?

Posted: Fri Apr 06, 2018 3:41 pm
by digitsoft
Thank you
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