Raised Button - Click Event

Fired when the mouse is clicked on the control

Member of Raised Button (PRIM_MD.RaisedButton)

Parameters

NameTypeData TypeDescription
Origin*InputPRIM_CTRLReference to the control on which the event was initially fired
Handled*BothBooleanSet to true to stop the event being propagated to the parent control

Details

The Click event is fired when the user presses and releases the left mouse button while the mouse is within the bounds of the same control.
 
The Click event is a routed event. This means that it can be detected on the control that was under the mouse pointer at the time of the click, as well as other controls in the parent chain.
 
The Origin and Handled parameters of the event provide the source of the event and a means to prevent propagation up the parent chain respectively

Example

The example has 2 clickable buttons. The Click event is flagged as handled True if Button2 is clicked.
 
If it's not, the click event for the page will fire.
Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME)
 
   Define_Com Class(#PRIM_TBLO) Name(#Layout)
   Define_Com Class(#PRIM_TBLO.Column) Name(#LayoutRow1) DisplayPosition(1) Parent(#Layout)
   Define_Com Class(#PRIM_TBLO.Row) Name(#LayoutColumn1) DisplayPosition(1) Parent(#Layout)
   Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem1) Alignment(CenterLeft) Column(#LayoutRow1) Manage(#ListPrimaryText) MarginLeft(16) MarginRight(16) Parent(#Layout) Row(#LayoutColumn1) Sizing(ContentHeightFitToWidth)
 
   Define_Com Class(#PRIM_MD.RaisedButton) Name(#Check) DisplayPosition(1) Left(64) Parent(#COM_OWNER) TabPosition(1) Top(56) ButtonDefault(True) Icon('check') ThemeDrawStyle('MediumTitle')
   Define_Com Class(#PRIM_MD.RaisedButton) Name(#Cross) DisplayPosition(2) Left(176) Parent(#COM_OWNER) TabPosition(2) Top(56) ButtonCancel(True) Icon('close') ThemeDrawStyle('MediumTitle')
   Define_Com Class(#PRIM_MD.List) Name(#List) DisplayPosition(3) LayoutManager(#Layout) Left(64) Parent(#COM_OWNER) RowHeight(48) TabPosition(3) TabStop(False) ThemeDrawStyle('Card') Top(104) Height(249)
   Define_Com Class(#PRIM_MD.ListLabel) Name(#ListPrimaryText) Caption('Single line item') CaptionAlignment(CenterLeft) DisplayPosition(3) Height(19) Left(16) Parent(#List) TabPosition(3) TabStop(False) ThemeDrawStyle('Heading3') Top(15) Width(246)
 
   Evtroutine Handling(#Check.Click) Handled(#Handled)
 
      #Handled := True
 
      Clr_List Named(#List)
      #Com_self.AddEntry( "Check" )
 
   Endroutine
 
   Evtroutine Handling(#Cross.Click)
 
      Clr_List Named(#List)
      #Com_self.AddEntry( "Cross" )
 
   Endroutine
 
   Evtroutine Handling(#Com_Owner.Click) Origin(#Origin)
 
      If (#Origin *IsEqualTo #Com_owner)
 
         Clr_List Named(#List)
 
      Endif
 
      #Com_self.AddEntry( "Page" )
 
   Endroutine
 
   Mthroutine Name(AddEntry)
      Define_Map For(*Input) Class(#Prim_str) Name(#Text)
 
      Add_Entry To_List(#List)
      #ListPrimaryText.CurrentItem.Caption := #Text
 
   Endroutine
 
End_Com

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2