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 "CommandManager.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 MenuTable;
62
63// Register menu items
64
66 wxT("Optional/Extra/Part2/Scriptables2"),
67 // Note that the PLUGIN_SYMBOL must have a space between words,
68 // whereas the short-form used here must not.
69 // (So if you did write "Compare Audio" for the PLUGIN_SYMBOL name, then
70 // you would have to use "CompareAudio" here.)
71 Command( wxT("Message"), XXO("Message..."),
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)
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:625
AUDACITY_DLL_API void OnAudacityCommand(const CommandContext &ctx)
std::unique_ptr< CommandItem > Command(const CommandID &name, const TranslatableString &label_in, void(Handler::*pmf)(const CommandContext &), CommandFlag flags, const CommandManager::Options &options={}, CommandHandlerFinder finder=FinderScope::DefaultFinder())
BuiltinCommandsModule::Registration< MessageCommand > reg