Audacity  3.0.3
Public Member Functions | Public Attributes | List of all members
AttachedToolBarMenuItem Struct Reference

#include <ToolManager.h>

Inheritance diagram for AttachedToolBarMenuItem:
[legend]
Collaboration diagram for AttachedToolBarMenuItem:
[legend]

Public Member Functions

 AttachedToolBarMenuItem (ToolBarID id, const CommandID &name, const TranslatableString &label_in, const Registry::OrderingHint &hint={}, std::vector< ToolBarID > excludeIds={})
 
void OnShowToolBar (const CommandContext &context)
 

Public Attributes

const ToolBarID mId
 
const MenuTable::AttachedItem mAttachedItem
 
const std::vector< ToolBarIDmExcludeIds
 

Detailed Description

Definition at line 224 of file ToolManager.h.

Constructor & Destructor Documentation

◆ AttachedToolBarMenuItem()

AttachedToolBarMenuItem::AttachedToolBarMenuItem ( ToolBarID  id,
const CommandID name,
const TranslatableString label_in,
const Registry::OrderingHint hint = {},
std::vector< ToolBarID excludeIds = {} 
)

Definition at line 1578 of file ToolManager.cpp.

1582  : mId{ id }
1583  , mAttachedItem{
1584  Registry::Placement{ wxT("View/Other/Toolbars/Toolbars/Other"), hint },
1587  { return *this; } ),
1588  MenuTable::Command( name, label_in,
1592  auto &toolManager = ToolManager::Get( project );
1593  return toolManager.IsVisible( id ); } ) ) ) }
1594  , mExcludeIds{ std::move( excludeIDs ) }
1595 {}

Member Function Documentation

◆ OnShowToolBar()

void AttachedToolBarMenuItem::OnShowToolBar ( const CommandContext context)

Definition at line 1597 of file ToolManager.cpp.

1598 {
1599  auto &project = context.project;
1600  auto &toolManager = ToolManager::Get( project );
1601 
1602  if( !toolManager.IsVisible( mId ) )
1603  {
1604  for ( const auto excludedID : mExcludeIds )
1605  toolManager.Expose( excludedID, false );
1606  }
1607 
1608  toolManager.ShowHide(mId);
1609  MenuManager::Get(project).ModifyToolbarMenus(project);
1610 }

References MenuManager::Get(), ToolManager::Get(), mExcludeIds, mId, MenuManager::ModifyToolbarMenus(), and CommandContext::project.

Here is the call graph for this function:

Member Data Documentation

◆ mAttachedItem

const MenuTable::AttachedItem AttachedToolBarMenuItem::mAttachedItem

Definition at line 234 of file ToolManager.h.

◆ mExcludeIds

const std::vector< ToolBarID > AttachedToolBarMenuItem::mExcludeIds

Definition at line 235 of file ToolManager.h.

Referenced by OnShowToolBar().

◆ mId

const ToolBarID AttachedToolBarMenuItem::mId

Definition at line 233 of file ToolManager.h.

Referenced by OnShowToolBar().


The documentation for this struct was generated from the following files:
AttachedToolBarMenuItem::mId
const ToolBarID mId
Definition: ToolManager.h:233
MenuTable::FinderScope
Definition: CommandManager.h:485
CommandManager::Options
Definition: CommandManager.h:98
CommandManager::Options::CheckTest
Options && CheckTest(const CheckFn &fn) &&
Definition: CommandManager.h:135
ToolManager::Get
static ToolManager & Get(AudacityProject &project)
Definition: ToolManager.cpp:356
AlwaysEnabledFlag
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:35
Registry::Placement
Definition: Registry.h:219
AttachedToolBarMenuItem::OnShowToolBar
void OnShowToolBar(const CommandContext &context)
Definition: ToolManager.cpp:1597
AttachedToolBarMenuItem::mAttachedItem
const MenuTable::AttachedItem mAttachedItem
Definition: ToolManager.h:234
name
const TranslatableString name
Definition: Distortion.cpp:98
MenuTable::Command
std::unique_ptr< CommandItem > Command(const CommandID &name, const TranslatableString &label_in, void(Handler::*pmf)(const CommandContext &), CommandFlag flags, const CommandManager::Options &options={}, CommandHandlerFinder finder=FinderScope::DefaultFinder())
Definition: CommandManager.h:675
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
MenuManager::Get
static MenuManager & Get(AudacityProject &project)
Definition: Menus.cpp:70
CommandHandlerObject
wxEvtHandler CommandHandlerObject
Definition: CommandFunctors.h:28
CommandContext::project
AudacityProject & project
Definition: CommandContext.h:64
MenuManager::ModifyToolbarMenus
static void ModifyToolbarMenus(AudacityProject &project)
Definition: Menus.cpp:592
AttachedToolBarMenuItem::mExcludeIds
const std::vector< ToolBarID > mExcludeIds
Definition: ToolManager.h:235