Open modal window before the main window
Posted: Thu Dec 23, 2010 12:24 am
How to open modal window before the main window?
I tried that, but it did not work:
I wanted to open a window Password before the main window. And when you finish the main window, open another modal window.
I tried that, but it did not work:
Code: Select all
#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.