FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Resizing a window
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Resizing a window
Posted: Sat Dec 08, 2007 12:34 AM
When resizing a window, I can see continuously its vertical size with the following code:
::OnResize := {|r,c,f|  ::cTxt := Str(::nHeight)} 
@ 20,20 Say ::cTxt ........

But, how can I detect the moment when I release the left button so that I can save the window size at that moment? I have tried
bLButtonUp := {|r,c| MsgInfo(Str(::nHeight))} but it does not seem to work when the cursor in over a window corner or border.
Thanks
Rafael
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Resizing a window
Posted: Sat Dec 08, 2007 10:17 AM

Rafael,

> it does not seem to work when the cursor in over a window corner or border

bLButtonUp should work. If not then you may need to use a tool like MS Spy to find what message is sent to the window in such event

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Resizing a window
Posted: Sat Dec 08, 2007 11:03 AM
Antonio:
Still it doesn't seem to work. Try this: Click within the window and the message pops up; resize the window and when you release the left button, no message appears:
#include "Fivewin.ch"
FUNCTION Main()
LOCAL oWnd
DEFINE Window oWnd  From 0,0 TO 300,400 Pixel Style WS_THICKFRAME
oWnd:bLButtonUp := {|r,c,f| MsgInfo(str(r)+str(c))}
ACTIVATE Window oWnd
Return Nil

What I would like is to be able to read the window height the moment I release the button. Any suggestion?
Rafael
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Resizing a window
Posted: Sat Dec 08, 2007 11:26 AM

Try using bResize instead.

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Resizing a window
Posted: Sat Dec 08, 2007 11:27 AM

Rafael,

You may need to use MS Spy and see if we get a message for such event

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Resizing a window
Posted: Sat Dec 08, 2007 12:06 PM
Antonio:
What is MS Spy and how do I get it? (In google I have found some references to anti spywares, My Space and so on, but I doubt they are related to this problem)

Enrico:
Yes; in my app I am using bResized updating continuously the window height. Like this:
::bResize := {|t,w,h| ::nHeight := h}

However, I would like to be able to store the final nHeight in a Dbf. For that, I need to detect the ButtonUp event. And there is where I am having problems

Thanks to you both for your suggestions
Rafael
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Resizing a window
Posted: Sat Dec 08, 2007 02:08 PM

Can't you simply save the window height at any bResize event?

EMG

Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Resizing a window
Posted: Sat Dec 08, 2007 02:31 PM

Enrico:
Yes: That's what I am doing now. I just wondered if there was a way to do it only once, when the resizing is finished.
Rafael

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Resizing a window
Posted: Sat Dec 08, 2007 02:41 PM
Rafael,

This seems to be the msg that you are looking for:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Resizing a window
Posted: Sat Dec 08, 2007 06:38 PM

Antonio:

Thanks for your help but I am afraid this modification is way over my capabilities. What am I suposed to do with that event?. I have modified the HandleEvent() method in Windows.prg to capture WM_EXITSIZEDMOVE but it does nothing. I suppose I have to modify the method (or perhaps WndHandleEvent()) somewhere else but could not find where. Could you give me still another hint?
Thanks

Rafael

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Resizing a window
Posted: Sat Dec 08, 2007 09:05 PM
Rafael,

Here you have a working sample:
#include "FiveWin.ch"

#define WM_EXITSIZEMOVE   0x0232

function Main()

   local oWnd := TMyWindow():New()

   oWnd:Activate()

return nil

CLASS TMyWindow FROM TWindow

   CLASSDATA lRegistered AS LOGICAL

   METHOD HandleEvent( nMsg, nWParam, nLParam )

ENDCLASS

METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TMyWindow

   if nMsg == WM_EXITSIZEMOVE
      MsgBeep()
   endif

return Super:HandleEvent( nMsg, nWParam, nLParam )
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion