Windows messages and events

WinBinder simplifies the process of responding to control or object events by selecting the most common and intuitive Windows message or messages for each control and sending a call to the callback function.

Only some events (e.g. button is pressed, list selection is changed, slider is moved, and so on) are passed to the main handler by default. These are the default events. Other events -- like mouse clicks, double-clicks and mouse movements -- are called additional notification events, and they will not be processed by default. To do this, you must explicitly include WBC_NOTIFY as style and the respective notification flags (e.g. WBC_DBLCLICK, WBC_MOUSEMOVE) in the window or dialog box param argument when it is created with the wb_create_window() function.

Example

$mainwin = wb_create_window(NULL, ResizableWindow, "Resize me", 200, 100, 410, 400, WBC_NOTIFY, WBC_RESIZE | WBC_MOUSEMOVE | WBC_MOUSEDOWN | WBC_MOUSEUP);

Classes and events

The following table shows the default and additional events that can be generated by each WinBinder class.

WinBinder class

Meaning of default event

Additional notification events  (WBC_NOTIFY) ³

Accel

Keyboard combination was pressed

  

Calendar

Selection has changed

 

CheckBox

Checked state has changed

 

ComboBox

Selection has changed

 

EditBox

Text has changed

 

Frame

(none)

 

Gauge

(none)

 

HTMLControl

N/A

 

HyperLink

N/A

 

ImageButton

Control was pressed

 

InvisibleArea

Control was pressed

 

Label

(none)

 

ListBox

Selection has changed

WBC_DBLCLICK

ListView

Selection has changed

WBC_DBLCLICK, WBC_HEADERSEL

Menu

Menu item was selected

 

PushButton

Control was pressed

 

RadioButton

Selection has changed

 

RTFEditBox

Text has changed 

 

ScrollBar

Scrolling occurred

 

Slider

Position has changed

 

Spinner

Position has changed

 

StatusBar

(none)

 

TabControl

Selected tab has changed

WBC_HEADERSEL

ToolBar

Toolbar button was pressed

 

TreeView

Selection has changed

WBC_DBLCLICK

¹ Additional events need the WBC_NOTIFY style flag and the respective notification flags (e.g. WBC_DBLCLICK, WBC_MOUSEMOVE) in the window or dialog box param argument when it is created with the wb_create_window() function. For a list of notification flags, click here.

See also

wb_send_message
wb_set_handler
Callback functions and window handlers
The main loop