MDI-Frame and using oWnd:bResized := {|| ...} ?

MDI-Frame and using oWnd:bResized := {|| ...} ?

Postby ukoenig » Fri Apr 06, 2012 2: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: MDI-Frame and using oWnd:bResized := {|| ...} ?

Postby Enrico Maria Giordano » Fri Apr 06, 2012 5:06 pm

ukoenig wrote:is it possible, using oWnd:bResized := {|| ..... } ? on a MDI-Frame ?


Have you already tried

Code: Select all  Expand view
oWnd:oWndClient:bResized := {|| ..... }


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: MDI-Frame and using oWnd:bResized := {|| ...} ?

Postby ukoenig » Fri Apr 06, 2012 6: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 )

Image

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

Image

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

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: MDI-Frame and using oWnd:bResized := {|| ...} ?

Postby Antonio Linares » Sat Apr 07, 2012 9:21 am

Uwe,

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

Code: Select all  Expand view

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Marc Venken and 95 guests