sample testing forms view as text based on persistence

This commit is contained in:
Antonio Linares
2001-09-04 09:53:49 +00:00
parent 60116a879c
commit c942dfec13

View 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