Class: Wx::Menu
- Inherits:
-
EvtHandler
- Object
- Object
- EvtHandler
- Wx::Menu
- Defined in:
- lib/wx/doc/gen/menu.rb,
lib/wx/doc/menu.rb
Overview
A menu is a popup (or pull down) list of items, one of which may be selected before the menu goes away (clicking elsewhere dismisses the menu).
Menus may be used to construct either menu bars or popup menus. A menu item has an integer ID associated with it which can be used to identify the selection, or to change the menu item in some way. A menu item with a special identifier StandardID::ID_SEPARATOR is a separator item and doesn’t have an associated command but just makes a separator line appear in the menu.
Please note that StandardID::ID_ABOUT and StandardID::ID_EXIT are predefined by wxWidgets and have a special meaning since entries using these IDs will be taken out of the normal menus under macOS and will be inserted into the system menu (following the appropriate macOS interface guideline).
Menu items may be either normal items, check items or radio items. Normal items don’t have any special properties while the check items have a boolean flag associated to them and they show a checkmark in the menu when the flag is set. wxWidgets automatically toggles the flag value when the item is clicked and its value may be retrieved using either #is_checked method of Menu or MenuBar itself or by using Event::IsChecked when you get the menu notification for the item in question. The radio items are similar to the check items except that all the other items in the same radio group are unchecked when a radio item is checked. The radio group is formed by a contiguous range of radio items, i.e. it starts at the first item of this kind and ends with the first item of a different kind (or the end of the menu). Notice that because the radio groups are defined in terms of the item positions inserting or removing the items in the menu containing the radio items risks to not work correctly.
Allocation strategy
All menus must be created on the heap because all menus attached to a menubar or to another menu will be deleted by their parent when it is deleted. The only exception to this rule are the popup menus (i.e. menus used with Window#popup_menu) as wxWidgets does not destroy them to allow reusing the same menu more than once. But the exception applies only to the menus themselves and not to any submenus of popup menus which are still destroyed by wxWidgets as usual and so must be heap-allocated. As the frame menubar is deleted by the frame itself, it means that normally all menus used are deleted automatically.
Event handling
Event handlers for the commands generated by the menu items can be connected directly to the menu object itself using EvtHandler#bind. If this menu is a submenu of another one, the events from its items can also be processed in the parent menu and so on, recursively. If the menu is part of a menu bar, then events can also be handled in MenuBar object. Finally, menu events can also be handled in the associated window, which is either the Frame associated with the menu bar this menu belongs to or the window for which Window#popup_menu was called for the popup menus. See Dynamic Event Handling for how to bind event handlers to the various objects.
Category: Menus
Instance Method Summary collapse
- #append(*args) ⇒ Object
-
#append_check_item(id, item, help = ('')) ⇒ Wx::MenuItem
Adds a checkable item to the end of the menu.
-
#append_radio_item(id, item, help = ('')) ⇒ Wx::MenuItem
Adds a radio item to the end of the menu.
-
#append_separator ⇒ Wx::MenuItem
Adds a separator to the end of the menu.
-
#append_sub_menu(submenu, text, help = ('')) ⇒ Wx::MenuItem
Adds the given submenu to this menu.
- #attach(menubar) ⇒ void
-
#break_ ⇒ void
Inserts a break in a menu, causing the next appended item to appear in a new column.
-
#check(id, check) ⇒ void
Checks or unchecks the menu item.
- #delete(*args) ⇒ Object
- #destroy(*args) ⇒ Object
- #detach ⇒ void
-
#each_item ⇒ Object
Yield each menu item to the given block.
-
#enable(id, enable) ⇒ void
Enables or disables (greys out) a menu item.
-
#find_child_item(id) ⇒ Array(Wx::MenuItem,Integer)
Finds the menu item object associated with the given menu item identifier and, optionally, the position of the item in the menu.
- #find_item(*args) ⇒ Object
-
#find_item_by_position(position) ⇒ Wx::MenuItem
Returns the MenuItem given a position in the menu.
-
#get_help_string(id) ⇒ String
(also: #help_string)
Returns the help string associated with a menu item.
- #get_invoking_window ⇒ Wx::Window (also: #invoking_window)
-
#get_label(id) ⇒ String
(also: #label)
Returns a menu item label.
-
#get_label_text(id) ⇒ String
(also: #label_text)
Returns a menu item label, without any of the original mnemonics and accelerators.
-
#get_menu_item_count ⇒ Integer
(also: #menu_item_count)
Returns the number of items in the menu.
-
#get_menu_items ⇒ Wx::MenuItemList
(also: #menu_items)
Returns the list of items in the menu.
- #get_parent ⇒ Wx::Menu (also: #parent)
- #get_style ⇒ Integer (also: #style)
-
#get_title ⇒ Wx::String
(also: #title)
Returns the title of the menu.
- #get_window ⇒ Wx::Window (also: #window)
-
#initialize(*args) ⇒ Menu
constructor
A new instance of Menu.
- #insert(*args) ⇒ Object
-
#insert_check_item(pos, id, item, helpString = ('')) ⇒ Wx::MenuItem
Inserts a checkable item at the given position.
-
#insert_radio_item(pos, id, item, helpString = ('')) ⇒ Wx::MenuItem
Inserts a radio item at the given position.
-
#insert_separator(pos) ⇒ Wx::MenuItem
Inserts a separator at the given position.
- #is_attached ⇒ Boolean (also: #attached?)
-
#is_checked(id) ⇒ Boolean
(also: #checked?)
Determines whether a menu item is checked.
-
#is_enabled(id) ⇒ Boolean
(also: #enabled?)
Determines whether a menu item is enabled.
- #prepend(*args) ⇒ Object
-
#prepend_check_item(id, item, helpString = ('')) ⇒ Wx::MenuItem
Inserts a checkable item at position 0.
-
#prepend_radio_item(id, item, helpString = ('')) ⇒ Wx::MenuItem
Inserts a radio item at position 0.
-
#prepend_separator ⇒ Wx::MenuItem
Inserts a separator at position 0.
- #remove(*args) ⇒ Object
-
#set_help_string(id, helpString) ⇒ void
Sets an item’s help string.
- #set_invoking_window(win) ⇒ void (also: #invoking_window=)
-
#set_label(id, label) ⇒ void
Sets the label of a menu item.
- #set_parent(parent) ⇒ void (also: #parent=)
-
#set_title(title) ⇒ void
(also: #title=)
Sets the title of the menu.
-
#update_ui(source = nil) ⇒ void
Update the state of all menu items, recursively, by generating EVT_UPDATE_UI events for them.
Methods inherited from EvtHandler
add_filter, #add_pending_event, #call_after, clear_filters, #connect, #delete_pending_events, #disconnect, #evt_activate, #evt_activate_app, #evt_aui_pane_activated, #evt_aui_pane_button, #evt_aui_pane_close, #evt_aui_pane_maximize, #evt_aui_pane_restore, #evt_aui_render, #evt_auinotebook_allow_dnd, #evt_auinotebook_begin_drag, #evt_auinotebook_bg_dclick, #evt_auinotebook_button, #evt_auinotebook_drag_done, #evt_auinotebook_drag_motion, #evt_auinotebook_end_drag, #evt_auinotebook_page_changed, #evt_auinotebook_page_changing, #evt_auinotebook_page_close, #evt_auinotebook_page_closed, #evt_auinotebook_tab_middle_down, #evt_auinotebook_tab_middle_up, #evt_auinotebook_tab_right_down, #evt_auinotebook_tab_right_up, #evt_auitoolbar_begin_drag, #evt_auitoolbar_middle_click, #evt_auitoolbar_overflow_click, #evt_auitoolbar_right_click, #evt_auitoolbar_tool_dropdown, #evt_button, #evt_calculate_layout, #evt_calendar, #evt_calendar_page_changed, #evt_calendar_sel_changed, #evt_calendar_week_clicked, #evt_calendar_weekday_clicked, #evt_char, #evt_char_hook, #evt_checkbox, #evt_checklistbox, #evt_child_focus, #evt_choice, #evt_choicebook_page_changed, #evt_choicebook_page_changing, #evt_close, #evt_collapsiblepane_changed, #evt_colourpicker_changed, #evt_colourpicker_current_changed, #evt_colourpicker_dialog_cancelled, #evt_combobox, #evt_combobox_closeup, #evt_combobox_dropdown, #evt_command, #evt_command_enter, #evt_command_kill_focus, #evt_command_left_click, #evt_command_left_dclick, #evt_command_range, #evt_command_right_click, #evt_command_scroll, #evt_command_scroll_bottom, #evt_command_scroll_changed, #evt_command_scroll_linedown, #evt_command_scroll_lineup, #evt_command_scroll_pagedown, #evt_command_scroll_pageup, #evt_command_scroll_thumbrelease, #evt_command_scroll_thumbtrack, #evt_command_scroll_top, #evt_command_set_focus, #evt_context_menu, #evt_date_changed, #evt_dialup_connected, #evt_dialup_disconnected, #evt_dirctrl_fileactivated, #evt_dirctrl_selectionchanged, #evt_dirpicker_changed, #evt_dpi_changed, #evt_drop_files, #evt_end_session, #evt_enter_window, #evt_erase_background, #evt_filectrl_fileactivated, #evt_filectrl_filterchanged, #evt_filectrl_folderchanged, #evt_filectrl_selectionchanged, #evt_filepicker_changed, #evt_find, #evt_find_close, #evt_find_next, #evt_find_replace, #evt_find_replace_all, #evt_fontpicker_changed, #evt_fullscreen, #evt_gesture_pan, #evt_gesture_rotate, #evt_gesture_zoom, #evt_grid_cell_changed, #evt_grid_cell_changing, #evt_grid_cell_left_click, #evt_grid_cell_left_dclick, #evt_grid_cell_right_click, #evt_grid_cell_right_dclick, #evt_grid_cmd_col_size, #evt_grid_cmd_editor_created, #evt_grid_cmd_range_selected, #evt_grid_cmd_range_selecting, #evt_grid_cmd_row_size, #evt_grid_col_auto_size, #evt_grid_col_label_size, #evt_grid_col_move, #evt_grid_col_size, #evt_grid_col_sort, #evt_grid_editor_created, #evt_grid_editor_hidden, #evt_grid_editor_shown, #evt_grid_label_left_click, #evt_grid_label_left_dclick, #evt_grid_label_right_click, #evt_grid_label_right_dclick, #evt_grid_range_selected, #evt_grid_range_selecting, #evt_grid_row_auto_size, #evt_grid_row_label_size, #evt_grid_row_move, #evt_grid_row_size, #evt_grid_select_cell, #evt_grid_tabbing, #evt_header_begin_reorder, #evt_header_begin_resize, #evt_header_click, #evt_header_dclick, #evt_header_dragging_cancelled, #evt_header_end_reorder, #evt_header_end_resize, #evt_header_middle_click, #evt_header_middle_dclick, #evt_header_resizing, #evt_header_right_click, #evt_header_right_dclick, #evt_header_separator_dclick, #evt_help, #evt_help_range, #evt_hibernate, #evt_hotkey, #evt_html_cell_clicked, #evt_html_cell_hover, #evt_html_link_clicked, #evt_hyperlink, #evt_iconize, #evt_idle, #evt_init_dialog, #evt_joy_button_down, #evt_joy_button_up, #evt_joy_move, #evt_joy_zmove, #evt_joystick_events, #evt_key_down, #evt_key_up, #evt_kill_focus, #evt_leave_window, #evt_left_dclick, #evt_left_down, #evt_left_up, #evt_list_begin_drag, #evt_list_begin_label_edit, #evt_list_begin_rdrag, #evt_list_cache_hint, #evt_list_col_begin_drag, #evt_list_col_click, #evt_list_col_dragging, #evt_list_col_end_drag, #evt_list_col_right_click, #evt_list_delete_all_items, #evt_list_delete_item, #evt_list_end_label_edit, #evt_list_insert_item, #evt_list_item_activated, #evt_list_item_checked, #evt_list_item_deselected, #evt_list_item_focused, #evt_list_item_middle_click, #evt_list_item_right_click, #evt_list_item_selected, #evt_list_item_unchecked, #evt_list_key_down, #evt_listbook_page_changed, #evt_listbook_page_changing, #evt_listbox, #evt_listbox_dclick, #evt_long_press, #evt_magnify, #evt_maximize, #evt_media_finished, #evt_media_loaded, #evt_media_pause, #evt_media_play, #evt_media_statechanged, #evt_media_stop, #evt_menu, #evt_menu_close, #evt_menu_highlight, #evt_menu_highlight_all, #evt_menu_open, #evt_menu_range, #evt_middle_dclick, #evt_middle_down, #evt_middle_up, #evt_motion, #evt_mouse_aux1_dclick, #evt_mouse_aux1_down, #evt_mouse_aux1_up, #evt_mouse_aux2_dclick, #evt_mouse_aux2_down, #evt_mouse_aux2_up, #evt_mouse_events, #evt_mousewheel, #evt_move, #evt_move_end, #evt_move_start, #evt_moving, #evt_navigation_key, #evt_notebook_page_changed, #evt_notebook_page_changing, #evt_paint, #evt_pg_changed, #evt_pg_changing, #evt_pg_col_begin_drag, #evt_pg_col_dragging, #evt_pg_col_end_drag, #evt_pg_double_click, #evt_pg_highlighted, #evt_pg_item_collapsed, #evt_pg_item_expanded, #evt_pg_label_edit_begin, #evt_pg_label_edit_ending, #evt_pg_page_changed, #evt_pg_right_click, #evt_pg_selected, #evt_press_and_tap, #evt_query_end_session, #evt_query_layout_info, #evt_radiobox, #evt_radiobutton, #evt_ribbonbar_help_click, #evt_ribbonbar_page_changed, #evt_ribbonbar_page_changing, #evt_ribbonbar_tab_left_dclick, #evt_ribbonbar_tab_middle_down, #evt_ribbonbar_tab_middle_up, #evt_ribbonbar_tab_right_down, #evt_ribbonbar_tab_right_up, #evt_ribbonbar_toggled, #evt_ribbonbuttonbar_clicked, #evt_ribbonbuttonbar_dropdown_clicked, #evt_ribbongallery_clicked, #evt_ribbongallery_hover_changed, #evt_ribbongallery_selected, #evt_ribbonpanel_extbutton_activated, #evt_ribbontoolbar_clicked, #evt_ribbontoolbar_dropdown_clicked, #evt_richtext_buffer_reset, #evt_richtext_character, #evt_richtext_consuming_character, #evt_richtext_content_deleted, #evt_richtext_content_inserted, #evt_richtext_delete, #evt_richtext_focus_object_changed, #evt_richtext_left_click, #evt_richtext_left_dclick, #evt_richtext_middle_click, #evt_richtext_properties_changed, #evt_richtext_return, #evt_richtext_right_click, #evt_richtext_selection_changed, #evt_richtext_style_changed, #evt_richtext_stylesheet_changed, #evt_richtext_stylesheet_replaced, #evt_richtext_stylesheet_replacing, #evt_right_dclick, #evt_right_down, #evt_right_up, #evt_sash_dragged, #evt_sash_dragged_range, #evt_scroll, #evt_scroll_bottom, #evt_scroll_changed, #evt_scroll_linedown, #evt_scroll_lineup, #evt_scroll_pagedown, #evt_scroll_pageup, #evt_scroll_thumbrelease, #evt_scroll_thumbtrack, #evt_scroll_top, #evt_scrollbar, #evt_scrollwin, #evt_scrollwin_bottom, #evt_scrollwin_linedown, #evt_scrollwin_lineup, #evt_scrollwin_pagedown, #evt_scrollwin_pageup, #evt_scrollwin_thumbrelease, #evt_scrollwin_thumbtrack, #evt_scrollwin_top, #evt_search, #evt_search_cancel, #evt_set_cursor, #evt_set_focus, #evt_show, #evt_size, #evt_slider, #evt_spin, #evt_spin_down, #evt_spin_up, #evt_spinctrl, #evt_spinctrldouble, #evt_splitter_dclick, #evt_splitter_sash_pos_changed, #evt_splitter_sash_pos_changing, #evt_splitter_sash_pos_resize, #evt_splitter_unsplit, #evt_stc_autocomp_cancelled, #evt_stc_autocomp_char_deleted, #evt_stc_autocomp_completed, #evt_stc_autocomp_selection, #evt_stc_autocomp_selection_change, #evt_stc_calltip_click, #evt_stc_change, #evt_stc_charadded, #evt_stc_clipboard_copy, #evt_stc_clipboard_paste, #evt_stc_do_drop, #evt_stc_doubleclick, #evt_stc_drag_over, #evt_stc_dwellend, #evt_stc_dwellstart, #evt_stc_hotspot_click, #evt_stc_hotspot_dclick, #evt_stc_hotspot_release_click, #evt_stc_indicator_click, #evt_stc_indicator_release, #evt_stc_macrorecord, #evt_stc_margin_right_click, #evt_stc_marginclick, #evt_stc_modified, #evt_stc_needshown, #evt_stc_painted, #evt_stc_romodifyattempt, #evt_stc_savepointleft, #evt_stc_savepointreached, #evt_stc_start_drag, #evt_stc_styleneeded, #evt_stc_updateui, #evt_stc_userlistselection, #evt_stc_zoom, #evt_sys_colour_changed, #evt_taskbar_click, #evt_taskbar_left_dclick, #evt_taskbar_left_down, #evt_taskbar_left_up, #evt_taskbar_move, #evt_taskbar_right_dclick, #evt_taskbar_right_down, #evt_taskbar_right_up, #evt_text, #evt_text_copy, #evt_text_cut, #evt_text_enter, #evt_text_maxlen, #evt_text_paste, #evt_text_url, #evt_time_changed, #evt_timer, #evt_togglebutton, #evt_tool, #evt_tool_dropdown, #evt_tool_enter, #evt_tool_range, #evt_tool_rclicked, #evt_tool_rclicked_range, #evt_toolbook_page_changed, #evt_toolbook_page_changing, #evt_tree_begin_drag, #evt_tree_begin_label_edit, #evt_tree_begin_rdrag, #evt_tree_delete_item, #evt_tree_end_drag, #evt_tree_end_label_edit, #evt_tree_get_info, #evt_tree_item_activated, #evt_tree_item_collapsed, #evt_tree_item_collapsing, #evt_tree_item_expanded, #evt_tree_item_expanding, #evt_tree_item_gettooltip, #evt_tree_item_menu, #evt_tree_item_middle_click, #evt_tree_item_right_click, #evt_tree_key_down, #evt_tree_sel_changed, #evt_tree_sel_changing, #evt_tree_set_info, #evt_tree_state_image_click, #evt_treebook_node_collapsed, #evt_treebook_node_expanded, #evt_treebook_page_changed, #evt_treebook_page_changing, #evt_two_finger_tap, #evt_update_ui, #evt_update_ui_range, #evt_window_create, #evt_window_destroy, #evt_wizard_before_page_changed, #evt_wizard_cancel, #evt_wizard_finished, #evt_wizard_help, #evt_wizard_page_changed, #evt_wizard_page_changing, #evt_wizard_page_shown, #get_client_object, #get_evt_handler_enabled, #get_next_handler, #get_previous_handler, #is_unlinked, #process_event, #process_event_locally, #process_pending_events, #queue_event, register_class, remove_filter, #safely_process_event, #set_client_object, #set_evt_handler_enabled, #set_next_handler, #try_after, #try_before, #unlink
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
Instance Method Details
#append(id, item = (''), helpString = (''), kind = Wx::ItemKind::ITEM_NORMAL) ⇒ Wx::MenuItem #append(menuItem) ⇒ Wx::MenuItem
114 |
# File 'lib/wx/doc/gen/menu.rb', line 114 def append(*args) end |
#append_check_item(id, item, help = ('')) ⇒ Wx::MenuItem
Adds a checkable item to the end of the menu.
125 |
# File 'lib/wx/doc/gen/menu.rb', line 125 def append_check_item(id, item, help=('')) end |
#append_radio_item(id, item, help = ('')) ⇒ Wx::MenuItem
Adds a radio item to the end of the menu.
All consequent radio items form a group and when an item in the group is checked, all the others are automatically unchecked.
136 |
# File 'lib/wx/doc/gen/menu.rb', line 136 def append_radio_item(id, item, help=('')) end |
#append_separator ⇒ Wx::MenuItem
Adds a separator to the end of the menu.
144 |
# File 'lib/wx/doc/gen/menu.rb', line 144 def append_separator; end |
#append_sub_menu(submenu, text, help = ('')) ⇒ Wx::MenuItem
Adds the given submenu to this menu.
text is the text shown in the menu for it and help is the help string shown in the status bar when the submenu item is selected.
155 |
# File 'lib/wx/doc/gen/menu.rb', line 155 def (, text, help=('')) end |
#attach(menubar) ⇒ void
This method returns an undefined value.
531 |
# File 'lib/wx/doc/gen/menu.rb', line 531 def attach() end |
#break_ ⇒ void
This method returns an undefined value.
Inserts a break in a menu, causing the next appended item to appear in a new column.
This function only actually inserts a break in WXMSW and does nothing under the other platforms.
161 |
# File 'lib/wx/doc/gen/menu.rb', line 161 def break_; end |
#check(id, check) ⇒ void
This method returns an undefined value.
Checks or unchecks the menu item.
170 |
# File 'lib/wx/doc/gen/menu.rb', line 170 def check(id, check) end |
#delete(id) ⇒ Boolean #delete(item) ⇒ Boolean
190 |
# File 'lib/wx/doc/gen/menu.rb', line 190 def delete(*args) end |
#destroy(id) ⇒ Boolean #destroy(item) ⇒ Boolean
210 |
# File 'lib/wx/doc/gen/menu.rb', line 210 def destroy(*args) end |
#detach ⇒ void
This method returns an undefined value.
534 |
# File 'lib/wx/doc/gen/menu.rb', line 534 def detach; end |
#each_item {|item| ... } ⇒ Object #each_item ⇒ Enumerator
Yield each menu item to the given block. Returns an Enumerator if no block given.
19 |
# File 'lib/wx/doc/menu.rb', line 19 def each_item(*) end |
#enable(id, enable) ⇒ void
This method returns an undefined value.
Enables or disables (greys out) a menu item.
219 |
# File 'lib/wx/doc/gen/menu.rb', line 219 def enable(id, enable) end |
#find_child_item(id) ⇒ Array(Wx::MenuItem,Integer)
Finds the menu item object associated with the given menu item identifier and, optionally, the position of the item in the menu.
Unlike #find_item, this function doesn’t recurse but only looks at the direct children of this menu.
Menu item object or nil if not found.
228 |
# File 'lib/wx/doc/gen/menu.rb', line 228 def find_child_item(id) end |
#find_item(itemString) ⇒ Integer #find_item(id) ⇒ Array(Wx::MenuItem,Wx::Menu)
248 |
# File 'lib/wx/doc/gen/menu.rb', line 248 def find_item(*args) end |
#find_item_by_position(position) ⇒ Wx::MenuItem
Returns the Wx::MenuItem given a position in the menu.
253 |
# File 'lib/wx/doc/gen/menu.rb', line 253 def find_item_by_position(position) end |
#get_help_string(id) ⇒ String Also known as: help_string
Returns the help string associated with a menu item.
The help string, or the empty string if there is no help string or the item was not found.
262 |
# File 'lib/wx/doc/gen/menu.rb', line 262 def get_help_string(id) end |
#get_invoking_window ⇒ Wx::Window Also known as: invoking_window
509 |
# File 'lib/wx/doc/gen/menu.rb', line 509 def get_invoking_window; end |
#get_label(id) ⇒ String Also known as: label
Returns a menu item label.
The item label, or the empty string if the item was not found.
272 |
# File 'lib/wx/doc/gen/menu.rb', line 272 def get_label(id) end |
#get_label_text(id) ⇒ String Also known as: label_text
Returns a menu item label, without any of the original mnemonics and accelerators.
The item label, or the empty string if the item was not found.
282 |
# File 'lib/wx/doc/gen/menu.rb', line 282 def get_label_text(id) end |
#get_menu_item_count ⇒ Integer Also known as:
Returns the number of items in the menu.
287 |
# File 'lib/wx/doc/gen/menu.rb', line 287 def ; end |
#get_menu_items ⇒ Wx::MenuItemList Also known as:
Returns the list of items in the menu.
Wx::MenuItemList is a pseudo-template list class containing Wx::MenuItem pointers, see List.
49 |
# File 'lib/wx/doc/gen/menu.rb', line 49 def ; end |
#get_parent ⇒ Wx::Menu Also known as: parent
526 |
# File 'lib/wx/doc/gen/menu.rb', line 526 def get_parent; end |
#get_style ⇒ Integer Also known as: style
517 |
# File 'lib/wx/doc/gen/menu.rb', line 517 def get_style; end |
#get_title ⇒ Wx::String Also known as: title
Returns the title of the menu.
295 |
# File 'lib/wx/doc/gen/menu.rb', line 295 def get_title; end |
#get_window ⇒ Wx::Window Also known as: window
513 |
# File 'lib/wx/doc/gen/menu.rb', line 513 def get_window; end |
#insert(pos, menuItem) ⇒ Wx::MenuItem #insert(pos, id, item = (''), helpString = (''), kind = Wx::ItemKind::ITEM_NORMAL) ⇒ Wx::MenuItem #insert(pos, id, text, submenu, help = ('')) ⇒ Wx::MenuItem
331 |
# File 'lib/wx/doc/gen/menu.rb', line 331 def insert(*args) end |
#insert_check_item(pos, id, item, helpString = ('')) ⇒ Wx::MenuItem
Inserts a checkable item at the given position.
343 |
# File 'lib/wx/doc/gen/menu.rb', line 343 def insert_check_item(pos, id, item, helpString=('')) end |
#insert_radio_item(pos, id, item, helpString = ('')) ⇒ Wx::MenuItem
Inserts a radio item at the given position.
355 |
# File 'lib/wx/doc/gen/menu.rb', line 355 def insert_radio_item(pos, id, item, helpString=('')) end |
#insert_separator(pos) ⇒ Wx::MenuItem
Inserts a separator at the given position.
364 |
# File 'lib/wx/doc/gen/menu.rb', line 364 def insert_separator(pos) end |
#is_attached ⇒ Boolean Also known as: attached?
537 |
# File 'lib/wx/doc/gen/menu.rb', line 537 def is_attached; end |
#is_checked(id) ⇒ Boolean Also known as: checked?
Determines whether a menu item is checked.
true if the menu item is checked, false otherwise.
372 |
# File 'lib/wx/doc/gen/menu.rb', line 372 def is_checked(id) end |
#is_enabled(id) ⇒ Boolean Also known as: enabled?
Determines whether a menu item is enabled.
true if the menu item is enabled, false otherwise.
381 |
# File 'lib/wx/doc/gen/menu.rb', line 381 def is_enabled(id) end |
#prepend(item) ⇒ Wx::MenuItem #prepend(id, item = (''), helpString = (''), kind = Wx::ItemKind::ITEM_NORMAL) ⇒ Wx::MenuItem #prepend(id, text, submenu, help = ('')) ⇒ Wx::MenuItem
414 |
# File 'lib/wx/doc/gen/menu.rb', line 414 def prepend(*args) end |
#prepend_check_item(id, item, helpString = ('')) ⇒ Wx::MenuItem
Inserts a checkable item at position 0.
425 |
# File 'lib/wx/doc/gen/menu.rb', line 425 def prepend_check_item(id, item, helpString=('')) end |
#prepend_radio_item(id, item, helpString = ('')) ⇒ Wx::MenuItem
Inserts a radio item at position 0.
436 |
# File 'lib/wx/doc/gen/menu.rb', line 436 def prepend_radio_item(id, item, helpString=('')) end |
#prepend_separator ⇒ Wx::MenuItem
Inserts a separator at position 0.
444 |
# File 'lib/wx/doc/gen/menu.rb', line 444 def prepend_separator; end |
#remove(id) ⇒ Wx::MenuItem #remove(item) ⇒ Wx::MenuItem
462 |
# File 'lib/wx/doc/gen/menu.rb', line 462 def remove(*args) end |
#set_help_string(id, helpString) ⇒ void
This method returns an undefined value.
Sets an item’s help string.
471 |
# File 'lib/wx/doc/gen/menu.rb', line 471 def set_help_string(id, helpString) end |
#set_invoking_window(win) ⇒ void Also known as: invoking_window=
This method returns an undefined value.
505 |
# File 'lib/wx/doc/gen/menu.rb', line 505 def set_invoking_window(win) end |
#set_label(id, label) ⇒ void
This method returns an undefined value.
Sets the label of a menu item.
481 |
# File 'lib/wx/doc/gen/menu.rb', line 481 def set_label(id, label) end |
#set_parent(parent) ⇒ void Also known as: parent=
This method returns an undefined value.
522 |
# File 'lib/wx/doc/gen/menu.rb', line 522 def set_parent(parent) end |
#set_title(title) ⇒ void Also known as: title=
This method returns an undefined value.
Sets the title of the menu.
Notice that you can only call this method directly for the popup menus, to change the title of a menu that is part of a menu bar you need to use Wx::MenuBar#set_label_top.
493 |
# File 'lib/wx/doc/gen/menu.rb', line 493 def set_title(title) end |
#update_ui(source = nil) ⇒ void
This method returns an undefined value.
Update the state of all menu items, recursively, by generating EVT_UPDATE_UI events for them.
This is an internal wxWidgets function and shouldn’t normally be called from outside of the library. If it is called, source argument should not be used, it is deprecated and exists only for backwards compatibility.
501 |
# File 'lib/wx/doc/gen/menu.rb', line 501 def update_ui(source=nil) end |