]>
git.saurik.com Git - wxWidgets.git/blob - utils/framelayout/src/panedrawpl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Central header file for control-bar related classes
5 // Author: Aleksandras Gluchovas <mailto:alex@soften.ktu.lt>
9 // Copyright: (c) Aleksandras Gluchovas
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef __PANEDRAWPL_G__
14 #define __PANEDRAWPL_G__
17 #pragma interface "panedrawpl.h"
20 #include "controlbar.h"
23 * Simple, but all-in-one plugin implementation. Resembles look & feel of
24 * to MFC control-bars. Handles painting of pane and items in it.
25 * Fires bar/layout customization event, when user right-clicks bar/pane.
26 * Hooking an instance of this and row-layouting plugins per each pane,
27 * would be enough for the frame layout to function properly.
28 * (they are plugged in autimatically by wxFrameLayout class)
31 class cbPaneDrawPlugin
: public cbPluginBase
34 DECLARE_DYNAMIC_CLASS( cbPaneDrawPlugin
)
37 // resizing bars/rows state variables
42 bool mRowHandleHitted
;
44 bool mBarHandleHitted
;
46 bool mBarContentHitted
;
48 cbBarInfo
* mpDraggedBar
; // also used when in bar-drag action
49 cbRowInfo
* mpResizedRow
;
51 // contstraints for dragging the handle
52 wxRect mHandleDragArea
;
53 bool mHandleIsVertical
;
58 // used for handling, start-draw-in-area events
61 cbDockPane
* mpPane
; // is set up temorary short-cut, while handling event
65 void DrawDraggedHandle( const wxPoint
& pos
, cbDockPane
& pane
);
67 virtual void DrawPaneShade( wxDC
& dc
, int alignment
);
68 virtual void DrawPaneShadeForRow( cbRowInfo
* pRow
, wxDC
& dc
);
70 virtual void DrawUpperRowHandle( cbRowInfo
* pRow
, wxDC
& dc
);
71 virtual void DrawLowerRowHandle( cbRowInfo
* pRow
, wxDC
& dc
);
73 virtual void DrawUpperRowShades( cbRowInfo
* pRow
, wxDC
& dc
, int level
);
74 virtual void DrawLowerRowShades( cbRowInfo
* pRow
, wxDC
& dc
, int level
);
76 virtual void DrawBarInnerShadeRect( cbBarInfo
* pBar
, wxDC
& dc
);
78 virtual void DrawShade( int level
, wxRect
& rect
, int alignment
, wxDC
& dc
);
79 virtual void DrawShade1( int level
, wxRect
& rect
, int alignment
, wxDC
& dc
);
81 inline void SetLightPixel( int x
, int y
, wxDC
& dc
);
82 inline void SetDarkPixel ( int x
, int y
, wxDC
& dc
);
85 cbPaneDrawPlugin(void);
87 cbPaneDrawPlugin( wxFrameLayout
* pPanel
, int paneMask
= wxALL_PANES
);
89 virtual ~cbPaneDrawPlugin();
91 virtual cbPluginBase
* Clone() { return new cbPaneDrawPlugin(0,0); }
93 // handlers for plugin-events
95 void OnLButtonDown( cbLeftDownEvent
& event
);
96 void OnLDblClick ( cbLeftDClickEvent
& event
);
97 void OnLButtonUp ( cbLeftUpEvent
& event
);
98 void OnRButtonUp ( cbRightUpEvent
& event
);
99 void OnMouseMove ( cbMotionEvent
& event
);
101 void OnDrawPaneBackground ( cbDrawPaneBkGroundEvent
& event
);
102 void OnDrawPaneDecorations( cbDrawPaneDecorEvent
& event
);
104 void OnDrawRowDecorations ( cbDrawRowDecorEvent
& event
);
105 void OnDrawRowHandles ( cbDrawRowHandlesEvent
& event
);
106 void OnDrawRowBackground ( cbDrawRowBkGroundEvent
& event
);
108 void OnSizeBarWindow ( cbSizeBarWndEvent
& event
);
109 void OnDrawBarDecorations ( cbDrawBarDecorEvent
& event
);
110 void OnDrawBarHandles ( cbDrawBarHandlesEvent
& event
);
112 void OnStartDrawInArea ( cbStartDrawInAreaEvent
& event
);
113 void OnFinishDrawInArea ( cbFinishDrawInAreaEvent
& event
);
115 DECLARE_EVENT_TABLE()