Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx Struct Referencefinal
Inheritance diagram for anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx:
[legend]
Collaboration diagram for anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx:
[legend]

Public Member Functions

 ~CommandListEntryEx () final
 
void UpdateCheckmark (AudacityProject &project) final
 Default implementation does nothing. More...
 
void Modify (const TranslatableString &newLabel) final
 Default implementation simply assigns this->label More...
 
bool GetEnabled () const final
 Default implementation simply returns this->enabled More...
 
void Check (bool checked) final
 Default implementation does nothing. More...
 
void Enable (bool enabled) final
 Default implementation simply assigns this->enabled More...
 
void EnableMultiItem (bool enabled) final
 Default implementation simply assigns this->enabled More...
 
- Public Member Functions inherited from CommandManager::CommandListEntry
virtual ~CommandListEntry ()
 
virtual void UpdateCheckmark (AudacityProject &project)
 Default implementation does nothing. More...
 
virtual void Modify (const TranslatableString &newLabel)
 Default implementation simply assigns this->label More...
 
virtual bool GetEnabled () const
 Default implementation simply returns this->enabled More...
 
virtual void Check (bool checked)
 Default implementation does nothing. More...
 
virtual void Enable (bool enabled)
 Default implementation simply assigns this->enabled More...
 
virtual void EnableMultiItem (bool enabled)
 Default implementation simply assigns this->enabled More...
 
wxString FormatLabelForMenu () const
 

Public Attributes

wxMenu * menu {}
 
- Public Attributes inherited from CommandManager::CommandListEntry
int id
 
CommandID name
 
TranslatableString longLabel
 
NormalizedKeyString key
 
NormalizedKeyString defaultKey
 
TranslatableString label
 
TranslatableString labelPrefix
 
TranslatableString labelTop
 
CommandHandlerFinder finder
 
CommandFunctorPointer callback
 
CommandParameter parameter
 
CheckFn checkmarkFn
 
bool multi
 
int index
 
int count
 
bool enabled
 
bool skipKeydown
 
bool wantKeyup
 
bool allowDup
 
bool isGlobal
 
bool isOccult
 
bool isEffect
 
bool excludeFromMacros
 
CommandFlag flags
 
bool useStrictFlags { false }
 

Additional Inherited Members

- Public Types inherited from CommandManager::CommandListEntry
using CheckFn = std::function< bool(AudacityProject &) >
 
- Static Public Member Functions inherited from CommandManager::CommandListEntry
static wxString FormatLabelForMenu (const TranslatableString &translatableLabel, const NormalizedKeyString &keyStr)
 

Detailed Description

Definition at line 147 of file MenuCreator.cpp.

Constructor & Destructor Documentation

◆ ~CommandListEntryEx()

anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx::~CommandListEntryEx ( )
finaldefault

Member Function Documentation

◆ Check()

void anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx::Check ( bool  checked)
finalvirtual

Default implementation does nothing.

Reimplemented from CommandManager::CommandListEntry.

Definition at line 212 of file MenuCreator.cpp.

◆ Enable()

void anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx::Enable ( bool  enabled)
finalvirtual

Default implementation simply assigns this->enabled

Reimplemented from CommandManager::CommandListEntry.

Definition at line 219 of file MenuCreator.cpp.

220{
221 if (!menu) {
222 enabled = b;
223 return;
224 }
225
226 // LL: Refresh from real state as we can get out of sync on the
227 // Mac due to its reluctance to enable menus when in a modal
228 // state.
229 enabled = menu->IsEnabled(id);
230
231 // Only enabled if needed
232 if (enabled != b) {
233 menu->Enable(id, b);
234 enabled = menu->IsEnabled(id);
235 }
236}
bool enabled

◆ EnableMultiItem()

void anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx::EnableMultiItem ( bool  enabled)
finalvirtual

Default implementation simply assigns this->enabled

Reimplemented from CommandManager::CommandListEntry.

Definition at line 238 of file MenuCreator.cpp.

239{
240 if (menu) {
241 const auto item = menu->FindItem(id);
242 if (item) {
243 item->Enable(b);
244 return;
245 }
246 }
247 // using GET in a log message for devs' eyes only
248 wxLogDebug(wxT("Warning: Menu entry with id %i in %s not found"),
249 id, name.GET());
250}
wxT("CloseDown"))
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
CommandID name

References name, and wxT().

Here is the call graph for this function:

◆ GetEnabled()

bool anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx::GetEnabled ( ) const
finalvirtual

Default implementation simply returns this->enabled

Reimplemented from CommandManager::CommandListEntry.

Definition at line 205 of file MenuCreator.cpp.

206{
207 if (!menu)
208 return false;
209 return enabled;
210}

◆ Modify()

void anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx::Modify ( const TranslatableString newLabel)
finalvirtual

Default implementation simply assigns this->label

Reimplemented from CommandManager::CommandListEntry.

Definition at line 197 of file MenuCreator.cpp.

198{
199 if (menu) {
200 label = newLabel;
201 menu->SetLabel(id, FormatLabelForMenu());
202 }
203}
wxString FormatLabelForMenu() const
TranslatableString label

References label.

◆ UpdateCheckmark()

void anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx::UpdateCheckmark ( AudacityProject project)
finalvirtual

Default implementation does nothing.

Reimplemented from CommandManager::CommandListEntry.

Definition at line 189 of file MenuCreator.cpp.

190{
191 if (menu && checkmarkFn && !isOccult) {
192 menu->Check(id, checkmarkFn(project));
193 }
194}
const auto project
CheckFn checkmarkFn

References project.

Member Data Documentation

◆ menu

wxMenu* anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx::menu {}

Definition at line 156 of file MenuCreator.cpp.


The documentation for this struct was generated from the following file: