sample testing forms view as text based on persistence
This commit is contained in:
56
harbour/contrib/hgf/tests/formtext.prg
Normal file
56
harbour/contrib/hgf/tests/formtext.prg
Normal file
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// Testing forms persistence
|
||||
|
||||
#include "hbclass.ch"
|
||||
|
||||
function Main()
|
||||
|
||||
local oForm2 := TForm2():New()
|
||||
|
||||
oForm2:ShowModal()
|
||||
|
||||
return nil
|
||||
|
||||
CLASS TForm2 FROM TForm
|
||||
|
||||
METHOD New()
|
||||
|
||||
METHOD ViewAsTextClick( oSender )
|
||||
METHOD ExitClick( oSender ) INLINE ::Close()
|
||||
|
||||
ENDCLASS
|
||||
|
||||
METHOD New() CLASS TForm2
|
||||
|
||||
local oMenu, oMenuItem
|
||||
|
||||
Super:New()
|
||||
|
||||
::cName = "oForm2"
|
||||
::Caption = "Harbour GUI demo"
|
||||
|
||||
oMenu = TMenu():New( Self )
|
||||
|
||||
oMenuItem = TMenuItem():New( oMenu )
|
||||
oMenuitem:Caption = "View as Text"
|
||||
oMenuitem:Name = "ViewAsText"
|
||||
oMenuItem:OnClick = "ViewAsTextClick" // The container method to execute
|
||||
oMenu:Add( oMenuItem )
|
||||
|
||||
oMenuItem = TMenuItem():New( oMenu )
|
||||
oMenuitem:Caption = "Exit"
|
||||
oMenuitem:Name = "Exit"
|
||||
oMenuItem:OnClick = "ExitClick" // The container method to execute
|
||||
oMenu:Add( oMenuItem )
|
||||
|
||||
::Menu = oMenu
|
||||
|
||||
return Self
|
||||
|
||||
METHOD ViewAsTextClick( oSender ) CLASS TForm2
|
||||
|
||||
MsgInfo( ::SaveToText() )
|
||||
|
||||
return nil
|
||||
Reference in New Issue
Block a user