]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/fl/controlbar.h
Changed test to reflect the real current state of dynamic loading
[wxWidgets.git] / contrib / include / wx / fl / controlbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: No names yet.
3 // Purpose: Central header file for control-bar related classes
4 //
5 // Author: Aleksandras Gluchovas <mailto:alex@soften.ktu.lt>
6 // Modified by:
7 // Created: 06/09/98
8 // RCS-ID: $Id$
9 // Copyright: (c) Aleksandras Gluchovas
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 #ifndef __CONTROLBAR_G__
14 #define __CONTROLBAR_G__
15
16 #ifdef __GNUG__
17 #pragma interface "controlbar.h"
18 #endif
19
20 #include "wx/defs.h"
21 #include "wx/string.h"
22 #include "wx/window.h"
23 #include "wx/dynarray.h"
24
25 #define WXCONTROLBAR_VERSION 1.3
26
27 // forward declarations
28
29 class wxFrameLayout;
30
31 class cbDockPane;
32 class cbUpdatesManagerBase;
33 class cbBarDimHandlerBase;
34 class cbPluginBase;
35 class cbPluginEvent;
36 class cbPaneDrawPlugin;
37
38 class cbBarInfo;
39 class cbRowInfo;
40 class cbDimInfo;
41 class cbCommonPaneProperties;
42
43 typedef cbBarInfo* BarInfoPtrT;
44 typedef cbRowInfo* RowInfoPtrT;
45
46 WX_DEFINE_ARRAY( BarInfoPtrT, BarArrayT );
47 WX_DEFINE_ARRAY( RowInfoPtrT, RowArrayT );
48
49 // control bar states
50
51 #define wxCBAR_DOCKED_HORIZONTALLY 0
52 #define wxCBAR_DOCKED_VERTICALLY 1
53 #define wxCBAR_FLOATING 2
54 #define wxCBAR_HIDDEN 3
55
56 // the states are enumerated above
57 #define MAX_BAR_STATES 4
58
59 // control bar alignments
60
61 #if !defined(FL_ALIGN_TOP)
62
63 #define FL_ALIGN_TOP 0
64 #define FL_ALIGN_BOTTOM 1
65 #define FL_ALIGN_LEFT 2
66 #define FL_ALIGN_RIGHT 3
67
68 #endif
69
70 // one pane for each alignment
71 #define MAX_PANES 4
72
73 // masks for each pane
74
75 #define FL_ALIGN_TOP_PANE 0x0001
76 #define FL_ALIGN_BOTTOM_PANE 0x0002
77 #define FL_ALIGN_LEFT_PANE 0x0004
78 #define FL_ALIGN_RIGHT_PANE 0x0008
79
80 #define wxALL_PANES 0x000F
81
82 // enumeration of hittest results, see cbDockPane::HitTestPaneItems(..)
83
84 enum CB_HITTEST_RESULT
85 {
86 CB_NO_ITEMS_HITTED,
87
88 CB_UPPER_ROW_HANDLE_HITTED,
89 CB_LOWER_ROW_HANDLE_HITTED,
90 CB_LEFT_BAR_HANDLE_HITTED,
91 CB_RIGHT_BAR_HANDLE_HITTED,
92 CB_BAR_CONTENT_HITTED
93 };
94
95 // FIXME:: somehow in debug v. originall wxASSERT's are not compiled in...
96
97 //#undef wxASSERT
98 //#define wxASSERT(x) if ( !(x) ) throw;
99
100 // helper class, used for spying for not-handled mouse events on control-bars
101 // and forwarding them to the frame layout
102
103 class cbBarSpy : public wxEvtHandler
104 {
105 public:
106 DECLARE_DYNAMIC_CLASS( cbBarSpy )
107
108 wxFrameLayout* mpLayout;
109 wxWindow* mpBarWnd;
110
111 public:
112 cbBarSpy(void);
113
114 cbBarSpy( wxFrameLayout* pPanel );
115
116 void SetBarWindow( wxWindow* pWnd );
117
118 // overriden
119
120 virtual bool ProcessEvent(wxEvent& event);
121 };
122
123 /* wxFrameLayout manages containment and docking of control bars.
124 * which can be docked along top, bottom, righ, or left side of the
125 * parent frame
126 */
127
128 class wxFrameLayout : public wxEvtHandler
129 {
130 public:
131 wxFrameLayout(void); // used only while serializing
132
133 wxFrameLayout( wxWindow* pParentFrame,
134 wxWindow* pFrameClient = NULL,
135 bool activateNow = TRUE );
136
137 // (doesn't destroy bar windows)
138 virtual ~wxFrameLayout();
139
140 // (by default floating of control-bars is ON)
141 virtual void EnableFloating( bool enable = TRUE );
142
143 // Can be called after some other layout has been deactivated,
144 // and this one must "take over" the current contents of frame window.
145 //
146 // Effectively hooks itself to the frame window, re-displays all not-hidden
147 // bar-windows and repaints decorations
148
149 virtual void Activate();
150
151 // unhooks itself from frame window, and hides all not-hidden windows
152 //
153 // NOTE:: two frame-layouts should not be active at the same time in the
154 // same frame window, it would cause messy overlapping of bar windows
155 // from both layouts
156
157 virtual void Deactivate();
158
159 // also hides the client window if presents
160
161 void HideBarWindows();
162
163 virtual void DestroyBarWindows();
164
165 // passes the client window (e.g. MDI-client frame) to be controled by
166 // frame layout, the size and position of which should be adjusted to be
167 // surrounded by controlbar panes, whenever frame is resized, or dimensions
168 // of control panes change
169
170 void SetFrameClient( wxWindow* pFrameClient );
171
172 wxWindow* GetFrameClient();
173
174 wxWindow& GetParentFrame() { return *mpFrame; }
175
176 // used by updates-managers
177 cbDockPane** GetPanesArray() { return mPanes; }
178
179 // see pane alignment types
180 cbDockPane* GetPane( int alignment )
181
182 { return mPanes[alignment]; }
183
184 // Adds bar information to frame-layout, appearence of layout is not refreshed
185 // immediately, RefreshNow() can be called if necessary.
186 //
187 // NOTES:: argument pBarWnd can by NULL, resulting bar decorations to be drawn
188 // around the empty rectangle (filled with default background colour).
189 // Argument dimInfo, can be re-used for adding any number of bars, since
190 // it is not used directly, instead it's members are copied. If dimensions-
191 // handler is present, it's instance shared (reference counted). Dimension
192 // handler should always be allocated on the heap!)
193
194 virtual void AddBar( wxWindow* pBarWnd,
195 const cbDimInfo& dimInfo,
196
197 // defaults:
198 int alignment = FL_ALIGN_TOP,
199 int rowNo = 0, // vert. position - row in the pane (if docked state)
200 int columnPos = 0, // horiz. position in the row in pixels (if docked state)
201 const wxString& name="bar",// name, by which the bar could be referred
202 // in layout customization dialogs
203
204 bool spyEvents = FALSE, // if TRUE - input events for the bar should
205 // be "spyed" in order to forward not-handled
206 // mouse clicks to frame layout (e.g. to enable
207 // easy-draggablity of toolbars just by clicking
208 // on their interior regions). For widgets like
209 // text/tree control this value should be FALSE
210 // (since there's _no_ certain way to detect
211 // whether the event was actually handled...)
212
213 int state = wxCBAR_DOCKED_HORIZONTALLY // e.g. wxCBAR_FLOATING
214 // or wxCBAR_HIDDEN
215 );
216
217 // can be used for repositioning already existing bars. The given bar is first removed
218 // from the pane it currently belongs to, and inserted into the pane, which "matches"
219 // the given recantular area. If pToPane is not NULL, bar is docked to this given pane
220
221 // to dock the bar which is floated, use wxFrameLayout::DockBar(..) method
222
223 virtual bool RedockBar( cbBarInfo* pBar, const wxRect& shapeInParent,
224 cbDockPane* pToPane = NULL, bool updateNow = TRUE );
225
226 // methods for access and modification of bars in frame layout
227
228 cbBarInfo* FindBarByName( const wxString& name );
229
230 cbBarInfo* FindBarByWindow( const wxWindow* pWnd );
231
232 BarArrayT& GetBars();
233
234 // changes bar's docking state (see possible control bar states)
235
236 void SetBarState( cbBarInfo* pBar, int newStatem, bool updateNow );
237
238 void InverseVisibility( cbBarInfo* pBar );
239
240 // reflects changes in bar information structure visually
241 // (e.g. moves bar, changes it's dimension info, pane to which it is docked)
242
243 void ApplyBarProperties( cbBarInfo* pBar );
244
245 // removes bar from layout permanently, hides it's corresponding window if present
246
247 void RemoveBar( cbBarInfo* pBar );
248
249 // recalcualtes layout of panes, and all bars/rows in each pane
250
251 virtual void RecalcLayout( bool repositionBarsNow = FALSE );
252
253 int GetClientHeight();
254 int GetClientWidth();
255 wxRect& GetClientRect() { return mClntWndBounds; }
256
257 // NOTE:: in future ubdates-manager will become a normal plugin
258
259 cbUpdatesManagerBase& GetUpdatesManager();
260
261 // destroys the previous manager if any, set the new one
262
263 void SetUpdatesManager( cbUpdatesManagerBase* pUMgr );
264
265 // NOTE:: changing properties of panes, does not result immediate on-screen update
266
267 virtual void GetPaneProperties( cbCommonPaneProperties& props, int alignment = FL_ALIGN_TOP );
268
269 virtual void SetPaneProperties( const cbCommonPaneProperties& props,
270 int paneMask = wxALL_PANES );
271
272 // TODO:: margins should go into cbCommonPaneProperties in the future
273 //
274 // NOTE:: this method should be called before any custom plugins are attached
275
276 virtual void SetMargins( int top, int bottom, int left, int right,
277 int paneMask = wxALL_PANES );
278
279 virtual void SetPaneBackground( const wxColour& colour );
280
281 // recalculates layoute and performs on-screen update of all panes
282
283 void RefreshNow( bool recalcLayout = TRUE );
284
285 // event handlers
286
287 void OnSize ( wxSizeEvent& event );
288 void OnLButtonDown( wxMouseEvent& event );
289 void OnLDblClick ( wxMouseEvent& event );
290 void OnLButtonUp ( wxMouseEvent& event );
291 void OnRButtonDown( wxMouseEvent& event );
292 void OnRButtonUp ( wxMouseEvent& event );
293 void OnMouseMove ( wxMouseEvent& event );
294
295 /*** plugin-related methods ***/
296
297 // should be used, instead of passing the event to ProcessEvent(..) method
298 // of the top-plugin directly. This method checks if events are currently
299 // captured and ensures that plugin-event is routed correctly.
300
301 virtual void FirePluginEvent( cbPluginEvent& event );
302
303 // captures/releases user-input event's for the given plugin
304 // Input events are: mouse movement, mouse clicks, keyboard input
305
306 virtual void CaptureEventsForPlugin ( cbPluginBase* pPlugin );
307 virtual void ReleaseEventsFromPlugin( cbPluginBase* pPlugin );
308
309 // called by plugins ( also captures/releases mouse in parent frame)
310 void CaptureEventsForPane( cbDockPane* toPane );
311 void ReleaseEventsFromPane( cbDockPane* fromPane );
312
313 // returns current top-level plugin (the one which receives events first,
314 // with an exception if input-events are currently captured by some other plugin)
315
316 virtual cbPluginBase& GetTopPlugin();
317
318 // hooking custom plugins to frame layout
319 //
320 // NOTE:: when hooking one plugin on top of the other -
321 // use SetNextHandler(..) or similar methods
322 // of wxEvtHandler class to compose the chain of plugins,
323 // than pass the left-most handler in this chain to
324 // the above methods (assuming that events are delegated
325 // from left-most towards right-most handler)
326 //
327 // NOTE2:: this secenario is very inconvenient and "low-level",
328 // use Add/Push/PopPlugin methods instead
329
330 virtual void SetTopPlugin( cbPluginBase* pPlugin );
331
332 // similar to wxWindow's "push/pop-event-handler" methods, execept
333 // that plugin is *deleted* upon "popping"
334
335 virtual void PushPlugin( cbPluginBase* pPugin );
336 virtual void PopPlugin();
337
338 virtual void PopAllPlugins();
339
340 // default plugins are : cbPaneDrawPlugin, cbRowLayoutPlugin, cbBarDragPlugin,
341 // cbAntiflickerPlugin, cbSimpleCustomizePlugin
342 //
343 // this method is automatically invoked, if no plugins were found upon
344 // fireing of the first plugin-event, i.e. wxFrameLayout *CONFIGURES* itself
345
346 virtual void PushDefaultPlugins();
347
348 /* "Advanced" methods for plugin-configuration using their */
349 /* dynamic class information (e.g. CLASSINFO(pluginClass) ) */
350
351 // first checks if plugin of the given class is already "hooked up",
352 // if not, adds it to the top of plugins chain
353
354 virtual void AddPlugin( wxClassInfo* pPlInfo, int paneMask = wxALL_PANES );
355
356 // first checks if plugin of the givne class already hooked,
357 // if so, removes it, and then inserts it to the chain
358 // before plugin of the class given by "pNextPlInfo"
359 //
360 // NOTE:: this method is "handy" in some cases, where the order
361 // of plugin-chain could be important, e.g. one plugin overrides
362 // some functionallity of the other already hooked plugin,
363 // thefore the former should be hooked before the one
364 // who's functionality is being overriden
365
366 virtual void AddPluginBefore( wxClassInfo* pNextPlInfo, wxClassInfo* pPlInfo,
367 int paneMask = wxALL_PANES );
368
369 // checks if plugin of the given class is hooked, removes
370 // it if found
371 //
372 // @param pPlInfo class information structure for the plugin
373 // @note
374 // @see wxFrameLayout::Method
375
376
377 virtual void RemovePlugin( wxClassInfo* pPlInfo );
378
379 // returns NULL, if plugin of the given class is not hooked
380
381 virtual cbPluginBase* FindPlugin( wxClassInfo* pPlInfo );
382
383 bool HasTopPlugin();
384
385 DECLARE_EVENT_TABLE()
386 DECLARE_DYNAMIC_CLASS( wxFrameLayout )
387
388 public: /* protected really, acessed only by plugins and serializers */
389
390 friend class cbDockPane;
391 friend class wxBarHandler;
392
393 wxWindow* mpFrame; // parent frame
394 wxWindow* mpFrameClient; // client window
395 cbDockPane* mPanes[MAX_PANES]; // panes in the panel
396
397 // misc. cursors
398 wxCursor* mpHorizCursor;
399 wxCursor* mpVertCursor;
400 wxCursor* mpNormalCursor;
401 wxCursor* mpDragCursor;
402 wxCursor* mpNECursor; // no-entry cursor
403
404 // pens for decoration and shades
405
406 wxPen mDarkPen; // default wxSYS_COLOUR_3DSHADOW
407 wxPen mLightPen; // default wxSYS_COLOUR_3DHILIGHT
408 wxPen mGrayPen; // default wxSYS_COLOUR_3DFACE
409 wxPen mBlackPen; // default wxColour( 0, 0, 0)
410 wxPen mBorderPen; // default wxSYS_COLOUR_3DFACE
411
412 wxPen mNullPen; // transparent pen
413
414 // pane to which the all mouse input is currently directed (caputred)
415
416 cbDockPane* mpPaneInFocus;
417
418 // pane, from which mouse pointer had just left
419
420 cbDockPane* mpLRUPane;
421
422 // bounds of client window in parent frame's coordinates
423
424 wxRect mClntWndBounds;
425 wxRect mPrevClntWndBounds;
426
427 bool mFloatingOn;
428 wxPoint mNextFloatedWndPos;
429 wxSize mFloatingPosStep;
430
431 // current plugin (right-most) plugin which receives events first
432
433 cbPluginBase* mpTopPlugin;
434
435 // plugin, which currently has captured all input events, otherwise NULL
436
437 cbPluginBase* mpCaputesInput;
438
439 // list of event handlers which are "pushed" onto each bar, to catch
440 // mouse events which are not handled by bars, and froward them to the ,
441 // frome-layout and further to plugins
442
443 wxList mBarSpyList;
444
445 // list of top-most frames which contain floated bars
446
447 wxList mFloatedFrames;
448
449 // linked list of references to all bars (docked/floated/hidden)
450
451 BarArrayT mAllBars;
452
453 // FOR NOW:: dirty stuff...
454 bool mClientWndRefreshPending;
455 bool mRecalcPending;
456 bool mCheckFocusWhenIdle;
457
458 public: /* protected really (accessed only by plugins) */
459
460 // refrence to custom updates manager
461 cbUpdatesManagerBase* mpUpdatesMgr;
462
463 // called to set calculated layout to window objects
464 void PositionClientWindow();
465 void PositionPanes();
466 void CreateCursors();
467
468 void RepositionFloatedBar( cbBarInfo* pBar );
469 void DoSetBarState( cbBarInfo* pBar );
470
471 bool LocateBar( cbBarInfo* pBarInfo,
472 cbRowInfo** ppRow,
473 cbDockPane** ppPane );
474
475
476 bool HitTestPane( cbDockPane* pPane, int x, int y );
477 cbDockPane* HitTestPanes( const wxRect& rect, cbDockPane* pCurPane );
478
479 // returns panes, to which the given bar belongs
480
481 cbDockPane* GetBarPane( cbBarInfo* pBar );
482
483 // delegated from "bar-spy"
484 void ForwardMouseEvent( wxMouseEvent& event,
485 cbDockPane* pToPane,
486 int eventType );
487
488 void RouteMouseEvent( wxMouseEvent& event, int pluginEvtType );
489
490 void ShowFloatedWindows( bool show );
491
492 void UnhookFromFrame();
493 void HookUpToFrame();
494
495 // NOTE:: reparenting of windows may NOT work on all platforms
496 // (reparenting allows control-bars to be floated)
497
498 bool CanReparent();
499 void ReparentWindow( wxWindow* pChild, wxWindow* pNewParent );
500
501 wxRect& GetPrevClientRect() { return mPrevClntWndBounds; }
502
503 void OnPaint( wxPaintEvent& event );
504 void OnEraseBackground( wxEraseEvent& event );
505 void OnKillFocus( wxFocusEvent& event );
506 void OnSetFocus( wxFocusEvent& event );
507 void OnActivate( wxActivateEvent& event );
508 void OnIdle( wxIdleEvent& event );
509
510 // factory method
511 virtual cbUpdatesManagerBase* CreateUpdatesManager();
512 };
513
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
517 * updating algorithm
518 */
519
520 class cbUpdateMgrData : public wxObject
521 {
522 DECLARE_DYNAMIC_CLASS( cbUpdateMgrData )
523 public:
524 wxRect mPrevBounds; // previous state of layout item (in parent frame's coordinates)
525
526 bool mIsDirty; // overrides result of current-against-previous bounds comparison,
527 // i.e. requires item to be updated, regardless of it's current area
528
529 wxObject* mpCustomData; // any custom data stored by specific updates mgr.
530
531 cbUpdateMgrData(); // is-dirty flag is set TRUE initially
532
533 void StoreItemState( const wxRect& boundsInParent );
534
535 void SetDirty( bool isDirty = TRUE );
536
537 void SetCustomData( wxObject* pCustomData );
538
539 inline bool IsDirty() { return mIsDirty; }
540 };
541
542 /* Abstract interface 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.
547 */
548
549 class cbBarDimHandlerBase : public wxObject
550 {
551 DECLARE_ABSTRACT_CLASS( cbBarDimHandlerBase )
552
553 public:
554 int mRefCount; // since one dim-handler can be assigned
555 // to multiple bars, it's instance is
556 // reference-counted
557 public:
558
559 // initial reference count is 0, since handler is not used, until the
560 // first invocation of AddRef()
561
562 cbBarDimHandlerBase();
563
564 void AddRef();
565 void RemoveRef();
566
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;
570 };
571
572 /* helper classes (used internally by wxFrameLayout class) */
573
574 // holds and manages information about bar dimensions
575
576 class cbDimInfo : public wxObject
577 {
578 DECLARE_DYNAMIC_CLASS( cbDimInfo )
579 public:
580 wxSize mSizes[MAX_BAR_STATES]; // preferred sizes for each possible bar state
581
582 wxRect mBounds[MAX_BAR_STATES]; // saved positions and sizes for each
583 // possible state, values contain (-1)s if
584 // not initialized yet
585
586 int mLRUPane; // pane to which this bar was docked before it was floated
587 // (FL_ALIGN_TOP,FL_ALIGN_BOTTOM,..)
588
589 // top/bottom gap, separates decorations
590 // from the bar's actual window, filled
591 // with frame's beckground color, default: 0
592
593 int mVertGap;
594
595 // left/right gap, separates decorations
596 // from the bar's actual window, filled
597 // with frame's beckground colour, default: 0
598
599 int mHorizGap; // NOTE:: gaps are given in frame's coord. orientation
600
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
604
605 bool mIsFixed;
606
607 cbBarDimHandlerBase* mpHandler; // NULL, if no handler present
608
609 public:
610
611 cbDimInfo(void);
612
613 cbDimInfo( cbBarDimHandlerBase* pDimHandler,
614 bool isFixed // (see comments on mIsFixed member)
615 );
616
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
620
621 bool isFixed = TRUE,// (see comments on mIsFixed member)
622 int horizGap = 6, // (see comments on mHorizGap member)
623 int vertGap = 6, // -/-
624
625 cbBarDimHandlerBase* pDimHandler = NULL
626 );
627
628 cbDimInfo( int x, int y,
629 bool isFixed = TRUE,
630 int gap = 6,
631 cbBarDimHandlerBase* pDimHandler = NULL
632 );
633
634 const cbDimInfo& operator=( const cbDimInfo& other );
635
636 // destroys handler automatically, if present
637 ~cbDimInfo();
638
639 inline cbBarDimHandlerBase* GetDimHandler() { return mpHandler; }
640 };
641
642 WX_DEFINE_ARRAY(float, cbArrayFloat);
643
644 class cbRowInfo : public wxObject
645 {
646 DECLARE_DYNAMIC_CLASS( cbRowInfo )
647 public:
648
649 BarArrayT mBars; // row content
650
651 // row flags (set up according to row-relations)
652
653 bool mHasUpperHandle;
654 bool mHasLowerHandle;
655 bool mHasOnlyFixedBars;
656 int mNotFixedBarsCnt;
657
658 int mRowWidth;
659 int mRowHeight;
660 int mRowY;
661
662 // stores precalculated row's bounds in parent frame's coordinates
663 wxRect mBoundsInParent;
664
665 // info stored for updates-manager
666 cbUpdateMgrData mUMgrData;
667
668 cbRowInfo* mpNext;
669 cbRowInfo* mpPrev;
670
671 cbBarInfo* mpExpandedBar; // NULL, if non of the bars is currently expanded
672
673 cbArrayFloat mSavedRatios; // length-ratios bofore some of the bars was expanded
674
675 public:
676 cbRowInfo(void);
677
678 ~cbRowInfo();
679
680 // convenience method
681
682 inline cbBarInfo* GetFirstBar()
683
684 { return mBars.GetCount() ? mBars[0] : NULL; }
685 };
686
687 class cbBarInfo : public wxObject
688 {
689 DECLARE_DYNAMIC_CLASS( cbBarInfo )
690 public:
691 // textual name, by which this bar is refered in layout-customization dialogs
692 wxString mName;
693
694 // stores bar's bounds in pane's coordinates
695 wxRect mBounds;
696
697 // stores precalculated bar's bounds in parent frame's coordinates
698 wxRect mBoundsInParent;
699
700 // back-ref to the row, which contains this bar
701 cbRowInfo* mpRow;
702
703 // are set up according to the types of the surrounding bars in the row
704 bool mHasLeftHandle;
705 bool mHasRightHandle;
706
707 cbDimInfo mDimInfo; // preferred sizes for each, control bar state
708
709 int mState; // (see definition of controlbar states)
710
711 int mAlignment; // alignment of the pane to which this
712 // bar is currently placed
713
714 int mRowNo; // row, into which this bar would be placed,
715 // when in the docking state
716
717 wxWindow* mpBarWnd; // the actual window object, NULL if no window
718 // is attached to the control bar (possible!)
719
720 double mLenRatio; // length ratio among not-fixed-size bars
721
722 wxPoint mPosIfFloated; // stored last position when bar was in "floated" state
723 // poistion is stored in parent-window's coordinates
724
725 cbUpdateMgrData mUMgrData; // info stored for updates-manager
726
727 cbBarInfo* mpNext; // next. bar in the row
728 cbBarInfo* mpPrev; // prev. bar in the row
729
730 public:
731 cbBarInfo(void);
732
733 ~cbBarInfo();
734
735 inline bool IsFixed() const { return mDimInfo.mIsFixed; }
736
737 inline bool IsExpanded() const { return this == mpRow->mpExpandedBar; }
738 };
739
740 // used for storing original bar's postions in the row, when the "non-destructive-friction"
741 // option is turned ON
742
743 class cbBarShapeData : public wxObject
744 {
745 public:
746 wxRect mBounds;
747 double mLenRatio;
748 };
749
750 // used for traversing through all bars of all rows in the pane
751
752 class wxBarIterator
753 {
754 RowArrayT* mpRows;
755 cbRowInfo* mpRow;
756 cbBarInfo* mpBar;
757
758 public:
759 wxBarIterator( RowArrayT& rows );
760
761 void Reset();
762 bool Next(); // TRUE, if next bar is available
763
764 cbBarInfo& BarInfo();
765
766 // returns reference to currently traversed row
767 cbRowInfo& RowInfo();
768 };
769
770 /* structure holds configuration options,
771 * which are usually the same for all panes in
772 * frame layout
773 */
774
775 class cbCommonPaneProperties : public wxObject
776 {
777 DECLARE_DYNAMIC_CLASS( cbCommonPaneProperties )
778
779 // look-and-feel configuration
780
781 bool mRealTimeUpdatesOn; // default: ON
782 bool mOutOfPaneDragOn; // default: ON
783 bool mExactDockPredictionOn; // default: OFF
784 bool mNonDestructFirctionOn; // default: OFF
785
786 bool mShow3DPaneBorderOn; // default: ON
787
788 // FOR NOW:: the below properties are reserved for the "future"
789
790 bool mBarFloatingOn; // default: OFF
791 bool mRowProportionsOn; // default: OFF
792 bool mColProportionsOn; // default: ON
793 bool mBarCollapseIconsOn; // default: OFF
794 bool mBarDragHintsOn; // default: OFF
795
796 // minimal dimensions for not-fixed bars in this pane (16x16 default)
797
798 wxSize mMinCBarDim;
799
800 // width/height of resizing sash
801
802 int mResizeHandleSize;
803
804 cbCommonPaneProperties(void);
805 };
806
807 /* class manages containment and control of control-bars
808 * along one of the four edges of the parent frame
809 */
810
811 class cbDockPane : public wxObject
812 {
813 public:
814 DECLARE_DYNAMIC_CLASS( cbDockPane )
815
816 // look-and-feel configuration for this pane
817 cbCommonPaneProperties mProps;
818
819 // pane margins (in frame's coordinate-syst. orientation)
820
821 int mLeftMargin; // default: 2 pixels
822 int mRightMargin; // default: 2 pixels
823 int mTopMargin; // default: 2 pixels
824 int mBottomMargin; // default: 2 pixels
825
826 public:
827 // position of the pane in frame's coordinates
828 wxRect mBoundsInParent;
829
830 // pane width and height in pane's coordinates
831 int mPaneWidth;
832 int mPaneHeight;
833
834 int mAlignment;
835
836 // info stored for updates-manager
837 cbUpdateMgrData mUMgrData;
838
839 public: /* protected really */
840
841 RowArrayT mRows;
842 wxFrameLayout* mpLayout; // back-ref
843
844 // transient properties
845
846 wxList mRowShapeData; // shapes of bars of recently modified row,
847 // stored when in "non-destructive-firction" mode
848 cbRowInfo* mpStoredRow; // row-info for which the shapes are stored
849
850 friend class wxFrameLayout;
851
852 public: /* protected really (accessed only by plugins) */
853
854 cbRowInfo* GetRow( int row );
855
856 int GetRowIndex( cbRowInfo* pRow );
857
858 // return -1, if row is not present at given vertical position
859 int GetRowAt( int paneY );
860 int GetRowAt( int upperY, int lowerY );
861
862 // re-setups flags in the row-information structure, so that
863 // the would match the changed state of row-items correctly
864 void SyncRowFlags( cbRowInfo* pRow );
865
866 // layout "AI" helpers:
867
868 bool IsFixedSize( cbBarInfo* pInfo );
869 int GetNotFixedBarsCount( cbRowInfo* pRow );
870
871 int GetRowWidth( wxList* pRow );
872
873 int GetRowY( cbRowInfo* pRow );
874
875 bool HasNotFixedRowsAbove( cbRowInfo* pRow );
876 bool HasNotFixedRowsBelow( cbRowInfo* pRow );
877 bool HasNotFixedBarsLeft ( cbBarInfo* pBar );
878 bool HasNotFixedBarsRight( cbBarInfo* pBar );
879
880 virtual void CalcLengthRatios( cbRowInfo* pInRow );
881 virtual void RecalcRowLayout( cbRowInfo* pRow );
882
883 virtual void ExpandBar( cbBarInfo* pBar );
884 virtual void ContractBar( cbBarInfo* pBar );
885
886 void InitLinksForRow( cbRowInfo* pRow );
887 void InitLinksForRows();
888
889 // coordinate translation between parent's frame and this pane
890
891 void FrameToPane( int* x, int* y );
892 void PaneToFrame( int* x, int* y );
893 void FrameToPane( wxRect* pRect );
894 void PaneToFrame( wxRect* pRect );
895
896 inline bool HasPoint( const wxPoint& pos, int x, int y, int width, int height );
897
898 int GetMinimalRowHeight( cbRowInfo* pRow );
899
900 // given row height includes height of row handles, if present
901 void SetRowHeight( cbRowInfo* pRow, int newHeight );
902
903 void DoInsertBar( cbBarInfo* pBar, int rowNo );
904
905 public: /* protected really (accessed only by plugins) */
906
907 // methods for incramental on-screen refreshing of the pane
908 // (simply, they are wrappers around corresponding plugin-events)
909
910 virtual void PaintBarDecorations( cbBarInfo* pBar, wxDC& dc );
911 virtual void PaintBarHandles( cbBarInfo* pBar, wxDC& dc );
912 virtual void PaintBar( cbBarInfo* pBar, wxDC& dc );
913 virtual void PaintRowHandles( cbRowInfo* pRow, wxDC& dc );
914 virtual void PaintRowBackground ( cbRowInfo* pRow, wxDC& dc );
915 virtual void PaintRowDecorations( cbRowInfo* pRow, wxDC& dc );
916 virtual void PaintRow( cbRowInfo* pRow, wxDC& dc );
917 virtual void PaintPaneBackground( wxDC& dc );
918 virtual void PaintPaneDecorations( wxDC& dc );
919 virtual void PaintPane( wxDC& dc );
920 virtual void SizeBar( cbBarInfo* pBar );
921 virtual void SizeRowObjects( cbRowInfo* pRow );
922 virtual void SizePaneObjects();
923
924 virtual wxDC* StartDrawInArea ( const wxRect& area );
925 virtual void FinishDrawInArea( const wxRect& area );
926
927 public: /* public members */
928
929 cbDockPane(void);
930
931 cbDockPane( int alignment, wxFrameLayout* pPanel );
932
933 // sets pane's margins in frame's coordinate orientations
934 void SetMargins( int top, int bottom, int left, int right );
935
936 virtual ~cbDockPane();
937
938 // does not destroys the info bar , only removes it's reference
939 // from this pane
940
941 virtual void RemoveBar( cbBarInfo* pBar );
942
943 // rect given in the parent frame's coordinates
944
945 virtual void InsertBar( cbBarInfo* pBar, const wxRect& atRect );
946
947 // inserts bar into the given row, with dimensions and position
948 // stored in pBarInfo->mBounds. Returns the node of inserted bar
949
950 virtual void InsertBar( cbBarInfo* pBar, cbRowInfo* pIntoRow );
951
952 // inserts bar, sets its position according to the preferred settings
953 // given in (*pBarInfo) structure
954
955 virtual void InsertBar( cbBarInfo* pBarInfo );
956
957 // does not destroy the row object, only removes the corresponding
958 // node from this pane
959 virtual void RemoveRow( cbRowInfo* pRow );
960
961 // does not refresh the inserted row immediately,
962 // if pBeforeRowNode arg. is NULL, row is appended to the end of pane's row list
963 virtual void InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow );
964
965 // sets pane's width in pane's coordinates (including margins)
966 void SetPaneWidth(int width);
967
968 // set the position and dims. of the pane in parent frame's coordinates
969 void SetBoundsInParent( const wxRect& rect );
970
971 inline wxRect& GetRealRect() { return mBoundsInParent; }
972
973 // used by updates-managers
974 inline RowArrayT& GetRowList() { return mRows; }
975
976 // convenience method
977
978 inline cbRowInfo* GetFirstRow()
979
980 { return mRows.GetCount() ? mRows[0] : NULL; }
981
982 // TRUE, if the given bar node presents in this pane
983
984 bool BarPresent( cbBarInfo* pBar );
985
986 // retuns height, in pane's coordinates
987 int GetPaneHeight();
988
989 int GetAlignment();
990
991 bool MatchesMask( int paneMask );
992
993 inline bool IsHorizontal()
994 {
995 return (mAlignment == FL_ALIGN_TOP ||
996 mAlignment == FL_ALIGN_BOTTOM );
997 }
998
999 virtual void RecalcLayout();
1000
1001 virtual int GetDockingState();
1002
1003 // returns result of hit-testing items in the pane,
1004 // see CB_HITTEST_RESULTS enumeration
1005
1006 virtual int HitTestPaneItems( const wxPoint& pos, // position in pane's coordinates
1007 cbRowInfo** ppRow,
1008 cbBarInfo** ppBar
1009 );
1010
1011 void GetBarResizeRange( cbBarInfo* pBar, int* from, int *till, bool forLeftHandle );
1012 void GetRowResizeRange( cbRowInfo* pRow, int* from, int* till, bool forUpperHandle );
1013
1014 cbBarInfo* GetBarInfoByWindow( wxWindow* pBarWnd );
1015
1016 public: /* protected really (accessed only by plugins) */
1017
1018 // row/bar resizing related helper-methods
1019
1020 void DrawVertHandle ( wxDC& dc, int x, int y, int height );
1021 void DrawHorizHandle( wxDC& dc, int x, int y, int width );
1022
1023 void ResizeRow( cbRowInfo* pRow, int ofs, bool forUpperHandle );
1024 void ResizeBar( cbBarInfo* pBar, int ofs, bool forLeftHandle );
1025
1026 // cbBarShapeData objects will be placed to given pLst (see comments on cbBarShapeData)
1027
1028 void GetRowShapeData( cbRowInfo* pRow, wxList* pLst );
1029
1030 // sets the shape to the given row, using the data provided in pLst
1031 void SetRowShapeData( cbRowInfo* pRowNode, wxList* pLst );
1032 };
1033
1034 /*
1035 * class declares abstract interface for optimized logic, which should refresh
1036 * areas of frame layout - that actually need to be updated. Should be extended,
1037 * to implement custom updating strategy
1038 */
1039
1040 class cbUpdatesManagerBase : public wxObject
1041 {
1042 DECLARE_ABSTRACT_CLASS( cbUpdatesManagerBase )
1043
1044 public: /* protected really, accessed by serializer (if any) */
1045
1046 wxFrameLayout* mpLayout;
1047
1048 public:
1049 cbUpdatesManagerBase(void)
1050 : mpLayout( 0 ) {}
1051
1052 cbUpdatesManagerBase( wxFrameLayout* pPanel )
1053 : mpLayout( pPanel ) {}
1054
1055 virtual ~cbUpdatesManagerBase() {}
1056
1057 void SetLayout( wxFrameLayout* pLayout ) { mpLayout = pLayout; }
1058
1059 // notificiactions received from frame-layout (in the order, in which
1060 // they usually would be invoked). Custom updates-managers may utilize
1061 // these notifications to implement more "fine-grained" updating strategy
1062
1063 virtual void OnStartChanges() = 0;
1064
1065 virtual void OnRowWillChange( cbRowInfo* pRow, cbDockPane* pInPane ) {}
1066 virtual void OnBarWillChange( cbBarInfo* pBar, cbRowInfo* pInRow, cbDockPane* pInPane ) {}
1067 virtual void OnPaneMarginsWillChange( cbDockPane* pPane ) {}
1068 virtual void OnPaneWillChange( cbDockPane* pPane ) {}
1069
1070 virtual void OnFinishChanges() {}
1071
1072 // refreshes parts of the frame layout, which need an update
1073 virtual void UpdateNow() = 0;
1074 };
1075
1076 /*------------------------------------------------------------
1077 * "API" for developing custom plugins of Frame Layout Engine
1078 * TODO:: documentation
1079 *------------------------------------------------------------
1080 */
1081
1082 // base class for all control-bar plugin events
1083
1084 class cbPluginEvent : public wxEvent
1085 {
1086 // NOTE:: plugin-event does not need to be a dynamic class
1087
1088 public:
1089 cbDockPane* mpPane; // NULL, if event is not addressed to any specific pane
1090
1091 /* OLD STUFF::
1092 // FOR NOW FOR NOW:: all-in-one plugin event structure
1093 wxNode* mpObjNode;
1094 wxNode* mpObjNodeAux;
1095 wxPoint mPos;
1096 wxSize mSize;
1097 wxDC* mpDC;
1098 bool mAuxBoolVal;
1099 */
1100
1101 // Not used, but required
1102 virtual wxEvent* Clone() const { return NULL; }
1103
1104 #if wxCHECK_VERSION(2,3,0)
1105 cbPluginEvent( wxEventType eventType, cbDockPane* pPane )
1106 : mpPane( pPane )
1107
1108 { m_eventType = eventType; }
1109 #else
1110 cbPluginEvent( int eventType, cbDockPane* pPane )
1111 : mpPane( pPane )
1112
1113 { m_eventType = eventType; }
1114 #endif
1115 };
1116
1117 // event types handled by plugins
1118
1119 #if wxCHECK_VERSION(2,3,0)
1120
1121 extern wxEventType cbEVT_PL_LEFT_DOWN;
1122 extern wxEventType cbEVT_PL_LEFT_UP;
1123 extern wxEventType cbEVT_PL_RIGHT_DOWN;
1124 extern wxEventType cbEVT_PL_RIGHT_UP;
1125 extern wxEventType cbEVT_PL_MOTION;
1126
1127 extern wxEventType cbEVT_PL_LEFT_DCLICK;
1128
1129 extern wxEventType cbEVT_PL_LAYOUT_ROW;
1130 extern wxEventType cbEVT_PL_RESIZE_ROW;
1131 extern wxEventType cbEVT_PL_LAYOUT_ROWS;
1132 extern wxEventType cbEVT_PL_INSERT_BAR;
1133 extern wxEventType cbEVT_PL_RESIZE_BAR;
1134 extern wxEventType cbEVT_PL_REMOVE_BAR;
1135 extern wxEventType cbEVT_PL_SIZE_BAR_WND;
1136
1137 extern wxEventType cbEVT_PL_DRAW_BAR_DECOR;
1138 extern wxEventType cbEVT_PL_DRAW_ROW_DECOR;
1139 extern wxEventType cbEVT_PL_DRAW_PANE_DECOR;
1140 extern wxEventType cbEVT_PL_DRAW_BAR_HANDLES;
1141 extern wxEventType cbEVT_PL_DRAW_ROW_HANDLES;
1142 extern wxEventType cbEVT_PL_DRAW_ROW_BKGROUND;
1143 extern wxEventType cbEVT_PL_DRAW_PANE_BKGROUND;
1144
1145 extern wxEventType cbEVT_PL_START_BAR_DRAGGING;
1146 extern wxEventType cbEVT_PL_DRAW_HINT_RECT;
1147
1148 extern wxEventType cbEVT_PL_START_DRAW_IN_AREA;
1149 extern wxEventType cbEVT_PL_FINISH_DRAW_IN_AREA;
1150
1151 extern wxEventType cbEVT_PL_CUSTOMIZE_BAR;
1152 extern wxEventType cbEVT_PL_CUSTOMIZE_LAYOUT;
1153
1154 extern wxEventType wxCUSTOM_CB_PLUGIN_EVENTS_START_AT;
1155
1156 #else
1157
1158 #define cbEVT_PL_LEFT_DOWN 0
1159 #define cbEVT_PL_LEFT_UP 1
1160 #define cbEVT_PL_RIGHT_DOWN 2
1161 #define cbEVT_PL_RIGHT_UP 3
1162 #define cbEVT_PL_MOTION 4
1163
1164 #define cbEVT_PL_LEFT_DCLICK 5
1165
1166 #define cbEVT_PL_LAYOUT_ROW 6
1167 #define cbEVT_PL_RESIZE_ROW 7
1168 #define cbEVT_PL_LAYOUT_ROWS 8
1169 #define cbEVT_PL_INSERT_BAR 9
1170 #define cbEVT_PL_RESIZE_BAR 10
1171 #define cbEVT_PL_REMOVE_BAR 11
1172 #define cbEVT_PL_SIZE_BAR_WND 12
1173
1174 #define cbEVT_PL_DRAW_BAR_DECOR 13
1175 #define cbEVT_PL_DRAW_ROW_DECOR 14
1176 #define cbEVT_PL_DRAW_PANE_DECOR 15
1177 #define cbEVT_PL_DRAW_BAR_HANDLES 16
1178 #define cbEVT_PL_DRAW_ROW_HANDLES 17
1179 #define cbEVT_PL_DRAW_ROW_BKGROUND 18
1180 #define cbEVT_PL_DRAW_PANE_BKGROUND 19
1181
1182 #define cbEVT_PL_START_BAR_DRAGGING 20
1183 #define cbEVT_PL_DRAW_HINT_RECT 21
1184
1185 #define cbEVT_PL_START_DRAW_IN_AREA 22
1186 #define cbEVT_PL_FINISH_DRAW_IN_AREA 23
1187
1188 #define cbEVT_PL_CUSTOMIZE_BAR 24
1189 #define cbEVT_PL_CUSTOMIZE_LAYOUT 25
1190
1191 #define wxCUSTOM_CB_PLUGIN_EVENTS_START_AT 100
1192
1193 #endif // wxCHECK_VERSION(2,3,0) else
1194
1195 // forward decls, separated by categories
1196
1197 class cbLeftDownEvent;
1198 class cbLeftUpEvent;
1199 class cbRightDownEvent;
1200 class cbRightUpEvent;
1201 class cbMotionEvent;
1202 class cbLeftDClickEvent;
1203
1204 class cbLayoutRowEvent;
1205 class cbResizeRowEvent;
1206 class cbLayoutRowsEvent;
1207 class cbInsertBarEvent;
1208 class cbResizeBarEvent;
1209 class cbRemoveBarEvent;
1210 class cbSizeBarWndEvent;
1211
1212 class cbDrawBarDecorEvent;
1213 class cbDrawRowDecorEvent;
1214 class cbDrawPaneDecorEvent;
1215 class cbDrawBarHandlesEvent;
1216 class cbDrawRowHandlesEvent;
1217 class cbDrawRowBkGroundEvent;
1218 class cbDrawPaneBkGroundEvent;
1219
1220 class cbStartBarDraggingEvent;
1221 class cbDrawHintRectEvent;
1222
1223 class cbStartDrawInAreaEvent;
1224 class cbFinishDrawInAreaEvent;
1225
1226 class cbCustomizeBarEvent;
1227 class cbCustomizeLayoutEvent;
1228
1229 // defs. for handler-methods
1230
1231 typedef void (wxEvtHandler::*cbLeftDownHandler )(cbLeftDownEvent&);
1232 typedef void (wxEvtHandler::*cbLeftUpHandler )(cbLeftUpEvent&);
1233 typedef void (wxEvtHandler::*cbRightDownHandler )(cbRightDownEvent&);
1234 typedef void (wxEvtHandler::*cbRightUpHandler )(cbRightUpEvent&);
1235 typedef void (wxEvtHandler::*cbMotionHandler )(cbMotionEvent&);
1236 typedef void (wxEvtHandler::*cbLeftDClickHandler )(cbLeftDClickEvent&);
1237
1238 typedef void (wxEvtHandler::*cbLayoutRowHandler )(cbLayoutRowEvent&);
1239 typedef void (wxEvtHandler::*cbResizeRowHandler )(cbResizeRowEvent&);
1240 typedef void (wxEvtHandler::*cbLayoutRowsHandler )(cbLayoutRowsEvent&);
1241 typedef void (wxEvtHandler::*cbInsertBarHandler )(cbInsertBarEvent&);
1242 typedef void (wxEvtHandler::*cbResizeBarHandler )(cbResizeBarEvent&);
1243 typedef void (wxEvtHandler::*cbRemoveBarHandler )(cbRemoveBarEvent&);
1244 typedef void (wxEvtHandler::*cbSizeBarWndHandler )(cbSizeBarWndEvent&);
1245
1246 typedef void (wxEvtHandler::*cbDrawBarDecorHandler )(cbDrawBarDecorEvent&);
1247 typedef void (wxEvtHandler::*cbDrawRowDecorHandler )(cbDrawRowDecorEvent&);
1248 typedef void (wxEvtHandler::*cbDrawPaneDecorHandler )(cbDrawPaneDecorEvent&);
1249 typedef void (wxEvtHandler::*cbDrawBarHandlesHandler )(cbDrawBarHandlesEvent&);
1250 typedef void (wxEvtHandler::*cbDrawRowHandlesHandler )(cbDrawRowHandlesEvent&);
1251 typedef void (wxEvtHandler::*cbDrawRowBkGroundHandler )(cbDrawRowBkGroundEvent&);
1252 typedef void (wxEvtHandler::*cbDrawPaneBkGroundHandler)(cbDrawPaneBkGroundEvent&);
1253
1254 typedef void (wxEvtHandler::*cbStartBarDraggingHandler )(cbStartBarDraggingEvent&);
1255 typedef void (wxEvtHandler::*cbDrawHintRectHandler )(cbDrawHintRectEvent&);
1256
1257 typedef void (wxEvtHandler::*cbStartDrawInAreaHandler )(cbStartDrawInAreaEvent&);
1258 typedef void (wxEvtHandler::*cbFinishDrawInAreaHandler)(cbFinishDrawInAreaEvent&);
1259
1260 typedef void (wxEvtHandler::*cbCustomizeBarHandler )(cbCustomizeBarEvent&);
1261 typedef void (wxEvtHandler::*cbCustomizeLayoutHandler )(cbCustomizeLayoutEvent&);
1262
1263 // macros for creating event table entries for plugin-events
1264
1265 #if wxCHECK_VERSION(2,3,0)
1266 #define EVT_PL_LEFT_DOWN(func) wxEventTableEntry( cbEVT_PL_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDownHandler ) & func, (wxObject *) NULL ),
1267 #define EVT_PL_LEFT_UP(func) wxEventTableEntry( cbEVT_PL_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftUpHandler ) & func, (wxObject *) NULL ),
1268 #define EVT_PL_RIGHT_DOWN(func) wxEventTableEntry( cbEVT_PL_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightDownHandler ) & func, (wxObject *) NULL ),
1269 #define EVT_PL_RIGHT_UP(func) wxEventTableEntry( cbEVT_PL_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightUpHandler ) & func, (wxObject *) NULL ),
1270 #define EVT_PL_MOTION(func) wxEventTableEntry( cbEVT_PL_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbMotionHandler ) & func, (wxObject *) NULL ),
1271 #define EVT_PL_LEFT_DCLICK(func) wxEventTableEntry( cbEVT_PL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDClickHandler ) & func, (wxObject *) NULL ),
1272
1273 #define EVT_PL_LAYOUT_ROW(func) wxEventTableEntry( cbEVT_PL_LAYOUT_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowHandler ) & func, (wxObject *) NULL ),
1274 #define EVT_PL_RESIZE_ROW(func) wxEventTableEntry( cbEVT_PL_RESIZE_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeRowHandler ) & func, (wxObject *) NULL ),
1275 #define EVT_PL_LAYOUT_ROWS(func) wxEventTableEntry( cbEVT_PL_LAYOUT_ROWS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowsHandler ) & func, (wxObject *) NULL ),
1276 #define EVT_PL_INSERT_BAR(func) wxEventTableEntry( cbEVT_PL_INSERT_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbInsertBarHandler ) & func, (wxObject *) NULL ),
1277 #define EVT_PL_RESIZE_BAR(func) wxEventTableEntry( cbEVT_PL_RESIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeBarHandler ) & func, (wxObject *) NULL ),
1278 #define EVT_PL_REMOVE_BAR(func) wxEventTableEntry( cbEVT_PL_REMOVE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRemoveBarHandler ) & func, (wxObject *) NULL ),
1279 #define EVT_PL_SIZE_BAR_WND(func) wxEventTableEntry( cbEVT_PL_SIZE_BAR_WND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbSizeBarWndHandler ) & func, (wxObject *) NULL ),
1280
1281 #define EVT_PL_DRAW_BAR_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_BAR_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarDecorHandler ) & func, (wxObject *) NULL ),
1282 #define EVT_PL_DRAW_ROW_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowDecorHandler ) & func, (wxObject *) NULL ),
1283 #define EVT_PL_DRAW_PANE_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_PANE_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneDecorHandler ) & func, (wxObject *) NULL ),
1284 #define EVT_PL_DRAW_BAR_HANDLES(func) wxEventTableEntry( cbEVT_PL_DRAW_BAR_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarHandlesHandler ) & func, (wxObject *) NULL ),
1285 #define EVT_PL_DRAW_ROW_HANDLES(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowHandlesHandler ) & func, (wxObject *) NULL ),
1286 #define EVT_PL_DRAW_ROW_BKGROUND(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowBkGroundHandler ) & func, (wxObject *) NULL ),
1287 #define EVT_PL_DRAW_PANE_BKGROUND(func) wxEventTableEntry( cbEVT_PL_DRAW_PANE_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneBkGroundHandler) & func, (wxObject *) NULL ),
1288
1289 #define EVT_PL_START_BAR_DRAGGING(func) wxEventTableEntry( cbEVT_PL_START_BAR_DRAGGING, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartBarDraggingHandler) & func, (wxObject *) NULL ),
1290 #define EVT_PL_DRAW_HINT_RECT(func) wxEventTableEntry( cbEVT_PL_DRAW_HINT_RECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawHintRectHandler ) & func, (wxObject *) NULL ),
1291
1292
1293 #define EVT_PL_START_DRAW_IN_AREA(func) wxEventTableEntry( cbEVT_PL_START_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartDrawInAreaHandler) & func, (wxObject *) NULL ),
1294 #define EVT_PL_FINISH_DRAW_IN_AREA(func) wxEventTableEntry( cbEVT_PL_FINISH_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbFinishDrawInAreaHandler) & func, (wxObject *) NULL ),
1295
1296 #define EVT_PL_CUSTOMIZE_BAR(func) wxEventTableEntry( cbEVT_PL_CUSTOMIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeBarHandler) & func, (wxObject *) NULL ),
1297 #define EVT_PL_CUSTOMIZE_LAYOUT(func) wxEventTableEntry( cbEVT_PL_CUSTOMIZE_LAYOUT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeLayoutHandler) & func, (wxObject *) NULL ),
1298 #else
1299 #define EVT_PL_LEFT_DOWN(func) { cbEVT_PL_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDownHandler ) & func },
1300 #define EVT_PL_LEFT_UP(func) { cbEVT_PL_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftUpHandler ) & func },
1301 #define EVT_PL_RIGHT_DOWN(func) { cbEVT_PL_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightDownHandler ) & func },
1302 #define EVT_PL_RIGHT_UP(func) { cbEVT_PL_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightUpHandler ) & func },
1303 #define EVT_PL_MOTION(func) { cbEVT_PL_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbMotionHandler ) & func },
1304 #define EVT_PL_LEFT_DCLICK(func) { cbEVT_PL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDClickHandler ) & func },
1305
1306 #define EVT_PL_LAYOUT_ROW(func) { cbEVT_PL_LAYOUT_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowHandler ) & func },
1307 #define EVT_PL_RESIZE_ROW(func) { cbEVT_PL_RESIZE_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeRowHandler ) & func },
1308 #define EVT_PL_LAYOUT_ROWS(func) { cbEVT_PL_LAYOUT_ROWS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowsHandler ) & func },
1309 #define EVT_PL_INSERT_BAR(func) { cbEVT_PL_INSERT_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbInsertBarHandler ) & func },
1310 #define EVT_PL_RESIZE_BAR(func) { cbEVT_PL_RESIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeBarHandler ) & func },
1311 #define EVT_PL_REMOVE_BAR(func) { cbEVT_PL_REMOVE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRemoveBarHandler ) & func },
1312 #define EVT_PL_SIZE_BAR_WND(func) { cbEVT_PL_SIZE_BAR_WND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbSizeBarWndHandler ) & func },
1313
1314 #define EVT_PL_DRAW_BAR_DECOR(func) { cbEVT_PL_DRAW_BAR_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarDecorHandler ) & func },
1315 #define EVT_PL_DRAW_ROW_DECOR(func) { cbEVT_PL_DRAW_ROW_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowDecorHandler ) & func },
1316 #define EVT_PL_DRAW_PANE_DECOR(func) { cbEVT_PL_DRAW_PANE_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneDecorHandler ) & func },
1317 #define EVT_PL_DRAW_BAR_HANDLES(func) { cbEVT_PL_DRAW_BAR_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarHandlesHandler ) & func },
1318 #define EVT_PL_DRAW_ROW_HANDLES(func) { cbEVT_PL_DRAW_ROW_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowHandlesHandler ) & func },
1319 #define EVT_PL_DRAW_ROW_BKGROUND(func) { cbEVT_PL_DRAW_ROW_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowBkGroundHandler ) & func },
1320 #define EVT_PL_DRAW_PANE_BKGROUND(func) { cbEVT_PL_DRAW_PANE_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneBkGroundHandler) & func },
1321
1322 #define EVT_PL_START_BAR_DRAGGING(func) { cbEVT_PL_START_BAR_DRAGGING, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartBarDraggingHandler) & func },
1323 #define EVT_PL_DRAW_HINT_RECT(func) { cbEVT_PL_DRAW_HINT_RECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawHintRectHandler ) & func },
1324
1325 #define EVT_PL_START_DRAW_IN_AREA(func) { cbEVT_PL_START_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartDrawInAreaHandler) & func },
1326 #define EVT_PL_FINISH_DRAW_IN_AREA(func) { cbEVT_PL_FINISH_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbFinishDrawInAreaHandler) & func },
1327
1328 #define EVT_PL_CUSTOMIZE_BAR(func) { cbEVT_PL_CUSTOMIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeBarHandler) & func },
1329 #define EVT_PL_CUSTOMIZE_LAYOUT(func) { cbEVT_PL_CUSTOMIZE_LAYOUT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeLayoutHandler) & func },
1330 #endif
1331 /*
1332 * abstract base class for all control-bar related plugins
1333 */
1334
1335 class cbPluginBase : public wxEvtHandler
1336 {
1337 DECLARE_ABSTRACT_CLASS( cbPluginBase )
1338 public:
1339
1340 wxFrameLayout* mpLayout; // back-reference to the frame layout
1341
1342 // specifies panes, for which this plugin receives events
1343 // (see pane masks definitions)
1344 int mPaneMask;
1345
1346 bool mIsReady; // is TRUE, when plugin is ready to handle events
1347
1348 public:
1349 cbPluginBase(void)
1350
1351 : mpLayout ( 0 ),
1352 mPaneMask( wxALL_PANES ),
1353 mIsReady ( FALSE )
1354 {}
1355
1356 cbPluginBase( wxFrameLayout* pPanel, int paneMask = wxALL_PANES )
1357
1358 : mpLayout ( pPanel ),
1359 mPaneMask( paneMask ),
1360 mIsReady ( FALSE )
1361 {}
1362
1363 inline int GetPaneMask() { return mPaneMask; }
1364
1365 // NOTE:: pointer positions of mouse-events sent to plugins
1366 // are always in pane's coordinates (pane's to which
1367 // this plugin is hooked)
1368
1369 // destroys the whole plugin chain of connected plagins
1370 virtual ~cbPluginBase();
1371
1372 // override this method to do plugin-specific initialization
1373 // (at this point plugin is already attached to the frame layout,
1374 // and pane masks are set)
1375 virtual void OnInitPlugin() { mIsReady = TRUE; }
1376
1377 bool IsReady() { return mIsReady; }
1378
1379 // overriden, to determine whether the target pane specified in the
1380 // event, matches the pane mask of this plugin (specific plugins
1381 // do not override this method)
1382
1383 virtual bool ProcessEvent(wxEvent& event);
1384 };
1385
1386 /*** event classes, for each corresponding event type (24 currnetly...uhh) ***/
1387
1388 // mouse-events category
1389
1390 class cbLeftDownEvent : public cbPluginEvent
1391 {
1392 public:
1393 wxPoint mPos;
1394
1395 cbLeftDownEvent( const wxPoint& pos, cbDockPane* pPane )
1396
1397 : cbPluginEvent( cbEVT_PL_LEFT_DOWN, pPane ),
1398 mPos( pos )
1399 {}
1400 };
1401
1402 class cbLeftUpEvent : public cbPluginEvent
1403 {
1404 public:
1405 wxPoint mPos;
1406
1407 cbLeftUpEvent( const wxPoint& pos, cbDockPane* pPane )
1408
1409 : cbPluginEvent( cbEVT_PL_LEFT_UP, pPane ),
1410 mPos( pos )
1411 {}
1412 };
1413
1414 class cbRightDownEvent : public cbPluginEvent
1415 {
1416 public:
1417 wxPoint mPos;
1418
1419 cbRightDownEvent( const wxPoint& pos, cbDockPane* pPane )
1420
1421 : cbPluginEvent( cbEVT_PL_RIGHT_DOWN, pPane ),
1422 mPos( pos )
1423 {}
1424 };
1425
1426 class cbRightUpEvent : public cbPluginEvent
1427 {
1428 public:
1429 wxPoint mPos;
1430
1431 cbRightUpEvent( const wxPoint& pos, cbDockPane* pPane )
1432
1433 : cbPluginEvent( cbEVT_PL_RIGHT_UP, pPane ),
1434 mPos( pos )
1435 {}
1436 };
1437
1438 class cbMotionEvent : public cbPluginEvent
1439 {
1440 public:
1441 wxPoint mPos;
1442
1443 cbMotionEvent( const wxPoint& pos, cbDockPane* pPane )
1444
1445 : cbPluginEvent( cbEVT_PL_MOTION, pPane ),
1446 mPos( pos )
1447 {}
1448 };
1449
1450 class cbLeftDClickEvent : public cbPluginEvent
1451 {
1452 public:
1453 wxPoint mPos;
1454
1455 cbLeftDClickEvent( const wxPoint& pos, cbDockPane* pPane )
1456
1457 : cbPluginEvent( cbEVT_PL_LEFT_DCLICK, pPane ),
1458 mPos( pos )
1459 {}
1460 };
1461
1462 // bar/row events category
1463
1464 class cbLayoutRowEvent : public cbPluginEvent
1465 {
1466 public:
1467 cbRowInfo* mpRow;
1468
1469 cbLayoutRowEvent( cbRowInfo* pRow, cbDockPane* pPane )
1470
1471 : cbPluginEvent( cbEVT_PL_LAYOUT_ROW, pPane ),
1472 mpRow( pRow )
1473 {}
1474 };
1475
1476 class cbResizeRowEvent : public cbPluginEvent
1477 {
1478 public:
1479 cbRowInfo* mpRow;
1480 int mHandleOfs;
1481 bool mForUpperHandle;
1482
1483 cbResizeRowEvent( cbRowInfo* pRow, int handleOfs, bool forUpperHandle, cbDockPane* pPane )
1484
1485 : cbPluginEvent( cbEVT_PL_RESIZE_ROW, pPane ),
1486 mpRow( pRow ),
1487 mHandleOfs( handleOfs ),
1488 mForUpperHandle( forUpperHandle )
1489 {}
1490 };
1491
1492 class cbLayoutRowsEvent : public cbPluginEvent
1493 {
1494 public:
1495
1496 cbLayoutRowsEvent( cbDockPane* pPane )
1497
1498 : cbPluginEvent( cbEVT_PL_LAYOUT_ROWS, pPane )
1499 {}
1500 };
1501
1502 class cbInsertBarEvent : public cbPluginEvent
1503 {
1504 public:
1505 cbBarInfo* mpBar;
1506 cbRowInfo* mpRow;
1507
1508 cbInsertBarEvent( cbBarInfo* pBar, cbRowInfo* pIntoRow, cbDockPane* pPane )
1509
1510 : cbPluginEvent( cbEVT_PL_INSERT_BAR, pPane ),
1511
1512 mpBar( pBar ),
1513 mpRow( pIntoRow )
1514 {}
1515 };
1516
1517 class cbResizeBarEvent : public cbPluginEvent
1518 {
1519 public:
1520 cbBarInfo* mpBar;
1521 cbRowInfo* mpRow;
1522
1523 cbResizeBarEvent( cbBarInfo* pBar, cbRowInfo* pRow, cbDockPane* pPane )
1524
1525 : cbPluginEvent( cbEVT_PL_RESIZE_BAR, pPane ),
1526 mpBar( pBar ),
1527 mpRow( pRow )
1528 {}
1529 };
1530
1531 class cbRemoveBarEvent : public cbPluginEvent
1532 {
1533 public:
1534 cbBarInfo* mpBar;
1535
1536 cbRemoveBarEvent( cbBarInfo* pBar, cbDockPane* pPane )
1537
1538 : cbPluginEvent( cbEVT_PL_REMOVE_BAR, pPane ),
1539 mpBar( pBar )
1540 {}
1541 };
1542
1543 class cbSizeBarWndEvent : public cbPluginEvent
1544 {
1545 public:
1546 cbBarInfo* mpBar;
1547 wxRect mBoundsInParent;
1548
1549 cbSizeBarWndEvent( cbBarInfo* pBar, cbDockPane* pPane )
1550
1551 : cbPluginEvent( cbEVT_PL_SIZE_BAR_WND, pPane ),
1552 mpBar( pBar ),
1553 mBoundsInParent( pBar->mBoundsInParent )
1554 {}
1555 };
1556
1557 class cbDrawBarDecorEvent : public cbPluginEvent
1558 {
1559 public:
1560 cbBarInfo* mpBar;
1561 wxDC* mpDc;
1562 wxRect mBoundsInParent;
1563
1564 cbDrawBarDecorEvent( cbBarInfo* pBar, wxDC& dc, cbDockPane* pPane )
1565
1566 : cbPluginEvent( cbEVT_PL_DRAW_BAR_DECOR, pPane ),
1567 mpBar( pBar ),
1568 mpDc( &dc ),
1569 mBoundsInParent( pBar->mBoundsInParent )
1570 {}
1571 };
1572
1573 class cbDrawRowDecorEvent : public cbPluginEvent
1574 {
1575 public:
1576 cbRowInfo* mpRow;
1577 wxDC* mpDc;
1578
1579 cbDrawRowDecorEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane )
1580
1581 : cbPluginEvent( cbEVT_PL_DRAW_ROW_DECOR, pPane ),
1582 mpRow( pRow ),
1583 mpDc( &dc )
1584 {}
1585 };
1586
1587 class cbDrawPaneDecorEvent : public cbPluginEvent
1588 {
1589 public:
1590 wxDC* mpDc;
1591
1592 cbDrawPaneDecorEvent( wxDC& dc, cbDockPane* pPane )
1593
1594 : cbPluginEvent( cbEVT_PL_DRAW_PANE_DECOR, pPane ),
1595 mpDc( &dc )
1596 {}
1597 };
1598
1599 class cbDrawBarHandlesEvent : public cbPluginEvent
1600 {
1601 public:
1602 cbBarInfo* mpBar;
1603 wxDC* mpDc;
1604
1605 cbDrawBarHandlesEvent( cbBarInfo* pBar, wxDC& dc, cbDockPane* pPane )
1606
1607 : cbPluginEvent( cbEVT_PL_DRAW_BAR_HANDLES, pPane ),
1608 mpBar( pBar ),
1609 mpDc( &dc )
1610 {}
1611 };
1612
1613 class cbDrawRowHandlesEvent : public cbPluginEvent
1614 {
1615 public:
1616 cbRowInfo* mpRow;
1617 wxDC* mpDc;
1618
1619 cbDrawRowHandlesEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane )
1620
1621 : cbPluginEvent( cbEVT_PL_DRAW_ROW_HANDLES, pPane ),
1622 mpRow( pRow ),
1623 mpDc( &dc )
1624 {}
1625 };
1626
1627 class cbDrawRowBkGroundEvent : public cbPluginEvent
1628 {
1629 public:
1630 cbRowInfo* mpRow;
1631 wxDC* mpDc;
1632
1633 cbDrawRowBkGroundEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane )
1634
1635 : cbPluginEvent( cbEVT_PL_DRAW_ROW_BKGROUND, pPane ),
1636 mpRow( pRow ),
1637 mpDc( &dc )
1638 {}
1639 };
1640
1641 class cbDrawPaneBkGroundEvent : public cbPluginEvent
1642 {
1643 public:
1644 wxDC* mpDc;
1645
1646 cbDrawPaneBkGroundEvent( wxDC& dc, cbDockPane* pPane )
1647
1648 : cbPluginEvent( cbEVT_PL_DRAW_PANE_BKGROUND, pPane ),
1649 mpDc( &dc )
1650 {}
1651 };
1652
1653 class cbStartBarDraggingEvent : public cbPluginEvent
1654 {
1655 public:
1656 cbBarInfo* mpBar;
1657 wxPoint mPos; // is given in frame's coordinates
1658
1659 cbStartBarDraggingEvent( cbBarInfo* pBar, const wxPoint& pos, cbDockPane* pPane )
1660
1661 : cbPluginEvent( cbEVT_PL_START_BAR_DRAGGING, pPane ),
1662 mpBar( pBar ),
1663 mPos( pos )
1664 {}
1665 };
1666
1667 class cbDrawHintRectEvent : public cbPluginEvent
1668 {
1669 public:
1670 wxRect mRect; // is given in frame's coordinates
1671
1672
1673 bool mLastTime; // indicates that this event finishes "session" of on-screen drawing,
1674 // thus associated resources can be freed now
1675 bool mEraseRect; // does not have any impact, if recangle is drawn using XOR-mask
1676
1677 bool mIsInClient;// in cleint area hint could be drawn differently,
1678 // e.g. with fat/hatched border
1679
1680
1681 cbDrawHintRectEvent( const wxRect& rect, bool isInClient, bool eraseRect, bool lastTime )
1682
1683 : cbPluginEvent( cbEVT_PL_DRAW_HINT_RECT, 0 ),
1684 mRect ( rect ),
1685 mLastTime ( lastTime ),
1686 mEraseRect ( eraseRect ),
1687 mIsInClient( isInClient )
1688 {}
1689 };
1690
1691 class cbStartDrawInAreaEvent : public cbPluginEvent
1692 {
1693 public:
1694 wxRect mArea;
1695 wxDC** mppDc; // points to pointer, where the reference
1696 // to the obtained buffer-context should be placed
1697
1698 cbStartDrawInAreaEvent( const wxRect& area, wxDC** ppDCForArea, cbDockPane* pPane )
1699
1700 : cbPluginEvent( cbEVT_PL_START_DRAW_IN_AREA, pPane ),
1701 mArea( area ),
1702 mppDc( ppDCForArea )
1703 {}
1704 };
1705
1706 class cbFinishDrawInAreaEvent : public cbPluginEvent
1707 {
1708 public:
1709 wxRect mArea;
1710
1711 cbFinishDrawInAreaEvent( const wxRect& area, cbDockPane* pPane )
1712
1713 : cbPluginEvent( cbEVT_PL_FINISH_DRAW_IN_AREA, pPane ),
1714 mArea( area )
1715 {}
1716 };
1717
1718 class cbCustomizeBarEvent : public cbPluginEvent
1719 {
1720 public:
1721 wxPoint mClickPos; // in parent frame's coordinates
1722 cbBarInfo* mpBar;
1723
1724 cbCustomizeBarEvent( cbBarInfo* pBar, const wxPoint& clickPos, cbDockPane* pPane )
1725
1726 : cbPluginEvent( cbEVT_PL_CUSTOMIZE_BAR, pPane ),
1727 mClickPos( clickPos ),
1728 mpBar( pBar )
1729 {}
1730 };
1731
1732 class cbCustomizeLayoutEvent : public cbPluginEvent
1733 {
1734 public:
1735 wxPoint mClickPos; // in parent frame's coordinates
1736
1737 cbCustomizeLayoutEvent( const wxPoint& clickPos )
1738
1739 : cbPluginEvent( cbEVT_PL_CUSTOMIZE_LAYOUT, 0 ),
1740 mClickPos( clickPos )
1741 {}
1742 };
1743
1744 #endif /* __CONTROLBAR_G__ */
1745