Applied patch [ 677730 ] Menus with radio items (wxUniv)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-02-02 14:50:05 +00:00
parent e2ca829e7d
commit 6f7c5199ed
3 changed files with 145 additions and 4 deletions

View File

@@ -115,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;
@@ -127,6 +130,9 @@ private:
wxAcceleratorTable m_accelTable;
#endif // wxUSE_ACCEL
// 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)

View File

@@ -48,6 +48,11 @@ public:
const wxBitmap& GetBitmap(bool checked = TRUE) const
{ return checked ? m_bmpChecked : m_bmpUnchecked; }
// 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
@@ -89,6 +94,19 @@ protected:
wxBitmap m_bmpChecked,
m_bmpUnchecked;
// 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;