Dialog Centering

Dialog Centering

Postby TimStone » Wed Oct 10, 2007 10:03 pm

I am curious about centering dialogs in the primary window. I open the program with a Window oWnd. Then, I create dialogs OF oWnd. The window takes up the whole monitor ( wide angle ) and the dialogs are activated CENTERED. This is fine until I reduce the size of the window. The dialogs still center on the screen and not the window area.

I would think that the OF oWnd would translate to centering the dialog on the window area of the opening program. Why not ? Is there a way around this ?

Thanks.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby Otto » Wed Oct 10, 2007 10:16 pm

Tim,
maybe you can use resize?
Regards,
Otto

ACTIVATE WINDOW oWnd
ON RESIZE ( ;
oLbxl:nTop := oWndt:nHeight()- 280 ,;
oSay:nLeft := oWnd:nWidth() - 240,;
cCbx:nLeft := oWnd:nWidth() - 130) VALID (oWnd:=NIL, .T.)
User avatar
Otto
 
Posts: 6327
Joined: Fri Oct 07, 2005 7:07 pm

Postby nageswaragunupudi » Wed Oct 10, 2007 10:38 pm

This works

ACTIVATE DIALOG oDlg ON INIT oDlg:center(oWndMain)
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10622
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby James Bott » Thu Oct 11, 2007 12:25 am

Note that wndMain() always returns the main window object so you never need to pass it around as a parameter. So you can do:

ACTIVATE DIALOG oDlg ON INIT oDlg:center( wndMain() )

instead.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Thanks

Postby TimStone » Thu Oct 11, 2007 2:33 am

It works fine ... oh for some documentation !
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 69 guests