X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d65c269b3f665e15a8ae1b8fff063b2ec0ef19a7..249e30415a58d8cad492f0b46ded8d7ac06fb535:/include/wx/univ/menuitem.h diff --git a/include/wx/univ/menuitem.h b/include/wx/univ/menuitem.h index ccbb528f98..da63e3afa0 100644 --- a/include/wx/univ/menuitem.h +++ b/include/wx/univ/menuitem.h @@ -12,10 +12,6 @@ #ifndef _WX_UNIV_MENUITEM_H_ #define _WX_UNIV_MENUITEM_H_ -#ifdef __GNUG__ - #pragma interface "univmenuitem.h" -#endif - // ---------------------------------------------------------------------------- // wxMenuItem implements wxMenuItemBase // ---------------------------------------------------------------------------- @@ -28,7 +24,7 @@ public: int id = wxID_SEPARATOR, const wxString& name = wxEmptyString, const wxString& help = wxEmptyString, - wxItemKind kind = wxItem_Normal, + wxItemKind kind = wxITEM_NORMAL, wxMenu *subMenu = (wxMenu *)NULL); virtual ~wxMenuItem(); @@ -36,8 +32,8 @@ public: virtual void SetText(const wxString& text); virtual void SetCheckable(bool checkable); - virtual void Enable(bool enable = TRUE); - virtual void Check(bool check = TRUE); + virtual void Enable(bool enable = true); + virtual void Check(bool check = true); // we add some extra functions which are also available under MSW from // wxOwnerDrawn class - they will be moved to wxMenuItemBase later @@ -45,9 +41,19 @@ public: void SetBitmaps(const wxBitmap& bmpChecked, const wxBitmap& bmpUnchecked = wxNullBitmap); void SetBitmap(const wxBitmap& bmp) { SetBitmaps(bmp); } - const wxBitmap& GetBitmap(bool checked = TRUE) const + const wxBitmap& GetBitmap(bool checked = true) const { return checked ? m_bmpChecked : m_bmpUnchecked; } + void SetDisabledBitmap( const wxBitmap& bmpDisabled ) + { m_bmpDisabled = bmpDisabled; } + const wxBitmap& GetDisabledBitmap() const + { return m_bmpDisabled; } + + // mark item as belonging to the given radio group + void SetAsRadioGroupStart(); + void SetRadioGroupStart(int start); + void SetRadioGroupEnd(int end); + // wxUniv-specific methods for implementation only starting from here // get the accel index of our label or -1 if none @@ -66,14 +72,14 @@ public: wxCoord GetPosition() const { - wxASSERT_MSG( m_posY != -1, _T("must call SetHeight first!") ); + wxASSERT_MSG( m_posY != wxDefaultCoord, _T("must call SetHeight first!") ); return m_posY; } wxCoord GetHeight() const { - wxASSERT_MSG( m_height != -1, _T("must call SetHeight first!") ); + wxASSERT_MSG( m_height != wxDefaultCoord, _T("must call SetHeight first!") ); return m_height; } @@ -87,7 +93,21 @@ protected: // the bitmaps (may be invalid, then they're not used) wxBitmap m_bmpChecked, - m_bmpUnchecked; + m_bmpUnchecked, + m_bmpDisabled; + + // the positions of the first and last items of the radio group this item + // belongs to or -1: start is the radio group start and is valid for all + // but first radio group items (m_isRadioGroupStart == false), end is valid + // only for the first one + union + { + int start; + int end; + } m_radioGroup; + + // does this item start a radio group? + bool m_isRadioGroupStart; // the position of the accelerator in our label, -1 if none int m_indexAccel;