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

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

327{
329}
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 321 of file ToolsToolBar.cpp.

322{
324}

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

332{
334}

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

348{
349 auto &project = context.project;
350 auto &trackPanel = TrackPanel::Get( project );
352
353 settings.SetTool( (settings.GetTool() + 1) % ToolCodes::numTools );
354 trackPanel.Refresh(false);
355}
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 336 of file ToolsToolBar.cpp.

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

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

316{
318}

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

299{
300 auto toolbar = &ToolsToolBar::Get( project );
301 if (toolbar) {
304 }
305}
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 283 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 378 of file ToolsToolBar.cpp.