diff --git a/docs/changes.txt b/docs/changes.txt index c5f6110fb7..90c70c24b6 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -184,6 +184,7 @@ All: All (GUI): - rare crash in wxFontMapper fixed (Robert Vazan) +- Added wxMenu::FindItemByPosition. Generic: @@ -211,6 +212,7 @@ wxMotif: - fixed "make install" +>>>>>>> 1.212.2.72 2.4.1 ----- diff --git a/docs/latex/wx/menu.tex b/docs/latex/wx/menu.tex index 5a42e562f8..cee22fffea 100644 --- a/docs/latex/wx/menu.tex +++ b/docs/latex/wx/menu.tex @@ -323,6 +323,12 @@ before matching. \pythonnote{The name of this method in wxPython is {\tt FindItemById} and it does not support the second parameter.} +\membersection{wxMenu::FindItemByPosition}\label{wxmenufinditembyposition} + +\constfunc{wxMenuItem*}{FindItemByPosition}{\param{size\_t }{position}} + +Finds the menu item for the given position, returning NULL if not found. + \membersection{wxMenu::GetHelpString}\label{wxmenugethelpstring} \constfunc{wxString}{GetHelpString}{\param{int}{ id}} diff --git a/docs/latex/wx/wizpage.tex b/docs/latex/wx/wizpage.tex index 456349c591..57cab97190 100644 --- a/docs/latex/wx/wizpage.tex +++ b/docs/latex/wx/wizpage.tex @@ -138,7 +138,8 @@ instead. \membersection{wxWizardPageSimple::wxWizardPageSimple}\label{wxwizardpagesimplewxwizardpagesimple} -\func{}{wxWizardPageSimple}{\param{wxWizard* }{parent = NULL}, \param{wxWizardPage* }{prev = NULL}, \param{wxWizardPage* }{next = NULL}} +\func{}{wxWizardPageSimple}{\param{wxWizard* }{parent = NULL}, \param{wxWizardPage* }{prev = NULL}, \param{wxWizardPage* }{next = NULL}, +\param{const wxBitmap& }{bitmap = wxNullBitmap}} Constructor takes the previous and next pages. They may be modified later by \helpref{SetPrev()}{wxwizardpagesimplesetprev} or diff --git a/include/wx/menu.h b/include/wx/menu.h index ccdac72ffa..c3248740d6 100644 --- a/include/wx/menu.h +++ b/include/wx/menu.h @@ -242,6 +242,9 @@ public: virtual int FindItem(const wxString& item) const; wxMenuItem* FindItem(int id, wxMenu **menu = NULL) const; + // find by position + wxMenuItem* FindItemByPosition(size_t position) const; + // get/set items attributes void Enable(int id, bool enable); bool IsEnabled(int id) const; diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 99bd5987a7..30d4b17f8c 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -533,6 +533,13 @@ wxMenuItem *wxMenuBase::FindChildItem(int id, size_t *ppos) const return item; } +// find by position +wxMenuItem* wxMenuBase::FindItemByPosition(size_t position) const +{ + if ( position >= m_items.GetCount()) return NULL; + return m_items.Item( position )->GetData(); +} + // ---------------------------------------------------------------------------- // wxMenu helpers used by derived classes // ----------------------------------------------------------------------------