// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// implementation of wxOwnerDrawn class
// ============================================================================
// implementation of wxOwnerDrawn class
size_t wxOwnerDrawn::ms_nDefaultMarginWidth = GetSystemMetrics(SM_CXMENUCHECK);
#else // # what is the reasonable default?
size_t wxOwnerDrawn::ms_nDefaultMarginWidth = 15;
size_t wxOwnerDrawn::ms_nDefaultMarginWidth = GetSystemMetrics(SM_CXMENUCHECK);
#else // # what is the reasonable default?
size_t wxOwnerDrawn::ms_nDefaultMarginWidth = 15;
- char *szStripped = new char[m_strName.Len()];
- wxStripMenuCodes((char *)m_strName.c_str(), szStripped);
+ wxChar *szStripped = new wxChar[m_strName.Len()];
+ wxStripMenuCodes((wxChar *)m_strName.c_str(), szStripped);
wxString str = szStripped;
delete [] szStripped;
// # without this menu items look too tightly packed (at least under Windows)
wxString str = szStripped;
delete [] szStripped;
// # without this menu items look too tightly packed (at least under Windows)
dc.GetTextExtent(str, (long *)pwidth, (long *)pheight);
m_nHeight = *pheight; // remember height for use in OnDrawItem
dc.GetTextExtent(str, (long *)pwidth, (long *)pheight);
m_nHeight = *pheight; // remember height for use in OnDrawItem
// Win32 GDI functions and not wxWindows ones. Might help to whoever decides to
// port this code to X. (VZ)
// Win32 GDI functions and not wxWindows ones. Might help to whoever decides to
// port this code to X. (VZ)
HFONT hPrevFont = (HFONT) ::SelectObject(hdc, hfont);
DrawState(hdc, NULL, NULL,
HFONT hPrevFont = (HFONT) ::SelectObject(hdc, hfont);
DrawState(hdc, NULL, NULL,
x, rc.y, rc.GetWidth(), rc.GetHeight(),
DST_PREFIXTEXT | ( st & wxODDisabled ? DSS_DISABLED : 0) );
x, rc.y, rc.GetWidth(), rc.GetHeight(),
DST_PREFIXTEXT | ( st & wxODDisabled ? DSS_DISABLED : 0) );
// then draw a check mark into it
RECT rect = { 0, 0, GetMarginWidth(), m_nHeight };
// then draw a check mark into it
RECT rect = { 0, 0, GetMarginWidth(), m_nHeight };
DrawFrameControl(hdcMem, &rect, DFC_MENU, DFCS_MENUCHECK);
DrawFrameControl(hdcMem, &rect, DFC_MENU, DFCS_MENUCHECK);
// finally copy it to screen DC and clean up
BitBlt(hdc, rc.x, rc.y, GetMarginWidth(), m_nHeight,
// finally copy it to screen DC and clean up
BitBlt(hdc, rc.x, rc.y, GetMarginWidth(), m_nHeight,