FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to receive Windows <ON MOVE> new top/left-position
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
How to receive Windows <ON MOVE> new top/left-position
Posted: 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.
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: How to receive Windows &lt;ON MOVE&gt; new top/left-position
Posted: Wed Dec 29, 2010 07: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)

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: How to receive Windows &lt;ON MOVE&gt; new top/left-position
Posted: Wed Dec 29, 2010 09: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:nHeight,0), ;
nLeft:= oWndEdit:nLeft, nLeft:= nLeft + if(oWndEdit:oLeft!=nil,oWnd:nWidth,0), ;
oWndCtrl:Move( nTop + 320, nLeft + 80 ) ) ;
ON RESIZE oWndCtrl:Move( oWndEdit:nTop() + 320, oWndEdit:nLeft() + 80 )







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



Best Regards
Uwe :-)
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.

Continue the discussion