mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 14:02:57 +02:00
Hide details of managing occult command items
This commit is contained in:
@@ -1831,9 +1831,24 @@ void CommandManager::WriteXML(XMLWriter &xmlFile) const
|
||||
xmlFile.EndTag(wxT("audacitykeyboard"));
|
||||
}
|
||||
|
||||
void CommandManager::SetOccultCommands( bool bOccult)
|
||||
void CommandManager::BeginOccultCommands()
|
||||
{
|
||||
bMakingOccultCommands = bOccult;
|
||||
// To do: perhaps allow occult item switching at lower levels of the
|
||||
// menu tree.
|
||||
wxASSERT( !CurrentMenu() );
|
||||
|
||||
// Make a temporary menu bar collecting items added after.
|
||||
// This bar will be discarded but other side effects on the command
|
||||
// manager persist.
|
||||
mTempMenuBar = AddMenuBar(wxT("ext-menu"));
|
||||
bMakingOccultCommands = true;
|
||||
}
|
||||
|
||||
void CommandManager::EndOccultCommands()
|
||||
{
|
||||
PopMenuBar();
|
||||
bMakingOccultCommands = false;
|
||||
mTempMenuBar.reset();
|
||||
}
|
||||
|
||||
void CommandManager::SetCommandFlags(const wxString &name,
|
||||
|
@@ -212,7 +212,8 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
||||
CommandFlag flags);
|
||||
|
||||
void PopMenuBar();
|
||||
void SetOccultCommands( bool bOccult);
|
||||
void BeginOccultCommands();
|
||||
void EndOccultCommands();
|
||||
|
||||
|
||||
void SetCommandFlags(const wxString &name, CommandFlag flags, CommandMask mask);
|
||||
@@ -394,6 +395,7 @@ private:
|
||||
wxMenu *mCurrentMenu {};
|
||||
|
||||
bool bMakingOccultCommands;
|
||||
std::unique_ptr< wxMenuBar > mTempMenuBar;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user