added bitmaps to menu items
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8431 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -65,16 +65,25 @@ wxObject *wxMenuXmlHandler::DoCreateResource()
|
|||||||
p_menu->AppendSeparator();
|
p_menu->AppendSeparator();
|
||||||
else if (m_Node->GetName() == _T("break"))
|
else if (m_Node->GetName() == _T("break"))
|
||||||
p_menu->Break();
|
p_menu->Break();
|
||||||
else
|
else /*menuitem*/
|
||||||
{
|
{
|
||||||
int id = GetID();
|
int id = GetID();
|
||||||
bool checkable = GetBool(_T("checkable"));
|
bool checkable = GetBool(_T("checkable"));
|
||||||
|
|
||||||
p_menu->Append(id, GetText(_T("label")),
|
p_menu->Append(id, GetText(_T("label")),
|
||||||
GetText(_T("help")), checkable);
|
GetText(_T("help")), checkable);
|
||||||
if (id != -1)
|
if (id != -1)
|
||||||
{
|
{
|
||||||
p_menu->Enable(id, GetBool(_T("enabled"), TRUE));
|
p_menu->Enable(id, GetBool(_T("enabled"), TRUE));
|
||||||
if (checkable) p_menu->Check(id, GetBool(_T("checked")));
|
if (checkable) p_menu->Check(id, GetBool(_T("checked")));
|
||||||
|
|
||||||
|
#if wxCHECK_VERSION(2,3,0) || defined(__WXMSW__)
|
||||||
|
if (HasParam(_T("bitmap")))
|
||||||
|
{
|
||||||
|
wxMenuItem *mitem = p_menu->FindItem(id);
|
||||||
|
mitem->SetBitmap(GetBitmap(_T("bitmap")));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user