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 357 of file ToolsToolBar.cpp.

358{
359 static auto menu = std::shared_ptr{
360 Menu( wxT("Tools"), XXO("T&ools"),
361 Command( wxT("SelectTool"), XXO("&Selection Tool"), OnSelectTool,
362 AlwaysEnabledFlag, wxT("F1") ),
363 Command( wxT("EnvelopeTool"), XXO("&Envelope Tool"),
365 Command( wxT("DrawTool"), XXO("&Draw Tool"), OnDrawTool,
366 AlwaysEnabledFlag, wxT("F3") ),
367 Command( wxT("MultiTool"), XXO("&Multi Tool"), OnMultiTool,
368 AlwaysEnabledFlag, wxT("F6") ),
369 Command( wxT("PrevTool"), XXO("&Previous Tool"), OnPrevTool,
370 AlwaysEnabledFlag, wxT("A") ),
371 Command( wxT("NextTool"), XXO("&Next Tool"), OnNextTool,
372 AlwaysEnabledFlag, wxT("D") )
373 ) };
374 return menu;
375}
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 325 of file ToolsToolBar.cpp.

326{
328}
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 320 of file ToolsToolBar.cpp.

321{
323}

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 330 of file ToolsToolBar.cpp.

331{
333}

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 346 of file ToolsToolBar.cpp.

347{
348 auto &project = context.project;
349 auto &trackPanel = TrackPanel::Get( project );
351
352 settings.SetTool( (settings.GetTool() + 1) % ToolCodes::numTools );
353 trackPanel.Refresh(false);
354}
const auto project
static Settings & settings()
Definition: TrackInfo.cpp:51
static ProjectSettings & Get(AudacityProject &project)
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:234

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 335 of file ToolsToolBar.cpp.

336{
337 auto &project = context.project;
338 auto &trackPanel = TrackPanel::Get( project );
340
341 settings.SetTool(
342 (settings.GetTool() + (ToolCodes::numTools - 1 )) % ToolCodes::numTools);
343 trackPanel.Refresh(false);
344}

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 314 of file ToolsToolBar.cpp.

315{
317}

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 297 of file ToolsToolBar.cpp.

298{
299 auto toolbar = &ToolsToolBar::Get( project );
300 if (toolbar) {
303 }
304}
void SetTool(int tool)
static ToolsToolBar & Get(AudacityProject &project)
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
Definition: TrackPanel.cpp:802

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 282 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 377 of file ToolsToolBar.cpp.