mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-06 15:19:29 +02:00
Simplify populating of Scrub menu
This commit is contained in:
parent
83ede10891
commit
32efcd43c4
@ -1159,26 +1159,22 @@ static CommandHandlerObject &findme(AudacityProject &project)
|
||||
void Scrubber::AddMenuItems()
|
||||
{
|
||||
auto cm = mProject->GetCommandManager();
|
||||
using Options = CommandManager::Options;
|
||||
|
||||
cm->BeginSubMenu(_("Scru&bbing"));
|
||||
for (const auto &item : menuItems) {
|
||||
if (item.StatusTest)
|
||||
cm->AddItem( item.name, wxGetTranslation(item.label),
|
||||
// No menu items yet have dialogs
|
||||
false,
|
||||
findme, static_cast<CommandFunctorPointer>(item.memFn),
|
||||
item.flags,
|
||||
CommandManager::Options{}.CheckState( false ) );
|
||||
else
|
||||
// The start item
|
||||
cm->AddItem( item.name, wxGetTranslation(item.label),
|
||||
// No menu items yet have dialogs
|
||||
false,
|
||||
findme, static_cast<CommandFunctorPointer>(item.memFn),
|
||||
item.flags );
|
||||
cm->AddItem( item.name, wxGetTranslation(item.label),
|
||||
// No menu items yet have dialogs
|
||||
false,
|
||||
findme, static_cast<CommandFunctorPointer>(item.memFn),
|
||||
item.flags,
|
||||
item.StatusTest
|
||||
? // a checkmark item
|
||||
Options{}.CheckState( (this->*item.StatusTest)() )
|
||||
: // not a checkmark item
|
||||
Options{} );
|
||||
}
|
||||
cm->EndSubMenu();
|
||||
CheckMenuItems();
|
||||
}
|
||||
|
||||
void Scrubber::PopulatePopupMenu(wxMenu &menu)
|
||||
|
Loading…
x
Reference in New Issue
Block a user