Audacity 3.2.0
|
MenuCreator is responsible for creating the main menu bar. More...
#include <MenuCreator.h>
Classes | |
struct | SpecialItem |
Public Member Functions | |
MenuCreator (AudacityProject &project) | |
~MenuCreator () override | |
void | CreateMenusAndCommands () |
void | RebuildMenuBar () |
bool | ReallyDoQuickCheck () override |
Default implementation returns true. More... | |
void | RemoveDuplicateShortcuts () |
Public Member Functions inherited from CommandManager | |
CommandManager (AudacityProject &project) | |
CommandManager (const CommandManager &)=delete | |
CommandManager & | operator= (const CommandManager &)=delete |
~CommandManager () override | |
CommandFlag | GetUpdateFlags (bool quick=false) const |
void | UpdatePrefs () override |
bool | ReportIfActionNotAllowed (const TranslatableString &Name, CommandFlag &flags, CommandFlag flagsRqd) |
bool | TryToMakeActionAllowed (CommandFlag &flags, CommandFlag flagsRqd) |
AudacityProject & | GetProject () |
size_t | NCommands () const |
void | PurgeData () |
void | SetCommandFlags (const CommandID &name, CommandFlag flags) |
void | EnableUsingFlags (CommandFlag flags, CommandFlag strictFlags) |
void | Enable (const wxString &name, bool enabled) |
void | Check (const CommandID &name, bool checked) |
void | Modify (const wxString &name, const TranslatableString &newLabel) |
Changes the label text of a menu item. More... | |
void | SetKeyFromName (const CommandID &name, const NormalizedKeyString &key) |
void | SetKeyFromIndex (int i, const NormalizedKeyString &key) |
bool | HandleMenuID (int id, CommandFlag flags, bool alwaysEnabled) |
void | RegisterLastAnalyzer (const CommandContext &context) |
void | RegisterLastTool (const CommandContext &context) |
void | DoRepeatProcess (const CommandContext &context, int) |
TextualCommandResult | HandleTextualCommand (const CommandID &Str, const CommandContext &context, CommandFlag flags, bool alwaysEnabled) |
TranslatableStrings | GetCategories () |
void | GetAllCommandNames (CommandIDs &names, bool includeMultis) const |
void | GetAllCommandLabels (TranslatableStrings &labels, std::vector< bool > &vExcludeFromMacros, bool includeMultis) const |
void | GetAllCommandData (CommandIDs &names, std::vector< NormalizedKeyString > &keys, std::vector< NormalizedKeyString > &default_keys, TranslatableStrings &labels, TranslatableStrings &categories, TranslatableStrings &prefixes, bool includeMultis) |
CommandID | GetNameFromNumericID (int id) const |
TranslatableString | GetLabelFromName (const CommandID &name) const |
TranslatableString | GetPrefixedLabelFromName (const CommandID &name) const |
TranslatableString | GetCategoryFromName (const CommandID &name) const |
NormalizedKeyString | GetKeyFromName (const CommandID &name) const |
NormalizedKeyString | GetDefaultKeyFromName (const CommandID &name) const |
bool | GetEnabled (const CommandID &name) const |
int | GetNumberOfKeysRead () const |
TranslatableString | ReportDuplicateShortcuts () |
void | WriteXML (XMLWriter &xmlFile) const |
TranslatableString | DescribeCommandsAndShortcuts (const ComponentInterfaceSymbol commands[], size_t nCommands) const |
void | UpdateCheckmarks () |
wxString | FormatLabelForMenu (const CommandID &id, const TranslatableString *pLabel) const |
Format a string appropriate for insertion in a menu. More... | |
void | ModifyUndoMenuItems () |
void | UpdateMenus (bool checkActive=true) |
Public Member Functions inherited from XMLTagHandler | |
XMLTagHandler () | |
virtual | ~XMLTagHandler () |
virtual bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs)=0 |
virtual void | HandleXMLEndTag (const std::string_view &WXUNUSED(tag)) |
virtual void | HandleXMLContent (const std::string_view &WXUNUSED(content)) |
virtual XMLTagHandler * | HandleXMLChild (const std::string_view &tag)=0 |
void | ReadXMLEndTag (const char *tag) |
void | ReadXMLContent (const char *s, int len) |
XMLTagHandler * | ReadXMLChild (const char *tag) |
Public Member Functions inherited from ClientData::Base | |
virtual | ~Base () |
Public Member Functions inherited from Observer::Publisher< MenuUpdateMessage > | |
Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={}) | |
Constructor supporting type-erased custom allocation/deletion. More... | |
Publisher (Publisher &&)=default | |
Publisher & | operator= (Publisher &&)=default |
Subscription | Subscribe (Callback callback) |
Connect a callback to the Publisher; later-connected are called earlier. More... | |
Subscription | Subscribe (Object &obj, Return(Object::*callback)(Args...)) |
Overload of Subscribe takes an object and pointer-to-member-function. More... | |
Static Public Member Functions | |
static bool | FilterKeyEvent (AudacityProject &project, const wxKeyEvent &evt, bool permit=false) |
static MenuCreator & | Get (AudacityProject &project) |
static const MenuCreator & | Get (const AudacityProject &project) |
static void | RebuildAllMenuBars () |
Static Public Member Functions inherited from CommandManager | |
static CommandManager & | Get (AudacityProject &project) |
static const CommandManager & | Get (const AudacityProject &project) |
static const std::vector< NormalizedKeyString > & | ExcludedList () |
Static Public Attributes | |
static constexpr auto | Special = Callable::UniqueMaker<SpecialItem>() |
Static Public Attributes inherited from Observer::Publisher< MenuUpdateMessage > | |
static constexpr bool | notifies_all |
Private Member Functions | |
void | ExecuteCommand (const CommandContext &context, const wxEvent *evt, const CommandListEntry &entry) override |
MenuCreator is responsible for creating the main menu bar.
Definition at line 18 of file MenuCreator.h.
MenuCreator::MenuCreator | ( | AudacityProject & | project | ) |
Definition at line 84 of file MenuCreator.cpp.
|
overridedefault |
void MenuCreator::CreateMenusAndCommands | ( | ) |
Definition at line 441 of file MenuCreator.cpp.
References AlwaysEnabledFlag, CommandManager::mLastFlags, and CommandManager::mProject.
Referenced by ProjectManager::New(), and RebuildMenuBar().
|
overrideprivatevirtual |
Reimplemented from CommandManager.
Definition at line 490 of file MenuCreator.cpp.
References entry, CommandManager::ExecuteCommand(), JournalCode, and Journal::Output().
|
static |
Definition at line 568 of file MenuCreator.cpp.
References entry, BasicUI::FindFocus(), FindProjectFrame(), Get(), KeyEventToKeyString(), NoFlagsSpecified, project, and valueRestorer().
Referenced by MixerBoardFrame::OnKeyEvent().
|
static |
Definition at line 91 of file MenuCreator.cpp.
References CommandManager::Get(), and project.
Referenced by DoReloadPreferences(), FilterKeyEvent(), AudacityApp::InitPart2(), ProjectManager::New(), anonymous_namespace{EditMenus.cpp}::OnPreferences(), RebuildAllMenuBars(), and MacrosWindow::UpdateMenus().
|
static |
Definition at line 96 of file MenuCreator.cpp.
References CommandManager::Get(), and project.
|
overridevirtual |
Default implementation returns true.
Reimplemented from CommandManager.
Definition at line 499 of file MenuCreator.cpp.
References GetProjectFrame(), and CommandManager::mProject.
|
static |
The following method moves to the previous track selecting and unselecting depending if you are on the start of a block or not.
Definition at line 508 of file MenuCreator.cpp.
References Get(), GetProjectFrame(), and RebuildMenuBar().
Referenced by anonymous_namespace{PluginMenus.cpp}::DoManagePluginsMenu(), AudacityApp::InitPart2(), IncompatiblePluginsDialog::OnPluginManagerClicked(), anonymous_namespace{ViewMenus.cpp}::OnShowExtraMenus(), anonymous_namespace{SpectrumView.cpp}::SpectrogramSettingsHandler::OnSpectrogramSettings(), ProjectFileManager::OpenFile(), EffectsPrefs::PopulateOrExchange(), and RemoveDuplicateShortcuts().
void MenuCreator::RebuildMenuBar | ( | ) |
Definition at line 461 of file MenuCreator.cpp.
References CreateMenusAndCommands(), BasicUI::FindFocus(), GetProjectFrame(), CommandManager::mProject, project, and CommandManager::PurgeData().
Referenced by DoReloadPreferences(), anonymous_namespace{EditMenus.cpp}::OnPreferences(), RebuildAllMenuBars(), and MacrosWindow::UpdateMenus().
void MenuCreator::RemoveDuplicateShortcuts | ( | ) |
Definition at line 526 of file MenuCreator.cpp.
References AudacityMessageBox(), audacity::BasicSettings::Flush(), gPrefs, RebuildAllMenuBars(), CommandManager::ReportDuplicateShortcuts(), and XO().
Referenced by AudacityApp::InitPart2().
|
staticconstexpr |
Definition at line 36 of file MenuCreator.h.
Referenced by anonymous_namespace{EditMenus.cpp}::EditMenu(), and anonymous_namespace{FileMenus.cpp}::FileMenu().