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

Functions

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

Variables

AttachedItem sAttachment1
 
AttachedItem sAttachment2
 

Function Documentation

◆ ExtraMenu()

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

Definition at line 32 of file ExtraMenus.cpp.

33{
34 // Table of menu factories.
35 static BaseItemSharedPtr extraItems{ Items( wxEmptyString,
36 Section( "Part1" ),
37 Section( "Part2" )
38 ) };
39
40 static const auto pred =
41 []{ return gPrefs->ReadBool(wxT("/GUI/ShowExtraMenus"), false); };
42 static BaseItemSharedPtr menu{
43 ConditionalItems( wxT("Optional"),
44 pred, Menu( wxT("Extra"), XXO("Ext&ra"), extraItems ) )
45 };
46 return menu;
47}
wxT("CloseDown"))
XXO("&Cut/Copy/Paste Toolbar")
FileConfig * gPrefs
Definition: Prefs.cpp:70
constexpr auto Section
constexpr auto Menu
constexpr auto Items
constexpr auto ConditionalItems
std::shared_ptr< BaseItem > BaseItemSharedPtr
Definition: Registry.h:74

References MenuTable::ConditionalItems, gPrefs, MenuTable::Items, MenuTable::Menu, MenuTable::Section, wxT(), and XXO().

Here is the call graph for this function:

◆ ExtraMiscItems()

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

Definition at line 55 of file ExtraMenus.cpp.

56{
58
59 // Not a menu.
60 static BaseItemSharedPtr items{
61 Items( wxT("Misc"),
62 // Delayed evaluation
63 []( AudacityProject &project ) {
64
65 static const auto key =
66#ifdef __WXMAC__
67 wxT("Ctrl+/")
68#else
69 wxT("F11")
70#endif
71 ;
72
73 return (
74 // Accel key is not bindable.
75 Command( wxT("FullScreenOnOff"), XXO("&Full Screen (on/off)"),
78 Options{ key }.CheckTest( []( const AudacityProject &project ) {
79 return GetProjectFrame( project )
80 .wxTopLevelWindow::IsFullScreen(); } ) )
81 );
82 }
83 ) };
84 return items;
85}
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 ...
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 Command
void OnFullScreen(const CommandContext &context)
Definition: ExtraMenus.cpp:17

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

Here is the call graph for this function:

◆ OnFullScreen()

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

Definition at line 17 of file ExtraMenus.cpp.

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

References ToolManager::Get(), GetProjectFrame(), ToolManager::ModifyToolbarMenus(), and CommandContext::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
Initial value:
{
wxT(""),
}
std::unique_ptr< IndirectItem > Indirect(const BaseItemSharedPtr &ptr)
A convenience function.
Definition: Registry.h:97

Definition at line 49 of file ExtraMenus.cpp.

◆ sAttachment2

AttachedItem anonymous_namespace{ExtraMenus.cpp}::sAttachment2
Initial value:
{
Placement{ wxT("Optional/Extra/Part2"), { OrderingHint::End } },
}
BaseItemSharedPtr ExtraMiscItems()
Definition: ExtraMenus.cpp:55

Definition at line 87 of file ExtraMenus.cpp.