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 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "barhintspl.h"
19 #include "wx/fl/controlbar.h"
20 #include "wx/fl/toolwnd.h"
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
27 class WXDLLIMPEXP_FL cbBarHintsPlugin
: public cbPluginBase
29 DECLARE_DYNAMIC_CLASS( cbBarHintsPlugin
)
32 cbDockPane
* mpPane
; // is set up temorarely, while handling event
34 cbMiniButton
* mBoxes
[2];
38 cbBarInfo
* mpClickedBar
;
42 // Helper function: draws a 3D box.
43 void Draw3DBox ( wxDC
& dc
, const wxPoint
& pos
, bool pressed
);
45 // Helper function: draws a close box.
46 void DrawCloseBox ( wxDC
& dc
, const wxPoint
& pos
, bool pressed
);
48 // Helper function: draws a collapse box.
49 void DrawCollapseBox( wxDC
& dc
, const wxPoint
& pos
,
50 bool atLeft
, bool disabled
, bool pressed
);
52 // Helper function: draws grooves.
53 void DrawGrooves ( wxDC
& dc
, const wxPoint
& pos
, int length
);
55 // Helper function: draws a hint.
56 void DoDrawHint( wxDC
& dc
, wxRect
& rect
, int pos
, int boxOfs
, int grooveOfs
, bool isFixed
);
58 // Helper function: gets the layout of a hint.
59 void GetHintsLayout( wxRect
& rect
, cbBarInfo
& info
,
60 int& boxOfs
, int& grooveOfs
, int& pos
);
62 // Helper function: returns information about the hint under the given position.
63 int HitTestHints( cbBarInfo
& info
, const wxPoint
& pos
);
66 void ExcludeHints( wxRect
& rect
, cbBarInfo
& info
);
68 // Helper function: creates close and collapse boxes.
72 /* public properties */
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)
81 // Default constructor.
82 cbBarHintsPlugin(void);
84 // Constructor, taking parent frame and pane mask flag.
85 cbBarHintsPlugin( wxFrameLayout
* pLayout
, int paneMask
= wxALL_PANES
);
90 // Set the number of grooves to be shown in the pane.
91 void SetGrooveCount( int nGrooves
);
93 // Called to initialize this plugin.
96 // Handles a plugin event.
97 void OnSizeBarWindow( cbSizeBarWndEvent
& event
);
99 // Handles a plugin event.
100 void OnDrawBarDecorations( cbDrawBarDecorEvent
& event
);
102 // Handles a plugin event.
103 void OnLeftDown( cbLeftDownEvent
& event
);
105 // Handles a plugin event.
106 void OnLeftUp ( cbLeftUpEvent
& event
);
108 // Handles a plugin event.
109 void OnMotion ( cbMotionEvent
& event
);
111 DECLARE_EVENT_TABLE()
114 #endif /* __DRAGHINTSPL_G__ */