Audacity 3.2.0
MessageCommand.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity - A Digital Audio Editor
4 Copyright 1999-2018 Audacity Team
5 License: wxwidgets
6
7 Dan Horgan
8
9******************************************************************//*******************************************************************/
15
16
17#include "MessageCommand.h"
18
19#include "CommandDispatch.h"
20#include "MenuRegistry.h"
21#include "../CommonCommandFlags.h"
22#include "LoadCommands.h"
23#include "CommandContext.h"
24#include "SettingsVisitor.h"
25#include "ShuttleGui.h"
26
28{ XO("Message") };
29
31
32template<bool Const>
34 S.Define( mMessage, wxT("Text"), wxString{"Some message"} );
35 return true;
36}
37
39 { return VisitSettings<false>(S); }
40
42 { return VisitSettings<true>(S); }
43
45{
46 S.AddSpace(0, 5);
47
48 S.StartMultiColumn(2, wxALIGN_CENTER);
49 {
50 S.TieTextBox(XXO("Text:"),mMessage,60);
51 }
52 S.EndMultiColumn();
53}
54
56 context.Status( mMessage );
57 return true;
58}
59
60namespace {
61using namespace MenuRegistry;
62
63// Register menu items
64
66 // Note that the PLUGIN_SYMBOL must have a space between words,
67 // whereas the short-form used here must not.
68 // (So if you did write "Compare Audio" for the PLUGIN_SYMBOL name, then
69 // you would have to use "CompareAudio" here.)
70 Command( wxT("Message"), XXO("Message..."),
72 wxT("Optional/Extra/Part2/Scriptables2")
73};
74
75}
wxT("CloseDown"))
const ReservedCommandFlag & AudioIONotBusyFlag()
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
Contains definition of MessageCommand class.
#define S(N)
Definition: ToChars.cpp:64
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
virtual void Status(const wxString &message, bool bFlush=false) const
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
void PopulateOrExchange(ShuttleGui &S) override
wxString mMessage
bool Apply(const CommandContext &context) override
static const ComponentInterfaceSymbol Symbol
bool VisitSettings(SettingsVisitorBase< Const > &S)
Generates classes whose instances register items at construction.
Definition: Registry.h:388
Visitor of effect or command parameters. This is a base class with lots of virtual functions that do ...
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
AUDACITY_DLL_API void OnAudacityCommand(const CommandContext &ctx)
constexpr auto Command
Definition: MenuRegistry.h:456
BuiltinCommandsModule::Registration< MessageCommand > reg