1 \section{\class{wxMenu
}}\label{wxmenu
}
3 A menu is a popup (or pull down) list of items, one of which may be
4 selected before the menu goes away (clicking elsewhere dismisses the
5 menu). Menus may be used to construct either menu bars or popup menus.
7 A menu item has an integer ID associated with it which can be used to
8 identify the selection, or to change the menu item in some way.
10 \wxheading{Derived from
}
12 \helpref{wxEvtHandler
}{wxevthandler
}\\
13 \helpref{wxObject
}{wxobject
}
15 \wxheading{Include files
}
19 \wxheading{Event handling
}
21 If the menu is part of a menubar, then
\helpref{wxMenuBar
}{wxmenubar
} event processing is used.
23 With a popup menu, there is a variety of ways to handle a menu selection event
24 (wxEVT
\_COMMAND\_MENU\_SELECTED).
26 \begin{enumerate
}\itemsep=
0pt
27 \item Derive a new class from wxMenu and define event table entries using the EVT
\_MENU macro.
28 \item Set a new event handler for wxMenu, using an object whose class has EVT
\_MENU entries.
29 \item Provide EVT
\_MENU handlers in the window which pops up the menu, or in an ancestor of
31 \item Define a callback of type wxFunction, which you pass to the wxMenu constructor.
32 The callback takes a reference to the menu, and a reference to a
33 \helpref{wxCommandEvent
}{wxcommandevent
}. This method is deprecated and should
34 not be used in the new code, it is provided for backwards compatibility only.
39 \helpref{wxMenuBar
}{wxmenubar
},
\helpref{wxWindow::PopupMenu
}{wxwindowpopupmenu
},
\rtfsp
40 \helpref{Event handling overview
}{eventhandlingoverview
}
42 \latexignore{\rtfignore{\wxheading{Members
}}}
44 \membersection{wxMenu::wxMenu
}\label{wxmenuconstr
}
46 \func{}{wxMenu
}{\param{const wxString\&
}{title = ""
},
\param{long
}{ style =
0}}
48 Constructs a wxMenu object.
50 \wxheading{Parameters
}
52 \docparam{title
}{A title for the popup menu: the empty string denotes no title.
}
54 \docparam{style
}{If set to
\tt{wxMENU
\_TEAROFF}, the menu will be detachable.
}
57 \func{}{wxMenu
}{\param{long
}{ style
}}
59 Constructs a wxMenu object.
61 \wxheading{Parameters
}
63 \docparam{style
}{If set to
\tt{wxMENU
\_TEAROFF}, the menu will be detachable.
}
65 \membersection{wxMenu::
\destruct{wxMenu
}}
67 \func{}{\destruct{wxMenu
}}{\void}
69 Destructor, destroying the menu.
71 Note: under Motif, a popup menu must have a valid parent (the window
72 it was last popped up on) when being destroyed. Therefore, make sure
73 you delete or re-use the popup menu
{\it before
} destroying the
74 parent window. Re-use in this context means popping up the menu on
75 a different window from last time, which causes an implicit destruction
76 and recreation of internal data structures.
78 \membersection{wxMenu::Append
}\label{wxmenuappend
}
80 \func{void
}{Append
}{\param{int
}{ id
},
\param{const wxString\&
}{ item
},
\param{const wxString\&
}{helpString = ""
},
\rtfsp
81 \param{const bool
}{ checkable = FALSE
}}
83 Adds a string item to the end of the menu.
85 \func{void
}{Append
}{\param{int
}{ id
},
\param{const wxString\&
}{ item
},
\param{wxMenu *
}{subMenu
},
\rtfsp
86 \param{const wxString\&
}{helpString = ""
}}
88 Adds a pull-right submenu to the end of the menu.
90 \func{void
}{Append
}{\param{wxMenuItem*
}{ menuItem
}}
92 Adds a menu item object. This is the most generic variant of Append() method
93 because it may be used for both items (including separators) and submenus and
94 because you can also specify various extra properties of a menu item this way,
95 such as bitmaps and fonts.
97 \wxheading{Parameters
}
99 \docparam{id
}{The menu command identifier.
}
101 \docparam{item
}{The string to appear on the menu item.
}
103 \docparam{menu
}{Pull-right submenu.
}
105 \docparam{checkable
}{If TRUE, this item is checkable.
}
107 \docparam{helpString
}{An optional help string associated with the item.
108 By default,
\helpref{wxFrame::OnMenuHighlight
}{wxframeonmenuhighlight
} displays
109 this string in the status line.
}
111 \docparam{menuItem
}{A menuitem object. It will be owned by the wxMenu object after this function
112 is called, so do not delete it yourself.
}
116 This command can be used after the menu has been shown, as well as on initial
117 creation of a menu or menubar.
121 \helpref{wxMenu::AppendSeparator
}{wxmenuappendseparator
},
\rtfsp
122 \helpref{wxMenu::Insert
}{wxmenuinsert
},
\rtfsp
123 \helpref{wxMenu::SetLabel
}{wxmenusetlabel
},
\helpref{wxMenu::GetHelpString
}{wxmenugethelpstring
},
\rtfsp
124 \helpref{wxMenu::SetHelpString
}{wxmenusethelpstring
},
\helpref{wxMenuItem
}{wxmenuitem
}
126 \pythonnote{In place of a single overloaded method name, wxPython
127 implements the following methods:
\par
128 \indented{2cm
}{\begin{twocollist
}
129 \twocolitem{\bf{Append(id, string, helpStr="", checkable=FALSE)
}}{}
130 \twocolitem{\bf{AppendMenu(id, string, aMenu, helpStr="")
}}{}
131 \twocolitem{\bf{AppendItem(aMenuItem)
}}{}
135 \membersection{wxMenu::AppendSeparator
}\label{wxmenuappendseparator
}
137 \func{void
}{AppendSeparator
}{\void}
139 Adds a separator to the end of the menu.
143 \helpref{wxMenu::Append
}{wxmenuappend
}
145 \membersection{wxMenu::Break
}\label{wxmenubreak
}
147 \func{void
}{Break
}{\void}
149 Inserts a break in a menu, causing the next appended item to appear in a new column.
151 \membersection{wxMenu::Check
}\label{wxmenucheck
}
153 \func{void
}{Check
}{\param{int
}{ id
},
\param{const bool
}{ check
}}
155 Checks or unchecks the menu item.
157 \wxheading{Parameters
}
159 \docparam{id
}{The menu item identifier.
}
161 \docparam{check
}{If TRUE, the item will be checked, otherwise it will be unchecked.
}
165 \helpref{wxMenu::IsChecked
}{wxmenuischecked
}
167 \membersection{wxMenu::Delete
}\label{wxmenudelete
}
169 \func{void
}{Delete
}{\param{int
}{id
}}
171 \func{void
}{Delete
}{\param{wxMenuItem *
}{item
}}
173 Deletes the menu item from the menu. If the item is a submenu, it will
174 {\bf not
} be deleted. Use
\helpref{Destroy
}{wxmenudestroy
} if you want to
177 \wxheading{Parameters
}
179 \docparam{id
}{Id of the menu item to be deleted.
}
181 \docparam{item
}{Menu item to be deleted.
}
185 \helpref{wxMenu::FindItem
}{wxmenufinditem
},
\rtfsp
186 \helpref{wxMenu::Destroy
}{wxmenudestroy
},
\rtfsp
187 \helpref{wxMenu::Remove
}{wxmenuremove
}
189 \membersection{wxMenu::Destroy
}\label{wxmenudestroy
}
191 \func{void
}{Destroy
}{\param{int
}{id
}}
193 \func{void
}{Destroy
}{\param{wxMenuItem *
}{item
}}
195 Deletes the menu item from the menu. If the item is a submenu, it will
196 be deleted. Use
\helpref{Remove
}{wxmenuremove
} if you want to keep the submenu
197 (for example, to reuse it later).
199 \wxheading{Parameters
}
201 \docparam{id
}{Id of the menu item to be deleted.
}
203 \docparam{item
}{Menu item to be deleted.
}
207 \helpref{wxMenu::FindItem
}{wxmenufinditem
},
\rtfsp
208 \helpref{wxMenu::Deletes
}{wxmenudelete
},
\rtfsp
209 \helpref{wxMenu::Remove
}{wxmenuremove
}
211 \membersection{wxMenu::Enable
}\label{wxmenuenable
}
213 \func{void
}{Enable
}{\param{int
}{ id
},
\param{const bool
}{ enable
}}
215 Enables or disables (greys out) a menu item.
217 \wxheading{Parameters
}
219 \docparam{id
}{The menu item identifier.
}
221 \docparam{enable
}{TRUE to enable the menu item, FALSE to disable it.
}
225 \helpref{wxMenu::IsEnabled
}{wxmenuisenabled
}
227 \membersection{wxMenu::FindItem
}\label{wxmenufinditem
}
229 \constfunc{int
}{FindItem
}{\param{const wxString\&
}{itemString
}}
231 Finds the menu item id for a menu item string.
233 \wxheading{Parameters
}
235 \docparam{itemString
}{Menu item string to find.
}
237 \wxheading{Return value
}
239 Menu item identifier, or wxNOT
\_FOUND if none is found.
243 Any special menu codes are stripped out of source and target strings
248 \helpref{wxMenu::FindItem
}{wxmenufinditem
}
250 \membersection{wxMenu::FindItem
}\label{wxmenufinditem
}
252 \constfunc{wxMenuItem *
}{FindItem
}{\param{int
}{ id
},
\param{wxMenu **
}{menu = NULL
}}
254 Finds the menu item object associated with the given menu item identifier and,
255 optionally, the (sub)menu it belongs to.
257 \wxheading{Parameters
}
259 \docparam{id
}{Menu item identifier.
}
261 \docparam{menu
}{If the pointer is not NULL, it will be filled with the items
262 parent menu (if the item was found)
}
264 \wxheading{Return value
}
266 Returns the menu item object, or NULL if it is not found.
270 \helpref{wxMenu::FindItem
}{wxmenufinditem
}
272 \membersection{wxMenu::GetHelpString
}\label{wxmenugethelpstring
}
274 \constfunc{wxString
}{GetHelpString
}{\param{int
}{ id
}}
276 Returns the help string associated with a menu item.
278 \wxheading{Parameters
}
280 \docparam{id
}{The menu item identifier.
}
282 \wxheading{Return value
}
284 The help string, or the empty string if there is no help string or the
289 \helpref{wxMenu::SetHelpString
}{wxmenusethelpstring
},
\helpref{wxMenu::Append
}{wxmenuappend
}
291 \membersection{wxMenu::GetLabel
}\label{wxmenugetlabel
}
293 \constfunc{wxString
}{GetLabel
}{\param{int
}{ id
}}
295 Returns a menu item label.
297 \wxheading{Parameters
}
299 \docparam{id
}{The menu item identifier.
}
301 \wxheading{Return value
}
303 The item label, or the empty string if the item was not found.
307 \helpref{wxMenu::SetLabel
}{wxmenusetlabel
}
309 \membersection{wxMenu::GetMenuItemCount
}\label{wxmenugetmenuitemcount
}
311 \constfunc{size
\_t}{GetMenuItemCount
}{\void}
313 Returns the number of items in the menu.
315 \membersection{wxMenu::GetMenuItems
}\label{wxmenugetmenuitems
}
317 \constfunc{wxMenuItemList\&
}{GetMenuItems
}{\void}
319 Returns the list of items in the menu. wxMenuItemList is a pseudo-template
320 list class containing wxMenuItem pointers.
322 \membersection{wxMenu::GetTitle
}\label{wxmenugettitle
}
324 \constfunc{wxString
}{GetTitle
}{\void}
326 Returns the title of the menu.
330 This is relevant only to popup menus.
334 \helpref{wxMenu::SetTitle
}{wxmenusettitle
}
336 \membersection{wxMenu::Insert
}\label{wxmenuinsert
}
338 \func{bool
}{Insert
}{\param{size
\_t }{pos
},
\param{wxMenuItem *
}{item
}}
340 Inserts the given
{\it item
} before the position
{\it pos
}. Inserting the item
341 at the position
\helpref{GetMenuItemCount
}{wxmenugetmenuitemcount
} is the same
346 \helpref{wxMenu::Append
}{wxmenuappend
}
348 \membersection{wxMenu::IsChecked
}\label{wxmenuischecked
}
350 \constfunc{bool
}{IsChecked
}{\param{int
}{ id
}}
352 Determines whether a menu item is checked.
354 \wxheading{Parameters
}
356 \docparam{id
}{The menu item identifier.
}
358 \wxheading{Return value
}
360 TRUE if the menu item is checked, FALSE otherwise.
364 \helpref{wxMenu::Check
}{wxmenucheck
}
366 \membersection{wxMenu::IsEnabled
}\label{wxmenuisenabled
}
368 \constfunc{bool
}{IsEnabled
}{\param{int
}{ id
}}
370 Determines whether a menu item is enabled.
372 \wxheading{Parameters
}
374 \docparam{id
}{The menu item identifier.
}
376 \wxheading{Return value
}
378 TRUE if the menu item is enabled, FALSE otherwise.
382 \helpref{wxMenu::Enable
}{wxmenuenable
}
384 \membersection{wxMenu::Remove
}\label{wxmenuremove
}
386 \func{wxMenuItem *
}{Remove
}{\param{int
}{id
}}
388 \func{wxMenuItem *
}{Remove
}{\param{wxMenuItem *
}{item
}}
390 Removes the menu item from the menu but doesn't delete the associated C++
391 object. This allows to reuse the same item later by adding it back to the menu
392 (especially useful with submenus).
394 \wxheading{Parameters
}
396 \docparam{id
}{The identifier of the menu item to remove.
}
398 \docparam{item
}{The menu item to remove.
}
400 \wxheading{Return value
}
402 The item which was detached from the menu.
404 \membersection{wxMenu::SetHelpString
}\label{wxmenusethelpstring
}
406 \func{void
}{SetHelpString
}{\param{int
}{ id
},
\param{const wxString\&
}{helpString
}}
408 Sets an item's help string.
410 \wxheading{Parameters
}
412 \docparam{id
}{The menu item identifier.
}
414 \docparam{helpString
}{The help string to set.
}
418 \helpref{wxMenu::GetHelpString
}{wxmenugethelpstring
}
420 \membersection{wxMenu::SetLabel
}\label{wxmenusetlabel
}
422 \func{void
}{SetLabel
}{\param{int
}{ id
},
\param{const wxString\&
}{label
}}
424 Sets the label of a menu item.
426 \wxheading{Parameters
}
428 \docparam{id
}{The menu item identifier.
}
430 \docparam{label
}{The menu item label to set.
}
434 \helpref{wxMenu::Append
}{wxmenuappend
},
\helpref{wxMenu::GetLabel
}{wxmenugetlabel
}
436 \membersection{wxMenu::SetTitle
}\label{wxmenusettitle
}
438 \func{void
}{SetTitle
}{\param{const wxString\&
}{title
}}
440 Sets the title of the menu.
442 \wxheading{Parameters
}
444 \docparam{title
}{The title to set.
}
448 This is relevant only to popup menus.
452 \helpref{wxMenu::SetTitle
}{wxmenusettitle
}
454 \membersection{wxMenu::UpdateUI
}\label{wxmenuupdateui
}
456 \constfunc{void
}{UpdateUI
}{\param{wxEvtHandler*
}{ source = NULL
}}
458 Sends events to
{\it source
} (or owning window if NULL) to update the
459 menu UI. This is called just before the menu is popped up with
\helpref{wxWindow::PopupMenu
}{wxwindowpopupmenu
}, but
460 the application may call it at other times if required.
464 \helpref{wxUpdateUIEvent
}{wxupdateuievent
}
466 \section{\class{wxMenuBar
}}\label{wxmenubar
}
468 A menu bar is a series of menus accessible from the top of a frame.
470 \wxheading{Derived from
}
472 \helpref{wxEvtHandler
}{wxevthandler
}\\
473 \helpref{wxObject
}{wxobject
}
475 \wxheading{Include files
}
479 \wxheading{Event handling
}
481 To respond to a menu selection, provide a handler for EVT
\_MENU, in the frame
482 that contains the menu bar. If you have a toolbar which uses the same identifiers
483 as your EVT
\_MENU entries, events from the toolbar will also be processed by your
484 EVT
\_MENU event handlers.
486 Note that menu commands (and UI update events for menus) are first sent to
487 the focus window within the frame. If no window within the frame has the focus,
488 then the events are sent directly to the frame. This allows command and UI update
489 handling to be processed by specific windows and controls, and not necessarily
490 by the application frame.
494 \helpref{wxMenu
}{wxmenu
},
\helpref{Event handling overview
}{eventhandlingoverview
}
496 \latexignore{\rtfignore{\wxheading{Members
}}}
498 \membersection{wxMenuBar::wxMenuBar
}\label{wxmenubarconstr
}
500 \func{void
}{wxMenuBar
}{\void}
504 \func{void
}{wxMenuBar
}{\param{int
}{ n
},
\param{wxMenu*
}{ menus
[]},
\param{const wxString
}{titles
[]}}
506 Construct a menu bar from arrays of menus and titles.
508 \wxheading{Parameters
}
510 \docparam{n
}{The number of menus.
}
512 \docparam{menus
}{An array of menus. Do not use this array again - it now belongs to the
515 \docparam{titles
}{An array of title strings. Deallocate this array after creating the menu bar.
}
517 \pythonnote{Only the default constructor is supported in wxPython.
518 Use wxMenuBar.Append instead.
}
520 \membersection{wxMenuBar::
\destruct{wxMenuBar
}}
522 \func{void
}{\destruct{wxMenuBar
}}{\void}
524 Destructor, destroying the menu bar and removing it from the parent frame (if any).
526 \membersection{wxMenuBar::Append
}\label{wxmenubarappend
}
528 \func{bool
}{Append
}{\param{wxMenu *
}{menu
},
\param{const wxString\&
}{title
}}
530 Adds the item to the end of the menu bar.
532 \wxheading{Parameters
}
534 \docparam{menu
}{The menu to add. Do not deallocate this menu after calling
{\bf Append
}.
}
536 \docparam{title
}{The title of the menu.
}
538 \wxheading{Return value
}
540 TRUE on success, FALSE if an error occured.
544 \helpref{wxMenuBar::Insert
}{wxmenubarinsert
}
546 \membersection{wxMenuBar::Check
}\label{wxmenubarcheck
}
548 \func{void
}{Check
}{\param{int
}{ id
},
\param{const bool
}{ check
}}
550 Checks or unchecks a menu item.
552 \wxheading{Parameters
}
554 \docparam{id
}{The menu item identifier.
}
556 \docparam{check
}{If TRUE, checks the menu item, otherwise the item is unchecked.
}
560 Only use this when the menu bar has been associated
561 with a frame; otherwise, use the wxMenu equivalent call.
563 \membersection{wxMenuBar::Enable
}\label{wxmenubarenable
}
565 \func{void
}{Enable
}{\param{int
}{ id
},
\param{const bool
}{ enable
}}
567 Enables or disables (greys out) a menu item.
569 \wxheading{Parameters
}
571 \docparam{id
}{The menu item identifier.
}
573 \docparam{enable
}{TRUE to enable the item, FALSE to disable it.
}
577 Only use this when the menu bar has been
578 associated with a frame; otherwise, use the wxMenu equivalent call.
580 \membersection{wxMenuBar::EnableTop
}\label{wxmenubarenabletop
}
582 \func{void
}{EnableTop
}{\param{int
}{ pos
},
\param{const bool
}{ enable
}}
584 Enables or disables a whole menu.
586 \wxheading{Parameters
}
588 \docparam{pos
}{The position of the menu, starting from zero.
}
590 \docparam{enable
}{TRUE to enable the menu, FALSE to disable it.
}
594 Only use this when the menu bar has been
595 associated with a frame.
597 \membersection{wxMenuBar::FindMenuItem
}\label{wxmenubarfindmenuitem
}
599 \constfunc{int
}{FindMenuItem
}{\param{const wxString\&
}{menuString
},
\param{const wxString\&
}{itemString
}}
601 Finds the menu item id for a menu name/menu item string pair.
603 \wxheading{Parameters
}
605 \docparam{menuString
}{Menu title to find.
}
607 \docparam{itemString
}{Item to find.
}
609 \wxheading{Return value
}
611 The menu item identifier, or wxNOT
\_FOUND if none was found.
615 Any special menu codes are stripped out of source and target strings
618 \membersection{wxMenuBar::FindItem
}\label{wxmenubarfinditem
}
620 \constfunc{wxMenuItem *
}{FindItem
}{\param{int
}{ id
},
\param{wxMenu
}{ **menu = NULL
}}
622 Finds the menu item object associated with the given menu item identifier.
624 \wxheading{Parameters
}
626 \docparam{id
}{Menu item identifier.
}
628 \docparam{menu
}{If not NULL, menu will get set to the associated menu.
}
630 \wxheading{Return value
}
632 The found menu item object, or NULL if one was not found.
634 \membersection{wxMenuBar::GetHelpString
}\label{wxmenubargethelpstring
}
636 \constfunc{wxString
}{GetHelpString
}{\param{int
}{ id
}}
638 Gets the help string associated with the menu item identifer.
640 \wxheading{Parameters
}
642 \docparam{id
}{The menu item identifier.
}
644 \wxheading{Return value
}
646 The help string, or the empty string if there was no help string or the menu item
651 \helpref{wxMenuBar::SetHelpString
}{wxmenubarsethelpstring
}
653 \membersection{wxMenuBar::GetLabel
}\label{wxmenubargetlabel
}
655 \constfunc{wxString
}{GetLabel
}{\param{int
}{ id
}}
657 Gets the label associated with a menu item.
659 \wxheading{Parameters
}
661 \docparam{id
}{The menu item identifier.
}
663 \wxheading{Return value
}
665 The menu item label, or the empty string if the item was not found.
669 Use only after the menubar has been associated with a frame.
671 \membersection{wxMenuBar::GetLabelTop
}\label{wxmenubargetlabeltop
}
673 \constfunc{wxString
}{GetLabelTop
}{\param{int
}{ pos
}}
675 Returns the label of a top-level menu.
677 \wxheading{Parameters
}
679 \docparam{pos
}{Position of the menu on the menu bar, starting from zero.
}
681 \wxheading{Return value
}
683 The menu label, or the empty string if the menu was not found.
687 Use only after the menubar has been associated with a frame.
691 \helpref{wxMenuBar::SetLabelTop
}{wxmenubarsetlabeltop
}
693 \membersection{wxMenuBar::GetMenu
}\label{wxmenubargetmenu
}
695 \constfunc{wxMenu*
}{GetMenu
}{\param{int
}{ menuIndex
}}
697 Returns the menu at
{\it menuIndex
} (zero-based).
699 \membersection{wxMenuBar::GetMenuCount
}\label{wxmenubargetmenucount
}
701 \constfunc{int
}{GetMenuCount
}{\void}
703 Returns the number of menus in this menubar.
705 \membersection{wxMenuBar::Insert
}{wxmenubarinsert
}
707 \func{bool
}{Insert
}{\param{size
\_t }{pos
},
\param{wxMenu *
}{menu
},
\param{const wxString\&
}{title
}}
709 Inserts the menu at the given position into the menu bar. Inserting menu at
710 position $
0$ will insert it in the very beginning of it, inserting at position
711 \helpref{GetMenuCount()
}{wxmenubargetmenucount
} is the same as calling
712 \helpref{Append()
}{wxmenubarappend
}.
714 \wxheading{Parameters
}
716 \docparam{pos
}{The position of the new menu in the menu bar
}
718 \docparam{menu
}{The menu to add. wxMenuBar owns the menu and will free it.
}
720 \docparam{title
}{The title of the menu.
}
722 \wxheading{Return value
}
724 TRUE on success, FALSE if an error occured.
728 \helpref{wxMenuBar::Append
}{wxmenubarappend
}
730 \membersection{wxMenuBar::IsChecked
}\label{wxmenubarischecked
}
732 \constfunc{bool
}{IsChecked
}{\param{int
}{ id
}}
734 Determines whether an item is checked.
736 \wxheading{Parameters
}
738 \docparam{id
}{The menu item identifier.
}
740 \wxheading{Return value
}
742 TRUE if the item was found and is checked, FALSE otherwise.
744 \membersection{wxMenuBar::IsEnabled
}\label{wxmenubarisenabled
}
746 \constfunc{bool
}{IsEnabled
}{\param{int
}{ id
}}
748 Determines whether an item is enabled.
750 \wxheading{Parameters
}
752 \docparam{id
}{The menu item identifier.
}
754 \wxheading{Return value
}
756 TRUE if the item was found and is enabled, FALSE otherwise.
758 \membersection{wxMenuBar::Refresh
}\label{wxmenubarrefresh
}
760 \func{void
}{Refresh
}{\void}
764 \membersection{wxMenuBar::Remove
}\label{wxmenubarremove
}
766 \func{wxMenu *
}{Remove
}{\param{size
\_t }{pos
}}
768 Removes the menu from the menu bar and returns the menu object - the caller is
769 reposnbile for deleting it. This function may be used together with
770 \helpref{wxMenuBar::Insert
}{wxmenubarinsert
} to change the menubar
775 \helpref{wxMenuBar::Replace
}[wxmenubarreplace
}
777 \membersection{wxMenuBar::Replace
}\label{wxmenubarreplace
}
779 \func{wxMenu *
}{Replace
}{\param{size
\_t }{pos
},
\param{wxMenu *
}{menu
},
\param{const wxString\&
}{title
}}
781 Replaces the menu at givenm position with another one.
783 \wxheading{Parameters
}
785 \docparam{pos
}{The position of the new menu in the menu bar
}
787 \docparam{menu
}{The menu to add.
}
789 \docparam{title
}{The title of the menu.
}
791 \wxheading{Return value
}
793 The menu which was previously at the position
{\it pos
}. The caller is
794 responsible for deleting it.
798 \helpref{wxMenuBar::Insert
}{wxmenubarinsert
},
\rtfsp
799 \helpref{wxMenuBar::Remove
}{wxmenubarremove
}
801 \membersection{wxMenuBar::IsChecked
}\label{wxmenubarischecked
}
803 \membersection{wxMenuBar::SetHelpString
}\label{wxmenubarsethelpstring
}
805 \func{void
}{SetHelpString
}{\param{int
}{ id
},
\param{const wxString\&
}{helpString
}}
807 Sets the help string associated with a menu item.
809 \wxheading{Parameters
}
811 \docparam{id
}{Menu item identifier.
}
813 \docparam{helpString
}{Help string to associate with the menu item.
}
817 \helpref{wxMenuBar::GetHelpString
}{wxmenubargethelpstring
}
819 \membersection{wxMenuBar::SetLabel
}\label{wxmenubarsetlabel
}
821 \func{void
}{SetLabel
}{\param{int
}{ id
},
\param{const wxString\&
}{label
}}
823 Sets the label of a menu item.
825 \wxheading{Parameters
}
827 \docparam{id
}{Menu item identifier.
}
829 \docparam{label
}{Menu item label.
}
833 Use only after the menubar has been associated with a frame.
837 \helpref{wxMenuBar::GetLabel
}{wxmenubargetlabel
}
839 \membersection{wxMenuBar::SetLabelTop
}\label{wxmenubarsetlabeltop
}
841 \func{void
}{SetLabelTop
}{\param{int
}{ pos
},
\param{const wxString\&
}{label
}}
843 Sets the label of a top-level menu.
845 \wxheading{Parameters
}
847 \docparam{pos
}{The position of a menu on the menu bar, starting from zero.
}
849 \docparam{label
}{The menu label.
}
853 Use only after the menubar has been associated with a frame.
857 \helpref{wxMenuBar::GetLabelTop
}{wxmenubargetlabeltop
}