Audacity  2.2.2
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 
27 DEFINE_EVENT_TYPE(wxEVT_APP_COMMAND_RECEIVED)
28 IMPLEMENT_DYNAMIC_CLASS(AppCommandEvent, wxEvent)
29 
30 AppCommandEvent::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
46 wxEvent *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 }
CommandHolder mCommand
std::shared_ptr< Command > CommandHolder
DEFINE_EVENT_TYPE(EVT_OPEN_AUDIO_FILE)
Custom events.
Headers and event table macros for AppCommandEvent.
AppCommandEvent(wxEventType commandType=wxEVT_APP_COMMAND_RECEIVED, int id=0)
#define safenew
Definition: Audacity.h:223
wxEvent * Clone() const override
An event 'envelope' for sending Command objects through the wxwidgets event loop. ...
CommandHolder GetCommand()
void SetCommand(const CommandHolder &cmd)
Store a pointer to a command object.