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 __CONTROLBAR_G__
14 #define __CONTROLBAR_G__
17 #pragma interface "controlbar.h"
21 #include "wx/string.h"
22 #include "wx/window.h"
23 #include "wx/dynarray.h"
25 #define WXCONTROLBAR_VERSION 1.3
27 // forward declarations
32 class cbUpdatesManagerBase
;
33 class cbBarDimHandlerBase
;
36 class cbPaneDrawPlugin
;
41 class cbCommonPaneProperties
;
43 typedef cbBarInfo
* BarInfoPtrT
;
44 typedef cbRowInfo
* RowInfoPtrT
;
46 WX_DEFINE_ARRAY( BarInfoPtrT
, BarArrayT
);
47 WX_DEFINE_ARRAY( RowInfoPtrT
, RowArrayT
);
51 #define wxCBAR_DOCKED_HORIZONTALLY 0
52 #define wxCBAR_DOCKED_VERTICALLY 1
53 #define wxCBAR_FLOATING 2
54 #define wxCBAR_HIDDEN 3
56 // the states are enumerated above
57 #define MAX_BAR_STATES 4
59 // control bar alignments
70 // one pane for each alignment
73 // masks for each pane
75 #define wxTOP_PANE 0x0001
76 #define wxBOTTOM_PANE 0x0002
77 #define wxLEFT_PANE 0x0004
78 #define wxRIGHT_PANE 0x0008
80 #define wxALL_PANES 0x000F
82 // enumeration of hittest results, see cbDockPane::HitTestPaneItems(..)
84 enum CB_HITTEST_RESULT
88 CB_UPPER_ROW_HANDLE_HITTED
,
89 CB_LOWER_ROW_HANDLE_HITTED
,
90 CB_LEFT_BAR_HANDLE_HITTED
,
91 CB_RIGHT_BAR_HANDLE_HITTED
,
95 // FIXME:: somehow in debug v. originall wxASSERT's are not compiled in...
98 //#define wxASSERT(x) if ( !(x) ) throw;
100 // helper class, used for spying for not-handled mouse events on control-bars
101 // and forwarding them to the frame layout
103 class cbBarSpy
: public wxEvtHandler
106 DECLARE_DYNAMIC_CLASS( cbBarSpy
)
108 wxFrameLayout
* mpLayout
;
114 cbBarSpy( wxFrameLayout
* pPanel
);
116 void SetBarWindow( wxWindow
* pWnd
);
120 virtual bool ProcessEvent(wxEvent
& event
);
123 /* wxFrameLayout manages containment and docking of control bars.
124 * which can be docked along top, bottom, righ, or left side of the
128 class wxFrameLayout
: public wxEvtHandler
131 DECLARE_DYNAMIC_CLASS( wxFrameLayout
)
133 public: /* protected really, acessed only by plugins and serializers */
135 friend class cbDockPane
;
136 friend class wxBarHandler
;
138 wxWindow
* mpFrame
; // parent frame
139 wxWindow
* mpFrameClient
; // client window
140 cbDockPane
* mPanes
[MAX_PANES
]; // panes in the panel
143 wxCursor
* mpHorizCursor
;
144 wxCursor
* mpVertCursor
;
145 wxCursor
* mpNormalCursor
;
146 wxCursor
* mpDragCursor
;
147 wxCursor
* mpNECursor
; // no-entry cursor
149 // pens for decoration and shades
151 wxPen mDarkPen
; // default wxSYS_COLOUR_3DSHADOW
152 wxPen mLightPen
; // default wxSYS_COLOUR_3DHILIGHT
153 wxPen mGrayPen
; // default wxSYS_COLOUR_3DFACE
154 wxPen mBlackPen
; // default wxColour( 0, 0, 0)
155 wxPen mBorderPen
; // default wxSYS_COLOUR_3DFACE
157 wxPen mNullPen
; // transparent pen
159 // pane to which the all mouse input is currently directed (caputred)
161 cbDockPane
* mpPaneInFocus
;
163 // pane, from which mouse pointer had just leaft
165 cbDockPane
* mpLRUPane
;
167 // bounds of client window in parent frame's coordinates
169 wxRect mClntWndBounds
;
170 wxRect mPrevClntWndBounds
;
173 wxPoint mNextFloatedWndPos
;
174 wxSize mFloatingPosStep
;
176 // current plugin (right-most) plugin which receives events first
178 cbPluginBase
* mpTopPlugin
;
180 // plugin, which currently has caputred all input events, otherwise NULL
182 cbPluginBase
* mpCaputesInput
;
184 // list of event handlers which are "pushed" onto each bar, to catch
185 // mouse events which are not handled by bars, and froward them to the ,
186 // frome-layout and further to plugins
190 // list of top-most frames which contain floated bars
192 wxList mFloatedFrames
;
194 // linked list of references to all bars (docked/floated/hidden)
198 // FOR NOW:: dirty stuff...
199 bool mClientWndRefreshPending
;
201 bool mCheckFocusWhenIdle
;
203 public: /* protected really (accessed only by plugins) */
205 // refrence to custom updates manager
206 cbUpdatesManagerBase
* mpUpdatesMgr
;
208 // called to set calculated layout to window objects
209 void PositionClientWindow();
210 void PositionPanes();
211 void CreateCursors();
213 void RepositionFloatedBar( cbBarInfo
* pBar
);
214 void DoSetBarState( cbBarInfo
* pBar
);
216 bool LocateBar( cbBarInfo
* pBarInfo
,
218 cbDockPane
** ppPane
);
221 bool HitTestPane( cbDockPane
* pPane
, int x
, int y
);
222 cbDockPane
* HitTestPanes( const wxRect
& rect
, cbDockPane
* pCurPane
);
224 // returns panes, to which the given bar belongs
226 cbDockPane
* GetBarPane( cbBarInfo
* pBar
);
228 // delegated from "bar-spy"
229 void ForwardMouseEvent( wxMouseEvent
& event
,
233 void RouteMouseEvent( wxMouseEvent
& event
, int pluginEvtType
);
235 void ShowFloatedWindows( bool show
);
237 void UnhookFromFrame();
238 void HookUpToFrame();
240 // NOTE:: reparenting of windows may NOT work on all platforms
241 // (reparenting allows control-bars to be floated)
244 void ReparentWindow( wxWindow
* pChild
, wxWindow
* pNewParent
);
246 wxRect
& GetPrevClientRect() { return mPrevClntWndBounds
; }
248 void OnPaint( wxPaintEvent
& event
);
249 void OnEraseBackground( wxEraseEvent
& event
);
250 void OnKillFocus( wxFocusEvent
& event
);
251 void OnSetFocus( wxFocusEvent
& event
);
252 void OnActivate( wxActivateEvent
& event
);
253 void OnIdle( wxIdleEvent
& event
);
256 virtual cbUpdatesManagerBase
* CreateUpdatesManager();
258 public: /* public members */
260 wxFrameLayout(void); // used only while serializing
262 wxFrameLayout( wxWindow
* pParentFrame
,
263 wxWindow
* pFrameClient
= NULL
,
264 bool activateNow
= TRUE
);
266 // (doesn't destory bar windows)
267 virtual ~wxFrameLayout();
269 // (by default floating of control-bars is ON)
270 virtual void EnableFloating( bool enable
= TRUE
);
272 // Can be called after some other layout has been deactivated,
273 // and this one must "take over" the current contents of frame window.
275 // Effectivelly hooks itself to the frame window, re-displays all not-hidden
276 // bar-windows and repaints decorations
278 virtual void Activate();
280 // unhooks itself from frame window, and hides all not-hidden windows
282 // NOTE:: two frame-layouts should not be active at the same time in the
283 // same frame window, it would cause messy overlapping of bar windows
286 virtual void Deactivate();
288 // also hides the client window if presents
290 void HideBarWindows();
292 virtual void DestroyBarWindows();
294 // passes the client window (e.g. MDI-client frame) to be controled by
295 // frame layout, the size and position of which should be adjusted to be
296 // surrounded by controlbar panes, whenever frame is resized, or dimesnions
297 // of control panes change
299 void SetFrameClient( wxWindow
* pFrameClient
);
301 wxWindow
* GetFrameClient();
303 wxWindow
& GetParentFrame() { return *mpFrame
; }
305 // used by updates-managers
306 cbDockPane
** GetPanesArray() { return mPanes
; }
308 // see pane alignment types
309 cbDockPane
* GetPane( int alignment
)
311 { return mPanes
[alignment
]; }
313 // Adds bar information to frame-layout, appearence of layout is not refreshed
314 // immediatelly, RefreshNow() can be called if necessary.
316 // NOTES:: argument pBarWnd can by NULL, resulting bar decorations to be drawn
317 // around the empty rectangle (filled with default background colour).
318 // Argument dimInfo, can be re-used for adding any number of bars, since
319 // it is not used directly, instead it's members are copied. If dimensions-
320 // handler is present, it's instance shared (reference counted). Dimension
321 // handler should always be allocated on the heap!)
323 virtual void AddBar( wxWindow
* pBarWnd
,
328 int alignment
= wxTOP
,
329 int rowNo
= 0, // vert. position - row in the pane (if docked state)
330 int columnPos
= 0, // horiz. position in the row in pixels (if docked state)
331 const wxString
& name
="bar",// name, by which the bar could be referred
332 // in layout costumization dialogs
334 bool spyEvents
= FALSE
, // if TRUE - input events for the bar should
335 // be "spyed" in order to forward not-handled
336 // mouse clicks to frame layout (e.g. to enable
337 // easy-draggablity of toolbars just by clicking
338 // on their interior regions). For widgets like
339 // text/tree control this value should be FALSE
340 // (since there's _no_ certain way to detect
341 // whether the event was actually handled...)
343 int state
= wxCBAR_DOCKED_HORIZONTALLY
// e.g. wxCBAR_FLOATING
347 // can be used for repositioning already existing bars. The given bar is first removed
348 // from the pane it currently belongs to, and inserted into the pane, which "matches"
349 // the given recantular area. If pToPane is not NULL, bar is docked to this given pane
351 // to dock the bar which is floated, use wxFrameLayout::DockBar(..) method
353 virtual bool RedockBar( cbBarInfo
* pBar
, const wxRect
& shapeInParent
,
354 cbDockPane
* pToPane
= NULL
, bool updateNow
= TRUE
);
356 // methods for access and modification of bars in frame layout
358 cbBarInfo
* FindBarByName( const wxString
& name
);
360 BarArrayT
& GetBars();
362 // changes bar's docking state (see possible control bar states)
364 void SetBarState( cbBarInfo
* pBar
, int newStatem
, bool updateNow
);
366 // reflects changes in bar information structure visually
367 // (e.g. moves bar, changes it's dimension info, pane to which it is docked)
369 void ApplyBarProperties( cbBarInfo
* pBar
);
371 // removes bar from layout permanently, hides it's corresponding window if present
373 void RemoveBar( cbBarInfo
* pBar
);
375 // recalcualtes layout of panes, and all bars/rows in each pane
377 virtual void RecalcLayout( bool repositionBarsNow
= FALSE
);
379 int GetClientHeight();
380 int GetClientWidth();
381 wxRect
& GetClientRect() { return mClntWndBounds
; }
383 // NOTE:: in future ubdates-manager will become a normal plugin
385 cbUpdatesManagerBase
& GetUpdatesManager();
387 // destroys the previous manager if any, set the new one
389 void SetUpdatesManager( cbUpdatesManagerBase
* pUMgr
);
391 // NOTE:: changing properties of panes, does not result immediate on-screen update
393 virtual void GetPaneProperties( cbCommonPaneProperties
& props
, int alignment
= wxTOP
);
395 virtual void SetPaneProperties( const cbCommonPaneProperties
& props
,
396 int paneMask
= wxALL_PANES
);
398 // TODO:: margins should go into cbCommonPaneProperties in the future
400 // NOTE:: this method should be called before any custom plugins are attached
402 virtual void SetMargins( int top
, int bottom
, int left
, int right
,
403 int paneMask
= wxALL_PANES
);
405 virtual void SetPaneBackground( const wxColour
& colour
);
407 // recalculates layoute and performs on-screen update of all panes
409 void RefreshNow( bool recalcLayout
= TRUE
);
413 void OnSize ( wxSizeEvent
& event
);
414 void OnLButtonDown( wxMouseEvent
& event
);
415 void OnLDblClick ( wxMouseEvent
& event
);
416 void OnLButtonUp ( wxMouseEvent
& event
);
417 void OnRButtonDown( wxMouseEvent
& event
);
418 void OnRButtonUp ( wxMouseEvent
& event
);
419 void OnMouseMove ( wxMouseEvent
& event
);
421 /*** plugin-related methods ***/
423 // should be used, instead of passing the event to ProcessEvent(..) method
424 // of the top-plugin directly. This method checks if events are currently
425 // captured and ensures that plugin-event is routed correctly.
427 virtual void FirePluginEvent( cbPluginEvent
& event
);
429 // captures/releases user-input event's for the given plugin
430 // Input events are: mouse movement, mouse clicks, keyboard input
432 virtual void CaptureEventsForPlugin ( cbPluginBase
* pPlugin
);
433 virtual void ReleaseEventsFromPlugin( cbPluginBase
* pPlugin
);
435 // called by plugins ( also captures/releases mouse in parent frame)
436 void CaptureEventsForPane( cbDockPane
* toPane
);
437 void ReleaseEventsFromPane( cbDockPane
* fromPane
);
439 // returns current top-level plugin (the one which receives events first,
440 // with an exception if input-events are currently captured by some other plugin)
442 virtual cbPluginBase
& GetTopPlugin();
444 // hooking custom plugins to frame layout
446 // NOTE:: when hooking one plugin on top of the other -
447 // use SetNextHandler(..) or similar methods
448 // of wxEvtHandler class to compose the chain of plugins,
449 // than pass the left-most handler in this chain to
450 // the above methods (assuming that events are delegated
451 // from left-most towards right-most handler)
453 // NOTE2:: this secenario is very inconvenient and "low-level",
454 // use Add/Push/PopPlugin methods instead
456 virtual void SetTopPlugin( cbPluginBase
* pPlugin
);
458 // similar to wxWindow's "push/pop-event-handler" methods, execept
459 // that plugin is *deleted* upon "popping"
461 virtual void PushPlugin( cbPluginBase
* pPugin
);
462 virtual void PopPlugin();
464 virtual void PopAllPlugins();
466 // default plugins are : cbPaneDrawPlugin, cbRowLayoutPlugin, cbBarDragPlugin,
467 // cbAntiflickerPlugin, cbSimpleCustomizePlugin
469 // this method is automatically invoked, if no plugins were found upon
470 // fireing of the first plugin-event, i.e. wxFrameLayout *CONFIGURES* itself
472 virtual void PushDefaultPlugins();
474 /* "Advanced" methods for plugin-configuration using their */
475 /* dynamic class information (e.g. CLASSINFO(pluginClass) ) */
477 // first checks if plugin of the given class is already "hooked up",
478 // if not, adds it to the top of plugins chain
480 virtual void AddPlugin( wxClassInfo
* pPlInfo
, int paneMask
= wxALL_PANES
);
482 // first checks if plugin of the givne class already hooked,
483 // if so, removes it, and then inserts it to the chain
484 // before plugin of the class given by "pNextPlInfo"
486 // NOTE:: this method is "handy" in some cases, where the order
487 // of plugin-chain could be important, e.g. one plugin overrides
488 // some functionallity of the other already hooked plugin,
489 // thefore the former should be hooked before the one
490 // who's functionality is being overriden
492 virtual void AddPluginBefore( wxClassInfo
* pNextPlInfo
, wxClassInfo
* pPlInfo
,
493 int paneMask
= wxALL_PANES
);
495 // checks if plugin of the given class is hooked, removes
498 // @param pPlInfo class information structure for the plugin
500 // @see wxFrameLayout::Method
503 virtual void RemovePlugin( wxClassInfo
* pPlInfo
);
505 // returns NULL, if plugin of the given class is not hooked
507 virtual cbPluginBase
* FindPlugin( wxClassInfo
* pPlInfo
);
511 DECLARE_EVENT_TABLE();
514 /* structure, which is present in each item of layout,
515 * it used by any specific updates-manager to store
516 * auxilary information to be used by it's specific
520 class cbUpdateMgrData
: public wxObject
522 DECLARE_DYNAMIC_CLASS( cbUpdateMgrData
)
524 wxRect mPrevBounds
; // previous state of layout item (in parent frame's coordinates)
526 bool mIsDirty
; // overrides result of current-against-previouse bounds comparison,
527 // i.e. requires item to be updated, regardless of it's current area
529 wxObject
* mpCustomData
; // any custom data stored by specific updates mgr.
531 cbUpdateMgrData(); // is-dirty flag is set TRUE initially
533 void StoreItemState( const wxRect
& boundsInParent
);
535 void SetDirty( bool isDirty
= TRUE
);
537 void SetCustomData( wxObject
* pCustomData
);
539 inline bool IsDirty() { return mIsDirty
; }
542 /* Abstract inteface for bar-size handler classes.
543 * These objects receive notifications, whenever the docking
544 * state of the bar is changed, thus they have a possibility
545 * to adjust the values in cbDimInfo::mSizes accordingly.
546 * Specific handlers can be hooked to specific types of bars.
549 class cbBarDimHandlerBase
: public wxObject
551 DECLARE_ABSTRACT_CLASS( cbBarDimHandlerBase
)
554 int mRefCount
; // since one dim-handler can be asigned
555 // to multiple bars, it's instance is
559 // inital refernce count is 0, since handler is not used, until the
560 // first invocation of AddRef()
562 cbBarDimHandlerBase();
567 // "bar-state-changes" notification
568 virtual void OnChangeBarState(cbBarInfo
* pBar
, int newState
) = 0;
569 virtual void OnResizeBar( cbBarInfo
* pBar
, const wxSize
& given
, wxSize
& preferred
) = 0;
572 /* helper classes (used internally by wxFrameLayout class) */
574 // holds and manages information about bar demensions
576 class cbDimInfo
: public wxObject
578 DECLARE_DYNAMIC_CLASS( cbDimInfo
)
580 wxSize mSizes
[MAX_BAR_STATES
]; // preferred sizes for each possible bar state
582 wxRect mBounds
[MAX_BAR_STATES
]; // saved positions and sizes for each
583 // possible state, values contain (-1)s if
584 // not initialized yet
586 int mLRUPane
; // pane to which this bar was docked before it was floated
587 // (wxTOP,wxBOTTOM,..)
589 // top/bottom gap, separates decorations
590 // from the bar's actual window, filled
591 // with frame's beckground color, default: 0
595 // left/right gap, separates decorations
596 // from the bar's actual window, filled
597 // with frame's beckground colour, default: 0
599 int mHorizGap
; // NOTE:: gaps are given in frame's coord. orientation
601 // TRUE, if vertical/horizotal dimensions cannot be mannualy adjusted
602 // by user using resizing handles. If FALSE, the frame-layout
603 // *automatically* places resizing handles among not-fixed bars
607 cbBarDimHandlerBase
* mpHandler
; // NULL, if no handler present
613 cbDimInfo( cbBarDimHandlerBase
* pDimHandler
,
614 bool isFixed
// (see comments on mIsFixed member)
617 cbDimInfo( int dh_x
, int dh_y
, // dims when docked horizontally
618 int dv_x
, int dv_y
, // dims when docked vertically
619 int f_x
, int f_y
, // dims when floating
621 bool isFixed
= TRUE
,// (see comments on mIsFixed member)
622 int horizGap
= 6, // (see comments on mHorizGap member)
623 int vertGap
= 6, // -/-
625 cbBarDimHandlerBase
* pDimHandler
= NULL
628 const cbDimInfo
& operator=( cbDimInfo
& other
);
630 // destroys handler automatically, if present
633 inline cbBarDimHandlerBase
* GetDimHandler() { return mpHandler
; }
636 WX_DEFINE_ARRAY(float, cbArrayFloat
);
638 class cbRowInfo
: public wxObject
640 DECLARE_DYNAMIC_CLASS( cbRowInfo
)
643 BarArrayT mBars
; // row content
645 // row flags (set up according to row-relations)
647 bool mHasUpperHandle
;
648 bool mHasLowerHandle
;
649 bool mHasOnlyFixedBars
;
650 int mNotFixedBarsCnt
;
656 // stores precalculated row's bounds in parent frame's coordinates
657 wxRect mBoundsInParent
;
659 // info stored for updates-manager
660 cbUpdateMgrData mUMgrData
;
665 cbBarInfo
* mpExpandedBar
; // NULL, if non of the bars is currently expanded
667 cbArrayFloat mSavedRatios
; // length-ratios bofore some of the bars was expanded
674 // convenience method
676 inline cbBarInfo
* GetFirstBar()
678 { return mBars
.GetCount() ? mBars
[0] : NULL
; }
681 class cbBarInfo
: public wxObject
683 DECLARE_DYNAMIC_CLASS( cbBarInfo
)
685 // textual name, by which this bar is refered in layout-costumization dialogs
688 // stores bar's bounds in pane's coordinates
691 // stores precalculated bar's bounds in parent frame's coordinates
692 wxRect mBoundsInParent
;
694 // back-ref to the row, which contains this bar
697 // are set up according to the types of the surrounding bars in the row
699 bool mHasRightHandle
;
701 cbDimInfo mDimInfo
; // preferred sizes for each, control bar state
703 int mState
; // (see definition of controlbar states)
705 int mAlignment
; // alignment of the pane to which this
706 // bar is currently placed
708 int mRowNo
; // row, into which this bar would be placed,
709 // when in the docking state
711 wxWindow
* mpBarWnd
; // the actual window object, NULL if no window
712 // is attached to the control bar (possible!)
714 double mLenRatio
; // length ratio among not-fixed-size bars
716 wxPoint mPosIfFloated
; // stored last position when bar was in "floated" state
717 // poistion is stored in parent-window's coordinates
719 cbUpdateMgrData mUMgrData
; // info stored for updates-manager
721 cbBarInfo
* mpNext
; // next. bar in the row
722 cbBarInfo
* mpPrev
; // prev. bar in the row
729 inline bool IsFixed() const { return mDimInfo
.mIsFixed
; }
731 inline bool IsExpanded() const { return this == mpRow
->mpExpandedBar
; }
734 // used for storing original bar's postions in the row, when the "non-destructive-friction"
735 // option is turned ON
737 class cbBarShapeData
: public wxObject
744 // used for traversing through all bars of all rows in the pane
753 wxBarIterator( RowArrayT
& rows
);
756 bool Next(); // TRUE, if next bar is available
758 cbBarInfo
& BarInfo();
760 // returns reference to currently traversed row
761 cbRowInfo
& RowInfo();
764 /* structure holds configuration options,
765 * which are usually the same for all panes in
769 class cbCommonPaneProperties
: public wxObject
771 DECLARE_DYNAMIC_CLASS( cbCommonPaneProperties
)
773 // look-and-feel configuration
775 bool mRealTimeUpdatesOn
; // default: ON
776 bool mOutOfPaneDragOn
; // default: ON
777 bool mExactDockPredictionOn
; // default: OFF
778 bool mNonDestructFirctionOn
; // default: OFF
780 bool mShow3DPaneBorderOn
; // default: ON
782 // FOR NOW:: the below properties are reserved for the "future"
784 bool mBarFloatingOn
; // default: OFF
785 bool mRowProportionsOn
; // default: OFF
786 bool mColProportionsOn
; // default: ON
787 bool mBarCollapseIconsOn
; // default: OFF
788 bool mBarDragHintsOn
; // default: OFF
790 // minimal dimensions for not-fixed bars in this pane (16x16 default)
794 // width/height of resizing sash
796 int mResizeHandleSize
;
798 cbCommonPaneProperties(void);
801 /* class manages containment and control of control-bars
802 * along one of the four edges of the parent frame
805 class cbDockPane
: public wxObject
808 DECLARE_DYNAMIC_CLASS( cbDockPane
)
810 // look-and-feel configuration for this pane
811 cbCommonPaneProperties mProps
;
813 // pane margins (in frame's coordinate-syst. orientation)
815 int mLeftMargin
; // default: 2 pixels
816 int mRightMargin
; // default: 2 pixels
817 int mTopMargin
; // default: 2 pixels
818 int mBottomMargin
; // default: 2 pixels
821 // position of the pane in frame's coordinates
822 wxRect mBoundsInParent
;
824 // pane width and height in pane's coordinates
830 // info stored for updates-manager
831 cbUpdateMgrData mUMgrData
;
833 public: /* protected really */
836 wxFrameLayout
* mpLayout
; // back-ref
838 // transient properties
840 wxList mRowShapeData
; // shapes of bars of recently modified row,
841 // stored when in "non-destructive-firction" mode
842 cbRowInfo
* mpStoredRow
; // row-info for which the shapes are stored
844 friend class wxFrameLayout
;
846 public: /* protected really (accessed only by plugins) */
848 cbRowInfo
* GetRow( int row
);
850 int GetRowIndex( cbRowInfo
* pRow
);
852 // return -1, if row is not present at given vertical position
853 int GetRowAt( int paneY
);
854 int GetRowAt( int upperY
, int lowerY
);
856 // re-setups flags in the row-information structure, so that
857 // the would match the changed state of row-items correctly
858 void SyncRowFlags( cbRowInfo
* pRow
);
860 // layout "AI" helpers:
862 bool IsFixedSize( cbBarInfo
* pInfo
);
863 int GetNotFixedBarsCount( cbRowInfo
* pRow
);
865 int GetRowWidth( wxList
* pRow
);
867 int GetRowY( cbRowInfo
* pRow
);
869 bool HasNotFixedRowsAbove( cbRowInfo
* pRow
);
870 bool HasNotFixedRowsBelow( cbRowInfo
* pRow
);
871 bool HasNotFixedBarsLeft ( cbBarInfo
* pBar
);
872 bool HasNotFixedBarsRight( cbBarInfo
* pBar
);
874 virtual void CalcLenghtRatios( cbRowInfo
* pInRow
);
875 virtual void RecalcRowLayout( cbRowInfo
* pRow
);
877 virtual void ExpandBar( cbBarInfo
* pBar
);
878 virtual void ContractBar( cbBarInfo
* pBar
);
880 void InitLinksForRow( cbRowInfo
* pRow
);
881 void InitLinksForRows();
883 // coordinate translation between parent's frame and this pane
885 void FrameToPane( long* x
, long* y
);
886 void PaneToFrame( long* x
, long* y
);
887 void FrameToPane( wxRect
* pRect
);
888 void PaneToFrame( wxRect
* pRect
);
890 inline bool HasPoint( const wxPoint
& pos
, int x
, int y
, int width
, int height
);
892 int GetMinimalRowHeight( cbRowInfo
* pRow
);
894 // given row height includes height of row handles, if present
895 void SetRowHeight( cbRowInfo
* pRow
, int newHeight
);
897 void DoInsertBar( cbBarInfo
* pBar
, int rowNo
);
899 public: /* protected really (accessed only by plugins) */
901 // methods for incramental on-screen refreshing of the pane
902 // (simply, they are wrappers around corresponding plugin-events)
904 virtual void PaintBarDecorations( cbBarInfo
* pBar
, wxDC
& dc
);
905 virtual void PaintBarHandles( cbBarInfo
* pBar
, wxDC
& dc
);
906 virtual void PaintBar( cbBarInfo
* pBar
, wxDC
& dc
);
907 virtual void PaintRowHandles( cbRowInfo
* pRow
, wxDC
& dc
);
908 virtual void PaintRowBackground ( cbRowInfo
* pRow
, wxDC
& dc
);
909 virtual void PaintRowDecorations( cbRowInfo
* pRow
, wxDC
& dc
);
910 virtual void PaintRow( cbRowInfo
* pRow
, wxDC
& dc
);
911 virtual void PaintPaneBackground( wxDC
& dc
);
912 virtual void PaintPaneDecorations( wxDC
& dc
);
913 virtual void PaintPane( wxDC
& dc
);
914 virtual void SizeBar( cbBarInfo
* pBar
);
915 virtual void SizeRowObjects( cbRowInfo
* pRow
);
916 virtual void SizePaneObjects();
918 virtual wxDC
* StartDrawInArea ( const wxRect
& area
);
919 virtual void FinishDrawInArea( const wxRect
& area
);
921 public: /* public members */
925 cbDockPane( int alignment
, wxFrameLayout
* pPanel
);
927 // sets pane's margins in frame's coordinate orientations
928 void SetMargins( int top
, int bottom
, int left
, int right
);
930 virtual ~cbDockPane();
932 // does not destroys the info bar , only removes it's reference
935 virtual void RemoveBar( cbBarInfo
* pBar
);
937 // rect given in the parent frame's coordinates
939 virtual void InsertBar( cbBarInfo
* pBar
, const wxRect
& atRect
);
941 // inserts bar into the given row, with dimensions and position
942 // stored in pBarInfo->mBounds. Returns the node of inserted bar
944 virtual void InsertBar( cbBarInfo
* pBar
, cbRowInfo
* pIntoRow
);
946 // inserts bar, sets its position according to the preferred settings
947 // given in (*pBarInfo) structure
949 virtual void InsertBar( cbBarInfo
* pBarInfo
);
951 // does not destroy the row object, only removes the corresponding
952 // node from this pane
953 virtual void RemoveRow( cbRowInfo
* pRow
);
955 // does not refresh the inserted row immediatelly,
956 // if pBeforeRowNode arg. is NULL, row is appended to the end of pane's row list
957 virtual void InsertRow( cbRowInfo
* pRow
, cbRowInfo
* pBeforeRow
);
959 // sets pane's width in pane's coordinates (including margins)
960 void SetPaneWidth(int width
);
962 // set the position and dims. of the pane in parent frame's coordinates
963 void SetBoundsInParent( const wxRect
& rect
);
965 inline wxRect
& GetRealRect() { return mBoundsInParent
; }
967 // used by upadates-managers
968 inline RowArrayT
& GetRowList() { return mRows
; }
970 // convenience method
972 inline cbRowInfo
* GetFirstRow()
974 { return mRows
.GetCount() ? mRows
[0] : NULL
; }
976 // TRUE, if the given bar node presents in this pane
978 bool BarPresent( cbBarInfo
* pBar
);
980 // retuns height, in pane's coordinates
985 bool MatchesMask( int paneMask
);
987 inline bool IsHorizontal()
989 return (mAlignment
== wxTOP
||
990 mAlignment
== wxBOTTOM
);
993 virtual void RecalcLayout();
995 virtual int GetDockingState();
997 // returns result of hit-testing items in the pane,
998 // see CB_HITTEST_RESULTS enumeration
1000 virtual int HitTestPaneItems( const wxPoint
& pos
, // position in pane's coorinates
1005 void GetBarResizeRange( cbBarInfo
* pBar
, int* from
, int *till
, bool forLeftHandle
);
1006 void GetRowResizeRange( cbRowInfo
* pRow
, int* from
, int* till
, bool forUpperHandle
);
1008 cbBarInfo
* GetBarInfoByWindow( wxWindow
* pBarWnd
);
1010 public: /* protected really (accessed only by plugins) */
1012 // row/bar resizing related helper-methods
1014 void DrawVertHandle ( wxDC
& dc
, int x
, int y
, int height
);
1015 void DrawHorizHandle( wxDC
& dc
, int x
, int y
, int width
);
1017 void ResizeRow( cbRowInfo
* pRow
, int ofs
, bool forUpperHandle
);
1018 void ResizeBar( cbBarInfo
* pBar
, int ofs
, bool forLeftHandle
);
1020 // cbBarShapeData objects will be placed to given pLst (see comments on cbBarShapeData)
1022 void GetRowShapeData( cbRowInfo
* pRow
, wxList
* pLst
);
1024 // sets the shape to the given row, using the data provided in pLst
1025 void SetRowShapeData( cbRowInfo
* pRowNode
, wxList
* pLst
);
1029 * class declares abstract interface for optimized logic, which should refresh
1030 * areas of frame layout - that actually need to be updated. Should be extanded,
1031 * to implemnet custom updating strategy
1034 class cbUpdatesManagerBase
: public wxObject
1036 DECLARE_ABSTRACT_CLASS( cbUpdatesManagerBase
)
1038 public: /* protected really, accessed by serializer (if any) */
1040 wxFrameLayout
* mpLayout
;
1043 cbUpdatesManagerBase(void)
1046 cbUpdatesManagerBase( wxFrameLayout
* pPanel
)
1047 : mpLayout( pPanel
) {}
1049 void SetLayout( wxFrameLayout
* pLayout
) { mpLayout
= pLayout
; }
1051 // notificiactions received from frame-layout (in the order, in which
1052 // they usually would be invoked). Custom updates-managers may utilize
1053 // these notifications to implement more "fine-grained" updating strategy
1055 virtual void OnStartChanges() = 0;
1057 virtual void OnRowWillChange( cbRowInfo
* pRow
, cbDockPane
* pInPane
) {}
1058 virtual void OnBarWillChange( cbBarInfo
* pBar
, cbRowInfo
* pInRow
, cbDockPane
* pInPane
) {}
1059 virtual void OnPaneMarginsWillChange( cbDockPane
* pPane
) {}
1060 virtual void OnPaneWillChange( cbDockPane
* pPane
) {}
1062 virtual void OnFinishChanges() {}
1064 // refreshes parts of the frame layout, which need an update
1065 virtual void UpdateNow() = 0;
1068 /*------------------------------------------------------------
1069 * "API" for developing custom plugins of Frame Layout Engine
1070 * TODO:: documentation
1071 *------------------------------------------------------------
1074 // base class for all control-bar plugin events
1076 class cbPluginEvent
: public wxEvent
1078 // NOTE:: plugin-event does not need to be a dynamic class
1081 cbDockPane
* mpPane
; // NULL, if event is not addressed to any specific pane
1084 // FOR NOW FOR NOW:: all-in-on plugin event structure
1086 wxNode* mpObjNodeAux;
1093 cbPluginEvent( int eventType
, cbDockPane
* pPane
)
1096 { m_eventType
= eventType
; }
1099 // event types handled by plugins
1101 #define cbEVT_PL_LEFT_DOWN 0
1102 #define cbEVT_PL_LEFT_UP 1
1103 #define cbEVT_PL_RIGHT_DOWN 2
1104 #define cbEVT_PL_RIGHT_UP 3
1105 #define cbEVT_PL_MOTION 4
1107 #define cbEVT_PL_LEFT_DCLICK 5
1109 #define cbEVT_PL_LAYOUT_ROW 6
1110 #define cbEVT_PL_RESIZE_ROW 7
1111 #define cbEVT_PL_LAYOUT_ROWS 8
1112 #define cbEVT_PL_INSERT_BAR 9
1113 #define cbEVT_PL_RESIZE_BAR 10
1114 #define cbEVT_PL_REMOVE_BAR 11
1115 #define cbEVT_PL_SIZE_BAR_WND 12
1117 #define cbEVT_PL_DRAW_BAR_DECOR 13
1118 #define cbEVT_PL_DRAW_ROW_DECOR 14
1119 #define cbEVT_PL_DRAW_PANE_DECOR 15
1120 #define cbEVT_PL_DRAW_BAR_HANDLES 16
1121 #define cbEVT_PL_DRAW_ROW_HANDLES 17
1122 #define cbEVT_PL_DRAW_ROW_BKGROUND 18
1123 #define cbEVT_PL_DRAW_PANE_BKGROUND 19
1125 #define cbEVT_PL_START_BAR_DRAGGING 20
1126 #define cbEVT_PL_DRAW_HINT_RECT 21
1128 #define cbEVT_PL_START_DRAW_IN_AREA 22
1129 #define cbEVT_PL_FINISH_DRAW_IN_AREA 23
1131 #define cbEVT_PL_CUSTOMIZE_BAR 24
1132 #define cbEVT_PL_CUSTOMIZE_LAYOUT 25
1134 #define wxCUSTOM_CB_PLUGIN_EVENTS_START_AT 100
1136 // forward decls, separated by categories
1138 class cbLeftDownEvent
;
1139 class cbLeftUpEvent
;
1140 class cbRightDownEvent
;
1141 class cbRightUpEvent
;
1142 class cbMotionEvent
;
1143 class cbLeftDClickEvent
;
1145 class cbLayoutRowEvent
;
1146 class cbResizeRowEvent
;
1147 class cbLayoutRowsEvent
;
1148 class cbInsertBarEvent
;
1149 class cbResizeBarEvent
;
1150 class cbRemoveBarEvent
;
1151 class cbSizeBarWndEvent
;
1153 class cbDrawBarDecorEvent
;
1154 class cbDrawRowDecorEvent
;
1155 class cbDrawPaneDecorEvent
;
1156 class cbDrawBarHandlesEvent
;
1157 class cbDrawRowHandlesEvent
;
1158 class cbDrawRowBkGroundEvent
;
1159 class cbDrawPaneBkGroundEvent
;
1161 class cbStartBarDraggingEvent
;
1162 class cbDrawHintRectEvent
;
1164 class cbStartDrawInAreaEvent
;
1165 class cbFinishDrawInAreaEvent
;
1167 class cbCustomizeBarEvent
;
1168 class cbCustomizeLayoutEvent
;
1170 // defs. for handler-methods
1172 typedef void (wxEvtHandler::*cbLeftDownHandler
)(cbLeftDownEvent
&);
1173 typedef void (wxEvtHandler::*cbLeftUpHandler
)(cbLeftUpEvent
&);
1174 typedef void (wxEvtHandler::*cbRightDownHandler
)(cbRightDownEvent
&);
1175 typedef void (wxEvtHandler::*cbRightUpHandler
)(cbRightUpEvent
&);
1176 typedef void (wxEvtHandler::*cbMotionHandler
)(cbMotionEvent
&);
1177 typedef void (wxEvtHandler::*cbLeftDClickHandler
)(cbLeftDClickEvent
&);
1179 typedef void (wxEvtHandler::*cbLayoutRowHandler
)(cbLayoutRowEvent
&);
1180 typedef void (wxEvtHandler::*cbResizeRowHandler
)(cbResizeRowEvent
&);
1181 typedef void (wxEvtHandler::*cbLayoutRowsHandler
)(cbLayoutRowsEvent
&);
1182 typedef void (wxEvtHandler::*cbInsertBarHandler
)(cbInsertBarEvent
&);
1183 typedef void (wxEvtHandler::*cbResizeBarHandler
)(cbResizeBarEvent
&);
1184 typedef void (wxEvtHandler::*cbRemoveBarHandler
)(cbRemoveBarEvent
&);
1185 typedef void (wxEvtHandler::*cbSizeBarWndHandler
)(cbSizeBarWndEvent
&);
1187 typedef void (wxEvtHandler::*cbDrawBarDecorHandler
)(cbDrawBarDecorEvent
&);
1188 typedef void (wxEvtHandler::*cbDrawRowDecorHandler
)(cbDrawRowDecorEvent
&);
1189 typedef void (wxEvtHandler::*cbDrawPaneDecorHandler
)(cbDrawPaneDecorEvent
&);
1190 typedef void (wxEvtHandler::*cbDrawBarHandlesHandler
)(cbDrawBarHandlesEvent
&);
1191 typedef void (wxEvtHandler::*cbDrawRowHandlesHandler
)(cbDrawRowHandlesEvent
&);
1192 typedef void (wxEvtHandler::*cbDrawRowBkGroundHandler
)(cbDrawRowBkGroundEvent
&);
1193 typedef void (wxEvtHandler::*cbDrawPaneBkGroundHandler
)(cbDrawPaneBkGroundEvent
&);
1195 typedef void (wxEvtHandler::*cbStartBarDraggingHandler
)(cbStartBarDraggingEvent
&);
1196 typedef void (wxEvtHandler::*cbDrawHintRectHandler
)(cbDrawHintRectEvent
&);
1198 typedef void (wxEvtHandler::*cbStartDrawInAreaHandler
)(cbStartDrawInAreaEvent
&);
1199 typedef void (wxEvtHandler::*cbFinishDrawInAreaHandler
)(cbFinishDrawInAreaEvent
&);
1201 typedef void (wxEvtHandler::*cbCustomizeBarHandler
)(cbCustomizeBarEvent
&);
1202 typedef void (wxEvtHandler::*cbCustomizeLayoutHandler
)(cbCustomizeLayoutEvent
&);
1204 // macros for creating event table entries for plugin-events
1206 #define EVT_PL_LEFT_DOWN(func) { cbEVT_PL_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDownHandler ) & func },
1207 #define EVT_PL_LEFT_UP(func) { cbEVT_PL_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftUpHandler ) & func },
1208 #define EVT_PL_RIGHT_DOWN(func) { cbEVT_PL_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightDownHandler ) & func },
1209 #define EVT_PL_RIGHT_UP(func) { cbEVT_PL_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightUpHandler ) & func },
1210 #define EVT_PL_MOTION(func) { cbEVT_PL_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbMotionHandler ) & func },
1211 #define EVT_PL_LEFT_DCLICK(func) { cbEVT_PL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDClickHandler ) & func },
1213 #define EVT_PL_LAYOUT_ROW(func) { cbEVT_PL_LAYOUT_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowHandler ) & func },
1214 #define EVT_PL_RESIZE_ROW(func) { cbEVT_PL_RESIZE_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeRowHandler ) & func },
1215 #define EVT_PL_LAYOUT_ROWS(func) { cbEVT_PL_LAYOUT_ROWS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowsHandler ) & func },
1216 #define EVT_PL_INSERT_BAR(func) { cbEVT_PL_INSERT_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbInsertBarHandler ) & func },
1217 #define EVT_PL_RESIZE_BAR(func) { cbEVT_PL_RESIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeBarHandler ) & func },
1218 #define EVT_PL_REMOVE_BAR(func) { cbEVT_PL_REMOVE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRemoveBarHandler ) & func },
1219 #define EVT_PL_SIZE_BAR_WND(func) { cbEVT_PL_SIZE_BAR_WND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbSizeBarWndHandler ) & func },
1221 #define EVT_PL_DRAW_BAR_DECOR(func) { cbEVT_PL_DRAW_BAR_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarDecorHandler ) & func },
1222 #define EVT_PL_DRAW_ROW_DECOR(func) { cbEVT_PL_DRAW_ROW_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowDecorHandler ) & func },
1223 #define EVT_PL_DRAW_PANE_DECOR(func) { cbEVT_PL_DRAW_PANE_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneDecorHandler ) & func },
1224 #define EVT_PL_DRAW_BAR_HANDLES(func) { cbEVT_PL_DRAW_BAR_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarHandlesHandler ) & func },
1225 #define EVT_PL_DRAW_ROW_HANDLES(func) { cbEVT_PL_DRAW_ROW_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowHandlesHandler ) & func },
1226 #define EVT_PL_DRAW_ROW_BKGROUND(func) { cbEVT_PL_DRAW_ROW_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowBkGroundHandler ) & func },
1227 #define EVT_PL_DRAW_PANE_BKGROUND(func) { cbEVT_PL_DRAW_PANE_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneBkGroundHandler) & func },
1229 #define EVT_PL_START_BAR_DRAGGING(func) { cbEVT_PL_START_BAR_DRAGGING, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartBarDraggingHandler) & func },
1230 #define EVT_PL_DRAW_HINT_RECT(func) { cbEVT_PL_DRAW_HINT_RECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawHintRectHandler ) & func },
1232 #define EVT_PL_START_DRAW_IN_AREA(func) { cbEVT_PL_START_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartDrawInAreaHandler) & func },
1233 #define EVT_PL_FINISH_DRAW_IN_AREA(func) { cbEVT_PL_FINISH_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbFinishDrawInAreaHandler) & func },
1235 #define EVT_PL_CUSTOMIZE_BAR(func) { cbEVT_PL_CUSTOMIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeBarHandler) & func },
1236 #define EVT_PL_CUSTOMIZE_LAYOUT(func) { cbEVT_PL_CUSTOMIZE_LAYOUT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeLayoutHandler) & func },
1239 * abstract base class for all control-bar related plugins
1242 class cbPluginBase
: public wxEvtHandler
1244 DECLARE_ABSTRACT_CLASS( cbPluginBase
)
1247 wxFrameLayout
* mpLayout
; // back-reference to the frame layout
1249 // specifies panes, for which this plugin receives events
1250 // (see pane masks definitions)
1253 bool mIsReady
; // is TRUE, when plugin is ready to handle events
1259 mPaneMask( wxALL_PANES
),
1263 cbPluginBase( wxFrameLayout
* pPanel
, int paneMask
= wxALL_PANES
)
1265 : mpLayout ( pPanel
),
1266 mPaneMask( paneMask
),
1270 inline int GetPaneMask() { return mPaneMask
; }
1272 // NOTE:: pointer positions of mouse-events sent to plugins
1273 // are always in pane's coordinates (pane's to which
1274 // this plugin is hooked)
1276 // destroys the whole plugin chain of connected plagins
1277 virtual ~cbPluginBase();
1279 // override this method to do plugin-specific initialization
1280 // (at this point plugin is already attached to the frame layout,
1281 // and pane masks are set)
1282 virtual void OnInitPlugin() { mIsReady
= TRUE
; }
1284 bool IsReady() { return mIsReady
; }
1286 // overriden, to determine whether the target pane specified in the
1287 // event, matches the pane mask of this plugin (specific plugins
1288 // do not override this method)
1290 virtual bool ProcessEvent(wxEvent
& event
);
1293 /*** event classes, for each corresponding event type (24 currnetly...uhh) ***/
1295 // mouse-events category
1297 class cbLeftDownEvent
: public cbPluginEvent
1302 cbLeftDownEvent( const wxPoint
& pos
, cbDockPane
* pPane
)
1304 : cbPluginEvent( cbEVT_PL_LEFT_DOWN
, pPane
),
1309 class cbLeftUpEvent
: public cbPluginEvent
1314 cbLeftUpEvent( const wxPoint
& pos
, cbDockPane
* pPane
)
1316 : cbPluginEvent( cbEVT_PL_LEFT_UP
, pPane
),
1321 class cbRightDownEvent
: public cbPluginEvent
1326 cbRightDownEvent( const wxPoint
& pos
, cbDockPane
* pPane
)
1328 : cbPluginEvent( cbEVT_PL_RIGHT_DOWN
, pPane
),
1333 class cbRightUpEvent
: public cbPluginEvent
1338 cbRightUpEvent( const wxPoint
& pos
, cbDockPane
* pPane
)
1340 : cbPluginEvent( cbEVT_PL_RIGHT_UP
, pPane
),
1345 class cbMotionEvent
: public cbPluginEvent
1350 cbMotionEvent( const wxPoint
& pos
, cbDockPane
* pPane
)
1352 : cbPluginEvent( cbEVT_PL_MOTION
, pPane
),
1357 class cbLeftDClickEvent
: public cbPluginEvent
1362 cbLeftDClickEvent( const wxPoint
& pos
, cbDockPane
* pPane
)
1364 : cbPluginEvent( cbEVT_PL_LEFT_DCLICK
, pPane
),
1369 // bar/row events category
1371 class cbLayoutRowEvent
: public cbPluginEvent
1376 cbLayoutRowEvent( cbRowInfo
* pRow
, cbDockPane
* pPane
)
1378 : cbPluginEvent( cbEVT_PL_LAYOUT_ROW
, pPane
),
1383 class cbResizeRowEvent
: public cbPluginEvent
1388 bool mForUpperHandle
;
1390 cbResizeRowEvent( cbRowInfo
* pRow
, int handleOfs
, bool forUpperHandle
, cbDockPane
* pPane
)
1392 : cbPluginEvent( cbEVT_PL_RESIZE_ROW
, pPane
),
1394 mHandleOfs( handleOfs
),
1395 mForUpperHandle( forUpperHandle
)
1399 class cbLayoutRowsEvent
: public cbPluginEvent
1403 cbLayoutRowsEvent( cbDockPane
* pPane
)
1405 : cbPluginEvent( cbEVT_PL_LAYOUT_ROWS
, pPane
)
1409 class cbInsertBarEvent
: public cbPluginEvent
1415 cbInsertBarEvent( cbBarInfo
* pBar
, cbRowInfo
* pIntoRow
, cbDockPane
* pPane
)
1417 : cbPluginEvent( cbEVT_PL_INSERT_BAR
, pPane
),
1424 class cbResizeBarEvent
: public cbPluginEvent
1430 cbResizeBarEvent( cbBarInfo
* pBar
, cbRowInfo
* pRow
, cbDockPane
* pPane
)
1432 : cbPluginEvent( cbEVT_PL_RESIZE_BAR
, pPane
),
1438 class cbRemoveBarEvent
: public cbPluginEvent
1443 cbRemoveBarEvent( cbBarInfo
* pBar
, cbDockPane
* pPane
)
1445 : cbPluginEvent( cbEVT_PL_REMOVE_BAR
, pPane
),
1450 class cbSizeBarWndEvent
: public cbPluginEvent
1454 wxRect mBoundsInParent
;
1456 cbSizeBarWndEvent( cbBarInfo
* pBar
, cbDockPane
* pPane
)
1458 : cbPluginEvent( cbEVT_PL_SIZE_BAR_WND
, pPane
),
1460 mBoundsInParent( pBar
->mBoundsInParent
)
1464 class cbDrawBarDecorEvent
: public cbPluginEvent
1469 wxRect mBoundsInParent
;
1471 cbDrawBarDecorEvent( cbBarInfo
* pBar
, wxDC
& dc
, cbDockPane
* pPane
)
1473 : cbPluginEvent( cbEVT_PL_DRAW_BAR_DECOR
, pPane
),
1476 mBoundsInParent( pBar
->mBoundsInParent
)
1480 class cbDrawRowDecorEvent
: public cbPluginEvent
1486 cbDrawRowDecorEvent( cbRowInfo
* pRow
, wxDC
& dc
, cbDockPane
* pPane
)
1488 : cbPluginEvent( cbEVT_PL_DRAW_ROW_DECOR
, pPane
),
1494 class cbDrawPaneDecorEvent
: public cbPluginEvent
1499 cbDrawPaneDecorEvent( wxDC
& dc
, cbDockPane
* pPane
)
1501 : cbPluginEvent( cbEVT_PL_DRAW_PANE_DECOR
, pPane
),
1506 class cbDrawBarHandlesEvent
: public cbPluginEvent
1512 cbDrawBarHandlesEvent( cbBarInfo
* pBar
, wxDC
& dc
, cbDockPane
* pPane
)
1514 : cbPluginEvent( cbEVT_PL_DRAW_BAR_HANDLES
, pPane
),
1520 class cbDrawRowHandlesEvent
: public cbPluginEvent
1526 cbDrawRowHandlesEvent( cbRowInfo
* pRow
, wxDC
& dc
, cbDockPane
* pPane
)
1528 : cbPluginEvent( cbEVT_PL_DRAW_ROW_HANDLES
, pPane
),
1534 class cbDrawRowBkGroundEvent
: public cbPluginEvent
1540 cbDrawRowBkGroundEvent( cbRowInfo
* pRow
, wxDC
& dc
, cbDockPane
* pPane
)
1542 : cbPluginEvent( cbEVT_PL_DRAW_ROW_BKGROUND
, pPane
),
1548 class cbDrawPaneBkGroundEvent
: public cbPluginEvent
1553 cbDrawPaneBkGroundEvent( wxDC
& dc
, cbDockPane
* pPane
)
1555 : cbPluginEvent( cbEVT_PL_DRAW_PANE_BKGROUND
, pPane
),
1560 class cbStartBarDraggingEvent
: public cbPluginEvent
1564 wxPoint mPos
; // is given in frame's coordinates
1566 cbStartBarDraggingEvent( cbBarInfo
* pBar
, const wxPoint
& pos
, cbDockPane
* pPane
)
1568 : cbPluginEvent( cbEVT_PL_START_BAR_DRAGGING
, pPane
),
1574 class cbDrawHintRectEvent
: public cbPluginEvent
1577 wxRect mRect
; // is given in frame's coordinates
1580 bool mLastTime
; // indicates that this event finishes "session" of on-screen drawing,
1581 // thus associated resources can be freed now
1582 bool mEraseRect
; // does not have any impact, if recangle is drawn using XOR-mask
1584 bool mIsInClient
;// in cleint area hint could be drawn differently,
1585 // e.g. with fat/hatched border
1588 cbDrawHintRectEvent( const wxRect
& rect
, bool isInClient
, bool eraseRect
, bool lastTime
)
1590 : cbPluginEvent( cbEVT_PL_DRAW_HINT_RECT
, 0 ),
1592 mLastTime ( lastTime
),
1593 mEraseRect ( eraseRect
),
1594 mIsInClient( isInClient
)
1598 class cbStartDrawInAreaEvent
: public cbPluginEvent
1602 wxDC
** mppDc
; // points to pointer, where the reference
1603 // to the obtained buffer-context should be placed
1605 cbStartDrawInAreaEvent( const wxRect
& area
, wxDC
** ppDCForArea
, cbDockPane
* pPane
)
1607 : cbPluginEvent( cbEVT_PL_START_DRAW_IN_AREA
, pPane
),
1609 mppDc( ppDCForArea
)
1613 class cbFinishDrawInAreaEvent
: public cbPluginEvent
1618 cbFinishDrawInAreaEvent( const wxRect
& area
, cbDockPane
* pPane
)
1620 : cbPluginEvent( cbEVT_PL_FINISH_DRAW_IN_AREA
, pPane
),
1625 class cbCustomizeBarEvent
: public cbPluginEvent
1628 wxPoint mClickPos
; // in parent frame's coordinates
1631 cbCustomizeBarEvent( cbBarInfo
* pBar
, const wxPoint
& clickPos
, cbDockPane
* pPane
)
1633 : cbPluginEvent( cbEVT_PL_CUSTOMIZE_BAR
, pPane
),
1634 mClickPos( clickPos
),
1639 class cbCustomizeLayoutEvent
: public cbPluginEvent
1642 wxPoint mClickPos
; // in parent frame's coordinates
1644 cbCustomizeLayoutEvent( const wxPoint
& clickPos
)
1646 : cbPluginEvent( cbEVT_PL_CUSTOMIZE_LAYOUT
, 0 ),
1647 mClickPos( clickPos
)