Do not test for obsolete OS versions to determine if it must use owner drawn item.
This commit is contained in:
@@ -1322,12 +1322,8 @@ void wxMenuItem::GetColourToUse(wxODStatus stat, wxColour& colText, wxColour& co
|
|||||||
|
|
||||||
bool wxMenuItem::MSWMustUseOwnerDrawn()
|
bool wxMenuItem::MSWMustUseOwnerDrawn()
|
||||||
{
|
{
|
||||||
// MIIM_BITMAP only works under WinME/2000+ so we always use owner
|
// we have to use owner drawn item if it has custom colours or font
|
||||||
// drawn item under the previous versions and we also have to use
|
bool mustUseOwnerDrawn = GetTextColour().IsOk() ||
|
||||||
// them in any case if the item has custom colours or font
|
|
||||||
static const wxWinVersion winver = wxGetWinVersion();
|
|
||||||
bool mustUseOwnerDrawn = winver < wxWinVersion_98 ||
|
|
||||||
GetTextColour().IsOk() ||
|
|
||||||
GetBackgroundColour().IsOk() ||
|
GetBackgroundColour().IsOk() ||
|
||||||
GetFont().IsOk();
|
GetFont().IsOk();
|
||||||
|
|
||||||
@@ -1338,6 +1334,7 @@ bool wxMenuItem::MSWMustUseOwnerDrawn()
|
|||||||
// doesn't seem to have any problems with even very large bitmaps
|
// doesn't seem to have any problems with even very large bitmaps
|
||||||
// so don't use owner-drawn items unnecessarily there (Vista wasn't
|
// so don't use owner-drawn items unnecessarily there (Vista wasn't
|
||||||
// actually tested but I assume it works as 7 rather than as XP).
|
// actually tested but I assume it works as 7 rather than as XP).
|
||||||
|
static const wxWinVersion winver = wxGetWinVersion();
|
||||||
if ( !mustUseOwnerDrawn && winver < wxWinVersion_Vista )
|
if ( !mustUseOwnerDrawn && winver < wxWinVersion_Vista )
|
||||||
{
|
{
|
||||||
const wxBitmap& bmpUnchecked = GetBitmap(false),
|
const wxBitmap& bmpUnchecked = GetBitmap(false),
|
||||||
|
Reference in New Issue
Block a user