Antonio,
I check code my apps. Places where I use comma separated commands based on window are too much. In this moment I probably must think about completly rewriting program code.
This is very bad news for me ...
Pawel
Antonio,
I check code my apps. Places where I use comma separated commands based on window are too much. In this moment I probably must think about completly rewriting program code.
This is very bad news for me ...
Pawel
Pawel,
Place all that code inside a function and call just that function. Its easy.
Antonio,
Call this function don't solve problem. In several places program show important data for user and should by wait for end user actions. In other situation window contents is dependent of other window and I must to know when second window is closed and do action eg. refresh objects in first window etc. Where we have little big project with many windows and many objects like browse, say, get, button and other is there little problem to multiple pass parameters to function where window is activate.
Comma separated commands with modal-only window were is the best programming solution in FWPPC. Program code were simple and forceful.
Thanks
Pawel
Pawel,
You may try this modification: In source\classes\window.prg Method Activate():
// if Self == oWndMain
WinRun()
// endif
This way, it will execute in a modal way. Please try it there and lets see how it works for you.
if Self == oWndMain
oWndMain = nil
// PostQuitMessage( 0 )
endif
PostQuitMessage( 0 )Function TestWnd1 ()
Local oWnd := Nil
Define Window oWnd Title 'Window 1'
@ 50, 50 Button 'Window 2' Size 100, 20 Pixel Action TestWnd2 ()
Activate Window oWnd
Return .T.
Function TestWnd2 ()
Local oWnd := Nil
Define Window oWnd Title 'Window 2'
Activate Window oWnd
MsgInfo ('Window closed')
Return .T. if Self == oWndMain .Or. ::lModal
WinRun()
endif
if Self == oWndMain
oWndMain = nil
PostQuitMessage( 0 )
else
if ::lModal
PostQuitMessage( 0 )
endif
endifPawel,
Ok, already implemented. Thanks,
if Self == oWndMain
oWndMain = nil
PostQuitMessage( 0 )
else
if ::lModal .And. ::ClassName() == "TWINDOW"
PostQuitMessage( 0 )
endif
endifPawel,
Thanks!
if ::lModal .And. ::ClassName() $ "TFOLDER;TWINDOW"
PostQuitMessage( 0 )
endifPawel,
thanks,