mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-14 15:29:53 +02:00
Remove dead code; so that all remaining calls to NewIdentifier...
...are followed by a setting of flags and mask
This commit is contained in:
parent
63f20f3405
commit
a1bd9062ae
@ -720,79 +720,6 @@ void CommandManager::ClearCurrentMenu()
|
|||||||
mCurrentMenu = nullptr;
|
mCurrentMenu = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
///
|
|
||||||
/// Add a menu item to the current menu. When the user selects it, the
|
|
||||||
/// given functor will be called
|
|
||||||
void CommandManager::InsertItem(const wxString & name,
|
|
||||||
const wxString & label_in,
|
|
||||||
CommandHandlerFinder finder,
|
|
||||||
CommandFunctorPointer callback,
|
|
||||||
const wxString & after,
|
|
||||||
int checkmark)
|
|
||||||
{
|
|
||||||
wxMenuBar *bar = GetActiveProject()->GetMenuBar();
|
|
||||||
wxArrayString names = ::wxStringTokenize(after, wxT(":"));
|
|
||||||
size_t cnt = names.GetCount();
|
|
||||||
|
|
||||||
if (cnt < 2) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int pos = bar->FindMenu(names[0]);
|
|
||||||
if (pos == wxNOT_FOUND) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxMenu *menu = bar->GetMenu(pos);
|
|
||||||
wxMenuItem *item = NULL;
|
|
||||||
pos = 0;
|
|
||||||
|
|
||||||
for (size_t ndx = 1; ndx < cnt; ndx++) {
|
|
||||||
wxMenuItemList list = menu->GetMenuItems();
|
|
||||||
size_t lcnt = list.GetCount();
|
|
||||||
wxString label = wxMenuItem::GetLabelText(names[ndx]);
|
|
||||||
|
|
||||||
for (size_t lndx = 0; lndx < lcnt; lndx++) {
|
|
||||||
item = list.Item(lndx)->GetData();
|
|
||||||
if (item->GetItemLabelText() == label) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
pos++;
|
|
||||||
item = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item->IsSubMenu()) {
|
|
||||||
menu = item->GetSubMenu();
|
|
||||||
item = NULL;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ndx + 1 != cnt) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CommandListEntry *entry = NewIdentifier(name, label_in, false, menu, finder, callback, {}, 0, 0, false);
|
|
||||||
int ID = entry->id;
|
|
||||||
wxString label = GetLabel(entry);
|
|
||||||
|
|
||||||
if (checkmark >= 0) {
|
|
||||||
menu->InsertCheckItem(pos, ID, label);
|
|
||||||
menu->Check(ID, checkmark != 0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
menu->Insert(pos, ID, label);
|
|
||||||
}
|
|
||||||
|
|
||||||
mbSeparatorAllowed = true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CommandManager::AddItem(const wxChar *name,
|
void CommandManager::AddItem(const wxChar *name,
|
||||||
|
@ -146,15 +146,6 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
|||||||
wxMenu* BeginSubMenu(const wxString & tName);
|
wxMenu* BeginSubMenu(const wxString & tName);
|
||||||
void EndSubMenu();
|
void EndSubMenu();
|
||||||
|
|
||||||
/*
|
|
||||||
void InsertItem(const wxString & name,
|
|
||||||
const wxString & label,
|
|
||||||
CommandHandlerFinder finder,
|
|
||||||
CommandFunctorPointer callback,
|
|
||||||
const wxString & after,
|
|
||||||
int checkmark = -1);
|
|
||||||
*/
|
|
||||||
|
|
||||||
// For specifying unusual arguments in AddItem
|
// For specifying unusual arguments in AddItem
|
||||||
struct Options
|
struct Options
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user