~ubuntu-branches/ubuntu/oneiric/codelite/oneiric

« back to all changes in this revision

Viewing changes to Plugin/cl_aui_notebook_art.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-04-09 02:03:19 UTC
  • mfrom: (0.1.3 sid) (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100409020319-302693n3vroavxwe
Tags: 2.5.2.4031~dfsg-1
* New upstream release.
* Refresh patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef CLAUI_TAB_ART_H
 
2
#define CLAUI_TAB_ART_H
 
3
 
 
4
#include <wx/aui/auibook.h>
 
5
#include <wx/pen.h>
 
6
 
 
7
// -- GUI helper classes and functions --
 
8
 
 
9
class wxAuiCommandCapture : public wxEvtHandler
 
10
{
 
11
public:
 
12
 
 
13
    wxAuiCommandCapture() { m_last_id = 0; }
 
14
    int GetCommandId() const { return m_last_id; }
 
15
 
 
16
    bool ProcessEvent(wxEvent& evt)
 
17
    {
 
18
        if (evt.GetEventType() == wxEVT_COMMAND_MENU_SELECTED)
 
19
        {
 
20
            m_last_id = evt.GetId();
 
21
            return true;
 
22
        }
 
23
 
 
24
        if (GetNextHandler())
 
25
            return GetNextHandler()->ProcessEvent(evt);
 
26
 
 
27
        return false;
 
28
    }
 
29
 
 
30
private:
 
31
    int m_last_id;
 
32
};
 
33
 
 
34
class clAuiTabArt : public wxAuiTabArt
 
35
{
 
36
 
 
37
public:
 
38
 
 
39
    clAuiTabArt();
 
40
    virtual ~clAuiTabArt();
 
41
 
 
42
    wxAuiTabArt* Clone();
 
43
    void SetFlags(unsigned int flags);
 
44
    void SetSizingInfo(const wxSize& tab_ctrl_size,
 
45
                       size_t tab_count);
 
46
 
 
47
    void SetNormalFont(const wxFont& font);
 
48
    void SetSelectedFont(const wxFont& font);
 
49
    void SetMeasuringFont(const wxFont& font);
 
50
 
 
51
    void DrawBackground(
 
52
                 wxDC& dc,
 
53
                 wxWindow* wnd,
 
54
                 const wxRect& rect);
 
55
 
 
56
    void DrawTab(wxDC& dc,
 
57
                 wxWindow* wnd,
 
58
                 const wxAuiNotebookPage& pane,
 
59
                 const wxRect& in_rect,
 
60
                 int close_button_state,
 
61
                 wxRect* out_tab_rect,
 
62
                 wxRect* out_button_rect,
 
63
                 int* x_extent);
 
64
 
 
65
    void DrawButton(
 
66
                 wxDC& dc,
 
67
                 wxWindow* wnd,
 
68
                 const wxRect& in_rect,
 
69
                 int bitmap_id,
 
70
                 int button_state,
 
71
                 int orientation,
 
72
                 wxRect* out_rect);
 
73
 
 
74
    int GetIndentSize();
 
75
 
 
76
    wxSize GetTabSize(
 
77
                 wxDC& dc,
 
78
                 wxWindow* wnd,
 
79
                 const wxString& caption,
 
80
                 const wxBitmap& bitmap,
 
81
                 bool active,
 
82
                 int close_button_state,
 
83
                 int* x_extent);
 
84
 
 
85
    int ShowDropDown(
 
86
                 wxWindow* wnd,
 
87
                 const wxAuiNotebookPageArray& items,
 
88
                 int active_idx);
 
89
 
 
90
    int GetBestTabCtrlSize(wxWindow* wnd,
 
91
                 const wxAuiNotebookPageArray& pages,
 
92
                 const wxSize& required_bmp_size);
 
93
 
 
94
protected:
 
95
 
 
96
    wxFont m_normal_font;
 
97
    wxFont m_selected_font;
 
98
    wxFont m_measuring_font;
 
99
    wxColour m_base_colour;
 
100
        // Light colours by %
 
101
    wxColour m_base_colour_2;
 
102
    wxColour m_base_colour_3;
 
103
    wxColour m_base_colour_4;
 
104
        
 
105
    wxPen m_base_colour_pen;
 
106
    wxPen m_border_pen;
 
107
    wxBrush m_base_colour_brush;
 
108
    wxBitmap m_active_close_bmp;
 
109
    wxBitmap m_disabled_close_bmp;
 
110
    wxBitmap m_active_left_bmp;
 
111
    wxBitmap m_disabled_left_bmp;
 
112
    wxBitmap m_active_right_bmp;
 
113
    wxBitmap m_disabled_right_bmp;
 
114
    wxBitmap m_active_windowlist_bmp;
 
115
    wxBitmap m_disabled_windowlist_bmp;
 
116
 
 
117
    int m_fixed_tab_width;
 
118
    int m_tab_ctrl_height;
 
119
    unsigned int m_flags;
 
120
};
 
121
 
 
122
#endif // CLAUI_TAB_ART_H
 
123
 
 
124