]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/fl/barhintspl.h
Added empty Clone method for cbPluginEvent
[wxWidgets.git] / contrib / include / wx / fl / barhintspl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: No names yet.
3 // Purpose: Contrib. demo
4 // Author: Aleksandras Gluchovas
5 // Modified by:
6 // Created: 30/11/98 (my 22th birthday :-)
7 // RCS-ID: $Id$
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __DRAGHINTSPL_G__
13 #define __DRAGHINTSPL_G__
14
15 #ifdef __GNUG__
16 #pragma interface "barhintspl.h"
17 #endif
18
19 #include "wx/fl/controlbar.h"
20 #include "wx/fl/toolwnd.h"
21
22 /*
23 * Intercepts bar-decoration and sizing events, draws 3d-hints
24 * around fixed and flexible bars, similar to those in Microsoft DevStudio 6.x
25 */
26
27 class cbBarHintsPlugin : public cbPluginBase
28 {
29 DECLARE_DYNAMIC_CLASS( cbBarHintsPlugin )
30
31 protected:
32 cbDockPane* mpPane; // is set up temorarely, while handling event
33
34 cbMiniButton* mBoxes[2];
35
36 bool mBtnPressed;
37 bool mClosePressed;
38 cbBarInfo* mpClickedBar;
39 bool mDepressed;
40
41 protected:
42 // drawing helpers
43
44 void Draw3DBox ( wxDC& dc, const wxPoint& pos, bool pressed );
45 void DrawCloseBox ( wxDC& dc, const wxPoint& pos, bool pressed );
46 void DrawCollapseBox( wxDC& dc, const wxPoint& pos,
47 bool atLeft, bool disabled, bool pressed );
48
49 void DrawGrooves ( wxDC& dc, const wxPoint& pos, int length );
50
51 void DoDrawHint( wxDC& dc, wxRect& rect, int pos, int boxOfs, int grooveOfs, bool isFixed );
52
53 void GetHintsLayout( wxRect& rect, cbBarInfo& info,
54 int& boxOfs, int& grooveOfs, int& pos );
55
56 int HitTestHints( cbBarInfo& info, const wxPoint& pos );
57
58 void ExcludeHints( wxRect& rect, cbBarInfo& info );
59
60 void CreateBoxes();
61
62 public:
63 /* public properties */
64
65 bool mCloseBoxOn; // default: ON
66 bool mCollapseBoxOn; // default: ON
67 int mGrooveCount; // default: 2 (two shaded bars)
68 int mHintGap; // default: 5 (pixels from above, below, right and left)
69 int mXWeight; // default: 2 (width in pixels of lines which used for drawing cross)
70
71 public:
72
73 cbBarHintsPlugin(void);
74
75 cbBarHintsPlugin( wxFrameLayout* pLayout, int paneMask = wxALL_PANES );
76
77 ~cbBarHintsPlugin();
78
79 void SetGrooveCount( int nGrooves );
80
81 void OnInitPlugin();
82
83 // handlers of plugin-events
84
85 void OnSizeBarWindow( cbSizeBarWndEvent& event );
86 void OnDrawBarDecorations( cbDrawBarDecorEvent& event );
87
88 void OnLeftDown( cbLeftDownEvent& event );
89 void OnLeftUp ( cbLeftUpEvent& event );
90 void OnMotion ( cbMotionEvent& event );
91
92 DECLARE_EVENT_TABLE()
93 };
94
95 #endif /* __DRAGHINTSPL_G__ */
96