Audacity 3.2.0
AppCommandEvent.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity - A Digital Audio Editor
4 Copyright 1999-2009 Audacity Team
5 File License: wxWidgets
6
7 Dan Horgan
8
9******************************************************************//****************************************************************//*******************************************************************/
24
25#include "AppCommandEvent.h"
26
27DEFINE_EVENT_TYPE(wxEVT_APP_COMMAND_RECEIVED)
29
30AppCommandEvent::AppCommandEvent(wxEventType commandType, int id)
31: wxCommandEvent(commandType, id)
32{ }
33
34// Copy constructor
36 : wxCommandEvent(event)
37 , mCommand(event.mCommand)
38{
39}
40
42{
43}
44
45// Clone is required by wxwidgets; implemented via copy constructor
46wxEvent *AppCommandEvent::Clone() const
47{
48 return safenew AppCommandEvent(*this);
49}
50
53{
54 wxASSERT(!mCommand);
55 mCommand = cmd;
56}
57
59{
60 return mCommand;
61}
Headers and event table macros for AppCommandEvent.
DEFINE_EVENT_TYPE(EVT_FREQWINDOW_RECALC)
#define safenew
Definition: MemoryX.h:9
IMPLEMENT_DYNAMIC_CLASS(PluginHostModule, wxModule)
An event 'envelope' for sending Command objects through the wxwidgets event loop.
OldStyleCommandPointer mCommand
AppCommandEvent(wxEventType commandType=wxEVT_APP_COMMAND_RECEIVED, int id=0)
void SetCommand(const OldStyleCommandPointer &cmd)
Store a pointer to a command object.
OldStyleCommandPointer GetCommand()
wxEvent * Clone() const override
OldStyleCommandPointer is a unique_ptr to an OldStyleCommand.