Audacity
3.2.0
src
commands
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
27
const
ComponentInterfaceSymbol
MessageCommand::Symbol
28
{
XO
(
"Message"
) };
29
30
namespace
{
BuiltinCommandsModule::Registration< MessageCommand >
reg
; }
31
32
template
<
bool
Const>
33
bool
MessageCommand::VisitSettings
(
SettingsVisitorBase<Const>
&
S
){
34
S
.Define(
mMessage
,
wxT
(
"Text"
), wxString{
"Some message"
} );
35
return
true
;
36
}
37
38
bool
MessageCommand::VisitSettings
(
SettingsVisitor
&
S
)
39
{
return
VisitSettings<false>(
S
); }
40
41
bool
MessageCommand::VisitSettings
(
ConstSettingsVisitor
&
S
)
42
{
return
VisitSettings<true>(
S
); }
43
44
void
MessageCommand::PopulateOrExchange
(
ShuttleGui
&
S
)
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
55
bool
MessageCommand::Apply
(
const
CommandContext
& context){
56
context.
Status
(
mMessage
);
57
return
true
;
58
}
59
60
namespace
{
61
using namespace
MenuRegistry
;
62
63
// Register menu items
64
65
AttachedItem
sAttachment
{
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..."
),
71
CommandDispatch::OnAudacityCommand
,
AudioIONotBusyFlag
() ),
72
wxT
(
"Optional/Extra/Part2/Scriptables2"
)
73
};
74
75
}
wxT
wxT("CloseDown"))
CommandContext.h
CommandDispatch.h
AudioIONotBusyFlag
const ReservedCommandFlag & AudioIONotBusyFlag()
Definition:
CommonCommandFlags.cpp:118
XO
XO("Cut/Copy/Paste")
XXO
XXO("&Cut/Copy/Paste Toolbar")
LoadCommands.h
MenuRegistry.h
MessageCommand.h
Contains definition of MessageCommand class.
SettingsVisitor.h
ShuttleGui.h
S
#define S(N)
Definition:
ToChars.cpp:64
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition:
CommandContext.h:37
CommandContext::Status
virtual void Status(const wxString &message, bool bFlush=false) const
Definition:
CommandContext.cpp:60
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition:
ComponentInterfaceSymbol.h:27
MessageCommand::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition:
MessageCommand.cpp:44
MessageCommand::mMessage
wxString mMessage
Definition:
MessageCommand.h:44
MessageCommand::Apply
bool Apply(const CommandContext &context) override
Definition:
MessageCommand.cpp:55
MessageCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition:
MessageCommand.h:30
MessageCommand::VisitSettings
bool VisitSettings(SettingsVisitorBase< Const > &S)
Definition:
MessageCommand.cpp:33
Registry::RegisteredItem
Generates classes whose instances register items at construction.
Definition:
Registry.h:388
SettingsVisitorBase
Visitor of effect or command parameters. This is a base class with lots of virtual functions that do ...
Definition:
SettingsVisitor.h:79
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition:
ShuttleGui.h:640
CommandDispatch::OnAudacityCommand
AUDACITY_DLL_API void OnAudacityCommand(const CommandContext &ctx)
Definition:
CommandDispatch.cpp:96
MenuRegistry
Definition:
MenuRegistry.cpp:19
MenuRegistry::Command
constexpr auto Command
Definition:
MenuRegistry.h:456
anonymous_namespace{MessageCommand.cpp}::sAttachment
AttachedItem sAttachment
Definition:
MessageCommand.cpp:65
anonymous_namespace{MessageCommand.cpp}::reg
BuiltinCommandsModule::Registration< MessageCommand > reg
Definition:
MessageCommand.cpp:30
BuiltinCommandsModule::Registration
Definition:
LoadCommands.h:41
Generated by
1.9.3