mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 15:49:41 +02:00
ExtraMenus.cpp not link dependent on external sub-menu definitions...
... They use the registry
This commit is contained in:
parent
de08d9ff86
commit
6225043ff3
@ -976,6 +976,12 @@ void InitializeMenuOrdering()
|
||||
{wxT(""), wxT(
|
||||
"File,Edit,Select,View,Transport,Tracks,Generate,Effect,Analyze,Tools,Window,Optional,Help"
|
||||
)},
|
||||
{wxT("/Optional/Extra/Part1"), wxT(
|
||||
"Transport,Tools,Mixer,Edit,PlayAtSpeed,Seek,Device,Select"
|
||||
)},
|
||||
{wxT("/Optional/Extra/Part2"), wxT(
|
||||
"Navigation,Focus,Cursor,Track,Scriptables1,Scriptables2"
|
||||
)},
|
||||
{wxT("/View/Windows"), wxT("UndoHistory,Karaoke,MixerBoard")},
|
||||
{wxT("/Analyze/Analyzers/Windows"), wxT("ContrastAnalyser,PlotSpectrum")},
|
||||
};
|
||||
|
@ -871,7 +871,7 @@ MenuTable::BaseItemSharedPtr ClipCursorItems()
|
||||
return items;
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra/Cursor
|
||||
// Under /MenuBar/Optional/Extra/Part2/Cursor
|
||||
MenuTable::BaseItemSharedPtr ExtraClipCursorItems()
|
||||
{
|
||||
using namespace MenuTable;
|
||||
|
@ -1168,10 +1168,8 @@ AttachedItem sAttachment1{
|
||||
wxT(""),
|
||||
Shared( EditMenu() )
|
||||
};
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraEditMenu()
|
||||
BaseItemSharedPtr ExtraEditMenu()
|
||||
{
|
||||
using Options = CommandManager::Options;
|
||||
static const auto flags =
|
||||
@ -1227,4 +1225,10 @@ RegisteredMenuItemEnabler selectWaveTracks2{{
|
||||
selectAll
|
||||
}};
|
||||
|
||||
AttachedItem sAttachment2{
|
||||
wxT("Optional/Extra/Part1"),
|
||||
Shared( ExtraEditMenu() )
|
||||
};
|
||||
|
||||
}
|
||||
#undef FN
|
||||
|
@ -136,28 +136,11 @@ static CommandHandlerObject &findCommandHandler(AudacityProject &) {
|
||||
|
||||
#define FN(X) (& ExtraActions::Handler :: X)
|
||||
|
||||
// Imported menu item definitions
|
||||
|
||||
MenuTable::BaseItemSharedPtr ExtraEditMenu();
|
||||
MenuTable::BaseItemSharedPtr ExtraSelectionMenu();
|
||||
MenuTable::BaseItemSharedPtr ExtraCursorMenu();
|
||||
MenuTable::BaseItemSharedPtr ExtraSeekMenu();
|
||||
MenuTable::BaseItemSharedPtr ExtraToolsMenu();
|
||||
MenuTable::BaseItemSharedPtr ExtraTransportMenu();
|
||||
MenuTable::BaseItemSharedPtr ExtraPlayAtSpeedMenu();
|
||||
MenuTable::BaseItemSharedPtr ExtraTrackMenu();
|
||||
MenuTable::BaseItemSharedPtr ExtraScriptablesIMenu();
|
||||
MenuTable::BaseItemSharedPtr ExtraScriptablesIIMenu();
|
||||
MenuTable::BaseItemSharedPtr ExtraWindowItems();
|
||||
MenuTable::BaseItemSharedPtr ExtraGlobalCommands();
|
||||
MenuTable::BaseItemSharedPtr ExtraFocusMenu();
|
||||
|
||||
namespace {
|
||||
using namespace MenuTable;
|
||||
|
||||
BaseItemSharedPtr ExtraMixerMenu();
|
||||
BaseItemSharedPtr ExtraDeviceMenu();
|
||||
BaseItemPtr ExtraMiscItems( AudacityProject & );
|
||||
|
||||
BaseItemSharedPtr ExtraMenu()
|
||||
{
|
||||
@ -165,27 +148,11 @@ BaseItemSharedPtr ExtraMenu()
|
||||
// TODO: devise a registration system instead.
|
||||
static BaseItemSharedPtr extraItems{ Items( wxEmptyString,
|
||||
Section( "Part1",
|
||||
ExtraTransportMenu()
|
||||
, ExtraToolsMenu()
|
||||
, ExtraMixerMenu()
|
||||
, ExtraEditMenu()
|
||||
, ExtraPlayAtSpeedMenu()
|
||||
, ExtraSeekMenu()
|
||||
ExtraMixerMenu()
|
||||
, ExtraDeviceMenu()
|
||||
, ExtraSelectionMenu()
|
||||
),
|
||||
|
||||
Section( "Part2",
|
||||
ExtraGlobalCommands()
|
||||
, ExtraFocusMenu()
|
||||
, ExtraCursorMenu()
|
||||
, ExtraTrackMenu()
|
||||
, ExtraScriptablesIMenu()
|
||||
, ExtraScriptablesIIMenu()
|
||||
|
||||
// Delayed evaluation:
|
||||
, ExtraMiscItems
|
||||
)
|
||||
Section( "Part2" )
|
||||
) };
|
||||
|
||||
static const auto pred =
|
||||
@ -202,7 +169,7 @@ AttachedItem sAttachment1{
|
||||
Shared( ExtraMenu() )
|
||||
};
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
// Under /MenuBar/Optional/Extra/Part1
|
||||
BaseItemSharedPtr ExtraMixerMenu()
|
||||
{
|
||||
static BaseItemSharedPtr menu{
|
||||
@ -224,7 +191,7 @@ BaseItemSharedPtr ExtraMixerMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
// Under /MenuBar/Optional/Extra/Part1
|
||||
BaseItemSharedPtr ExtraDeviceMenu()
|
||||
{
|
||||
static BaseItemSharedPtr menu{
|
||||
@ -245,8 +212,8 @@ BaseItemSharedPtr ExtraDeviceMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
BaseItemPtr ExtraMiscItems( AudacityProject &project )
|
||||
// Under /MenuBar/Optional/Extra/Part2
|
||||
BaseItemPtr ExtraMiscItems()
|
||||
{
|
||||
using Options = CommandManager::Options;
|
||||
|
||||
@ -261,17 +228,24 @@ BaseItemPtr ExtraMiscItems( AudacityProject &project )
|
||||
// Not a menu.
|
||||
return ( FinderScope{ findCommandHandler },
|
||||
Items( wxT("Misc"),
|
||||
// Accel key is not bindable.
|
||||
Command( wxT("FullScreenOnOff"), XXO("&Full Screen (on/off)"),
|
||||
FN(OnFullScreen),
|
||||
AlwaysEnabledFlag,
|
||||
Options{ key }.CheckState(
|
||||
GetProjectFrame( project ).wxTopLevelWindow::IsFullScreen() ) ),
|
||||
|
||||
ExtraWindowItems()
|
||||
// Delayed evaluation
|
||||
[]( AudacityProject &project ) {
|
||||
return
|
||||
// Accel key is not bindable.
|
||||
Command( wxT("FullScreenOnOff"), XXO("&Full Screen (on/off)"),
|
||||
FN(OnFullScreen),
|
||||
AlwaysEnabledFlag,
|
||||
Options{ key }.CheckState(
|
||||
GetProjectFrame( project ).wxTopLevelWindow::IsFullScreen() ) );
|
||||
}
|
||||
) );
|
||||
}
|
||||
|
||||
AttachedItem sAttachment2{
|
||||
Placement{ wxT("Optional/Extra/Part2"), { OrderingHint::End } },
|
||||
Shared( ExtraMiscItems() )
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#undef FN
|
||||
|
@ -555,11 +555,11 @@ static CommandHandlerObject &findCommandHandler(AudacityProject &project) {
|
||||
|
||||
#define FN(X) (& NavigationActions::Handler :: X)
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraGlobalCommands()
|
||||
namespace {
|
||||
using namespace MenuTable;
|
||||
BaseItemSharedPtr ExtraGlobalCommands()
|
||||
{
|
||||
// Ceci n'est pas un menu
|
||||
using namespace MenuTable;
|
||||
using Options = CommandManager::Options;
|
||||
|
||||
static BaseItemSharedPtr items{
|
||||
@ -575,10 +575,13 @@ MenuTable::BaseItemSharedPtr ExtraGlobalCommands()
|
||||
return items;
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraFocusMenu()
|
||||
AttachedItem sAttachment2{
|
||||
wxT("Optional/Extra/Part2"),
|
||||
Shared( ExtraGlobalCommands() )
|
||||
};
|
||||
|
||||
BaseItemSharedPtr ExtraFocusMenu()
|
||||
{
|
||||
using namespace MenuTable;
|
||||
static const auto FocusedTracksFlags = TracksExistFlag() | TrackPanelHasFocus();
|
||||
|
||||
static BaseItemSharedPtr menu{
|
||||
@ -610,4 +613,11 @@ MenuTable::BaseItemSharedPtr ExtraFocusMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
AttachedItem sAttachment3{
|
||||
wxT("Optional/Extra/Part2"),
|
||||
Shared( ExtraFocusMenu() )
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#undef FN
|
||||
|
@ -917,10 +917,8 @@ AttachedItem sAttachment4{
|
||||
wxT(""),
|
||||
Shared( ToolsMenu() )
|
||||
};
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraScriptablesIMenu()
|
||||
BaseItemSharedPtr ExtraScriptablesIMenu()
|
||||
{
|
||||
// These are the more useful to VI user Scriptables.
|
||||
static BaseItemSharedPtr menu{
|
||||
@ -967,8 +965,12 @@ MenuTable::BaseItemSharedPtr ExtraScriptablesIMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraScriptablesIIMenu()
|
||||
AttachedItem sAttachment5{
|
||||
wxT("Optional/Extra/Part2"),
|
||||
Shared( ExtraScriptablesIMenu() )
|
||||
};
|
||||
|
||||
BaseItemSharedPtr ExtraScriptablesIIMenu()
|
||||
{
|
||||
// Less useful to VI users.
|
||||
static BaseItemSharedPtr menu{
|
||||
@ -1007,4 +1009,11 @@ MenuTable::BaseItemSharedPtr ExtraScriptablesIIMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
AttachedItem sAttachment6{
|
||||
wxT("Optional/Extra/Part2"),
|
||||
Shared( ExtraScriptablesIIMenu() )
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#undef FN
|
||||
|
@ -1148,10 +1148,8 @@ AttachedItem sAttachment1{
|
||||
wxT(""),
|
||||
Shared( SelectMenu() )
|
||||
};
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraSelectionMenu()
|
||||
BaseItemSharedPtr ExtraSelectionMenu()
|
||||
{
|
||||
static BaseItemSharedPtr menu{
|
||||
( FinderScope{ findCommandHandler },
|
||||
@ -1192,6 +1190,12 @@ MenuTable::BaseItemSharedPtr ExtraSelectionMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
AttachedItem sAttachment2{
|
||||
wxT("Optional/Extra/Part1"),
|
||||
Shared( ExtraSelectionMenu() )
|
||||
};
|
||||
}
|
||||
|
||||
MenuTable::BaseItemSharedPtr ClipCursorItems();
|
||||
|
||||
// Under /MenuBar/Transport
|
||||
@ -1241,8 +1245,8 @@ MenuTable::BaseItemSharedPtr CursorMenu()
|
||||
|
||||
MenuTable::BaseItemSharedPtr ExtraClipCursorItems();
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraCursorMenu()
|
||||
namespace {
|
||||
BaseItemSharedPtr ExtraCursorMenu()
|
||||
{
|
||||
static BaseItemSharedPtr menu{
|
||||
( FinderScope{ findCommandHandler },
|
||||
@ -1271,8 +1275,12 @@ MenuTable::BaseItemSharedPtr ExtraCursorMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraSeekMenu()
|
||||
AttachedItem sAttachment4{
|
||||
wxT("Optional/Extra/Part2"),
|
||||
Shared( ExtraCursorMenu() )
|
||||
};
|
||||
|
||||
BaseItemSharedPtr ExtraSeekMenu()
|
||||
{
|
||||
static BaseItemSharedPtr menu{
|
||||
( FinderScope{ findCommandHandler },
|
||||
@ -1290,4 +1298,11 @@ MenuTable::BaseItemSharedPtr ExtraSeekMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
AttachedItem sAttachment5{
|
||||
wxT("Optional/Extra/Part1"),
|
||||
Shared( ExtraSeekMenu() )
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#undef FN
|
||||
|
@ -338,10 +338,10 @@ MenuTable::BaseItemSharedPtr ToolbarsMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraToolsMenu()
|
||||
namespace {
|
||||
using namespace MenuTable;
|
||||
BaseItemSharedPtr ExtraToolsMenu()
|
||||
{
|
||||
using namespace MenuTable;
|
||||
static BaseItemSharedPtr menu{
|
||||
( FinderScope{ findCommandHandler },
|
||||
Menu( wxT("Tools"), XO("T&ools"),
|
||||
@ -365,4 +365,10 @@ MenuTable::BaseItemSharedPtr ExtraToolsMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
AttachedItem sAttachment2{
|
||||
wxT("Optional/Extra/Part1"),
|
||||
Shared( ExtraToolsMenu() )
|
||||
};
|
||||
}
|
||||
|
||||
#undef FN
|
||||
|
@ -1442,10 +1442,8 @@ AttachedItem sAttachment1{
|
||||
wxT(""),
|
||||
Shared( TracksMenu() )
|
||||
};
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraTrackMenu()
|
||||
BaseItemSharedPtr ExtraTrackMenu()
|
||||
{
|
||||
static BaseItemSharedPtr menu{
|
||||
( FinderScope{ findCommandHandler },
|
||||
@ -1497,4 +1495,11 @@ MenuTable::BaseItemSharedPtr ExtraTrackMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
AttachedItem sAttachment2{
|
||||
wxT("Optional/Extra/Part2"),
|
||||
Shared( ExtraTrackMenu() )
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#undef FN
|
||||
|
@ -1103,10 +1103,8 @@ AttachedItem sAttachment1{
|
||||
wxT(""),
|
||||
Shared( TransportMenu() )
|
||||
};
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraTransportMenu()
|
||||
BaseItemSharedPtr ExtraTransportMenu()
|
||||
{
|
||||
static BaseItemSharedPtr menu{
|
||||
( FinderScope{ findCommandHandler },
|
||||
@ -1156,8 +1154,12 @@ MenuTable::BaseItemSharedPtr ExtraTransportMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra
|
||||
MenuTable::BaseItemSharedPtr ExtraPlayAtSpeedMenu()
|
||||
AttachedItem sAttachment2{
|
||||
wxT("Optional/Extra/Part1"),
|
||||
Shared( ExtraTransportMenu() )
|
||||
};
|
||||
|
||||
BaseItemSharedPtr ExtraPlayAtSpeedMenu()
|
||||
{
|
||||
static BaseItemSharedPtr menu{
|
||||
( FinderScope{ findCommandHandler },
|
||||
@ -1189,4 +1191,11 @@ MenuTable::BaseItemSharedPtr ExtraPlayAtSpeedMenu()
|
||||
return menu;
|
||||
}
|
||||
|
||||
AttachedItem sAttachment3{
|
||||
wxT("Optional/Extra/Part1"),
|
||||
Shared( ExtraPlayAtSpeedMenu() )
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#undef FN
|
||||
|
@ -154,10 +154,7 @@ AttachedItem sAttachment1{
|
||||
Shared( WindowMenu() )
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// Under /MenuBar/Optional/Extra/Misc
|
||||
MenuTable::BaseItemSharedPtr ExtraWindowItems()
|
||||
BaseItemSharedPtr ExtraWindowItems()
|
||||
{
|
||||
static BaseItemSharedPtr items{
|
||||
( FinderScope{ findCommandHandler },
|
||||
@ -171,14 +168,17 @@ MenuTable::BaseItemSharedPtr ExtraWindowItems()
|
||||
return items;
|
||||
}
|
||||
|
||||
AttachedItem sAttachment2{
|
||||
Placement{ wxT("Optional/Extra/Part2/Misc"), OrderingHint::End },
|
||||
Shared( ExtraWindowItems() )
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#undef FN
|
||||
|
||||
#else
|
||||
|
||||
// Not WXMAC. Stub functions.
|
||||
MenuTable::BaseItemSharedPtr ExtraWindowItems()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
// Not WXMAC.
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user