Audacity  2.2.2
Public Member Functions | Private Attributes | List of all members
AppCommandEvent Class Referencefinal

An event 'envelope' for sending Command objects through the wxwidgets event loop. More...

#include <AppCommandEvent.h>

Inheritance diagram for AppCommandEvent:

Public Member Functions

 AppCommandEvent (wxEventType commandType=wxEVT_APP_COMMAND_RECEIVED, int id=0)
 
 AppCommandEvent (const AppCommandEvent &event)
 
 ~AppCommandEvent ()
 
wxEvent * Clone () const override
 
void SetCommand (const OldStyleCommandPointer &cmd)
 Store a pointer to a command object. More...
 
OldStyleCommandPointer GetCommand ()
 

Private Attributes

OldStyleCommandPointer mCommand
 

Detailed Description

An event 'envelope' for sending Command objects through the wxwidgets event loop.

This allows commands to be communicated from the script thread to the main thread.

Definition at line 28 of file AppCommandEvent.h.

Constructor & Destructor Documentation

AppCommandEvent::AppCommandEvent ( wxEventType  commandType = wxEVT_APP_COMMAND_RECEIVED,
int  id = 0 
)

Definition at line 30 of file AppCommandEvent.cpp.

Referenced by Clone().

31 : wxCommandEvent(commandType, id)
32 { }
AppCommandEvent::AppCommandEvent ( const AppCommandEvent event)

Definition at line 35 of file AppCommandEvent.cpp.

36  : wxCommandEvent(event)
37  , mCommand(event.mCommand)
38 {
39 }
OldStyleCommandPointer mCommand
AppCommandEvent::~AppCommandEvent ( )

Definition at line 41 of file AppCommandEvent.cpp.

42 {
43 }

Member Function Documentation

wxEvent * AppCommandEvent::Clone ( ) const
override

Definition at line 46 of file AppCommandEvent.cpp.

References AppCommandEvent(), and safenew.

47 {
48  return safenew AppCommandEvent(*this);
49 }
AppCommandEvent(wxEventType commandType=wxEVT_APP_COMMAND_RECEIVED, int id=0)
#define safenew
Definition: Audacity.h:230
OldStyleCommandPointer AppCommandEvent::GetCommand ( )

Definition at line 58 of file AppCommandEvent.cpp.

References mCommand.

59 {
60  return mCommand;
61 }
OldStyleCommandPointer mCommand
void AppCommandEvent::SetCommand ( const OldStyleCommandPointer cmd)

Store a pointer to a command object.

Definition at line 52 of file AppCommandEvent.cpp.

References mCommand.

Referenced by ScriptCommandRelay::PostCommand().

53 {
54  wxASSERT(!mCommand);
55  mCommand = cmd;
56 }
OldStyleCommandPointer mCommand

Member Data Documentation

OldStyleCommandPointer AppCommandEvent::mCommand
private

Definition at line 31 of file AppCommandEvent.h.

Referenced by GetCommand(), and SetCommand().


The documentation for this class was generated from the following files: