From 60116a879cee5bdae98d6135fcbb1700fefe4452 Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Tue, 4 Sep 2001 09:51:10 +0000 Subject: [PATCH] some little changes to test events routing --- harbour/contrib/hgf/tests/form2.prg | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/harbour/contrib/hgf/tests/form2.prg b/harbour/contrib/hgf/tests/form2.prg index 117ecd5499..fa9a5cb6ef 100644 --- a/harbour/contrib/hgf/tests/form2.prg +++ b/harbour/contrib/hgf/tests/form2.prg @@ -1,7 +1,6 @@ // // $Id$ // - // Inheriting from Class TForm sample #include "hbclass.ch" @@ -18,20 +17,40 @@ CLASS TForm2 FROM TForm METHOD New() - METHOD Button1Click( oSender ) + METHOD TestClick( oSender ) + METHOD ExitClick( oSender ) INLINE ::Close() ENDCLASS METHOD New() CLASS TForm2 + local oMenu, oMenuItem + Super:New() - ::cCaption = ::ClassName() + ::Caption = "Harbour GUI demo" + + oMenu = TMenu():New( Self ) + + oMenuItem = TMenuItem():New( oMenu ) + oMenuitem:Caption = "Test" + oMenuitem:Name = "Test" + oMenuItem:OnClick = "TestClick" // 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 Button1Click( oSender ) CLASS TForm2 +METHOD TestClick( oSender ) CLASS TForm2 - MsgInfo( oSender:ClassName() ) + MsgInfo( "This event has been fired by a " + oSender:ClassName() + " object",; + "Welcome to Harbour GUI power" ) return nil \ No newline at end of file