#include "wx/stockitem.h"
#ifndef WX_PRECOMP
+ #include "wx/app.h"
+ #include "wx/dcmemory.h"
#include "wx/font.h"
#include "wx/bitmap.h"
#include "wx/settings.h"
static const MenuDrawData* Get()
{
+ // notice that s_menuData can't be created as a global variable because
+ // it needs a window to initialize and no windows exist at the time of
+ // globals initialization yet
+ if ( !ms_instance )
+ {
+ static MenuDrawData s_menuData;
+ ms_instance = &s_menuData;
+ }
+
#if wxUSE_UXTHEME
bool theme = MenuLayout() == FullTheme;
if ( ms_instance->Theme != theme )
MenuDrawData()
{
- ms_instance = this;
Init();
}
MenuDrawData* MenuDrawData::ms_instance = NULL;
-MenuDrawData s_menuData;
-
void MenuDrawData::Init()
{
#if wxUSE_UXTHEME
{
if ( stat & wxODChecked )
{
- DrawStdCheckMark(hdc, &rcImg, stat);
+ DrawStdCheckMark((WXHDC)hdc, &rcImg, stat);
}
}
else
} // anonymous namespace
-void wxMenuItem::DrawStdCheckMark(HDC hdc, const RECT* rc, wxODStatus stat)
+void wxMenuItem::DrawStdCheckMark(WXHDC hdc_, const RECT* rc, wxODStatus stat)
{
+ HDC hdc = (HDC)hdc_;
+
#if wxUSE_UXTHEME
wxUxThemeEngine* theme = MenuDrawData::GetUxThemeEngine();
if ( theme )