How to receive Windows <ON MOVE> new top/left-position

How to receive Windows <ON MOVE> new top/left-position

Postby ukoenig » Wed Dec 29, 2010 12:11 pm

Hello,

I need the new TOP/LEFT - position of a Window to be returned with < ON MOVE >.
I getting allways the old Values from Start-position ( no change ).
Using < ON RESIZE > it works with => oWnd:nTop(), oWnd:nLeft()

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to receive Windows <ON MOVE> new top/left-position

Postby James Bott » Wed Dec 29, 2010 7:19 pm

Uwe,

Below is from my notes. Maybe it is what you need.

James

Note that this method updates the instance vars containing the coordinates of the client area of the window, nTop,nBottom,nWidth, and nHeight. These are NOT the coordinates of the window itself.

To get the coordinates of the window you will have to add the width or height of any objects attached to the window client oClient.

oWnd:coorsUpdate()
nTop:= oWnd:nTop
nTop:= nTop + if(oWnd:oTop!=nil,oWnd:oTop:nHeight,0)
// Note that oMenu doesn't have an attribute nHeight. It is fixed at 20 pixels.
nTop:= nTop + if(oWnd:oMenu!=nil,20,0)
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: How to receive Windows <ON MOVE> new top/left-position

Postby ukoenig » Wed Dec 29, 2010 9:36 pm

James,

Thank You very much, it does exactly, what I'm trying to do.
It is a part of my question, how to connect a Dialog to a MDI-child.

viewtopic.php?f=3&t=20559&p=109122#p109122
from Rao :
The real solution is to recheck the issue of transparency of all controls once again,
rather than to look for workarounds of using dialogs.

As long there is no other working solution, we could use it.
To make it complete, Minimize = Dialog:Hide(), Maximize = Dialog:Show()
otherwise, the Dialog stays on Screen.
...
...
ACTIVATE WINDOW oWndEdit ;
ON MOVE ( oWndEdit:CoorsUpdate(), nTop:= oWndEdit:nTop, ;
nTop:= nTop + if(oWndEdit:oTop!=nil,oWnd:oTop:nHeight,0), ;
nLeft:= oWndEdit:nLeft, nLeft:= nLeft + if(oWndEdit:oLeft!=nil,oWnd:oLeft:nWidth,0), ;
oWndCtrl:Move( nTop + 320, nLeft + 80 ) ) ;
ON RESIZE oWndCtrl:Move( oWndEdit:nTop() + 320, oWndEdit:nLeft() + 80 )

Image

Image

Image

Dialog-resize needed, if Child-bottom < ( Dialog-top + Dialog-height )
or if Child-width < ( Dialog-left + Dialog-width )

Image

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 78 guests