1
/***************************************************************
2
* Name: CodeSnippetsEvent
4
* Purpose: This class implements the events sent by/for a
5
* CodeSnippets request to the
6
* CodeSnippets Manager to request services such as
7
* Tree item focus and/or editing services.
8
* wxCommandEvent m_id contains a code snippets id.
14
**************************************************************/
15
#ifndef CODESNIPPETS_EVENT_H
16
#define CODESNIPPETS_EVENT_H
20
// ----------------------------------------------------------------------------
21
class CodeSnippetsEvent : public wxCommandEvent
22
// ----------------------------------------------------------------------------
26
CodeSnippetsEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
28
/** Copy constructor. */
29
CodeSnippetsEvent( const CodeSnippetsEvent& event);
34
virtual wxEvent* Clone() const { return new CodeSnippetsEvent(*this);}
36
DECLARE_DYNAMIC_CLASS(CodeSnippetsEvent);
38
int GetSnippetID() const {return m_SnippetID;}
39
void SetSnippetID( const int itemid ) {m_SnippetID = itemid;}
40
wxString GetSnippetString() const {return m_SnippetString;}
41
void SetSnippetString( const wxString string ) {m_SnippetString = string;}
42
wxString GetEventTypeLabel() const {return m_EventTypeLabel;}
43
bool PostCodeSnippetsEvent(const CodeSnippetsEvent& event);
44
bool ProcessCodeSnippetsEvent(const CodeSnippetsEvent& event);
48
wxString m_SnippetString;
49
wxString m_EventTypeLabel;
52
typedef void (wxEvtHandler::*CodeSnippetsEventFunction)(CodeSnippetsEvent&);
54
BEGIN_DECLARE_EVENT_TYPES()
55
DECLARE_EXPORTED_EVENT_TYPE(WXEXPORT, wxEVT_CODESNIPPETS_SELECT, wxID_ANY)
56
DECLARE_EXPORTED_EVENT_TYPE(WXEXPORT, wxEVT_CODESNIPPETS_EDIT, wxID_ANY)
57
DECLARE_EXPORTED_EVENT_TYPE(WXEXPORT, wxEVT_CODESNIPPETS_NEW_INDEX, wxID_ANY)
58
DECLARE_EXPORTED_EVENT_TYPE(WXEXPORT, wxEVT_CODESNIPPETS_GETFILELINKS, wxID_ANY)
59
END_DECLARE_EVENT_TYPES()
61
#define EVT_CODESNIPPETS_SELECT(id, fn) \
62
DECLARE_EVENT_TABLE_ENTRY(wxEVT_CODESNIPPETS_SELECT, id, -1, \
63
(wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction) (CodeSnippetsEventFunction) & fn,(wxObject *) NULL ),
65
#define EVT_CODESNIPPETS_EDIT(id, fn) \
66
DECLARE_EVENT_TABLE_ENTRY(wxEVT_CODESNIPPETS_EDIT, id, -1, \
67
(wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction) (CodeSnippetsEventFunction) & fn,(wxObject *) NULL ),
69
#define EVT_CODESNIPPETS_NEW_INDEX(id, fn) \
70
DECLARE_EVENT_TABLE_ENTRY(wxEVT_CODESNIPPETS_NEW_INDEX, id, -1, \
71
(wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction) (CodeSnippetsEventFunction) & fn,(wxObject *) NULL ),
73
#define EVT_CODESNIPPETS_GETFILELINKS(id, fn) \
74
DECLARE_EVENT_TABLE_ENTRY(wxEVT_CODESNIPPETS_GETFILELINKS, id, -1, \
75
(wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction) (CodeSnippetsEventFunction) & fn,(wxObject *) NULL ),
77
#endif // CODESNIPPETS_EVENT_H