Audacity 3.2.0
Functions | Variables
anonymous_namespace{ToolsToolBar.cpp} Namespace Reference

Namespace for functions for View Toolbar menu. More...

Functions

void SetTool (AudacityProject &project, int tool)
 Called by handlers that set tools. More...
 
void OnSelectTool (const CommandContext &context)
 Handler to set the select tool active. More...
 
void OnEnvelopeTool (const CommandContext &context)
 Handler to set the Envelope tool active. More...
 
void OnDrawTool (const CommandContext &context)
 
void OnMultiTool (const CommandContext &context)
 
void OnPrevTool (const CommandContext &context)
 
void OnNextTool (const CommandContext &context)
 
auto ExtraToolsMenu ()
 

Variables

AttachedToolBarMenuItem sAttachment
 
AttachedItem sAttachment2
 

Detailed Description

Namespace for functions for View Toolbar menu.

Function Documentation

◆ ExtraToolsMenu()

auto anonymous_namespace{ToolsToolBar.cpp}::ExtraToolsMenu ( )

Definition at line 336 of file ToolsToolBar.cpp.

337{
338 static auto menu = std::shared_ptr{
339 Menu( wxT("Tools"), XXO("T&ools"),
340 Command( wxT("SelectTool"), XXO("&Selection Tool"), OnSelectTool,
341 AlwaysEnabledFlag, wxT("F1") ),
342 Command( wxT("EnvelopeTool"), XXO("&Envelope Tool"),
344 Command( wxT("DrawTool"), XXO("&Draw Tool"), OnDrawTool,
345 AlwaysEnabledFlag, wxT("F3") ),
346 Command( wxT("MultiTool"), XXO("&Multi Tool"), OnMultiTool,
347 AlwaysEnabledFlag, wxT("F6") ),
348 Command( wxT("PrevTool"), XXO("&Previous Tool"), OnPrevTool,
349 AlwaysEnabledFlag, wxT("A") ),
350 Command( wxT("NextTool"), XXO("&Next Tool"), OnNextTool,
351 AlwaysEnabledFlag, wxT("D") )
352 ) };
353 return menu;
354}
wxT("CloseDown"))
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:34
XXO("&Cut/Copy/Paste Toolbar")
constexpr auto Command
Definition: MenuRegistry.h:456
constexpr auto Menu
Items will appear in a main toolbar menu or in a sub-menu.
Definition: MenuRegistry.h:445
void OnNextTool(const CommandContext &context)
void OnPrevTool(const CommandContext &context)
void OnMultiTool(const CommandContext &context)
void OnSelectTool(const CommandContext &context)
Handler to set the select tool active.
void OnEnvelopeTool(const CommandContext &context)
Handler to set the Envelope tool active.
void OnDrawTool(const CommandContext &context)

References AlwaysEnabledFlag, MenuRegistry::Command, MenuRegistry::Menu, OnDrawTool(), OnEnvelopeTool(), OnMultiTool(), OnNextTool(), OnPrevTool(), OnSelectTool(), wxT(), and XXO().

Here is the call graph for this function:

◆ OnDrawTool()

void anonymous_namespace{ToolsToolBar.cpp}::OnDrawTool ( const CommandContext context)

Definition at line 304 of file ToolsToolBar.cpp.

305{
307}
AudacityProject & project
void SetTool(AudacityProject &project, int tool)
Called by handlers that set tools.

References ToolCodes::drawTool, CommandContext::project, and SetTool().

Referenced by ExtraToolsMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnEnvelopeTool()

void anonymous_namespace{ToolsToolBar.cpp}::OnEnvelopeTool ( const CommandContext context)

Handler to set the Envelope tool active.

Definition at line 299 of file ToolsToolBar.cpp.

300{
302}

References ToolCodes::envelopeTool, CommandContext::project, and SetTool().

Referenced by ExtraToolsMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnMultiTool()

void anonymous_namespace{ToolsToolBar.cpp}::OnMultiTool ( const CommandContext context)

Definition at line 309 of file ToolsToolBar.cpp.

310{
312}

References ToolCodes::multiTool, CommandContext::project, and SetTool().

Referenced by ExtraToolsMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnNextTool()

void anonymous_namespace{ToolsToolBar.cpp}::OnNextTool ( const CommandContext context)

Definition at line 325 of file ToolsToolBar.cpp.

326{
327 auto &project = context.project;
328 auto &trackPanel = TrackPanel::Get( project );
330
331 settings.SetTool( (settings.GetTool() + 1) % ToolCodes::numTools );
332 trackPanel.Refresh(false);
333}
const auto project
static Settings & settings()
Definition: TrackInfo.cpp:69
static ProjectSettings & Get(AudacityProject &project)
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:233

References ProjectSettings::Get(), TrackPanel::Get(), ToolCodes::numTools, CommandContext::project, project, and settings().

Referenced by ExtraToolsMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnPrevTool()

void anonymous_namespace{ToolsToolBar.cpp}::OnPrevTool ( const CommandContext context)

Definition at line 314 of file ToolsToolBar.cpp.

315{
316 auto &project = context.project;
317 auto &trackPanel = TrackPanel::Get( project );
319
320 settings.SetTool(
321 (settings.GetTool() + (ToolCodes::numTools - 1 )) % ToolCodes::numTools);
322 trackPanel.Refresh(false);
323}

References ProjectSettings::Get(), TrackPanel::Get(), ToolCodes::numTools, CommandContext::project, project, and settings().

Referenced by ExtraToolsMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnSelectTool()

void anonymous_namespace{ToolsToolBar.cpp}::OnSelectTool ( const CommandContext context)

Handler to set the select tool active.

Definition at line 293 of file ToolsToolBar.cpp.

294{
296}

References CommandContext::project, ToolCodes::selectTool, and SetTool().

Referenced by ExtraToolsMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetTool()

void anonymous_namespace{ToolsToolBar.cpp}::SetTool ( AudacityProject project,
int  tool 
)

Called by handlers that set tools.

Definition at line 276 of file ToolsToolBar.cpp.

277{
278 auto toolbar = &ToolsToolBar::Get( project );
279 if (toolbar) {
282 }
283}
void SetTool(int tool)
static ToolsToolBar & Get(AudacityProject &project)
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
Definition: TrackPanel.cpp:801

References ProjectSettings::Get(), ToolsToolBar::Get(), TrackPanel::Get(), project, TrackPanel::Refresh(), and ProjectSettings::SetTool().

Referenced by OnDrawTool(), OnEnvelopeTool(), OnMultiTool(), and OnSelectTool().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ sAttachment

AttachedToolBarMenuItem anonymous_namespace{ToolsToolBar.cpp}::sAttachment
Initial value:
{
ToolsToolBar::ID(), wxT("ShowToolsTB"), XXO("T&ools Toolbar"),
}
static Identifier ID()

Definition at line 261 of file ToolsToolBar.cpp.

◆ sAttachment2

AttachedItem anonymous_namespace{ToolsToolBar.cpp}::sAttachment2
Initial value:
wxT("Optional/Extra/Part1")
}
std::unique_ptr< detail::IndirectItem< Item > > Indirect(const std::shared_ptr< Item > &ptr)
A convenience function.
Definition: Registry.h:175

Definition at line 356 of file ToolsToolBar.cpp.