1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: cbBarHintsPlugin class declaration
4 // Author: Aleksandras Gluchovas
6 // Created: 30/11/98 (my 22th birthday :-)
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __DRAGHINTSPL_G__
13 #define __DRAGHINTSPL_G__
15 #include "wx/fl/controlbar.h"
16 #include "wx/fl/toolwnd.h"
19 This class intercepts bar-decoration and sizing events, and draws 3D hints
20 around fixed and flexible bars, similar to those in Microsoft DevStudio 6.x
23 class WXDLLIMPEXP_FL cbBarHintsPlugin
: public cbPluginBase
25 DECLARE_DYNAMIC_CLASS( cbBarHintsPlugin
)
28 cbDockPane
* mpPane
; // is set up temorarely, while handling event
30 cbMiniButton
* mBoxes
[2];
34 cbBarInfo
* mpClickedBar
;
38 // Helper function: draws a 3D box.
39 void Draw3DBox ( wxDC
& dc
, const wxPoint
& pos
, bool pressed
);
41 // Helper function: draws a close box.
42 void DrawCloseBox ( wxDC
& dc
, const wxPoint
& pos
, bool pressed
);
44 // Helper function: draws a collapse box.
45 void DrawCollapseBox( wxDC
& dc
, const wxPoint
& pos
,
46 bool atLeft
, bool disabled
, bool pressed
);
48 // Helper function: draws grooves.
49 void DrawGrooves ( wxDC
& dc
, const wxPoint
& pos
, int length
);
51 // Helper function: draws a hint.
52 void DoDrawHint( wxDC
& dc
, wxRect
& rect
, int pos
, int boxOfs
, int grooveOfs
, bool isFixed
);
54 // Helper function: gets the layout of a hint.
55 void GetHintsLayout( wxRect
& rect
, cbBarInfo
& info
,
56 int& boxOfs
, int& grooveOfs
, int& pos
);
58 // Helper function: returns information about the hint under the given position.
59 int HitTestHints( cbBarInfo
& info
, const wxPoint
& pos
);
62 void ExcludeHints( wxRect
& rect
, cbBarInfo
& info
);
64 // Helper function: creates close and collapse boxes.
68 /* public properties */
70 bool mCloseBoxOn
; // default: ON
71 bool mCollapseBoxOn
; // default: ON
72 int mGrooveCount
; // default: 2 (two shaded bars)
73 int mHintGap
; // default: 5 (pixels from above, below, right and left)
74 int mXWeight
; // default: 2 (width in pixels of lines which used for drawing cross)
77 // Default constructor.
78 cbBarHintsPlugin(void);
80 // Constructor, taking parent frame and pane mask flag.
81 cbBarHintsPlugin( wxFrameLayout
* pLayout
, int paneMask
= wxALL_PANES
);
86 // Set the number of grooves to be shown in the pane.
87 void SetGrooveCount( int nGrooves
);
89 // Called to initialize this plugin.
92 // Handles a plugin event.
93 void OnSizeBarWindow( cbSizeBarWndEvent
& event
);
95 // Handles a plugin event.
96 void OnDrawBarDecorations( cbDrawBarDecorEvent
& event
);
98 // Handles a plugin event.
99 void OnLeftDown( cbLeftDownEvent
& event
);
101 // Handles a plugin event.
102 void OnLeftUp ( cbLeftUpEvent
& event
);
104 // Handles a plugin event.
105 void OnMotion ( cbMotionEvent
& event
);
107 DECLARE_EVENT_TABLE()
110 #endif /* __DRAGHINTSPL_G__ */