1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 08:09:32 +02:00

Bug 2295 - ENH: cannot add a comment in a Macro with Audacity

Comments can now be added using the Comment command.
This commit is contained in:
James Crook 2020-08-16 20:22:48 +01:00
parent 542a9a8d98
commit 894867d692
2 changed files with 40 additions and 0 deletions

View File

@ -27,7 +27,11 @@
const ComponentInterfaceSymbol HelpCommand::Symbol
{ XO("Help") };
const ComponentInterfaceSymbol CommentCommand::Symbol
{ XO("Comment") };
namespace{ BuiltinCommandsModule::Registration< HelpCommand > reg; }
namespace{ BuiltinCommandsModule::Registration< CommentCommand > reg2; }
enum {
kJson,
@ -103,3 +107,19 @@ bool HelpCommand::ApplyInner(const CommandContext & context){
return true;
}
bool CommentCommand::DefineParams( ShuttleParams & S ){
S.Define( mComment, wxT("_"), "" );
return true;
}
void CommentCommand::PopulateOrExchange(ShuttleGui & S)
{
S.AddSpace(0, 5);
S.StartMultiColumn(2, wxALIGN_CENTER);
{
S.TieTextBox(XXO("_"),mComment,80);
}
S.EndMultiColumn();
}

View File

@ -43,5 +43,25 @@ public:
wxString mCommandName;
};
class CommentCommand : public AudacityCommand
{
public:
static const ComponentInterfaceSymbol Symbol;
int mFormat;
// ComponentInterface overrides
ComponentInterfaceSymbol GetSymbol() override {return Symbol;};
TranslatableString GetDescription() override {return XO("For comments in a macro.");};
bool DefineParams( ShuttleParams & S ) override;
void PopulateOrExchange(ShuttleGui & S) override;
bool Apply(const CommandContext & context) override {
return false;
};
// AudacityCommand overrides
wxString ManualPage() override {return wxT("Extra_Menu:_Scriptables_II#comment");};
public:
wxString mComment;
};
#endif /* End of include guard: __HELPCOMMAND__ */