Audacity 3.2.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CommandManager::CommandListEntry Struct Reference

#include <CommandManager.h>

Inheritance diagram for CommandManager::CommandListEntry:
[legend]
Collaboration diagram for CommandManager::CommandListEntry:
[legend]

Public Types

using CheckFn = std::function< bool(AudacityProject &) >
 

Public Member Functions

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
 

Static Public Member Functions

static wxString FormatLabelForMenu (const TranslatableString &translatableLabel, const NormalizedKeyString &keyStr)
 

Public Attributes

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 }
 

Detailed Description

Definition at line 374 of file CommandManager.h.

Member Typedef Documentation

◆ CheckFn

Definition at line 412 of file CommandManager.h.

Constructor & Destructor Documentation

◆ ~CommandListEntry()

CommandManager::CommandListEntry::~CommandListEntry ( )
virtualdefault

Member Function Documentation

◆ Check()

void CommandManager::CommandListEntry::Check ( bool  checked)
virtual

Default implementation does nothing.

Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx.

Definition at line 727 of file CommandManager.cpp.

728{
729}

◆ Enable()

void CommandManager::CommandListEntry::Enable ( bool  enabled)
virtual

Default implementation simply assigns this->enabled

Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx.

Definition at line 653 of file CommandManager.cpp.

654{
655 enabled = b;
656}
bool enabled

◆ EnableMultiItem()

void CommandManager::CommandListEntry::EnableMultiItem ( bool  enabled)
virtual

Default implementation simply assigns this->enabled

Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx.

Definition at line 658 of file CommandManager.cpp.

659{
660 enabled = b;
661}

◆ FormatLabelForMenu() [1/2]

wxString CommandManager::CommandListEntry::FormatLabelForMenu ( ) const
inline

Definition at line 395 of file CommandManager.h.

395 {
397 }
NormalizedKeyString key
wxString FormatLabelForMenu() const
TranslatableString label

References key, and label.

Referenced by CommandManager::FormatLabelForMenu().

Here is the caller graph for this function:

◆ FormatLabelForMenu() [2/2]

wxString CommandManager::CommandListEntry::FormatLabelForMenu ( const TranslatableString translatableLabel,
const NormalizedKeyString keyStr 
)
static

Definition at line 614 of file CommandManager.cpp.

617{
618 auto label = translatableLabel.Translation();
619 auto key = keyStr.GET();
620 if (!key.empty())
621 {
622 // using GET to compose menu item name for wxWidgets
623 label += wxT("\t") + key;
624 }
625
626 return label;
627}
wxT("CloseDown"))
bool empty() const
Definition: Identifier.h:61
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
wxString Translation() const

References Identifier::GET(), key, label, TranslatableString::Translation(), and wxT().

Here is the call graph for this function:

◆ GetEnabled()

bool CommandManager::CommandListEntry::GetEnabled ( ) const
virtual

Default implementation simply returns this->enabled

Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx.

Definition at line 710 of file CommandManager.cpp.

711{
712 return enabled;
713}

◆ Modify()

void CommandManager::CommandListEntry::Modify ( const TranslatableString newLabel)
virtual

Default implementation simply assigns this->label

Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx.

Definition at line 739 of file CommandManager.cpp.

740{
741 label = newLabel;
742}

References label.

◆ UpdateCheckmark()

void CommandManager::CommandListEntry::UpdateCheckmark ( AudacityProject project)
virtual

Default implementation does nothing.

Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor::CommandListEntryEx.

Definition at line 345 of file CommandManager.cpp.

346{
347}

Member Data Documentation

◆ allowDup

bool CommandManager::CommandListEntry::allowDup

Definition at line 421 of file CommandManager.h.

◆ callback

CommandFunctorPointer CommandManager::CommandListEntry::callback

Definition at line 408 of file CommandManager.h.

◆ checkmarkFn

CheckFn CommandManager::CommandListEntry::checkmarkFn

Definition at line 413 of file CommandManager.h.

◆ count

int CommandManager::CommandListEntry::count

Definition at line 417 of file CommandManager.h.

◆ defaultKey

NormalizedKeyString CommandManager::CommandListEntry::defaultKey

Definition at line 403 of file CommandManager.h.

◆ enabled

bool CommandManager::CommandListEntry::enabled

Definition at line 418 of file CommandManager.h.

◆ excludeFromMacros

bool CommandManager::CommandListEntry::excludeFromMacros

Definition at line 425 of file CommandManager.h.

◆ finder

CommandHandlerFinder CommandManager::CommandListEntry::finder

Definition at line 407 of file CommandManager.h.

◆ flags

CommandFlag CommandManager::CommandListEntry::flags

Definition at line 426 of file CommandManager.h.

◆ id

int CommandManager::CommandListEntry::id

Definition at line 399 of file CommandManager.h.

◆ index

int CommandManager::CommandListEntry::index

Definition at line 416 of file CommandManager.h.

◆ isEffect

bool CommandManager::CommandListEntry::isEffect

Definition at line 424 of file CommandManager.h.

◆ isGlobal

bool CommandManager::CommandListEntry::isGlobal

Definition at line 422 of file CommandManager.h.

◆ isOccult

bool CommandManager::CommandListEntry::isOccult

Definition at line 423 of file CommandManager.h.

◆ key

NormalizedKeyString CommandManager::CommandListEntry::key

Definition at line 402 of file CommandManager.h.

◆ label

TranslatableString CommandManager::CommandListEntry::label

Definition at line 404 of file CommandManager.h.

Referenced by CommandManager::Populator::NewIdentifier().

◆ labelPrefix

TranslatableString CommandManager::CommandListEntry::labelPrefix

Definition at line 405 of file CommandManager.h.

◆ labelTop

TranslatableString CommandManager::CommandListEntry::labelTop

Definition at line 406 of file CommandManager.h.

◆ longLabel

TranslatableString CommandManager::CommandListEntry::longLabel

Definition at line 401 of file CommandManager.h.

◆ multi

bool CommandManager::CommandListEntry::multi

Definition at line 415 of file CommandManager.h.

◆ name

CommandID CommandManager::CommandListEntry::name

Definition at line 400 of file CommandManager.h.

◆ parameter

CommandParameter CommandManager::CommandListEntry::parameter

Definition at line 409 of file CommandManager.h.

◆ skipKeydown

bool CommandManager::CommandListEntry::skipKeydown

Definition at line 419 of file CommandManager.h.

◆ useStrictFlags

bool CommandManager::CommandListEntry::useStrictFlags { false }

Definition at line 427 of file CommandManager.h.

◆ wantKeyup

bool CommandManager::CommandListEntry::wantKeyup

Definition at line 420 of file CommandManager.h.


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