some little changes to test events routing

This commit is contained in:
Antonio Linares
2001-09-04 09:51:10 +00:00
parent 5f42f22307
commit 60116a879c

View File

@@ -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