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

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
digitsoft
Posts: 461
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

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

#1 Post by digitsoft »

Hi Roger
How can I center a screen at the end of the desktop?
Nolberto Paulino
Regards

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

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

#2 Post 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?
The eXpress train is coming - and it has more cars.

User avatar
digitsoft
Posts: 461
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

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

#3 Post 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?
Attachments
Sin título.jpg
Sin título.jpg (316.78 KiB) Viewed 9633 times
Nolberto Paulino
Regards

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

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

#4 Post 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
The eXpress train is coming - and it has more cars.

User avatar
digitsoft
Posts: 461
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

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

#5 Post 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
Nolberto Paulino
Regards

User avatar
digitsoft
Posts: 461
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

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

#6 Post 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
Nolberto Paulino
Regards

Post Reply