X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3870b2ff595ba4bb4f0397ace77ceeb9628e94d..01526d4f6cd7dd242e561aa24066f8ca0290a9ac:/include/wx/univ/menu.h?ds=inline diff --git a/include/wx/univ/menu.h b/include/wx/univ/menu.h index 1dbc2b3345..6447a0c36a 100644 --- a/include/wx/univ/menu.h +++ b/include/wx/univ/menu.h @@ -12,7 +12,7 @@ #ifndef _WX_UNIV_MENU_H_ #define _WX_UNIV_MENU_H_ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "univmenu.h" #endif @@ -24,26 +24,12 @@ // fwd declarations class WXDLLEXPORT wxMenuInfo; -WX_DECLARE_OBJARRAY(wxMenuInfo, wxMenuInfoArray); - -class wxPopupMenuWindow; +WX_DECLARE_EXPORTED_OBJARRAY(wxMenuInfo, wxMenuInfoArray); +class WXDLLEXPORT wxMenuGeometryInfo; +class WXDLLEXPORT wxPopupMenuWindow; class WXDLLEXPORT wxRenderer; -// ---------------------------------------------------------------------------- -// wxMenu helper classes, used in implementation only -// ---------------------------------------------------------------------------- - -// used by wxRenderer -class WXDLLEXPORT wxMenuGeometryInfo -{ -public: - // get the total size of the menu - virtual wxSize GetSize() const = 0; - - virtual ~wxMenuGeometryInfo(); -}; - // ---------------------------------------------------------------------------- // wxMenu // ---------------------------------------------------------------------------- @@ -68,7 +54,7 @@ public: // show this menu at the given position (in screen coords) and optionally // select its first item void Popup(const wxPoint& pos, const wxSize& size, - bool selectFirst = TRUE); + bool selectFirst = true); // dismiss the menu void Dismiss(); @@ -79,11 +65,11 @@ public: // implementation only from here - // do as if this item were clicked, return TRUE if the resulting event was - // processed, FALSE otherwise + // do as if this item were clicked, return true if the resulting event was + // processed, false otherwise bool ClickItem(wxMenuItem *item); - // process the key event, return TRUE if done + // process the key event, return true if done bool ProcessKeyDown(int key); #if wxUSE_ACCEL @@ -93,9 +79,9 @@ public: protected: // implement base class virtuals - virtual bool DoAppend(wxMenuItem *item); - virtual bool DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem *DoRemove(wxMenuItem *item); + virtual wxMenuItem* DoAppend(wxMenuItem *item); + virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); + virtual wxMenuItem* DoRemove(wxMenuItem *item); // common part of DoAppend and DoInsert void OnItemAdded(wxMenuItem *item); @@ -129,6 +115,9 @@ private: // common part of all ctors void Init(); + // terminate the current radio group, if any + void EndRadioGroup(); + // the exact menu geometry is defined by a struct derived from this one // which is opaque and defined by the renderer wxMenuGeometryInfo *m_geometry; @@ -141,9 +130,11 @@ private: wxAcceleratorTable m_accelTable; #endif // wxUSE_ACCEL - // it calls out OnDismiss() - friend wxPopupMenuWindow; + // the position of the first item in the current radio group or -1 + int m_startRadioGroup; + // it calls out OnDismiss() + friend class wxPopupMenuWindow; DECLARE_DYNAMIC_CLASS(wxMenu) }; @@ -176,8 +167,8 @@ public: // get the next item for the givan accel letter (used by wxFrame), return // -1 if none // - // if unique is not NULL, filled with TRUE if there is only one item with - // this accel, FALSE if two or more + // if unique is not NULL, filled with true if there is only one item with + // this accel, false if two or more int FindNextItemForAccel(int idxStart, int keycode, bool *unique = NULL) const; @@ -192,7 +183,7 @@ public: #endif // wxUSE_ACCEL // called by wxMenu when it is dismissed - void OnDismissMenu(bool dismissMenuBar = FALSE); + void OnDismissMenu(bool dismissMenuBar = false); protected: // common part of all ctors @@ -204,7 +195,7 @@ protected: void OnKeyDown(wxKeyEvent& event); void OnKillFocus(wxFocusEvent& event); - // process the mouse move event, return TRUE if we did, FALSE to continue + // process the mouse move event, return true if we did, false to continue // processing as usual // // the coordinates are client coordinates of menubar, convert if necessary @@ -245,7 +236,7 @@ protected: void DoSelectMenu(size_t pos); // popup the currently selected menu - void PopupCurrentMenu(bool selectFirst = TRUE); + void PopupCurrentMenu(bool selectFirst = true); // hide the currently selected menu void DismissMenu(); @@ -275,7 +266,7 @@ private: bool m_shouldShowMenu; // it calls out ProcessMouseEvent() - friend wxPopupMenuWindow; + friend class wxPopupMenuWindow; DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxMenuBar)