~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/contrib/dragscroll/dragscrollevent.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************
 
2
 * Name:      DragScrollEvent
 
3
 *
 
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.
 
9
 *
 
10
 * Created:   2008/04/23
 
11
 * Copyright: Pecan
 
12
 * License:   GPL
 
13
 **************************************************************/
 
14
 
 
15
 #include "dragscrollevent.h"
 
16
 #include "dragscroll.h"
 
17
 
 
18
IMPLEMENT_DYNAMIC_CLASS(DragScrollEvent, wxCommandEvent)
 
19
 
 
20
const wxEventType wxEVT_DRAGSCROLL_EVENT = wxNewEventType();
 
21
 
 
22
// ----------------------------------------------------------------------------
 
23
DragScrollEvent::DragScrollEvent(wxEventType commandType, int id)
 
24
// ----------------------------------------------------------------------------
 
25
                                         :wxCommandEvent(commandType, id)
 
26
{
 
27
    //ctor
 
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");
 
40
}
 
41
// -- clone -------------------------------------------------------------------
 
42
DragScrollEvent::DragScrollEvent( const DragScrollEvent& Event)
 
43
// ----------------------------------------------------------------------------
 
44
                                  :wxCommandEvent(Event)
 
45
                                  //-,m_WindowID(0)
 
46
                                  //-,m_pWindow(0)
 
47
{
 
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();
 
51
}
 
52
// ----------------------------------------------------------------------------
 
53
DragScrollEvent::~DragScrollEvent()
 
54
// ----------------------------------------------------------------------------
 
55
{
 
56
    //dtor
 
57
}
 
58
// ----------------------------------------------------------------------------
 
59
bool DragScrollEvent::PostDragScrollEvent(const cbPlugin* targetWin)
 
60
// ----------------------------------------------------------------------------
 
61
{
 
62
    // Propagate DragScrollEvent to ThreadSearchFrame
 
63
 
 
64
    cbPlugin* pPlgn = (cbPlugin*)targetWin;
 
65
    if ( not targetWin )
 
66
        pPlgn = Manager::Get()->GetPluginManager()->FindPluginByName(_T("cbDragScroll"));
 
67
    //cbPlugin* pPlgn = GetConfig()->GetDragScrollPlugin();
 
68
 
 
69
    // Propagate the event to DragScroll plugin
 
70
    if ( pPlgn )
 
71
    {
 
72
        pPlgn->AddPendingEvent( (wxEvent&)*this );
 
73
    }
 
74
    else
 
75
    {
 
76
        #if defined(LOGGING)
 
77
        LOGIT( _T("PostDragScrollEvent[%s]"), _T("Failed"));
 
78
        #endif
 
79
        return false;
 
80
    }
 
81
 
 
82
    return true;
 
83
 
 
84
}//PostDragScrollEvent
 
85
// ----------------------------------------------------------------------------
 
86
bool DragScrollEvent::ProcessDragScrollEvent(const cbPlugin* targetWin)
 
87
// ----------------------------------------------------------------------------
 
88
{
 
89
    // Propagate DragScrollEvent
 
90
 
 
91
 
 
92
    cbPlugin* pPlgn = (cbPlugin*)targetWin;
 
93
    if ( not targetWin )
 
94
        pPlgn = Manager::Get()->GetPluginManager()->FindPluginByName(_T("cbDragScroll"));
 
95
 
 
96
    // Propagate the event to DragScroll plugin
 
97
    if ( pPlgn )
 
98
    {
 
99
        pPlgn->ProcessEvent( (wxEvent&)*this );
 
100
    }
 
101
    else
 
102
    {
 
103
        #if defined(LOGGING)
 
104
        LOGIT( _T("ProcessDragScrollEvent[%s]"), _T("Failed"));
 
105
        #endif
 
106
        return false;
 
107
    }
 
108
 
 
109
    return true;
 
110
 
 
111
}//PostDragScrollEvent