1
/***************************************************************
2
* Name: DragScrollEvent
4
* Purpose: This class implements the events sent by/for a
5
* DragScroll request to the
6
* DragScroll plugin for services such as
7
* add/remove scrollable windows.
8
* wxCommandEvent m_id contains a window id.
13
**************************************************************/
15
#include "dragscrollevent.h"
16
#include "dragscroll.h"
18
IMPLEMENT_DYNAMIC_CLASS(DragScrollEvent, wxCommandEvent)
20
const wxEventType wxEVT_DRAGSCROLL_EVENT = wxNewEventType();
22
// ----------------------------------------------------------------------------
23
DragScrollEvent::DragScrollEvent(wxEventType commandType, int id)
24
// ----------------------------------------------------------------------------
25
:wxCommandEvent(commandType, id)
28
//-m_propagationLevel = wxEVENT_PROPAGATE_MAX ;
29
m_EventTypeLabel = _T("UNKOWN");
30
if ( idDragScrollAddWindow == id)
31
m_EventTypeLabel = _T("EVT_DRAGSCROLL_ADD_WINDOW");
32
if ( idDragScrollRemoveWindow == id)
33
m_EventTypeLabel = _T("EVT_DRAGSCROLL_REMOVE_WINDOW");
34
if ( idDragScrollRescan == id)
35
m_EventTypeLabel = _T("EVT_DRAGSCROLL_RESCAN");
36
if ( idDragScrollReadConfig == id)
37
m_EventTypeLabel = _T("EVT_DRAGSCROLL_READ_CONFIG");
38
if ( idDragScrollInvokeConfig == id)
39
m_EventTypeLabel = _T("EVT_DRAGSCROLL_INVOKE_CONFIG");
41
// -- clone -------------------------------------------------------------------
42
DragScrollEvent::DragScrollEvent( const DragScrollEvent& Event)
43
// ----------------------------------------------------------------------------
44
:wxCommandEvent(Event)
48
// This is invoked by DragScrollEvent::Clone() from AddPendingEvent etc
49
// Copy any fields necessary to the cloned event, eg.
50
m_EventTypeLabel = Event.GetEventTypeLabel();
52
// ----------------------------------------------------------------------------
53
DragScrollEvent::~DragScrollEvent()
54
// ----------------------------------------------------------------------------
58
// ----------------------------------------------------------------------------
59
bool DragScrollEvent::PostDragScrollEvent(const cbPlugin* targetWin)
60
// ----------------------------------------------------------------------------
62
// Propagate DragScrollEvent to ThreadSearchFrame
64
cbPlugin* pPlgn = (cbPlugin*)targetWin;
66
pPlgn = Manager::Get()->GetPluginManager()->FindPluginByName(_T("cbDragScroll"));
67
//cbPlugin* pPlgn = GetConfig()->GetDragScrollPlugin();
69
// Propagate the event to DragScroll plugin
72
pPlgn->AddPendingEvent( (wxEvent&)*this );
77
LOGIT( _T("PostDragScrollEvent[%s]"), _T("Failed"));
84
}//PostDragScrollEvent
85
// ----------------------------------------------------------------------------
86
bool DragScrollEvent::ProcessDragScrollEvent(const cbPlugin* targetWin)
87
// ----------------------------------------------------------------------------
89
// Propagate DragScrollEvent
92
cbPlugin* pPlgn = (cbPlugin*)targetWin;
94
pPlgn = Manager::Get()->GetPluginManager()->FindPluginByName(_T("cbDragScroll"));
96
// Propagate the event to DragScroll plugin
99
pPlgn->ProcessEvent( (wxEvent&)*this );
104
LOGIT( _T("ProcessDragScrollEvent[%s]"), _T("Failed"));
111
}//PostDragScrollEvent