]>
Commit | Line | Data |
---|---|---|
8e08b761 | 1 | ///////////////////////////////////////////////////////////////////////////// |
e598303a JS |
2 | // Name: barhintspl.h |
3 | // Purpose: cbBarHintsPlugin class declaration | |
8e08b761 JS |
4 | // Author: Aleksandras Gluchovas |
5 | // Modified by: | |
6 | // Created: 30/11/98 (my 22th birthday :-) | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Aleksandras Gluchovas | |
4cbc57f0 | 9 | // Licence: wxWindows licence |
8e08b761 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef __DRAGHINTSPL_G__ | |
13 | #define __DRAGHINTSPL_G__ | |
14 | ||
ab7ce33c | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
8e08b761 JS |
16 | #pragma interface "barhintspl.h" |
17 | #endif | |
18 | ||
19 | #include "wx/fl/controlbar.h" | |
20 | #include "wx/fl/toolwnd.h" | |
21 | ||
22 | /* | |
e598303a JS |
23 | This class intercepts bar-decoration and sizing events, and draws 3D hints |
24 | around fixed and flexible bars, similar to those in Microsoft DevStudio 6.x | |
25 | */ | |
8e08b761 JS |
26 | |
27 | class cbBarHintsPlugin : public cbPluginBase | |
28 | { | |
4cbc57f0 | 29 | DECLARE_DYNAMIC_CLASS( cbBarHintsPlugin ) |
8e08b761 JS |
30 | |
31 | protected: | |
4cbc57f0 | 32 | cbDockPane* mpPane; // is set up temorarely, while handling event |
8e08b761 | 33 | |
4cbc57f0 | 34 | cbMiniButton* mBoxes[2]; |
8e08b761 | 35 | |
4cbc57f0 JS |
36 | bool mBtnPressed; |
37 | bool mClosePressed; | |
38 | cbBarInfo* mpClickedBar; | |
39 | bool mDepressed; | |
8e08b761 JS |
40 | |
41 | protected: | |
4cbc57f0 JS |
42 | // Helper function: draws a 3D box. |
43 | void Draw3DBox ( wxDC& dc, const wxPoint& pos, bool pressed ); | |
e598303a | 44 | |
4cbc57f0 JS |
45 | // Helper function: draws a close box. |
46 | void DrawCloseBox ( wxDC& dc, const wxPoint& pos, bool pressed ); | |
e598303a | 47 | |
4cbc57f0 JS |
48 | // Helper function: draws a collapse box. |
49 | void DrawCollapseBox( wxDC& dc, const wxPoint& pos, | |
50 | bool atLeft, bool disabled, bool pressed ); | |
8e08b761 | 51 | |
4cbc57f0 JS |
52 | // Helper function: draws grooves. |
53 | void DrawGrooves ( wxDC& dc, const wxPoint& pos, int length ); | |
8e08b761 | 54 | |
4cbc57f0 JS |
55 | // Helper function: draws a hint. |
56 | void DoDrawHint( wxDC& dc, wxRect& rect, int pos, int boxOfs, int grooveOfs, bool isFixed ); | |
8e08b761 | 57 | |
4cbc57f0 JS |
58 | // Helper function: gets the layout of a hint. |
59 | void GetHintsLayout( wxRect& rect, cbBarInfo& info, | |
60 | int& boxOfs, int& grooveOfs, int& pos ); | |
8e08b761 | 61 | |
4cbc57f0 JS |
62 | // Helper function: returns information about the hint under the given position. |
63 | int HitTestHints( cbBarInfo& info, const wxPoint& pos ); | |
8e08b761 | 64 | |
4cbc57f0 JS |
65 | // Helper function. |
66 | void ExcludeHints( wxRect& rect, cbBarInfo& info ); | |
67 | ||
68 | // Helper function: creates close and collapse boxes. | |
69 | void CreateBoxes(); | |
8e08b761 JS |
70 | |
71 | public: | |
4cbc57f0 | 72 | /* public properties */ |
8e08b761 | 73 | |
4cbc57f0 JS |
74 | bool mCloseBoxOn; // default: ON |
75 | bool mCollapseBoxOn; // default: ON | |
76 | int mGrooveCount; // default: 2 (two shaded bars) | |
77 | int mHintGap; // default: 5 (pixels from above, below, right and left) | |
78 | int mXWeight; // default: 2 (width in pixels of lines which used for drawing cross) | |
8e08b761 JS |
79 | |
80 | public: | |
4cbc57f0 JS |
81 | // Default constructor. |
82 | cbBarHintsPlugin(void); | |
8e08b761 | 83 | |
4cbc57f0 JS |
84 | // Constructor, taking parent frame and pane mask flag. |
85 | cbBarHintsPlugin( wxFrameLayout* pLayout, int paneMask = wxALL_PANES ); | |
8e08b761 | 86 | |
4cbc57f0 | 87 | // Destructor. |
8e08b761 JS |
88 | ~cbBarHintsPlugin(); |
89 | ||
4cbc57f0 JS |
90 | // Set the number of grooves to be shown in the pane. |
91 | void SetGrooveCount( int nGrooves ); | |
8e08b761 | 92 | |
4cbc57f0 JS |
93 | // Called to initialize this plugin. |
94 | void OnInitPlugin(); | |
8e08b761 | 95 | |
4cbc57f0 JS |
96 | // Handles a plugin event. |
97 | void OnSizeBarWindow( cbSizeBarWndEvent& event ); | |
e598303a | 98 | |
4cbc57f0 JS |
99 | // Handles a plugin event. |
100 | void OnDrawBarDecorations( cbDrawBarDecorEvent& event ); | |
8e08b761 | 101 | |
4cbc57f0 JS |
102 | // Handles a plugin event. |
103 | void OnLeftDown( cbLeftDownEvent& event ); | |
e598303a | 104 | |
4cbc57f0 JS |
105 | // Handles a plugin event. |
106 | void OnLeftUp ( cbLeftUpEvent& event ); | |
e598303a | 107 | |
4cbc57f0 JS |
108 | // Handles a plugin event. |
109 | void OnMotion ( cbMotionEvent& event ); | |
8e08b761 | 110 | |
4cbc57f0 | 111 | DECLARE_EVENT_TABLE() |
8e08b761 JS |
112 | }; |
113 | ||
114 | #endif /* __DRAGHINTSPL_G__ */ | |
115 |