Skip to content
Snippets Groups Projects
Commit ab2d11ee authored by 관우 안's avatar 관우 안
Browse files

MenuCreator.cpp 수정, 다양한 종류의 Menu를 수정해 MenuItem 형태로 Append시키고 폰트 변경 적용

parent 68899442
No related branches found
No related tags found
No related merge requests found
...@@ -329,12 +329,20 @@ FormatLabelWithDisabledAccel(const CommandManager::CommandListEntry &entry) ...@@ -329,12 +329,20 @@ FormatLabelWithDisabledAccel(const CommandManager::CommandListEntry &entry)
return label; return label;
} }
//추가된 코드
wxFont fontB(wxFontInfo(10).FaceName("Malgun Gothic").Bold());
void MenuItemVisitor::VisitEntry(CommandManager::CommandListEntry &entry, void MenuItemVisitor::VisitEntry(CommandManager::CommandListEntry &entry,
const MenuRegistry::Options *pOptions) const MenuRegistry::Options *pOptions)
{ {
if (!pOptions) if (!pOptions) {
// 추가된코드
wxMenuItem* menu_item = new wxMenuItem(NULL, entry.id, entry.FormatLabelForMenu());
menu_item->SetFont(fontB);
CurrentMenu()->Append(menu_item);
// command list item // command list item
CurrentMenu()->Append(entry.id, entry.FormatLabelForMenu()); //CurrentMenu()->Append(entry.id, entry.FormatLabelForMenu());
}
else if (pOptions->global) else if (pOptions->global)
; ;
else { else {
...@@ -342,11 +350,22 @@ void MenuItemVisitor::VisitEntry(CommandManager::CommandListEntry &entry, ...@@ -342,11 +350,22 @@ void MenuItemVisitor::VisitEntry(CommandManager::CommandListEntry &entry,
auto label = FormatLabelWithDisabledAccel(entry); auto label = FormatLabelWithDisabledAccel(entry);
auto &checker = pOptions->checker; auto &checker = pOptions->checker;
if (checker) { if (checker) {
CurrentMenu()->AppendCheckItem(ID, label); //추가된코드
wxMenuItem* menu_item = new wxMenuItem(NULL, ID, label, wxEmptyString, wxITEM_CHECK, NULL);
menu_item->SetFont(fontB);
CurrentMenu()->Append(menu_item);
//CurrentMenu()->AppendCheckItem(ID, label);
CurrentMenu()->Check(ID, checker(mProject)); CurrentMenu()->Check(ID, checker(mProject));
} }
else else {
CurrentMenu()->Append(ID, label); //추가된 코드
wxMenuItem* menu_item = new wxMenuItem(NULL, ID, label);
menu_item->SetFont(fontB);
CurrentMenu()->Append(menu_item);
//CurrentMenu()->Append(ID, label);
}
} }
} }
...@@ -409,8 +428,13 @@ void MenuItemVisitor::EndSubMenu() ...@@ -409,8 +428,13 @@ void MenuItemVisitor::EndSubMenu()
//Add the submenu to the current menu //Add the submenu to the current menu
auto name = MenuNames().back().Translation(); auto name = MenuNames().back().Translation();
CurrentMenu()->Append(0, name, tmpSubMenu.menu.release(),
name /* help string */ ); //추가된코드
wxMenuItem* menu_item = new wxMenuItem(NULL, 0, name, name, wxITEM_NORMAL, tmpSubMenu.menu.release());
menu_item->SetFont(fontB);
CurrentMenu()->Append(menu_item);
//CurrentMenu()->Append(0, name, tmpSubMenu.menu.release(), name /* help string */ );
mbSeparatorAllowed = true; mbSeparatorAllowed = true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment