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);
// 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
if ( item == GetCurrentItem() )
flags |= wxCONTROL_SELECTED;
+ wxBitmap bmp;
+
+ if ( !item->IsEnabled() )
+ {
+ bmp = item->GetDisabledBitmap();
+ }
+
+ if ( !bmp.Ok() )
+ {
+ // strangely enough, for unchecked item we use the
+ // "checked" bitmap because this is the default one - this
+ // explains this strange boolean expression
+ bmp = item->GetBitmap(!item->IsCheckable() || item->IsChecked());
+ }
+
rend->DrawMenuItem
(
dc,
gi,
item->GetLabel(),
item->GetAccelString(),
- // strangely enough, for unchecked item we use the
- // "checked" bitmap because this is the default one - this
- // explains this strange boolean expression
- item->GetBitmap(!item->IsCheckable() || item->IsChecked()),
+ bmp,
flags,
item->GetAccelIndex()
);
m_radioGroup.start = -1;
m_isRadioGroupStart = FALSE;
+ m_bmpDisabled = wxNullBitmap;
+
UpdateAccelInfo();
}