FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour MDI-Frame and using oWnd:bResized := {|| ...} ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
MDI-Frame and using oWnd:bResized := {|| ...} ?
Posted: Fri Apr 06, 2012 02:54 PM
Hello,

is it possible, using oWnd:bResized := {|| ..... } ? on a MDI-Frame ?
Tested, but nothing happens.

NOT :

nCount := 1

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON RESIZE MsgAlert( nCount++ )


because the Alert was executed twice and returns value 1 and 2.

The following ( MDI and Modal ) :

nCount := 1
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT MsgAlert( "Test" ) ;
ON RESIZE ( nCount++, MsgAlert( nCount ) )


Returns on INIT :

2
Test
3


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.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: MDI-Frame and using oWnd:bResized := {|| ...} ?
Posted: Fri Apr 06, 2012 05:06 PM
ukoenig wrote:is it possible, using oWnd:bResized := {|| ..... } ? on a MDI-Frame ?


Have you already tried

Code (fw): Select all Collapse
oWnd:oWndClient:bResized := {|| ..... }


EMG
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: MDI-Frame and using oWnd:bResized := {|| ...} ?
Posted: Fri Apr 06, 2012 06:11 PM
Enrico,

Yes, tested with the same Result : nothing happens.

oWnd:oWndClient:bResized := {|| Msgalert ( "Test" ) }

I can use ON RESIZE ( that works ), but a called function is executed twice.
I noticed it, because of a forgotten logical var.
The function PAINT_LOGO sets lVisible to .T. ( double painting disabled )

lVisible := .F.
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON RESIZE ( W_BACKGRD( oWnd:oWndClient, "PICTURE8.jpg" ), ;
IIF( lVisible = .T., oLogo:End(), NIL ), ;
PAINT_LOGO(oWnd:oWndClient), ;
aLogo[1] := ( oWnd:nHeight / 2 ) - 50 - ( 248 / 2 ), ;
aLogo[2] := ( oWnd:nWidth / 2 ) - ( 320 / 2 ), ;
oBtn1:Move( oWnd:nHeight - 250, oWnd:nWidth - 110, , ,.T. ), ;
oBtn2:Move( oWnd:nHeight - 158, oWnd:nWidth - 110, , ,.T. ) )

ON INIT ( painted once )



ON RESIZE ( double painted on startup without using a logical var )



Centered on RESIZE
Background adjusted
Logo repainted with new calculated top / left
New Button-pos calculated



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.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: MDI-Frame and using oWnd:bResized := {|| ...} ?
Posted: Sat Apr 07, 2012 09:21 AM
Uwe,

Generate an error from that called code and check the stackcalls:

Code (fw): Select all Collapse
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON RESIZE CheckCallStack()

...

function CheckCallStack()

   local nLevel := 0, cCalls := "" 

   while ! Empty( ProcName( nLevel )  )
      cCalls += ProcName( nLevel ) + " (" + AllTrim( Str( ProcLine( nLevel++ ) ) ) + ")" + CRLF
   end
   MsgInfo( cCalls )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion