Menu actions

Postby pawelu » Mon Oct 30, 2006 1:13 pm

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
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Mon Oct 30, 2006 3:14 pm

Pawel,

Place all that code inside a function and call just that function. Its easy.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby pawelu » Fri Nov 03, 2006 1:47 pm

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
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Fri Nov 03, 2006 11:14 pm

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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby pawelu » Sat Nov 04, 2006 7:15 am

Antonio,

After change this code only first call create second window. Message is show after close main window. I check process in PPC environment and when main window is closed program process still running.
When I change this in Window.Prg:

Code: Select all  Expand view
   if Self == oWndMain
      oWndMain = nil
      // PostQuitMessage( 0 )     
   endif 
   PostQuitMessage( 0 )     


it's look like windows is really modal now (windows and process is properly created and closed).

Thanks for help
Pawel

Sample code:
Code: Select all  Expand view
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.
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby pawelu » Sat Nov 04, 2006 9:47 am

Antonio,

If there changes for window.prg is valid please update command for activate window eg. add clause modal (activate window wnd modal).

Thanks for help
Pawel

Changes for window.prg
Code: Select all  Expand view
   if Self == oWndMain .Or. ::lModal
      WinRun()
   endif
   if Self == oWndMain
      oWndMain = nil
      PostQuitMessage( 0 )
   else
       if ::lModal
          PostQuitMessage( 0 )
       endif
   endif
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Sun Nov 05, 2006 8:37 am

Pawel,

Ok, already implemented. Thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby pawelu » Sun Nov 05, 2006 2:08 pm

Antonio,

Finally I change window.prg as is:

Code: Select all  Expand view
   if Self == oWndMain
      oWndMain = nil
      PostQuitMessage( 0 )
   else
       if ::lModal .And. ::ClassName() == "TWINDOW"
          PostQuitMessage( 0 )
       endif
   endif


Regards
Pawel
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Sun Nov 05, 2006 4:11 pm

Pawel,

Thanks!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby pawelu » Mon Nov 06, 2006 7:55 pm

Antonio,

This is finally construct for today (modal window with TFolder object doesn't executing clause after window close):

Code: Select all  Expand view
       if ::lModal .And. ::ClassName() $ "TFOLDER;TWINDOW"
          PostQuitMessage( 0 )
       endif


Regards
Pawel
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Mon Nov 06, 2006 9:26 pm

Pawel,

thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Previous

Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 7 guests