#include "hmg.ch"
Function Main
Local oMainWindow
With Object oMainWindow := Window():New()
:Row := 10
:Col := 10
:Width := 400
:Height := 200
:Title := 'System Demo'
:Type := WND_MAIN
:OnInit := { || Password_(), oMainWindow:Maximize() }
:OnRelease := { || Close_Win() }
End With
oMainWindow:Activate()
Return
Function Password_()
Local oModalPass, oButton1
With Object oModalPass := Window():New()
:Row := 10
:Col := 10
:Width := 200
:Height := 100
:Title := 'Password'
:Type := WND_MODAL
:OnInit := { || ( oModalPass:Center() ) }
With Object oButton1 := Button():New()
:Row := 40
:Col := 40
:Caption := 'Close Window Password'
:OnClick := { || oModalPass:Release() }
End With
End With
oModalPass:Activate()
return .T.
Function Close_Win()
Local oModalClose, oButton2
With Object oModalClose := Window():New()
:Row := 10
:Col := 10
:Width := 200
:Height := 100
:Title := 'Close System'
:Type := WND_MODAL
:OnInit := { || ( oModalClose:Center() ) }
With Object oButton2 := Button():New()
:Row := 40
:Col := 40
:Caption := 'Close System'
:OnClick := { || oModalClose:Release() }
End With
End With
oModalClose:Activate()
return .T.
I wanted to open a window Password before the main window. And when you finish the main window, open another modal window.
You can open the main window with 'noshow' clause. So, the modal window will be shown to the user first. From the modal window, you can show or close the main window as the case may be.
East or West HMG is the Best. South or North HMG is worth.
...the possibilities are endless.