From c942dfec131d40948e9566d62d0f4e0366cec8fb Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Tue, 4 Sep 2001 09:53:49 +0000 Subject: [PATCH] sample testing forms view as text based on persistence --- harbour/contrib/hgf/tests/formtext.prg | 56 ++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 harbour/contrib/hgf/tests/formtext.prg diff --git a/harbour/contrib/hgf/tests/formtext.prg b/harbour/contrib/hgf/tests/formtext.prg new file mode 100644 index 0000000000..9277bbeefd --- /dev/null +++ b/harbour/contrib/hgf/tests/formtext.prg @@ -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 \ No newline at end of file