Skip to content

#Events

General

These are all purposes general events that are utilised in a wide range of controls. For all events the reference is only passed if it has been provided. (You do however have to declare it every time)

OnClick

An event triggered when the user clicks a dialogstdbutton, bitmapbutton, button, or tool. And the relevant dataform1 equivalents for button and bitmapbutton

The event handling function will require the following parameters:

type(wxformcontrol) me[, type(*) reference]

OnChange

This event is called by the checkbox, edittext, and option controls

The event handling function will require the following parameters:

type(wxformcontrol) me[, type(*) reference]

OnGotFocus

This event is called by the bitmapbutton, button, checkbox, combo, datagrid, edittext, grid, list, option, scrollbar controls

The event handling function will require the following parameters:

type(wxformcontrol) me[, type(*) reference])

OnLostFocus

This event is called by the bitmapbutton, button, checkbox, combo, edittext, both grids, list, option, scrollbar controls

The event handling function will require the following parameters:

type(wxformcontrol) me[, type(*) reference])

OnMouse

This event is called by all wxcontrols, the event handling function for an onmouse event will require the following parameters:

type(wxformcontrol) me, integer etype, integer keys, integer x, integer y, type(*) reference

The reference is only passed if it is provided by the user, this will normally be the window or form that the control is in

etype is the bit (defined by onmousemask) showing what sort of event it is. There’s a whole separate page explaining mousemasks here)

keys is a collection of bits showing key positions

Key TypeBit Value
shift down0x00010000
ctrl down0x00020000
alt down0x00040000
meta down0x00080000

OnDoubleClick

An event that is triggered when a list control receives a double-click. The event handling function requires the following parameters:

wxformlist me[, type(*) reference]

Applies to both dataform1list and wxformlist

OnFill

list

OnScroll

An event that is triggered every time the scroll position changes. The event handling function requires the following parameters:

wxformscrollbar me, string scrolltype[, type(*) reference]

This applies to both wxformscrollbar and dataform1scrollbar. The scrolltype variable can be one of the following:

  • "top"
  • "bottom"
  • "thumbdrop"
  • "thumbdrag"
  • "pageup"
  • "pagedown"
  • "lineup"
  • "linedown"

OnSelect

This is a widely used event, not only used in the traditional GUI library but also in other such as the filtergui, printform1, and mrulib. It is however also used by wxmenuitem and dataform1

type(wxformcontrol) me[, type(*) reference]

OnSelectionChange

An event that is triggered when the selection is changed. This event is found in both wxformcombo and wxformlist (and there dataform1 equivalents). The event handling function will require the following parameters:

wxformcombo me[, type(*) reference]

OnSize

This event is triggered by wxformsizebox and wxwindow whenever the user changes the size of either. The event handling functions requires the following parameters:

type(wxformcontrol) me[, type(*) reference]

OnStateChange

This event is triggered when the user changes the state of a wxwindow, for example by minimzing or maximising the window

wxwindow me[, type (*) reference]

OnVisibilityChange

An event triggered when the user changes the visibility of a wxdialog or a wxwindow by, for example ‘closing’ the window or dialog

type(wxformcontrol) me[, type(*) reference]
Pages: 1 2 3 4