Hi guys
I revised a lot about window Release and Interactive close. For this and other reason, I also added the ability to store properties at HMGAPP level. On the other hand, I activate some defined vars.
The most important thing of this commit is (hopefully) improvement and expansion of management INTERACTIVECLOSE
A) I add a new folder: samples/window.morewin. Source with character "b" are in XBase style format. With demo in OOP style, you can play a lot with many opened form. With XBase style it's not the same.
B) To keep HMG3 compatibility (see "SET INTERACTIVECLOSE .....") there is a "global" property "InteractiveClose"; you can assign one of this values: INTCLOSE_OFF, INTCLOSE_ON, INTCLOSE_QUERY, INTCLOSE_QUERYMAIN. As default you can use INTCLOSE_DEFAULT it's the same of INTCLOSE_ON: in other words you can use [X] or ALT+F4. The other values MIN and MAX are used in some test. It takes precedence. The most important demos for this are samples/window.morewin/demo_3.prg and samples/window.morewin/demo_3b.prg.
C) I have added the same ability for any single form. I have used previous :SetInteractiveClose method. About XBase style there are new related commands: "WININTERACTIVECLOSE....." with usage of the same value (INTCLOSE*). In this way you can have a setting for any window.
D) There is a new future about end Qt. I've introduce this property "WhoQuitQt"; by default (WHOQUITQT_DEFAULT) QApplication quit when the WND_MAIN or the FirstWindow (see below) is released/closed. You can choose to end QApplication in other moment and for this you must use this value WHOQUITQT_USER. For a better description, take a look to the samples/window.morewin/demo_2.prg or samples/window.morewin/demo_2b.prg.
E) These are valid sequences to open forms
E.1) WND_MAIN and then [WND_MODAL | WND_STANDARD ]
E.2) WND_MODAL then [WND_MODAL | WND_STANDARD ]
There is a little trick to open a MODAL form, release it and then open a WND_MAIN form. so the third possibility is
E.3) WND_MODAL, release it (mandatory), WND_MAIN then [WND_MODAL | WND_STANDARD ]. take a look to the samples/window.morewin/demo_2.prg or samples/window.morewin/demo_2b.prg
I done test but I have only two eyes.....
Cheers
Code: Select all
2011-09-30 21:40 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> )
+ samples/window.morewin
+ samples/window.morewin/build.bat
+ samples/window.morewin/demo_1.prg
+ samples/window.morewin/demo_1b.prg
+ samples/window.morewin/demo_2.prg
+ samples/window.morewin/demo_2b.prg
+ samples/window.morewin/demo_3.prg
+ samples/window.morewin/demo_3b.prg
+ samples/window.morewin/demo_int_1.prg
+ samples/window.morewin/hbmk.hbm
+ samples/window.morewin/hmg.ico
+ samples/window.morewin/qt.conf
! samples/window.close/demo_1.prg
! usage of defined values INTCLOSE_*
! samples/window.close/demo_2.prg
! usage of defined command WININTERACTIVECLOSE
* source/virtualwindow.prg
+ METHOD __HmgConnectEv from window.prg
+ METHOD __HmgDisconnectEv from window.prg
* added METHOD __HmgOnSizeExec and fixed METHOD OnSize
! Release(): TODO check when Visible is .F.
! __HmgOnCloseExec() to handle INTERACTIVE settings and minor changes
* source/window.prg
- moved METHOD __HmgConnectEv ti virtualwindow.prg
- moved METHOD __HmgDisconnectEv to virtualwindow.prg
! Create(), Activate() in according with new properties
+ IsActivated(): it return ::lActivated
* source/hmgapp.prg
+ WindowsDefined() to find defined forms, check if closable and
do an automatized close
+ added property "FirstWindow"; by default is set to NIL.
This property store the first form object activated
+ added property "MainWindow"; by default is set to NIL.
This property store the first WND_MAIN form object activated
+ added property "WhoQuitQt"; by default is set to WHOQUITQT_DEFAULT. Qt
is quit when WND_MAIN or the first opened form is released.
+ added property "InteractiveClose"; by default is INTCLOSE_DEFAULT
in other words to INTCLOSE_ON. ATTENTION: this setup it's at application
level (like HMG3) but with HMG4 you can handle also for any form.
Application-level setting takes precedence
+ added an internal properties system. Related methods are: Property() to
set and get value, IsProperty() to check its existence; usage:
to set HMGAPP():Property( "PropName", PropValue )
to get HMGAPP():Property( "PropName" )
to check HMGAPP():IsProperty( "PropName" ) it return .T. or .F.
* include/hmg.ch
! SET INTERCATIVECLOSE commands to handle global settings like HMG3
+ WININTERACTIVECLOSE commands to handle window specific settings
+ #define WND_TYPE_MIN and WND_TYPE_MAX to know the minimum and the maximum
value can be assigned
+ #define WHOQUITQT_DEFAULT and WHOQUITQT_USER to handle who quit Qt
by default is WHOQUITQT_DEFAULT
+ #define INTCLOSE_OFF, INTCLOSE_ON, INTCLOSE_QUERY, INTCLOSE_QUERYMAIN
INTCLOSE_DEFAULT, INTCLOSE_MIN, INTCLOSE_MAX
to handle INTERACTIVECLOSE settings and execution
* source/virtualwindow.prg
* source/window.prg
* source/windowgroup.prg
* oEventLoop data name changed into oQtEventLoop