]>
git.saurik.com Git - wxWidgets.git/blob - utils/framelayout/src/barhintspl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Contrib. demo
4 // Author: Aleksandras Gluchovas
6 // Created: 30/11/98 (my 22th birthday :-)
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __DRAGHINTSPL_G__
13 #define __DRAGHINTSPL_G__
15 #include "controlbar.h"
19 * Intercepts bar-decoration and sizing events, draws 3d-hints
20 * around fixed and flexible bars, similar to those in Microsoft DevStudio 6.x
23 class 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
;
40 void Draw3DBox ( wxDC
& dc
, const wxPoint
& pos
, bool pressed
);
41 void DrawCloseBox ( wxDC
& dc
, const wxPoint
& pos
, bool pressed
);
42 void DrawCollapseBox( wxDC
& dc
, const wxPoint
& pos
,
43 bool atLeft
, bool disabled
, bool pressed
);
45 void DrawGrooves ( wxDC
& dc
, const wxPoint
& pos
, int length
);
47 void DoDrawHint( wxDC
& dc
, wxRect
& rect
, int pos
, int boxOfs
, int grooveOfs
, bool isFixed
);
49 void GetHintsLayout( wxRect
& rect
, cbBarInfo
& info
,
50 int& boxOfs
, int& grooveOfs
, int& pos
);
52 int HitTestHints( cbBarInfo
& info
, const wxPoint
& pos
);
54 void ExcludeHints( wxRect
& rect
, cbBarInfo
& info
);
59 /* public properties */
61 bool mCloseBoxOn
; // default: ON
62 bool mCollapseBoxOn
; // default: ON
63 int mGrooveCount
; // default: 2 (two shaded bars)
64 int mHintGap
; // default: 5 (pixels from above, below, right and left)
65 int mXWeight
; // default: 2 (width in pixels of lines which used for drawing cross)
69 cbBarHintsPlugin(void);
71 cbBarHintsPlugin( wxFrameLayout
* pLayout
, int paneMask
= wxALL_PANES
);
73 void SetGrooveCount( int nGrooves
);
77 // handlers of plugin-events
79 void OnSizeBarWindow( cbSizeBarWndEvent
& event
);
80 void OnDrawBarDecorations( cbDrawBarDecorEvent
& event
);
82 void OnLeftDown( cbLeftDownEvent
& event
);
83 void OnLeftUp ( cbLeftUpEvent
& event
);
84 void OnMotion ( cbMotionEvent
& event
);