|[Top] [Chapter] [Previous] [Next]|
Member of WPDLLInt
OnButtonClick(Object Sender, int Editor, IWPDllButton Def)
OnButtonClick(ByVal Editor As Long, ByVal Def As WPTDynInt.IWPDllButton)
This event is triggered when the user clicks on a button or menu. (new: works with all buttons, not only custom buttons).
Inside the event OnButtonClick event the property Disabled can be set to true to abort the execution of the default button action until the button is clicked the next time.
(The state of "disabled" cannot be permanently changed in OnButtonClick - this has to be done in OnUpdateGUI)
The interface IWPDllButton provides access to the properties of the button. Most important is property "Name" which can be set in the toolbar description.
Private Sub WPDLLInt1_OnButtonClick(ByVal Editor As Long, ByVal Def As WPTDynInt.IWPDllButton)
If Def.Name = "CreateNewWindow" Then
LoadNewDoc ' implemented as public routine in 'Main.BAS'
This code uses a new button created in the PCC file: