~ubuntu-branches/ubuntu/hardy/codeblocks/hardy-backports

« back to all changes in this revision

Viewing changes to src/plugins/contrib/wxSmith/wxwidgets/wxstoolspace.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* This file is part of wxSmith plugin for Code::Blocks Studio
 
3
* Copyright (C) 2006-2007  Bartlomiej Swiecki
 
4
*
 
5
* wxSmith is free software; you can redistribute it and/or modify
 
6
* it under the terms of the GNU General Public License as published by
 
7
* the Free Software Foundation; either version 3 of the License, or
 
8
* (at your option) any later version.
 
9
*
 
10
* wxSmith is distributed in the hope that it will be useful,
 
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
13
* GNU General Public License for more details.
 
14
*
 
15
* You should have received a copy of the GNU General Public License
 
16
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
 
17
*
 
18
* $Revision: 4850 $
 
19
* $Id: wxstoolspace.h 4850 2008-01-29 21:45:49Z byo $
 
20
* $HeadURL: svn://svn.berlios.de/codeblocks/tags/8.02/src/plugins/contrib/wxSmith/wxwidgets/wxstoolspace.h $
 
21
*/
 
22
 
 
23
#ifndef WXSTOOLSPACE_H
 
24
#define WXSTOOLSPACE_H
 
25
 
 
26
#include <wx/scrolwin.h>
 
27
 
 
28
class wxsItemResData;
 
29
class wxsTool;
 
30
 
 
31
/** \brief This class represents extra tools space in editor allowing to edit tools */
 
32
class wxsToolSpace: public wxScrolledWindow
 
33
{
 
34
    public:
 
35
 
 
36
        /** \brief Ctor */
 
37
        wxsToolSpace(wxWindow* Parent,wxsItemResData* Data);
 
38
 
 
39
        /** \brief Dctor */
 
40
        virtual ~wxsToolSpace();
 
41
 
 
42
        /** \brief Function shiwch must be called before changing preview */
 
43
        void BeforePreviewChanged();
 
44
 
 
45
        /** \brief Function which must be called after changing preview */
 
46
        void AfterPreviewChanged();
 
47
 
 
48
        /** \brief Function refreshing current selection (calculating new positions) */
 
49
        void RefreshSelection();
 
50
 
 
51
        /** \brief Checking whether there are any tools inside this resource */
 
52
        inline bool AreAnyTools() { return m_First!=0; }
 
53
 
 
54
    private:
 
55
 
 
56
        struct Entry;
 
57
 
 
58
        /** \brief Custom paint handler */
 
59
        void OnPaint(wxPaintEvent& event);
 
60
 
 
61
        /** \brief Custom mouse click event */
 
62
        void OnMouseClick(wxMouseEvent& event);
 
63
 
 
64
        /** \brief Custom mouse double-click event */
 
65
        void OnMouseDClick(wxMouseEvent& event);
 
66
 
 
67
        /** \brief Custom right click event */
 
68
        void OnMouseRight(wxMouseEvent& event);
 
69
 
 
70
        /** \brief Any mouse event */
 
71
        void OnMouse(wxMouseEvent& event);
 
72
 
 
73
        /** \brief Custom key down event */
 
74
        void OnKeyDown(wxKeyEvent& event);
 
75
 
 
76
        /** \brief Recalculating virtual space required by this window */
 
77
        void RecalculateVirtualSize();
 
78
 
 
79
        /** \brief Searching for tool entry at given position */
 
80
        Entry* FindEntry(int& PosX,int& PosY);
 
81
 
 
82
        /** \brief Entry for each tool in resource */
 
83
        struct Entry
 
84
        {
 
85
            wxsTool* m_Tool;
 
86
            Entry*   m_Next;
 
87
        };
 
88
 
 
89
        Entry*          m_First;        ///< \brief First tool in resource
 
90
        int             m_Count;        ///< \brief Number of enteries
 
91
        wxsItemResData* m_Data;         ///< \brief Resource's data
 
92
        bool            m_Unstable;     ///< \brief True between BeforePreviewChanged and AfterPreviewChanged to prevent some rare seg faults
 
93
 
 
94
        DECLARE_EVENT_TABLE()
 
95
};
 
96
 
 
97
 
 
98
 
 
99
#endif