h1(#wxcommandevent). Wx::CommandEvent This event class contains information about command events, which originate from a variety of simple controls such as "buttons":button.html, "checkboxes":checkbox.html, "lists":listbox.html and "menus":menu.html. It controls which contain multiple items with string labels, it can be used to determine which specific item has been used (see "get_index":#CommandEvent_getindex, and whether a selection or deselection has taken place (see "is_selection":#CommandEvent_isselection). More complex controls, such as "TreeCtrl":treectrl.html, have separate command event classes. h2. Custom event classes If implementing completely new custom controls in Ruby, event types associated with that control should normally inherit from CommandEvent. If you wish to associate data with instances of your custom Event class, you should do so using "set_client_data":#CommandEvent_setclientdata. Normal instance variables are *not* preserved so will be set to @nil@ when they are handled by event handler methods. See the "event" sample included with wxRuby for an example. h2. Derived from "Event":event.html h2. Event table macros To handle command events, use these event handler methods to set up a block to receive the event. All of these event handler methods require that the control whose events are being listened for be identified - see the "event handling overview":eventhandlingoverview.html#events_with_ids for more information. |*evt_command(id) { | event | ... }*|Process a command, supplying the window identifier,command event identifier, and member function.| |*evt_command_range(id1, id2) { | event | ... }*|Process a command for a rangeof window identifiers, supplying the minimum and maximum window identifiers,command event identifier, and member function.| |*evt_button(id) { | event | ... }*|Process a EVT_COMMAND_BUTTON_CLICKED command,which is generated by a Button control.| |*evt_checkbox(id) { | event | ... }*|Process a EVT_COMMAND_CHECKBOX_CLICKED command,which is generated by a CheckBox control.| |*evt_choice(id) { | event | ... }*|Process a EVT_COMMAND_CHOICE_SELECTED command,which is generated by a Choice control.| |*evt_combobox(id) { | event | ... }*|Process a EVT_COMMAND_COMBOBOX_SELECTED command,which is generated by a ComboBox control.| |*evt_listbox(id) { | event | ... }*|Process a EVT_COMMAND_LISTBOX_SELECTED command,which is generated by a ListBox control.| |*evt_listbox_dclick(id) { | event | ... }*|Process a EVT_COMMAND_LISTBOX_DOUBLECLICKED command,which is generated by a ListBox control.| |*evt_menu(id) { | event | ... }*|Process a EVT_COMMAND_MENU_SELECTED command,which is generated by a menu item.| |*evt_menu_range(id1, id2) { | event | ... }*|Process a EVT_COMMAND_MENU_RANGE command,which is generated by a range of menu items.| |*evt_context_menu() { | event | ... }*|Process the event generatedwhen the user has requested a popup menu to appear by pressing a specialkeyboard key (under Windows) or by right clicking the mouse.| |*evt_radiobox(id) { | event | ... }*|Process a EVT_COMMAND_RADIOBOX_SELECTED command,which is generated by a RadioBox control.| |*evt_radiobutton(id) { | event | ... }*|Process a EVT_COMMAND_RADIOBUTTON_SELECTED command,which is generated by a RadioButton control.| |*evt_scrollbar(id) { | event | ... }*|Process a EVT_COMMAND_SCROLLBAR_UPDATED command,which is generated by a ScrollBar control. This is provided for compatibility only;more specific scrollbar event macros should be used instead (see "ScrollEvent":scrollevent.html).| |*evt_slider(id) { | event | ... }*|Process a EVT_COMMAND_SLIDER_UPDATED command,which is generated by a Slider control.| |*evt_text(id) { | event | ... }*|Process a EVT_COMMAND_TEXT_UPDATED command,which is generated by a TextCtrl control.| |*evt_text_enter(id) { | event | ... }*|Process a EVT_COMMAND_TEXT_ENTER command,which is generated by a TextCtrl control. Note that you must useTE_PROCESS_ENTER flag when creating the control if you want it to generatesuch events.| |*evt_text_maxlen(id) { | event | ... }*|Process a EVT_COMMAND_TEXT_MAXLEN command,which is generated by a TextCtrl control when the user tries to enter morecharacters into it than the limit previously set with "set_max_length":#CommandEvent_setmaxlength.| |*evt_togglebutton(id) { | event | ... }*|Process a EVT_COMMAND_TOGGLEBUTTON_CLICKED event.| |*evt_tool(id) { | event | ... }*|Process a EVT_COMMAND_TOOL_CLICKED event(a synonym for EVT_COMMAND_MENU_SELECTED). Pass the id of the tool.| |*evt_tool_range(id1, id2) { | event | ... }*|Process a EVT_COMMAND_TOOL_CLICKED eventfor a range of identifiers. Pass the ids of the tools.| |*evt_tool_rclicked(id) { | event | ... }*|Process a EVT_COMMAND_TOOL_RCLICKED event.Pass the id of the tool.| |*evt_tool_rclicked_range(id1, id2) { | event | ... }*|Process a EVT_COMMAND_TOOL_RCLICKED eventfor a range of ids. Pass the ids of the tools.| |*evt_tool_enter(id) { | event | ... }*|Process a EVT_COMMAND_TOOL_ENTER event.Pass the id of the toolbar itself. The value of CommandEvent::GetSelection is the tool id, or -1 if the mouse cursor has moved off a tool.| |*evt_command_left_click(id) { | event | ... }*|Process a EVT_COMMAND_LEFT_CLICK command,which is generated by a control (Windows 95 and NT only).| |*evt_command_left_dclick(id) { | event | ... }*|Process a EVT_COMMAND_LEFT_DCLICK command,which is generated by a control (Windows 95 and NT only).| |*evt_command_right_click(id) { | event | ... }*|Process a EVT_COMMAND_RIGHT_CLICK command,which is generated by a control (Windows 95 and NT only).| |*evt_command_set_focus(id) { | event | ... }*|Process a EVT_COMMAND_SET_FOCUS command,which is generated by a control (Windows 95 and NT only).| |*evt_command_kill_focus(id) { | event | ... }*|Process a EVT_COMMAND_KILL_FOCUS command,which is generated by a control (Windows 95 and NT only).| |*evt_command_enter(id) { | event | ... }*|Process a EVT_COMMAND_ENTER command,which is generated by a control.|