Audacity 3.2.0
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 (Identifier id, const CommandID &name, const TranslatableString &label_in, const Registry::OrderingHint &hint={}, std::vector< Identifier > excludeIds={})
 
void OnShowToolBar (const CommandContext &context)
 

Public Attributes

const Identifier mId
 
const MenuRegistry::AttachedItem mAttachedItem
 
const std::vector< IdentifiermExcludeIds
 

Detailed Description

Definition at line 247 of file ToolManager.h.

Constructor & Destructor Documentation

◆ AttachedToolBarMenuItem()

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

Definition at line 1559 of file ToolManager.cpp.

1563 : mId{ id }
1564 , mAttachedItem{
1567 { return *this; } ),
1568 MenuRegistry::Command( name, label_in,
1572 auto &toolManager = ToolManager::Get( project );
1573 return toolManager.IsVisible( id ); } ) ) ),
1574 Registry::Placement{ wxT("View/Other/Toolbars/Toolbars/Other"), hint }
1575 }
1576 , mExcludeIds{ std::move( excludeIDs ) }
1577{}
wxT("CloseDown"))
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:34
wxEvtHandler CommandHandlerObject
const TranslatableString name
Definition: Distortion.cpp:76
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static ToolManager & Get(AudacityProject &project)
constexpr auto Command
Definition: MenuRegistry.h:456
const MenuRegistry::AttachedItem mAttachedItem
Definition: ToolManager.h:257
void OnShowToolBar(const CommandContext &context)
const std::vector< Identifier > mExcludeIds
Definition: ToolManager.h:258
const Identifier mId
Definition: ToolManager.h:256
Options && CheckTest(const CheckFn &fn) &&
Definition: MenuRegistry.h:74

Member Function Documentation

◆ OnShowToolBar()

void AttachedToolBarMenuItem::OnShowToolBar ( const CommandContext context)

Definition at line 1579 of file ToolManager.cpp.

1580{
1581 auto &project = context.project;
1582 auto &toolManager = ToolManager::Get( project );
1583
1584 if( !toolManager.IsVisible( mId ) )
1585 {
1586 for ( const auto excludedID : mExcludeIds )
1587 toolManager.Expose( excludedID, false );
1588 }
1589
1590 toolManager.ShowHide(mId);
1592}
AudacityProject & project
static void ModifyToolbarMenus(AudacityProject &project)

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

Here is the call graph for this function:

Member Data Documentation

◆ mAttachedItem

const MenuRegistry::AttachedItem AttachedToolBarMenuItem::mAttachedItem

Definition at line 257 of file ToolManager.h.

◆ mExcludeIds

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

Definition at line 258 of file ToolManager.h.

Referenced by OnShowToolBar().

◆ mId

const Identifier AttachedToolBarMenuItem::mId

Definition at line 256 of file ToolManager.h.

Referenced by OnShowToolBar().


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