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

Functions

void OnFullScreen (const CommandContext &context)
 
auto ExtraMenu ()
 
auto ExtraMiscItems ()
 

Variables

AttachedItem sAttachment1 { Indirect(ExtraMenu()) }
 
AttachedItem sAttachment2
 

Function Documentation

◆ ExtraMenu()

auto anonymous_namespace{ExtraMenus.cpp}::ExtraMenu ( )

Definition at line 30 of file ExtraMenus.cpp.

31{
32 static const auto pred =
33 []{ return gPrefs->ReadBool(wxT("/GUI/ShowExtraMenus"), false); };
34 static auto menu = std::shared_ptr{
35 ConditionalItems("Optional", pred,
36 Menu("Extra", XXO("Ext&ra"),
37 Section("Part1"),
38 Section("Part2"))
39 )
40 };
41 return menu;
42}
wxT("CloseDown"))
XXO("&Cut/Copy/Paste Toolbar")
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
bool ReadBool(const wxString &key, bool defaultValue) const
constexpr auto Section
Definition: MenuRegistry.h:436
constexpr auto Menu
Items will appear in a main toolbar menu or in a sub-menu.
Definition: MenuRegistry.h:445
constexpr auto ConditionalItems
Definition: MenuRegistry.h:454

References MenuRegistry::ConditionalItems, gPrefs, MenuRegistry::Menu, audacity::BasicSettings::ReadBool(), MenuRegistry::Section, wxT(), and XXO().

Here is the call graph for this function:

◆ ExtraMiscItems()

auto anonymous_namespace{ExtraMenus.cpp}::ExtraMiscItems ( )

Definition at line 47 of file ExtraMenus.cpp.

48{
49 // Not a menu.
50 static auto items = std::shared_ptr{
51 Items( wxT("Misc"),
52 // Delayed evaluation
53 [](AudacityProject &) {
54
55 static const auto key =
56#ifdef __WXMAC__
57 wxT("Ctrl+/")
58#else
59 wxT("F11")
60#endif
61 ;
62
63 return (
64 // Accel key is not bindable.
65 Command( wxT("FullScreenOnOff"), XXO("Enable &Full Screen"),
68 Options{ key }.CheckTest( []( const AudacityProject &project ) {
69 return GetProjectFrame( project )
70 .wxTopLevelWindow::IsFullScreen(); } ) )
71 );
72 }
73 ) };
74 return items;
75}
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:34
static const AudacityProject::AttachedObjects::RegisteredFactory key
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
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
constexpr auto Items
Definition: MenuRegistry.h:427
constexpr auto Command
Definition: MenuRegistry.h:456
void OnFullScreen(const CommandContext &context)
Definition: ExtraMenus.cpp:15

References AlwaysEnabledFlag, MenuRegistry::Command, GetProjectFrame(), MenuRegistry::Items, key, OnFullScreen(), project, wxT(), and XXO().

Here is the call graph for this function:

◆ OnFullScreen()

void anonymous_namespace{ExtraMenus.cpp}::OnFullScreen ( const CommandContext context)

Definition at line 15 of file ExtraMenus.cpp.

16{
17 auto &project = context.project;
18 auto &window = GetProjectFrame( project );
19
20 bool bChecked = !window.wxTopLevelWindow::IsFullScreen();
21 window.wxTopLevelWindow::ShowFullScreen(bChecked);
22
24}
AudacityProject & project
static ToolManager & Get(AudacityProject &project)
static void ModifyToolbarMenus(AudacityProject &project)

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

Referenced by ExtraMiscItems().

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

Variable Documentation

◆ sAttachment1

AttachedItem anonymous_namespace{ExtraMenus.cpp}::sAttachment1 { Indirect(ExtraMenu()) }

Definition at line 44 of file ExtraMenus.cpp.

◆ sAttachment2

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

Definition at line 77 of file ExtraMenus.cpp.