]> git.saurik.com Git - wxWidgets.git/blame - contrib/include/wx/fl/controlbar.h
WX_XMLRES_CURRENT_VERSION_STRING wasn't Unicode safe
[wxWidgets.git] / contrib / include / wx / fl / controlbar.h
CommitLineData
8e08b761 1/////////////////////////////////////////////////////////////////////////////
e598303a 2// Name: controlbar.h
8e08b761
JS
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
4cbc57f0 10// Licence: wxWindows licence
8e08b761
JS
11/////////////////////////////////////////////////////////////////////////////
12
13#ifndef __CONTROLBAR_G__
14#define __CONTROLBAR_G__
15
ab7ce33c 16#if defined(__GNUG__) && !defined(__APPLE__)
8e08b761
JS
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"
2b5f62a0 24#include "wx/fl/fldefs.h"
8e08b761
JS
25
26#define WXCONTROLBAR_VERSION 1.3
27
28// forward declarations
29
2b5f62a0 30class WXFL_DECLSPEC wxFrameLayout;
8e08b761 31
2b5f62a0
VZ
32class WXFL_DECLSPEC cbDockPane;
33class WXFL_DECLSPEC cbUpdatesManagerBase;
34class WXFL_DECLSPEC cbBarDimHandlerBase;
35class WXFL_DECLSPEC cbPluginBase;
36class WXFL_DECLSPEC cbPluginEvent;
37class WXFL_DECLSPEC cbPaneDrawPlugin;
8e08b761 38
2b5f62a0
VZ
39class WXFL_DECLSPEC cbBarInfo;
40class WXFL_DECLSPEC cbRowInfo;
41class WXFL_DECLSPEC cbDimInfo;
42class WXFL_DECLSPEC cbCommonPaneProperties;
8e08b761
JS
43
44typedef cbBarInfo* BarInfoPtrT;
45typedef cbRowInfo* RowInfoPtrT;
46
2b5f62a0
VZ
47WXFL_DEFINE_ARRAY( BarInfoPtrT, BarArrayT );
48WXFL_DEFINE_ARRAY( RowInfoPtrT, RowArrayT );
8e08b761
JS
49
50// control bar states
51
52#define wxCBAR_DOCKED_HORIZONTALLY 0
53#define wxCBAR_DOCKED_VERTICALLY 1
54#define wxCBAR_FLOATING 2
55#define wxCBAR_HIDDEN 3
56
57// the states are enumerated above
58#define MAX_BAR_STATES 4
59
60// control bar alignments
61
62#if !defined(FL_ALIGN_TOP)
63
64#define FL_ALIGN_TOP 0
65#define FL_ALIGN_BOTTOM 1
66#define FL_ALIGN_LEFT 2
67#define FL_ALIGN_RIGHT 3
68
69#endif
70
71// one pane for each alignment
72#define MAX_PANES 4
73
74// masks for each pane
75
4cbc57f0 76#define FL_ALIGN_TOP_PANE 0x0001
8e08b761 77#define FL_ALIGN_BOTTOM_PANE 0x0002
4cbc57f0 78#define FL_ALIGN_LEFT_PANE 0x0004
8e08b761
JS
79#define FL_ALIGN_RIGHT_PANE 0x0008
80
81#define wxALL_PANES 0x000F
82
ffc6ce3f 83// enumeration of hittest results, see cbDockPane::HitTestPaneItems(..)
8e08b761
JS
84
85enum CB_HITTEST_RESULT
86{
4cbc57f0 87 CB_NO_ITEMS_HITTED,
8e08b761 88
4cbc57f0
JS
89 CB_UPPER_ROW_HANDLE_HITTED,
90 CB_LOWER_ROW_HANDLE_HITTED,
91 CB_LEFT_BAR_HANDLE_HITTED,
92 CB_RIGHT_BAR_HANDLE_HITTED,
93 CB_BAR_CONTENT_HITTED
8e08b761
JS
94};
95
e598303a
JS
96/*
97Helper class, used for spying for unhandled mouse events on control bars
98and forwarding them to the frame layout.
99*/
8e08b761 100
2b5f62a0 101class WXFL_DECLSPEC cbBarSpy : public wxEvtHandler
8e08b761
JS
102{
103public:
4cbc57f0 104 DECLARE_DYNAMIC_CLASS( cbBarSpy )
8e08b761 105
4cbc57f0
JS
106 wxFrameLayout* mpLayout;
107 wxWindow* mpBarWnd;
8e08b761
JS
108
109public:
4cbc57f0 110 // Default constructor.
e598303a 111
4cbc57f0 112 cbBarSpy(void);
8e08b761 113
4cbc57f0 114 // Constructor, taking a parent pane.
e598303a 115
4cbc57f0 116 cbBarSpy( wxFrameLayout* pPanel );
8e08b761 117
4cbc57f0 118 // Sets the bar window.
e598303a 119
4cbc57f0 120 void SetBarWindow( wxWindow* pWnd );
8e08b761 121
4cbc57f0 122 // Performs special event processing.
8e08b761 123
4cbc57f0 124 virtual bool ProcessEvent(wxEvent& event);
8e08b761
JS
125};
126
e598303a
JS
127/*
128wxFrameLayout manages containment and docking of control bars,
129which can be docked along the top, bottom, right, or left side of the
130parent frame.
131*/
8e08b761 132
2b5f62a0 133class WXFL_DECLSPEC wxFrameLayout : public wxEvtHandler
8e08b761
JS
134{
135public:
4cbc57f0 136 // Default constructor, used only for serialization.
e598303a 137
4cbc57f0 138 wxFrameLayout();
e598303a 139
4cbc57f0
JS
140 // Constructor, taking parent window, the (MDI) client of the parent if there
141 // is one, and flag specifying whether to activate the layout.
8e08b761 142
4cbc57f0
JS
143 wxFrameLayout( wxWindow* pParentFrame,
144 wxWindow* pFrameClient = NULL,
145 bool activateNow = TRUE );
8e08b761 146
4cbc57f0 147 // Destructor. It does not destroy the bar windows.
e598303a 148
4cbc57f0 149 virtual ~wxFrameLayout();
8e08b761 150
4cbc57f0 151 // Enables floating behaviour. By default floating of control bars is on.
e598303a 152
4cbc57f0 153 virtual void EnableFloating( bool enable = TRUE );
8e08b761 154
4cbc57f0
JS
155 // Activate can be called after some other layout has been deactivated,
156 // and this one must take over the current contents of the frame window.
157 //
158 // Effectively hooks itself to the frame window, re-displays all non-hidden
159 // bar windows and repaints the decorations.
8e08b761 160
4cbc57f0 161 virtual void Activate();
8e08b761 162
4cbc57f0
JS
163 // Deactivate unhooks itself from frame window, and hides all non-hidden windows.
164 //
165 // Note: two frame layouts should not be active at the same time in the
166 // same frame window, since it would cause messy overlapping of bar windows
167 // from both layouts.
8e08b761 168
4cbc57f0 169 virtual void Deactivate();
8e08b761 170
4cbc57f0 171 // Hides the bar windows, and also the client window if present.
8e08b761 172
4cbc57f0 173 void HideBarWindows();
8e08b761 174
4cbc57f0 175 // Destroys the bar windows.
e598303a 176
4cbc57f0 177 virtual void DestroyBarWindows();
8e08b761 178
4cbc57f0
JS
179 // Passes the client window (e.g. MDI client window) to be controlled by
180 // frame layout, the size and position of which should be adjusted to be
181 // surrounded by controlbar panes, whenever the frame is resized or the dimensions
182 // of control panes change.
8e08b761 183
4cbc57f0 184 void SetFrameClient( wxWindow* pFrameClient );
8e08b761 185
4cbc57f0 186 // Returns the frame client, or NULL if not present.
e598303a 187
4cbc57f0 188 wxWindow* GetFrameClient();
8e08b761 189
4cbc57f0 190 // Returns the parent frame.
e598303a 191
4cbc57f0 192 wxWindow& GetParentFrame() { return *mpFrame; }
8e08b761 193
4cbc57f0 194 // Returns an array of panes. Used by update managers.
e598303a 195
4cbc57f0 196 cbDockPane** GetPanesArray() { return mPanes; }
8e08b761 197
4cbc57f0 198 // Returns a pane for the given alignment. See pane alignment types.
e598303a 199
4cbc57f0 200 cbDockPane* GetPane( int alignment )
8e08b761 201
4cbc57f0 202 { return mPanes[alignment]; }
8e08b761 203
4cbc57f0
JS
204 // Adds bar information to the frame layout. The appearance of the layout is not refreshed
205 // immediately; RefreshNow() can be called if necessary.
206 //
207 // Notes: the argument pBarWnd can by NULL, resulting in bar decorations to be drawn
208 // around the empty rectangle (filled with default background colour).
209 // Argument dimInfo can be reused for adding any number of bars, since
210 // it is not used directly - instead its members are copied. If the dimensions
211 // handler is present, its instance is shared (reference counted). The dimension
212 // handler should always be allocated on the heap.
e598303a 213
4cbc57f0 214 // pBarWnd is the window to be managed.
e598303a 215
4cbc57f0 216 // dimInfo contains dimension information.
e598303a 217
4cbc57f0 218 // alignment is a value such as FL_ALIGN_TOP.
e598303a 219
4cbc57f0 220 // rowNo is the vertical position or row in the pane (if in docked state).
e598303a 221
4cbc57f0 222 // columnPos is the horizontal position within the row in pixels (if in docked state).
e598303a 223
4cbc57f0 224 // name is a name by which the bar can be referred in layout customization dialogs.
e598303a 225
4cbc57f0
JS
226 // If spyEvents is TRUE, input events for the bar should be "spyed" in order
227 // to forward unhandled mouse clicks to the frame layout, for example to enable
228 // easy draggablity of toolbars just by clicking on their interior regions.
229 // For widgets like text/tree control this value should be FALSE,
230 // since there's no certain way to detect whether the event was actually handled.
e598303a 231
4cbc57f0
JS
232 // state is the initial state, such as wxCBAR_DOCKED_HORIZONTALLY,
233 // wxCBAR_FLOATING, wxCBAR_HIDDEN.
8e08b761 234
4cbc57f0 235 virtual void AddBar( wxWindow* pBarWnd,
8e08b761
JS
236 const cbDimInfo& dimInfo,
237
4cbc57f0
JS
238 // defaults:
239 int alignment = FL_ALIGN_TOP,
240 int rowNo = 0,
241 int columnPos = 0,
242 const wxString& name="bar",
243 bool spyEvents = FALSE,
244 int state = wxCBAR_DOCKED_HORIZONTALLY
245 );
8e08b761 246
4cbc57f0
JS
247 // ReddockBar can be used for repositioning existing bars. The given bar is first removed
248 // from the pane it currently belongs to, and inserted into the pane, which "matches"
249 // the given rectangular area. If pToPane is not NULL, the bar is docked to this given pane.
250 // To dock a bar which is floating, use the wxFrameLayout::DockBar method.
8e08b761 251
4cbc57f0
JS
252 virtual bool RedockBar( cbBarInfo* pBar, const wxRect& shapeInParent,
253 cbDockPane* pToPane = NULL, bool updateNow = TRUE );
8e08b761 254
4cbc57f0 255 // Finds the bar in the framelayout, by name.
8e08b761 256
4cbc57f0 257 cbBarInfo* FindBarByName( const wxString& name );
8e08b761 258
4cbc57f0 259 // Finds the bar in the framelayout, by window.
e598303a 260
4cbc57f0 261 cbBarInfo* FindBarByWindow( const wxWindow* pWnd );
8e08b761 262
4cbc57f0 263 // Gets an array of bars.
e598303a 264
4cbc57f0 265 BarArrayT& GetBars();
8e08b761 266
4cbc57f0 267 // Changes the bar's docking state (see possible control bar states).
8e08b761 268
4cbc57f0 269 void SetBarState( cbBarInfo* pBar, int newStatem, bool updateNow );
8e08b761 270
4cbc57f0 271 // Toggles the bar between visible and hidden.
e598303a 272
4cbc57f0 273 void InverseVisibility( cbBarInfo* pBar );
8e08b761 274
4cbc57f0
JS
275 // Reflects changes in bar information structure visually.
276 // For example, moves the bar, changes its dimension information,
277 // or changes the pane to which it is docked.
8e08b761 278
4cbc57f0 279 void ApplyBarProperties( cbBarInfo* pBar );
8e08b761 280
4cbc57f0 281 // Removes the bar from the layout permanently, and hides its corresponding window if present.
8e08b761 282
4cbc57f0 283 void RemoveBar( cbBarInfo* pBar );
8e08b761 284
4cbc57f0 285 // Recalculates the layout of panes, and all bars/rows in each pane.
8e08b761 286
4cbc57f0 287 virtual void RecalcLayout( bool repositionBarsNow = FALSE );
8e08b761 288
4cbc57f0 289 // Returns the client height.
e598303a 290
4cbc57f0 291 int GetClientHeight();
e598303a 292
4cbc57f0 293 // Returns the client width.
e598303a 294
4cbc57f0 295 int GetClientWidth();
e598303a 296
4cbc57f0 297 // Returns the client's rectangle.
e598303a 298
4cbc57f0 299 wxRect& GetClientRect() { return mClntWndBounds; }
8e08b761 300
4cbc57f0
JS
301 // Returns a reference to the updates manager.
302 // Note: in future, the updates manager will become a normal plugin.
ffc6ce3f 303
4cbc57f0 304 cbUpdatesManagerBase& GetUpdatesManager();
ffc6ce3f 305
4cbc57f0 306 // Destroys the previous manager if any, and sets the new one.
8e08b761 307
4cbc57f0 308 void SetUpdatesManager( cbUpdatesManagerBase* pUMgr );
8e08b761 309
4cbc57f0 310 // Gets the pane properties for the given alignment.
8e08b761 311
4cbc57f0 312 virtual void GetPaneProperties( cbCommonPaneProperties& props, int alignment = FL_ALIGN_TOP );
8e08b761 313
4cbc57f0
JS
314 // Sets the pane properties for the given alignment.
315 // Note: changing properties of panes does not result immediate on-screen update.
e598303a 316
4cbc57f0
JS
317 virtual void SetPaneProperties( const cbCommonPaneProperties& props,
318 int paneMask = wxALL_PANES );
8e08b761 319
4cbc57f0
JS
320 // Sets the margins for the given panes.
321 // The margins should go into cbCommonPaneProperties in the future.
322 //
323 // Note: this method should be called before any custom plugins are attached.
8e08b761 324
4cbc57f0
JS
325 virtual void SetMargins( int top, int bottom, int left, int right,
326 int paneMask = wxALL_PANES );
8e08b761 327
4cbc57f0 328 // Sets the pane background colour.
e598303a 329
4cbc57f0 330 virtual void SetPaneBackground( const wxColour& colour );
8e08b761 331
4cbc57f0 332 // Recalculates layout and performs on-screen update of all panes.
8e08b761 333
4cbc57f0 334 void RefreshNow( bool recalcLayout = TRUE );
8e08b761 335
4cbc57f0 336 // Event handler for a size event.
8e08b761 337
4cbc57f0 338 void OnSize ( wxSizeEvent& event );
e598303a 339
4cbc57f0 340 // Event handler for a left down button event.
e598303a 341
4cbc57f0 342 void OnLButtonDown( wxMouseEvent& event );
e598303a 343
4cbc57f0 344 // Event handler for a left doubleclick button event.
e598303a 345
4cbc57f0 346 void OnLDblClick ( wxMouseEvent& event );
e598303a 347
4cbc57f0 348 // Event handler for a left button up event.
e598303a 349
4cbc57f0 350 void OnLButtonUp ( wxMouseEvent& event );
e598303a 351
4cbc57f0 352 // Event handler for a right button down event.
e598303a 353
4cbc57f0 354 void OnRButtonDown( wxMouseEvent& event );
e598303a 355
4cbc57f0 356 // Event handler for a right button up event.
e598303a 357
4cbc57f0 358 void OnRButtonUp ( wxMouseEvent& event );
8e08b761 359
4cbc57f0 360 // Event handler for a mouse move event.
8e08b761 361
4cbc57f0 362 void OnMouseMove ( wxMouseEvent& event );
e598303a 363
4cbc57f0
JS
364 // This function should be used instead of passing the event to the ProcessEvent method
365 // of the top-level plugin directly. This method checks if events are currently
366 // captured and ensures that plugin-event is routed correctly.
8e08b761 367
4cbc57f0 368 virtual void FirePluginEvent( cbPluginEvent& event );
ffc6ce3f 369
4cbc57f0
JS
370 // Captures user input events for the given plugin.
371 // Input events are: mouse movement, mouse clicks, keyboard input.
8e08b761 372
4cbc57f0 373 virtual void CaptureEventsForPlugin ( cbPluginBase* pPlugin );
e598303a 374
4cbc57f0
JS
375 // Releases user input events for the given plugin.
376 // Input events are: mouse movement, mouse clicks, keyboard input
e598303a 377
4cbc57f0 378 virtual void ReleaseEventsFromPlugin( cbPluginBase* pPlugin );
8e08b761 379
4cbc57f0 380 // Called by plugins; also captures the mouse in the parent frame.
e598303a 381
4cbc57f0 382 void CaptureEventsForPane( cbDockPane* toPane );
e598303a 383
4cbc57f0 384 // Called by plugins; also releases mouse in the parent frame.
e598303a 385
4cbc57f0 386 void ReleaseEventsFromPane( cbDockPane* fromPane );
8e08b761 387
4cbc57f0
JS
388 // Returns the current top-level plugin (the one that receives events first,
389 // except if input events are currently captured by some other plugin).
ffc6ce3f 390
4cbc57f0 391 virtual cbPluginBase& GetTopPlugin();
8e08b761 392
4cbc57f0
JS
393 // Hooking custom plugins to frame layout.
394 //
395 // Note: when hooking one plugin on top of the other,
396 // use SetNextHandler or similar methods
397 // of wxEvtHandler class to compose the chain of plugins,
398 // than pass the left-most handler in this chain to
399 // the above methods (assuming that events are delegated
400 // from left-most towards right-most handler).
401 //
402 // This secenario is very inconvenient and "low-level",
403 // so use the Add/Push/PopPlugin methods instead.
8e08b761 404
4cbc57f0 405 virtual void SetTopPlugin( cbPluginBase* pPlugin );
8e08b761 406
4cbc57f0
JS
407 // Similar to wxWindow's "push/pop-event-handler" methods, execept
408 // that the plugin is deleted upon "popping".
8e08b761 409
4cbc57f0 410 virtual void PushPlugin( cbPluginBase* pPugin );
e598303a 411
4cbc57f0
JS
412 // Similar to wxWindow's "push/pop-event-handler" methods, execept
413 // that the plugin is deleted upon "popping".
e598303a 414
4cbc57f0 415 virtual void PopPlugin();
8e08b761 416
4cbc57f0
JS
417 // Pop all plugins.
418 virtual void PopAllPlugins();
8e08b761 419
4cbc57f0
JS
420 // Adds the default plugins. These are cbPaneDrawPlugin, cbRowLayoutPlugin, cbBarDragPlugin,
421 // cbAntiflickerPlugin, cbSimpleCustomizePlugin.
422 //
423 // This method is automatically invoked if no plugins were found upon
424 // firing of the first plugin-event, i.e. when wxFrameLayout configures itself.
8e08b761 425
4cbc57f0 426 virtual void PushDefaultPlugins();
8e08b761 427
4cbc57f0
JS
428 // An advanced methods for plugin configuration using their
429 // dynamic class information, for example CLASSINFO(pluginClass).
8e08b761 430
4cbc57f0
JS
431 // First checks if the plugin of the given class is already "hooked up".
432 // If not, adds it to the top of the plugins chain.
8e08b761 433
4cbc57f0 434 virtual void AddPlugin( wxClassInfo* pPlInfo, int paneMask = wxALL_PANES );
8e08b761 435
4cbc57f0
JS
436 // First checks if the plugin of the given class is already hooked.
437 // If so, removes it, and then inserts it into the chain
438 // before the plugin of the class given by pNextPlInfo.
439 //
440 // Note: this method is handy in some cases where the order
441 // of the plugin-chain could be important, for example when one plugin overrides
442 // some functionality of another already-hooked plugin,
443 // so that the former plugin should be hooked before the one
444 // whose functionality is being overridden.
8e08b761 445
4cbc57f0
JS
446 virtual void AddPluginBefore( wxClassInfo* pNextPlInfo, wxClassInfo* pPlInfo,
447 int paneMask = wxALL_PANES );
8e08b761 448
4cbc57f0
JS
449 // Checks if the plugin of the given class is hooked, and removes
450 // it if found.
8e08b761 451
4cbc57f0 452 virtual void RemovePlugin( wxClassInfo* pPlInfo );
8e08b761 453
4cbc57f0
JS
454 // Finds a plugin with the given class, or returns NULL if a plugin of the given
455 // class is not hooked.
8e08b761 456
4cbc57f0 457 virtual cbPluginBase* FindPlugin( wxClassInfo* pPlInfo );
8e08b761 458
4cbc57f0 459 // Returns true if there is a top plugin.
e598303a 460
4cbc57f0 461 bool HasTopPlugin();
8e08b761 462
4cbc57f0
JS
463 DECLARE_EVENT_TABLE()
464 DECLARE_DYNAMIC_CLASS( wxFrameLayout )
8e08b761
JS
465
466public: /* protected really, acessed only by plugins and serializers */
467
4cbc57f0
JS
468 friend class cbDockPane;
469 friend class wxBarHandler;
8e08b761 470
4cbc57f0
JS
471 wxWindow* mpFrame; // parent frame
472 wxWindow* mpFrameClient; // client window
473 cbDockPane* mPanes[MAX_PANES]; // panes in the panel
8e08b761 474
4cbc57f0
JS
475 // misc. cursors
476 wxCursor* mpHorizCursor;
477 wxCursor* mpVertCursor;
478 wxCursor* mpNormalCursor;
479 wxCursor* mpDragCursor;
480 wxCursor* mpNECursor; // no-entry cursor
8e08b761 481
4cbc57f0 482 // pens for decoration and shades
8e08b761 483
4cbc57f0
JS
484 wxPen mDarkPen; // default wxSYS_COLOUR_3DSHADOW
485 wxPen mLightPen; // default wxSYS_COLOUR_3DHILIGHT
486 wxPen mGrayPen; // default wxSYS_COLOUR_3DFACE
487 wxPen mBlackPen; // default wxColour( 0, 0, 0)
488 wxPen mBorderPen; // default wxSYS_COLOUR_3DFACE
8e08b761 489
4cbc57f0 490 wxPen mNullPen; // transparent pen
8e08b761 491
4cbc57f0 492 // pane to which the all mouse input is currently directed (caputred)
8e08b761 493
4cbc57f0 494 cbDockPane* mpPaneInFocus;
8e08b761 495
4cbc57f0 496 // pane, from which mouse pointer had just left
8e08b761 497
4cbc57f0 498 cbDockPane* mpLRUPane;
8e08b761 499
4cbc57f0 500 // bounds of client window in parent frame's coordinates
8e08b761 501
4cbc57f0
JS
502 wxRect mClntWndBounds;
503 wxRect mPrevClntWndBounds;
8e08b761 504
4cbc57f0
JS
505 bool mFloatingOn;
506 wxPoint mNextFloatedWndPos;
507 wxSize mFloatingPosStep;
8e08b761 508
4cbc57f0 509 // current plugin (right-most) plugin which receives events first
8e08b761 510
4cbc57f0 511 cbPluginBase* mpTopPlugin;
8e08b761 512
4cbc57f0 513 // plugin, which currently has captured all input events, otherwise NULL
8e08b761 514
4cbc57f0 515 cbPluginBase* mpCaputesInput;
8e08b761 516
4cbc57f0
JS
517 // list of event handlers which are "pushed" onto each bar, to catch
518 // mouse events which are not handled by bars, and froward them to the ,
519 // frome-layout and further to plugins
8e08b761 520
4cbc57f0 521 wxList mBarSpyList;
8e08b761 522
4cbc57f0 523 // list of top-most frames which contain floated bars
8e08b761 524
4cbc57f0 525 wxList mFloatedFrames;
8e08b761 526
4cbc57f0 527 // linked list of references to all bars (docked/floated/hidden)
8e08b761 528
4cbc57f0 529 BarArrayT mAllBars;
8e08b761 530
4cbc57f0
JS
531 // FOR NOW:: dirty stuff...
532 bool mClientWndRefreshPending;
533 bool mRecalcPending;
534 bool mCheckFocusWhenIdle;
8e08b761
JS
535
536public: /* protected really (accessed only by plugins) */
537
4cbc57f0
JS
538 // refrence to custom updates manager
539 cbUpdatesManagerBase* mpUpdatesMgr;
8e08b761 540
4cbc57f0 541 // Called to apply the calculated layout to window objects.
e598303a 542
4cbc57f0 543 void PositionClientWindow();
e598303a 544
4cbc57f0 545 // Called to apply the calculated layout to window objects.
e598303a 546
4cbc57f0 547 void PositionPanes();
e598303a 548
4cbc57f0 549 // Creates the cursors.
e598303a 550
4cbc57f0 551 void CreateCursors();
8e08b761 552
4cbc57f0 553 // Applies the calculated layout to a floating bar.
e598303a 554
4cbc57f0 555 void RepositionFloatedBar( cbBarInfo* pBar );
e598303a 556
4cbc57f0 557 // Applies the state to the window objects.
e598303a 558
4cbc57f0 559 void DoSetBarState( cbBarInfo* pBar );
8e08b761 560
4cbc57f0 561 // The purpose of this function is unknown.
e598303a 562
4cbc57f0
JS
563 bool LocateBar( cbBarInfo* pBarInfo,
564 cbRowInfo** ppRow,
565 cbDockPane** ppPane );
8e08b761
JS
566
567
4cbc57f0 568 // Returns TRUE if the position is within the given pane.
e598303a 569
4cbc57f0 570 bool HitTestPane( cbDockPane* pPane, int x, int y );
e598303a 571
4cbc57f0
JS
572 // Returns the pane for which the rectangle hit test succeeds, giving
573 // preference to the given pane if supplied.
e598303a 574
4cbc57f0 575 cbDockPane* HitTestPanes( const wxRect& rect, cbDockPane* pCurPane );
8e08b761 576
4cbc57f0 577 // Returns the pane to which the given bar belongs.
8e08b761 578
4cbc57f0 579 cbDockPane* GetBarPane( cbBarInfo* pBar );
8e08b761 580
4cbc57f0
JS
581 // Delegated from "bar-spy".
582 void ForwardMouseEvent( wxMouseEvent& event,
583 cbDockPane* pToPane,
584 int eventType );
8e08b761 585
4cbc57f0 586 // Routes the mouse event to the appropriate pane.
e598303a 587
4cbc57f0 588 void RouteMouseEvent( wxMouseEvent& event, int pluginEvtType );
8e08b761 589
4cbc57f0 590 // Shows all floated windows.
e598303a 591
4cbc57f0 592 void ShowFloatedWindows( bool show );
8e08b761 593
4cbc57f0 594 // Unhooks the layout from the frame.
e598303a 595
4cbc57f0 596 void UnhookFromFrame();
e598303a 597
4cbc57f0
JS
598 // Hooks the layout up to the frame (pushes the layout onto the
599 // frame's event handler stack).
e598303a 600
4cbc57f0 601 void HookUpToFrame();
8e08b761 602
4cbc57f0
JS
603 // Returns TRUE if the platform allows reparenting. This may not return TRUE
604 // for all platforms. Reparenting allows control bars to be floated.
8e08b761 605
4cbc57f0 606 bool CanReparent();
e598303a 607
4cbc57f0 608 // Reparents pChild to have parent pNewParent.
e598303a 609
4cbc57f0 610 void ReparentWindow( wxWindow* pChild, wxWindow* pNewParent );
8e08b761 611
4cbc57f0 612 // Returns the previous client window rectangle.
e598303a 613
4cbc57f0 614 wxRect& GetPrevClientRect() { return mPrevClntWndBounds; }
8e08b761 615
4cbc57f0 616 // Handles paint events, calling PaintPane for each pane.
e598303a 617
4cbc57f0 618 void OnPaint( wxPaintEvent& event );
e598303a 619
4cbc57f0 620 // Handles background erase events. Currently does nothing.
e598303a 621
4cbc57f0 622 void OnEraseBackground( wxEraseEvent& event );
e598303a 623
4cbc57f0 624 // Handles focus kill events. Currently does nothing.
e598303a 625
4cbc57f0 626 void OnKillFocus( wxFocusEvent& event );
e598303a 627
4cbc57f0 628 // Handles focus set events. Currently does nothing.
e598303a 629
4cbc57f0 630 void OnSetFocus( wxFocusEvent& event );
e598303a 631
4cbc57f0 632 // Handles activation events. Currently does nothing.
e598303a 633
4cbc57f0 634 void OnActivate( wxActivateEvent& event );
e598303a 635
4cbc57f0 636 // Handles idle events.
e598303a 637
4cbc57f0 638 void OnIdle( wxIdleEvent& event );
8e08b761 639
4cbc57f0 640 // Returns a new cbGCUpdatesMgr object.
e598303a 641
4cbc57f0 642 virtual cbUpdatesManagerBase* CreateUpdatesManager();
8e08b761
JS
643};
644
e598303a
JS
645/*
646A structure that is present in each item of layout,
647used by any particular updates-manager to store
648auxiliary information to be used by its updating algorithm.
649*/
8e08b761 650
2b5f62a0 651class WXFL_DECLSPEC cbUpdateMgrData : public wxObject
8e08b761 652{
4cbc57f0 653 DECLARE_DYNAMIC_CLASS( cbUpdateMgrData )
8e08b761 654public:
4cbc57f0 655 wxRect mPrevBounds; // previous state of layout item (in parent frame's coordinates)
8e08b761 656
4cbc57f0
JS
657 bool mIsDirty; // overrides result of current-against-previous bounds comparison,
658 // i.e. requires item to be updated, regardless of it's current area
ffc6ce3f 659
4cbc57f0 660 wxObject* mpCustomData; // any custom data stored by specific updates mgr.
8e08b761 661
4cbc57f0 662 // Default constructor. Is-dirty flag is set TRUE initially.
e598303a 663
4cbc57f0 664 cbUpdateMgrData();
e598303a 665
4cbc57f0 666 // Store the item state.
8e08b761 667
4cbc57f0 668 void StoreItemState( const wxRect& boundsInParent );
8e08b761 669
4cbc57f0 670 // Set the dirty flag.
e598303a 671
4cbc57f0 672 void SetDirty( bool isDirty = TRUE );
8e08b761 673
4cbc57f0 674 // Set custom data.
e598303a 675
4cbc57f0 676 void SetCustomData( wxObject* pCustomData );
8e08b761 677
4cbc57f0 678 // Returns the is-dirty flag.
e598303a 679
4cbc57f0 680 inline bool IsDirty() { return mIsDirty; }
8e08b761
JS
681};
682
e598303a
JS
683/*
684Abstract interface for bar-size handler classes.
685These objects receive notifications whenever the docking
686state of the bar is changed, thus they provide the possibility
687to adjust the values in cbDimInfo::mSizes accordingly.
688Specific handlers can be hooked up to specific types of bar.
689*/
8e08b761 690
2b5f62a0 691class WXFL_DECLSPEC cbBarDimHandlerBase : public wxObject
8e08b761 692{
4cbc57f0 693 DECLARE_ABSTRACT_CLASS( cbBarDimHandlerBase )
8e08b761
JS
694
695public:
4cbc57f0
JS
696 int mRefCount; // since one dim-handler can be assigned
697 // to multiple bars, it's instance is
698 // reference-counted
8e08b761
JS
699public:
700
4cbc57f0
JS
701 // Default constructor. The initial reference count is 0, since
702 // the handler is not used until the first invocation of AddRef().
8e08b761 703
4cbc57f0 704 cbBarDimHandlerBase();
8e08b761 705
4cbc57f0 706 // Increments the reference count.
8e08b761 707
4cbc57f0
JS
708 void AddRef();
709
710 // Decrements the reference count, and if the count is at zero,
711 // delete 'this'.
712
713 void RemoveRef();
8e08b761 714
4cbc57f0
JS
715 // Responds to "bar-state-changes" notifications.
716
717 virtual void OnChangeBarState(cbBarInfo* pBar, int newState ) = 0;
718
719 // Responds to bar resize notifications.
720
721 virtual void OnResizeBar( cbBarInfo* pBar, const wxSize& given, wxSize& preferred ) = 0;
722};
8e08b761 723
4cbc57f0
JS
724/*
725Helper class used internally by the wxFrameLayout class.
726Holds and manages information about bar dimensions.
727*/
8e08b761 728
2b5f62a0 729class WXFL_DECLSPEC cbDimInfo : public wxObject
8e08b761 730{
4cbc57f0 731 DECLARE_DYNAMIC_CLASS( cbDimInfo )
8e08b761 732public:
4cbc57f0 733 wxSize mSizes[MAX_BAR_STATES]; // preferred sizes for each possible bar state
8e08b761 734
4cbc57f0
JS
735 wxRect mBounds[MAX_BAR_STATES]; // saved positions and sizes for each
736 // possible state, values contain (-1)s if
737 // not initialized yet
8e08b761 738
4cbc57f0
JS
739 int mLRUPane; // pane to which this bar was docked before it was floated
740 // (FL_ALIGN_TOP,FL_ALIGN_BOTTOM,..)
8e08b761 741
4cbc57f0
JS
742 // top/bottom gap, separates decorations
743 // from the bar's actual window, filled
744 // with frame's beckground color, default: 0
8e08b761 745
4cbc57f0 746 int mVertGap;
8e08b761 747
4cbc57f0
JS
748 // left/right gap, separates decorations
749 // from the bar's actual wndow, filled
750 // with frame's beckground colour, default: 0
8e08b761 751
4cbc57f0 752 int mHorizGap; // NOTE:: gaps are given in frame's coord. orientation
8e08b761 753
4cbc57f0
JS
754 // TRUE, if vertical/horizontal dimensions cannot be mannualy adjusted
755 // by user using resizing handles. If FALSE, the frame-layout
756 // *automatically* places resizing handles among not-fixed bars
8e08b761 757
4cbc57f0 758 bool mIsFixed;
8e08b761 759
4cbc57f0 760 cbBarDimHandlerBase* mpHandler; // NULL, if no handler present
8e08b761
JS
761
762public:
763
4cbc57f0
JS
764 // Default constructor.
765
766 cbDimInfo(void);
8e08b761 767
4cbc57f0
JS
768 // Constructor.
769 // isFixed is TRUE if vertical/horizontal dimensions cannot be manually adjusted
770 // by the user using resizing handles. If FALSE, the frame-layout
771 // automatically places resizing handles among bars that do are not fixed.
772
773 cbDimInfo( cbBarDimHandlerBase* pDimHandler,
774 bool isFixed // (see comments on mIsFixed member)
775 );
8e08b761 776
4cbc57f0
JS
777 // Constructor taking dimenstion information.
778 //
779 // dh_x, dh_y are the dimensions when docked horizontally.
780 //
781 // dv_x, dv_y are the dimensions when docked vertically.
782 //
783 // f_x, f_y are the dimensions when floating.
784 //
785 // For information on isFixed, see comments above.
786 //
787 // horizGap is the left/right gap, separating decorations
788 // from the bar's actual wndow, filled with the frame's background colour.
789 // The dimension is given in the frame's coordinates.
790 //
791 // vertGap is the top/bottom gap, separating decorations
792 // from the bar's actual wndow, filled with the frame's background colour.
793 // The dimension is given in the frame's coordinates.
794
795 cbDimInfo( int dh_x, int dh_y,
796 int dv_x, int dv_y,
797 int f_x, int f_y,
8e08b761 798
4cbc57f0
JS
799 bool isFixed = TRUE,
800 int horizGap = 6,
801 int vertGap = 6,
802
803 cbBarDimHandlerBase* pDimHandler = NULL
804 );
8e08b761 805
4cbc57f0 806 // Constructor.
8e08b761 807
ffc6ce3f
JS
808 cbDimInfo( int x, int y,
809 bool isFixed = TRUE,
810 int gap = 6,
8e08b761 811 cbBarDimHandlerBase* pDimHandler = NULL
ffc6ce3f 812 );
8e08b761 813
4cbc57f0 814 // Destructor. Destroys handler automatically, if present.
8e08b761 815
4cbc57f0 816 ~cbDimInfo();
8e08b761 817
4cbc57f0
JS
818 // Assignment operator.
819
820 const cbDimInfo& operator=( const cbDimInfo& other );
821
822 // Returns the handler, if any.
823
824 inline cbBarDimHandlerBase* GetDimHandler() { return mpHandler; }
8e08b761
JS
825};
826
41b3c966 827// FIXME: this array definition compiles but probably doesn't do what was intended (GD)
2b5f62a0 828WXFL_DEFINE_ARRAY_LONG(float, cbArrayFloat);
8e08b761 829
4cbc57f0
JS
830/*
831Helper class used internally by the wxFrameLayout class.
832Holds and manages information about bar rows.
833*/
834
8e08b761
JS
835class cbRowInfo : public wxObject
836{
4cbc57f0 837 DECLARE_DYNAMIC_CLASS( cbRowInfo )
8e08b761
JS
838public:
839
4cbc57f0 840 BarArrayT mBars; // row content
8e08b761 841
4cbc57f0 842 // row flags (set up according to row-relations)
8e08b761 843
4cbc57f0
JS
844 bool mHasUpperHandle;
845 bool mHasLowerHandle;
846 bool mHasOnlyFixedBars;
847 int mNotFixedBarsCnt;
8e08b761 848
4cbc57f0
JS
849 int mRowWidth;
850 int mRowHeight;
851 int mRowY;
8e08b761 852
4cbc57f0
JS
853 // stores precalculated row's bounds in parent frame's coordinates
854 wxRect mBoundsInParent;
8e08b761 855
4cbc57f0
JS
856 // info stored for updates-manager
857 cbUpdateMgrData mUMgrData;
8e08b761 858
4cbc57f0
JS
859 cbRowInfo* mpNext;
860 cbRowInfo* mpPrev;
8e08b761 861
4cbc57f0 862 cbBarInfo* mpExpandedBar; // NULL, if non of the bars is currently expanded
8e08b761 863
4cbc57f0 864 cbArrayFloat mSavedRatios; // length-ratios bofore some of the bars was expanded
8e08b761
JS
865
866public:
4cbc57f0
JS
867 // Constructor.
868
869 cbRowInfo(void);
8e08b761 870
4cbc57f0 871 // Destructor.
8e08b761 872
4cbc57f0 873 ~cbRowInfo();
8e08b761 874
4cbc57f0 875 // Returns the first bar.
8e08b761 876
4cbc57f0
JS
877 inline cbBarInfo* GetFirstBar()
878
879 { return mBars.GetCount() ? mBars[0] : NULL; }
8e08b761
JS
880};
881
4cbc57f0
JS
882/*
883Helper class used internally by the wxFrameLayout class.
884Holds and manages bar information.
885*/
886
8e08b761
JS
887class cbBarInfo : public wxObject
888{
4cbc57f0 889 DECLARE_DYNAMIC_CLASS( cbBarInfo )
8e08b761 890public:
4cbc57f0
JS
891 // textual name, by which this bar is refered in layout-customization dialogs
892 wxString mName;
8e08b761 893
4cbc57f0
JS
894 // stores bar's bounds in pane's coordinates
895 wxRect mBounds;
8e08b761 896
4cbc57f0
JS
897 // stores precalculated bar's bounds in parent frame's coordinates
898 wxRect mBoundsInParent;
8e08b761 899
4cbc57f0
JS
900 // back-ref to the row, which contains this bar
901 cbRowInfo* mpRow;
8e08b761 902
4cbc57f0
JS
903 // are set up according to the types of the surrounding bars in the row
904 bool mHasLeftHandle;
905 bool mHasRightHandle;
8e08b761 906
fc7c8ae9
JS
907 // determines if this bar can float. The layout's setting as priority. For
908 // example, if the layout's mFloatingOn is false, this setting is irrelevant
909 // since nothing will float at all. If the layout's floating is on, use this
910 // setting to prevent specific bars from floating. In other words, all bars
911 // float by default and floating can be turned off on individual bars.
912 bool mFloatingOn; // default: ON (which is also the layout's mFloatingOn default setting)
913
4cbc57f0 914 cbDimInfo mDimInfo; // preferred sizes for each, control bar state
ffc6ce3f 915
4cbc57f0 916 int mState; // (see definition of controlbar states)
8e08b761 917
4cbc57f0
JS
918 int mAlignment; // alignment of the pane to which this
919 // bar is currently placed
8e08b761 920
4cbc57f0
JS
921 int mRowNo; // row, into which this bar would be placed,
922 // when in the docking state
8e08b761 923
4cbc57f0
JS
924 wxWindow* mpBarWnd; // the actual window object, NULL if no window
925 // is attached to the control bar (possible!)
8e08b761 926
4cbc57f0 927 double mLenRatio; // length ratio among not-fixed-size bars
8e08b761 928
4cbc57f0
JS
929 wxPoint mPosIfFloated; // stored last position when bar was in "floated" state
930 // poistion is stored in parent-window's coordinates
ffc6ce3f 931
4cbc57f0 932 cbUpdateMgrData mUMgrData; // info stored for updates-manager
8e08b761 933
4cbc57f0
JS
934 cbBarInfo* mpNext; // next. bar in the row
935 cbBarInfo* mpPrev; // prev. bar in the row
8e08b761
JS
936
937public:
4cbc57f0
JS
938 // Constructor.
939
940 cbBarInfo(void);
941
942 // Destructor.
8e08b761 943
4cbc57f0 944 ~cbBarInfo();
8e08b761 945
4cbc57f0 946 // Returns TRUE if this bar is fixed.
8e08b761 947
4cbc57f0
JS
948 inline bool IsFixed() const { return mDimInfo.mIsFixed; }
949
950 // Returns TRUE if this bar is expanded.
951
952 inline bool IsExpanded() const { return this == mpRow->mpExpandedBar; }
8e08b761
JS
953};
954
4cbc57f0
JS
955/*
956Used for storing the original bar's positions in the row, when the 'non-destructive-friction'
957option is turned on.
958*/
8e08b761
JS
959
960class cbBarShapeData : public wxObject
961{
962public:
4cbc57f0
JS
963 wxRect mBounds;
964 double mLenRatio;
8e08b761
JS
965};
966
4cbc57f0
JS
967/*
968Used for traversing through all bars of all rows in the pane.
969*/
8e08b761
JS
970
971class wxBarIterator
972{
4cbc57f0
JS
973 RowArrayT* mpRows;
974 cbRowInfo* mpRow;
975 cbBarInfo* mpBar;
8e08b761
JS
976
977public:
4cbc57f0
JS
978 // Constructor, taking row array.
979
980 wxBarIterator( RowArrayT& rows );
981
982 // Resets the iterator to the start of the first row.
983
984 void Reset();
8e08b761 985
4cbc57f0 986 // Advances the iterator and returns TRUE if a bar is available.
ffc6ce3f 987
4cbc57f0 988 bool Next();
8e08b761 989
4cbc57f0
JS
990 // Gets the current bar information.
991
992 cbBarInfo& BarInfo();
993
994 // Returns a reference to the currently traversed row.
995
996 cbRowInfo& RowInfo();
8e08b761
JS
997};
998
4cbc57f0
JS
999/*
1000A structure holding configuration options,
1001which are usually the same for all panes in
1002a frame layout.
1003*/
8e08b761
JS
1004
1005class cbCommonPaneProperties : public wxObject
1006{
4cbc57f0
JS
1007 DECLARE_DYNAMIC_CLASS( cbCommonPaneProperties )
1008
1009 // look-and-feel configuration
8e08b761 1010
4cbc57f0
JS
1011 bool mRealTimeUpdatesOn; // default: ON
1012 bool mOutOfPaneDragOn; // default: ON
1013 bool mExactDockPredictionOn; // default: OFF
6e8515a3 1014 bool mNonDestructFrictionOn; // default: OFF
8e08b761 1015
4cbc57f0 1016 bool mShow3DPaneBorderOn; // default: ON
8e08b761 1017
4cbc57f0 1018 // FOR NOW:: the below properties are reserved for the "future"
8e08b761 1019
4cbc57f0
JS
1020 bool mBarFloatingOn; // default: OFF
1021 bool mRowProportionsOn; // default: OFF
1022 bool mColProportionsOn; // default: ON
1023 bool mBarCollapseIconsOn; // default: OFF
1024 bool mBarDragHintsOn; // default: OFF
8e08b761 1025
4cbc57f0 1026 // minimal dimensions for not-fixed bars in this pane (16x16 default)
8e08b761 1027
4cbc57f0 1028 wxSize mMinCBarDim;
8e08b761 1029
4cbc57f0 1030 // width/height of resizing sash
8e08b761 1031
4cbc57f0 1032 int mResizeHandleSize;
ffc6ce3f 1033
4cbc57f0 1034 // Default constructor.
8e08b761 1035
4cbc57f0 1036 cbCommonPaneProperties(void);
69b8ed1b
GD
1037
1038 // Copy constructor
1039
1040 cbCommonPaneProperties(const cbCommonPaneProperties&);
1041
1042 // Assignment operator
1043
1044 cbCommonPaneProperties& operator=(const cbCommonPaneProperties&);
8e08b761
JS
1045};
1046
4cbc57f0
JS
1047/*
1048This class manages containment and control of control bars
1049along one of the four edges of the parent frame.
1050*/
8e08b761
JS
1051
1052class cbDockPane : public wxObject
1053{
1054public:
4cbc57f0 1055 DECLARE_DYNAMIC_CLASS( cbDockPane )
8e08b761 1056
4cbc57f0
JS
1057 // look-and-feel configuration for this pane
1058 cbCommonPaneProperties mProps;
8e08b761 1059
4cbc57f0 1060 // pane margins (in frame's coordinate-syst. orientation)
8e08b761 1061
4cbc57f0
JS
1062 int mLeftMargin; // default: 2 pixels
1063 int mRightMargin; // default: 2 pixels
1064 int mTopMargin; // default: 2 pixels
1065 int mBottomMargin; // default: 2 pixels
ffc6ce3f 1066
8e08b761 1067public:
4cbc57f0
JS
1068 // position of the pane in frame's coordinates
1069 wxRect mBoundsInParent;
8e08b761 1070
4cbc57f0
JS
1071 // pane width and height in pane's coordinates
1072 int mPaneWidth;
1073 int mPaneHeight;
8e08b761 1074
4cbc57f0 1075 int mAlignment;
8e08b761 1076
4cbc57f0
JS
1077 // info stored for updates-manager
1078 cbUpdateMgrData mUMgrData;
8e08b761
JS
1079
1080public: /* protected really */
1081
4cbc57f0
JS
1082 RowArrayT mRows;
1083 wxFrameLayout* mpLayout; // back-ref
8e08b761 1084
4cbc57f0 1085 // transient properties
8e08b761 1086
4cbc57f0 1087 wxList mRowShapeData; // shapes of bars of recently modified row,
6e8515a3 1088 // stored when in "non-destructive-friction" mode
4cbc57f0 1089 cbRowInfo* mpStoredRow; // row-info for which the shapes are stored
8e08b761 1090
4cbc57f0 1091 friend class wxFrameLayout;
8e08b761
JS
1092
1093public: /* protected really (accessed only by plugins) */
1094
4cbc57f0
JS
1095 // Returns the row info for a row index. Internal function called by plugins.
1096
1097 cbRowInfo* GetRow( int row );
1098
1099 // Returns the row index for the given row info. Internal function called by plugins.
1100
1101 int GetRowIndex( cbRowInfo* pRow );
1102
1103 // Returns the row at the given vertical position.
1104 // Returns -1 if the row is not present at given vertical position.
1105 // Internal function called by plugins.
1106
1107 int GetRowAt( int paneY );
1108
1109 // Returns the row between the given vertical positions.
1110 // Returns -1 if the row is not present.
1111 // Internal function called by plugins.
1112
1113 int GetRowAt( int upperY, int lowerY );
1114
1115 // Sets up flags in the row information structure, so that
1116 // they match the changed state of row items correctly.
1117 // Internal function called by plugins.
1118
1119 void SyncRowFlags( cbRowInfo* pRow );
1120
1121 // Returns TRUE if the bar's dimension information indicates a fixed size.
1122 // Internal function called by plugins.
1123
1124 bool IsFixedSize( cbBarInfo* pInfo );
1125
1126 // Returns the number of bars whose size is not fixed.
1127 // Internal function called by plugins.
1128
1129 int GetNotFixedBarsCount( cbRowInfo* pRow );
1130
1131 // Gets the vertical position at the given row.
1132 // Internal function called by plugins.
1133
1134 int GetRowY( cbRowInfo* pRow );
1135
1136 // Returns TRUE if there are any variable-sized rows above this one.
1137 // Internal function called by plugins.
1138
1139 bool HasNotFixedRowsAbove( cbRowInfo* pRow );
1140
1141 // Returns TRUE if there are any variable-sized rows below this one.
1142 // Internal function called by plugins.
1143
1144 bool HasNotFixedRowsBelow( cbRowInfo* pRow );
1145
1146 // Returns TRUE if there are any variable-sized rows to the left of this one.
1147 // Internal function called by plugins.
1148
1149 bool HasNotFixedBarsLeft ( cbBarInfo* pBar );
1150
1151 // Returns TRUE if there are any variable-sized rows to the right of this one.
1152 // Internal function called by plugins.
8e08b761 1153
4cbc57f0 1154 bool HasNotFixedBarsRight( cbBarInfo* pBar );
8e08b761 1155
4cbc57f0
JS
1156 // Calculate lengths.
1157 // Internal function called by plugins.
8e08b761 1158
4cbc57f0 1159 virtual void CalcLengthRatios( cbRowInfo* pInRow );
8e08b761 1160
4cbc57f0
JS
1161 // Generates a cbLayoutRowEvent event to recalculate row layouts.
1162 // Internal function called by plugins.
8e08b761 1163
4cbc57f0 1164 virtual void RecalcRowLayout( cbRowInfo* pRow );
8e08b761 1165
4cbc57f0
JS
1166 // Expands the bar.
1167 // Internal function called by plugins.
8e08b761 1168
4cbc57f0 1169 virtual void ExpandBar( cbBarInfo* pBar );
8e08b761 1170
4cbc57f0
JS
1171 // Contracts the bar.
1172 // Internal function called by plugins.
8e08b761 1173
4cbc57f0 1174 virtual void ContractBar( cbBarInfo* pBar );
8e08b761 1175
4cbc57f0
JS
1176 // Sets up links between bars.
1177 // Internal function called by plugins.
8e08b761 1178
4cbc57f0 1179 void InitLinksForRow( cbRowInfo* pRow );
8e08b761 1180
4cbc57f0
JS
1181 // Sets up links between bars.
1182 // Internal function called by plugins.
8e08b761 1183
4cbc57f0 1184 void InitLinksForRows();
8e08b761 1185
4cbc57f0
JS
1186 // Coordinate translation between parent's frame and this pane.
1187 // Internal function called by plugins.
8e08b761 1188
4cbc57f0 1189 void FrameToPane( int* x, int* y );
8e08b761 1190
4cbc57f0
JS
1191 // Coordinate translation between parent's frame and this pane.
1192 // Internal function called by plugins.
8e08b761 1193
4cbc57f0
JS
1194 void PaneToFrame( int* x, int* y );
1195
1196 // Coordinate translation between parent's frame and this pane.
1197 // Internal function called by plugins.
1198
1199 void FrameToPane( wxRect* pRect );
1200
1201 // Coordinate translation between parent's frame and this pane.
1202 // Internal function called by plugins.
1203
1204 void PaneToFrame( wxRect* pRect );
1205
1206 // Returns TRUE if pos is within the given rectangle.
1207 // Internal function called by plugins.
1208
1209 inline bool HasPoint( const wxPoint& pos, int x, int y, int width, int height );
1210
1211 // Returns the minimal row height for the given row.
1212 // Internal function called by plugins.
1213
1214 int GetMinimalRowHeight( cbRowInfo* pRow );
1215
1216 // Sets the row height for the given height. newHeight includes the height of row handles, if present.
1217 // Internal function called by plugins.
1218
1219 void SetRowHeight( cbRowInfo* pRow, int newHeight );
1220
1221 // Inserts the bar at the given row number.
1222 // Internal function called by plugins.
1223
1224 void DoInsertBar( cbBarInfo* pBar, int rowNo );
8e08b761
JS
1225
1226public: /* protected really (accessed only by plugins) */
1227
4cbc57f0
JS
1228 // Generates a cbDrawBarDecorEvent and sends it to the layout to paint the bar decorations.
1229 // Internal function called by plugins.
1230
1231 virtual void PaintBarDecorations( cbBarInfo* pBar, wxDC& dc );
1232
1233 // Generates a cbDrawBarHandlesEvent and sends it to the layout to paint the bar handles.
1234 // Internal function called by plugins.
1235
1236 virtual void PaintBarHandles( cbBarInfo* pBar, wxDC& dc );
1237
1238 // Calls PaintBarDecorations and PaintBarHandles.
1239 // Internal function called by plugins.
1240
1241 virtual void PaintBar( cbBarInfo* pBar, wxDC& dc );
1242
1243 // Generates cbDrawRowHandlesEvent and cbDrawRowDecorEvent and sends them to the layout.
1244 // Internal function called by plugins.
1245
1246 virtual void PaintRowHandles( cbRowInfo* pRow, wxDC& dc );
1247
1248 // Generates cbDrawRowBkGroundEvent and sends it to the layout.
1249 // Internal function called by plugins.
1250
1251 virtual void PaintRowBackground ( cbRowInfo* pRow, wxDC& dc );
1252
1253 // Calls PaintBarDecorations for each row.
1254 // Internal function called by plugins.
1255
1256 virtual void PaintRowDecorations( cbRowInfo* pRow, wxDC& dc );
1257
1258 // Calls PaintRowBackground, PaintRowDecorations, PaintRowHandles.
1259 // Internal function called by plugins.
1260
1261 virtual void PaintRow( cbRowInfo* pRow, wxDC& dc );
1262
1263 // Generates cbDrawPaneBkGroundEvent and sends it to the layout.
1264 // Internal function called by plugins.
1265
1266 virtual void PaintPaneBackground( wxDC& dc );
1267
1268 // Generates cbDrawPaneDecorEvent and sends it to the layout.
1269 // Internal function called by plugins.
1270
1271 virtual void PaintPaneDecorations( wxDC& dc );
1272
1273 // Paints the pane background, the row background and decorations,
1274 // and finally the pane decorations.
1275 // Internal function called by plugins.
1276
1277 virtual void PaintPane( wxDC& dc );
1278
1279 // Generates a cbSizeBarWndEvent and sends it to the layout.
1280 // Internal function called by plugins.
1281
1282 virtual void SizeBar( cbBarInfo* pBar );
1283
1284 // Calls SizeBar for each bar in the row.
1285 // Internal function called by plugins.
1286
1287 virtual void SizeRowObjects( cbRowInfo* pRow );
1288
1289 // Calls SizeRowObjects for each row.
1290 // Internal function called by plugins.
1291
1292 virtual void SizePaneObjects();
1293
1294 // Generates cbStartDrawInAreaEvent and sends it to the layout.
1295 // Internal function called by plugins.
1296
1297 virtual wxDC* StartDrawInArea ( const wxRect& area );
1298
1299 // Generates cbFinishDrawInAreaEvent and sends it to the layout.
1300 // Internal function called by plugins.
1301
1302 virtual void FinishDrawInArea( const wxRect& area );
8e08b761
JS
1303
1304public: /* public members */
1305
4cbc57f0
JS
1306 // Default constructor.
1307
1308 cbDockPane(void);
1309
1310 // Constructor, taking alignment and layout panel.
1311
1312 cbDockPane( int alignment, wxFrameLayout* pPanel );
1313
1314 // Sets pane's margins in frame's coordinate orientations.
1315
1316 void SetMargins( int top, int bottom, int left, int right );
1317
1318 // Destructor.
1319
1320 virtual ~cbDockPane();
1321
1322 // Removes the bar from this pane. Does not destroy the bar.
1323
1324 virtual void RemoveBar( cbBarInfo* pBar );
1325
1326 // Inserts the bar into this pane. rect is given in the parent frame's coordinates.
1327
1328 virtual void InsertBar( cbBarInfo* pBar, const wxRect& rect );
8e08b761 1329
4cbc57f0
JS
1330 // Inserts the bar into the given row, with dimensions and position
1331 // stored in pBarInfo->mBounds. Returns the node of inserted bar.
8e08b761 1332
4cbc57f0 1333 virtual void InsertBar( cbBarInfo* pBar, cbRowInfo* pIntoRow );
8e08b761 1334
4cbc57f0
JS
1335 // Inserts bar and sets its position according to the preferred settings
1336 // given in pBarInfo.
8e08b761 1337
4cbc57f0 1338 virtual void InsertBar( cbBarInfo* pBarInfo );
8e08b761 1339
4cbc57f0 1340 // Removes the row from this pane. Does not destroy the row object.
8e08b761 1341
4cbc57f0 1342 virtual void RemoveRow( cbRowInfo* pRow );
ffc6ce3f 1343
4cbc57f0
JS
1344 // Inserts a row. Does not refresh the inserted row immediately.
1345 // If pBeforeRowNode is NULL, the row is appended to the end of pane's row list.
8e08b761 1346
4cbc57f0 1347 virtual void InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow );
8e08b761 1348
4cbc57f0 1349 // Sets pane's width in the pane's coordinates (including margins).
8e08b761 1350
4cbc57f0 1351 void SetPaneWidth(int width);
8e08b761 1352
4cbc57f0 1353 // Set the position and dimensions of the pane in the parent frame's coordinates.
8e08b761 1354
4cbc57f0 1355 void SetBoundsInParent( const wxRect& rect );
ffc6ce3f 1356
4cbc57f0 1357 // Returns the bounds of the pane, in parent coordinates.
8e08b761 1358
4cbc57f0 1359 inline wxRect& GetRealRect() { return mBoundsInParent; }
8e08b761 1360
4cbc57f0 1361 // Returns an array of rows. Used by updates-managers.
8e08b761 1362
4cbc57f0 1363 inline RowArrayT& GetRowList() { return mRows; }
8e08b761 1364
4cbc57f0 1365 // Returns the first row.
8e08b761 1366
4cbc57f0 1367 inline cbRowInfo* GetFirstRow()
8e08b761 1368
4cbc57f0 1369 { return mRows.GetCount() ? mRows[0] : NULL; }
ffc6ce3f 1370
4cbc57f0 1371 // Returns TRUE if the given bar is present in this pane.
8e08b761 1372
4cbc57f0 1373 bool BarPresent( cbBarInfo* pBar );
8e08b761 1374
4cbc57f0 1375 // Returns the height in the pane's coordinates.
8e08b761 1376
4cbc57f0 1377 int GetPaneHeight();
8e08b761 1378
4cbc57f0
JS
1379 // Returns the alignment for this pane. The value is one of
1380 // FL_ALIGN_TOP, FL_ALIGN_BOTTOM, FL_ALIGN_LEFT, FL_ALIGN_RIGHT.
8e08b761 1381
4cbc57f0 1382 int GetAlignment();
8e08b761 1383
4cbc57f0 1384 // Returns TRUE if the given mask matches the pane's mask.
8e08b761 1385
4cbc57f0 1386 bool MatchesMask( int paneMask );
8e08b761 1387
4cbc57f0 1388 // Returns TRUE if the pane is aligned to the top or bottom.
8e08b761 1389
4cbc57f0
JS
1390 inline bool IsHorizontal()
1391 {
1392 return (mAlignment == FL_ALIGN_TOP ||
1393 mAlignment == FL_ALIGN_BOTTOM );
1394 }
8e08b761 1395
4cbc57f0 1396 // Generates events to perform layout calculations.
8e08b761 1397
4cbc57f0 1398 virtual void RecalcLayout();
8e08b761 1399
4cbc57f0
JS
1400 // Returns wxCBAR_DOCKED_HORIZONTALLY if the alignment is top or bottom,
1401 // or wxCBAR_DOCKED_VERTICALLY otherwise.
1402
1403 virtual int GetDockingState();
1404
1405 // Returns the result of hit-testing items in the pane.
1406 // See CB_HITTEST_RESULT enumerated type.
1407 // pos is the position in this pane's coordinates.
1408
1409 virtual int HitTestPaneItems( const wxPoint& pos,
1410 cbRowInfo** ppRow,
1411 cbBarInfo** ppBar
1412 );
1413
1414 // Returns the bar's resize range.
1415
1416 void GetBarResizeRange( cbBarInfo* pBar, int* from, int *till, bool forLeftHandle );
1417
1418 // Returns the row's resize range.
1419
1420 void GetRowResizeRange( cbRowInfo* pRow, int* from, int* till, bool forUpperHandle );
1421
1422 // Finds the bar information by corresponding window.
1423
1424 cbBarInfo* GetBarInfoByWindow( wxWindow* pBarWnd );
8e08b761
JS
1425
1426public: /* protected really (accessed only by plugins) */
1427
4cbc57f0 1428 // Row/bar resizing related helper-method.
8e08b761 1429
4cbc57f0 1430 void DrawVertHandle ( wxDC& dc, int x, int y, int height );
8e08b761 1431
4cbc57f0 1432 // Row/bar resizing related helper-method.
8e08b761 1433
4cbc57f0 1434 void DrawHorizHandle( wxDC& dc, int x, int y, int width );
8e08b761 1435
4cbc57f0 1436 // Row/bar resizing related helper-method.
8e08b761 1437
4cbc57f0
JS
1438 void ResizeRow( cbRowInfo* pRow, int ofs, bool forUpperHandle );
1439
1440 // Row/bar resizing related helper-method.
1441
1442 void ResizeBar( cbBarInfo* pBar, int ofs, bool forLeftHandle );
1443
1444 // Returns row shape data.
1445 // cbBarShapeData objects will be added to the given pLst.
1446 // cbBarShapeData is used for storing the original bar's positions in the row,
1447 // when the 'non-destructive-friction' option is turned on.
1448
1449 void GetRowShapeData( cbRowInfo* pRow, wxList* pLst );
1450
1451 // Sets the shape data for the given row, using the data provided in pLst.
1452 // cbBarShapeData is used for storing the original bar's positions in the row,
1453 // when the 'non-destructive-friction' option is turned on.
1454
1455 void SetRowShapeData( cbRowInfo* pRowNode, wxList* pLst );
8e08b761
JS
1456};
1457
1458/*
4cbc57f0
JS
1459This class declares an abstract interface for optimized logic that should refresh
1460areas of frame layout that actually need to be updated. This should be extended in future
1461to implement a custom updating strategy.
1462*/
8e08b761
JS
1463
1464class cbUpdatesManagerBase : public wxObject
1465{
4cbc57f0 1466 DECLARE_ABSTRACT_CLASS( cbUpdatesManagerBase )
8e08b761
JS
1467
1468public: /* protected really, accessed by serializer (if any) */
1469
4cbc57f0 1470 wxFrameLayout* mpLayout;
8e08b761
JS
1471
1472public:
4cbc57f0 1473 // Default constructor
8e08b761 1474
4cbc57f0
JS
1475 cbUpdatesManagerBase(void)
1476 : mpLayout( 0 ) {}
8e08b761 1477
4cbc57f0 1478 // Constructor taking layout panel.
ffc6ce3f 1479
4cbc57f0
JS
1480 cbUpdatesManagerBase( wxFrameLayout* pPanel )
1481 : mpLayout( pPanel ) {}
8e08b761 1482
4cbc57f0 1483 // Destructor.
8e08b761 1484
4cbc57f0 1485 virtual ~cbUpdatesManagerBase() {}
8e08b761 1486
4cbc57f0 1487 // Sets the associated layout.
8e08b761 1488
4cbc57f0 1489 void SetLayout( wxFrameLayout* pLayout ) { mpLayout = pLayout; }
8e08b761 1490
4cbc57f0
JS
1491 // This function receives a notification from the frame layout (in the order in which
1492 // they would usually be invoked). Custom updates-managers may utilize
1493 // these notifications to implement a more fine-grained updating strategy.
8e08b761 1494
4cbc57f0 1495 virtual void OnStartChanges() = 0;
8e08b761 1496
4cbc57f0
JS
1497 // This function receives a notification from the frame layout (in the order in which
1498 // they would usually be invoked). Custom updates-managers may utilize
1499 // these notifications to implement a more fine-grained updating strategy.
8e08b761 1500
4cbc57f0 1501 virtual void OnRowWillChange( cbRowInfo* pRow, cbDockPane* pInPane ) {}
8e08b761 1502
4cbc57f0
JS
1503 // This function receives a notification from the frame layout (in the order in which
1504 // they would usually be invoked). Custom updates-managers may utilize
1505 // these notifications to implement a more fine-grained updating strategy.
ffc6ce3f 1506
4cbc57f0 1507 virtual void OnBarWillChange( cbBarInfo* pBar, cbRowInfo* pInRow, cbDockPane* pInPane ) {}
ffc6ce3f 1508
4cbc57f0
JS
1509 // This function receives a notification from the frame layout (in the order in which
1510 // they would usually be invoked). Custom updates-managers may utilize
1511 // these notifications to implement a more fine-grained updating strategy.
ffc6ce3f 1512
4cbc57f0 1513 virtual void OnPaneMarginsWillChange( cbDockPane* pPane ) {}
8e08b761 1514
4cbc57f0
JS
1515 // This function receives a notification from the frame layout (in the order in which
1516 // they would usually be invoked). Custom updates-managers may utilize
1517 // these notifications to implement a more fine-grained updating strategy.
1518
1519 virtual void OnPaneWillChange( cbDockPane* pPane ) {}
1520
1521 // This function receives a notification from the frame layout (in the order in which
1522 // they would usually be invoked). Custom updates-managers may utilize
1523 // these notifications to implement a more fine-grained updating strategy.
8e08b761 1524
4cbc57f0 1525 virtual void OnFinishChanges() {}
8e08b761 1526
4cbc57f0 1527 // Refreshes parts of the frame layout that need an update.
8e08b761 1528
4cbc57f0
JS
1529 virtual void UpdateNow() = 0;
1530};
8e08b761 1531
4cbc57f0
JS
1532/*
1533Base class for all control-bar plugin events.
1534This is not a dynamically-creatable class.
1535*/
8e08b761 1536
4cbc57f0
JS
1537class cbPluginEvent : public wxEvent
1538{
1539public:
1540 // NULL if event is not addressed to any specific pane.
8e08b761 1541
4cbc57f0 1542 cbDockPane* mpPane;
8e08b761 1543
4cbc57f0 1544 // Not used, but required.
8e08b761 1545
4cbc57f0 1546 virtual wxEvent* Clone() const { return NULL; }
8e08b761 1547
4cbc57f0 1548 // Constructor, taking event type and pane.
8e08b761 1549
4cbc57f0
JS
1550 cbPluginEvent( wxEventType eventType, cbDockPane* pPane )
1551 : mpPane( pPane )
8e08b761 1552
4cbc57f0
JS
1553 { m_eventType = eventType; }
1554};
8e08b761 1555
4cbc57f0 1556// event types handled by plugins
8e08b761 1557
4cbc57f0
JS
1558extern wxEventType cbEVT_PL_LEFT_DOWN;
1559extern wxEventType cbEVT_PL_LEFT_UP;
1560extern wxEventType cbEVT_PL_RIGHT_DOWN;
1561extern wxEventType cbEVT_PL_RIGHT_UP;
1562extern wxEventType cbEVT_PL_MOTION;
8e08b761 1563
4cbc57f0 1564extern wxEventType cbEVT_PL_LEFT_DCLICK;
8e08b761 1565
4cbc57f0
JS
1566extern wxEventType cbEVT_PL_LAYOUT_ROW;
1567extern wxEventType cbEVT_PL_RESIZE_ROW;
1568extern wxEventType cbEVT_PL_LAYOUT_ROWS;
1569extern wxEventType cbEVT_PL_INSERT_BAR;
1570extern wxEventType cbEVT_PL_RESIZE_BAR;
1571extern wxEventType cbEVT_PL_REMOVE_BAR;
1572extern wxEventType cbEVT_PL_SIZE_BAR_WND;
8e08b761 1573
4cbc57f0
JS
1574extern wxEventType cbEVT_PL_DRAW_BAR_DECOR;
1575extern wxEventType cbEVT_PL_DRAW_ROW_DECOR;
1576extern wxEventType cbEVT_PL_DRAW_PANE_DECOR;
1577extern wxEventType cbEVT_PL_DRAW_BAR_HANDLES;
1578extern wxEventType cbEVT_PL_DRAW_ROW_HANDLES;
1579extern wxEventType cbEVT_PL_DRAW_ROW_BKGROUND;
1580extern wxEventType cbEVT_PL_DRAW_PANE_BKGROUND;
8e08b761 1581
4cbc57f0
JS
1582extern wxEventType cbEVT_PL_START_BAR_DRAGGING;
1583extern wxEventType cbEVT_PL_DRAW_HINT_RECT;
8e08b761 1584
4cbc57f0
JS
1585extern wxEventType cbEVT_PL_START_DRAW_IN_AREA;
1586extern wxEventType cbEVT_PL_FINISH_DRAW_IN_AREA;
8e08b761 1587
4cbc57f0
JS
1588extern wxEventType cbEVT_PL_CUSTOMIZE_BAR;
1589extern wxEventType cbEVT_PL_CUSTOMIZE_LAYOUT;
8e08b761 1590
4cbc57f0
JS
1591extern wxEventType wxCUSTOM_CB_PLUGIN_EVENTS_START_AT;
1592
1593// Forward declarations, separated by categories.
8e08b761
JS
1594
1595class cbLeftDownEvent;
1596class cbLeftUpEvent;
1597class cbRightDownEvent;
1598class cbRightUpEvent;
1599class cbMotionEvent;
1600class cbLeftDClickEvent;
1601
1602class cbLayoutRowEvent;
1603class cbResizeRowEvent;
1604class cbLayoutRowsEvent;
1605class cbInsertBarEvent;
1606class cbResizeBarEvent;
1607class cbRemoveBarEvent;
1608class cbSizeBarWndEvent;
1609
1610class cbDrawBarDecorEvent;
1611class cbDrawRowDecorEvent;
1612class cbDrawPaneDecorEvent;
1613class cbDrawBarHandlesEvent;
1614class cbDrawRowHandlesEvent;
1615class cbDrawRowBkGroundEvent;
1616class cbDrawPaneBkGroundEvent;
1617
1618class cbStartBarDraggingEvent;
1619class cbDrawHintRectEvent;
1620
1621class cbStartDrawInAreaEvent;
1622class cbFinishDrawInAreaEvent;
1623
1624class cbCustomizeBarEvent;
1625class cbCustomizeLayoutEvent;
1626
4cbc57f0 1627// Definitions for for handler-methods.
ffc6ce3f 1628
8e08b761
JS
1629typedef void (wxEvtHandler::*cbLeftDownHandler )(cbLeftDownEvent&);
1630typedef void (wxEvtHandler::*cbLeftUpHandler )(cbLeftUpEvent&);
1631typedef void (wxEvtHandler::*cbRightDownHandler )(cbRightDownEvent&);
1632typedef void (wxEvtHandler::*cbRightUpHandler )(cbRightUpEvent&);
1633typedef void (wxEvtHandler::*cbMotionHandler )(cbMotionEvent&);
1634typedef void (wxEvtHandler::*cbLeftDClickHandler )(cbLeftDClickEvent&);
1635
1636typedef void (wxEvtHandler::*cbLayoutRowHandler )(cbLayoutRowEvent&);
1637typedef void (wxEvtHandler::*cbResizeRowHandler )(cbResizeRowEvent&);
1638typedef void (wxEvtHandler::*cbLayoutRowsHandler )(cbLayoutRowsEvent&);
1639typedef void (wxEvtHandler::*cbInsertBarHandler )(cbInsertBarEvent&);
1640typedef void (wxEvtHandler::*cbResizeBarHandler )(cbResizeBarEvent&);
1641typedef void (wxEvtHandler::*cbRemoveBarHandler )(cbRemoveBarEvent&);
1642typedef void (wxEvtHandler::*cbSizeBarWndHandler )(cbSizeBarWndEvent&);
1643
1644typedef void (wxEvtHandler::*cbDrawBarDecorHandler )(cbDrawBarDecorEvent&);
1645typedef void (wxEvtHandler::*cbDrawRowDecorHandler )(cbDrawRowDecorEvent&);
1646typedef void (wxEvtHandler::*cbDrawPaneDecorHandler )(cbDrawPaneDecorEvent&);
1647typedef void (wxEvtHandler::*cbDrawBarHandlesHandler )(cbDrawBarHandlesEvent&);
1648typedef void (wxEvtHandler::*cbDrawRowHandlesHandler )(cbDrawRowHandlesEvent&);
1649typedef void (wxEvtHandler::*cbDrawRowBkGroundHandler )(cbDrawRowBkGroundEvent&);
1650typedef void (wxEvtHandler::*cbDrawPaneBkGroundHandler)(cbDrawPaneBkGroundEvent&);
1651
1652typedef void (wxEvtHandler::*cbStartBarDraggingHandler )(cbStartBarDraggingEvent&);
1653typedef void (wxEvtHandler::*cbDrawHintRectHandler )(cbDrawHintRectEvent&);
1654
1655typedef void (wxEvtHandler::*cbStartDrawInAreaHandler )(cbStartDrawInAreaEvent&);
1656typedef void (wxEvtHandler::*cbFinishDrawInAreaHandler)(cbFinishDrawInAreaEvent&);
1657
1658typedef void (wxEvtHandler::*cbCustomizeBarHandler )(cbCustomizeBarEvent&);
1659typedef void (wxEvtHandler::*cbCustomizeLayoutHandler )(cbCustomizeLayoutEvent&);
1660
4cbc57f0
JS
1661// Macros for creating event table entries for plugin-events.
1662
1663#define EVT_PL_LEFT_DOWN(func) wxEventTableEntry( cbEVT_PL_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDownHandler ) & func, (wxObject *) NULL ),
1664#define EVT_PL_LEFT_UP(func) wxEventTableEntry( cbEVT_PL_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftUpHandler ) & func, (wxObject *) NULL ),
1665#define EVT_PL_RIGHT_DOWN(func) wxEventTableEntry( cbEVT_PL_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightDownHandler ) & func, (wxObject *) NULL ),
1666#define EVT_PL_RIGHT_UP(func) wxEventTableEntry( cbEVT_PL_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightUpHandler ) & func, (wxObject *) NULL ),
1667#define EVT_PL_MOTION(func) wxEventTableEntry( cbEVT_PL_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbMotionHandler ) & func, (wxObject *) NULL ),
1668#define EVT_PL_LEFT_DCLICK(func) wxEventTableEntry( cbEVT_PL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDClickHandler ) & func, (wxObject *) NULL ),
1669
1670#define EVT_PL_LAYOUT_ROW(func) wxEventTableEntry( cbEVT_PL_LAYOUT_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowHandler ) & func, (wxObject *) NULL ),
1671#define EVT_PL_RESIZE_ROW(func) wxEventTableEntry( cbEVT_PL_RESIZE_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeRowHandler ) & func, (wxObject *) NULL ),
1672#define EVT_PL_LAYOUT_ROWS(func) wxEventTableEntry( cbEVT_PL_LAYOUT_ROWS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowsHandler ) & func, (wxObject *) NULL ),
1673#define EVT_PL_INSERT_BAR(func) wxEventTableEntry( cbEVT_PL_INSERT_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbInsertBarHandler ) & func, (wxObject *) NULL ),
1674#define EVT_PL_RESIZE_BAR(func) wxEventTableEntry( cbEVT_PL_RESIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeBarHandler ) & func, (wxObject *) NULL ),
1675#define EVT_PL_REMOVE_BAR(func) wxEventTableEntry( cbEVT_PL_REMOVE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRemoveBarHandler ) & func, (wxObject *) NULL ),
1676#define EVT_PL_SIZE_BAR_WND(func) wxEventTableEntry( cbEVT_PL_SIZE_BAR_WND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbSizeBarWndHandler ) & func, (wxObject *) NULL ),
1677
1678#define EVT_PL_DRAW_BAR_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_BAR_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarDecorHandler ) & func, (wxObject *) NULL ),
1679#define EVT_PL_DRAW_ROW_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowDecorHandler ) & func, (wxObject *) NULL ),
1680#define EVT_PL_DRAW_PANE_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_PANE_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneDecorHandler ) & func, (wxObject *) NULL ),
1681#define EVT_PL_DRAW_BAR_HANDLES(func) wxEventTableEntry( cbEVT_PL_DRAW_BAR_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarHandlesHandler ) & func, (wxObject *) NULL ),
1682#define EVT_PL_DRAW_ROW_HANDLES(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowHandlesHandler ) & func, (wxObject *) NULL ),
1683#define EVT_PL_DRAW_ROW_BKGROUND(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowBkGroundHandler ) & func, (wxObject *) NULL ),
1684#define EVT_PL_DRAW_PANE_BKGROUND(func) wxEventTableEntry( cbEVT_PL_DRAW_PANE_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneBkGroundHandler) & func, (wxObject *) NULL ),
1685
1686#define EVT_PL_START_BAR_DRAGGING(func) wxEventTableEntry( cbEVT_PL_START_BAR_DRAGGING, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartBarDraggingHandler) & func, (wxObject *) NULL ),
1687#define EVT_PL_DRAW_HINT_RECT(func) wxEventTableEntry( cbEVT_PL_DRAW_HINT_RECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawHintRectHandler ) & func, (wxObject *) NULL ),
1688
1689
1690#define EVT_PL_START_DRAW_IN_AREA(func) wxEventTableEntry( cbEVT_PL_START_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartDrawInAreaHandler) & func, (wxObject *) NULL ),
1691#define EVT_PL_FINISH_DRAW_IN_AREA(func) wxEventTableEntry( cbEVT_PL_FINISH_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbFinishDrawInAreaHandler) & func, (wxObject *) NULL ),
1692
1693#define EVT_PL_CUSTOMIZE_BAR(func) wxEventTableEntry( cbEVT_PL_CUSTOMIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeBarHandler) & func, (wxObject *) NULL ),
1694#define EVT_PL_CUSTOMIZE_LAYOUT(func) wxEventTableEntry( cbEVT_PL_CUSTOMIZE_LAYOUT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeLayoutHandler) & func, (wxObject *) NULL ),
1695
ffc6ce3f 1696/*
4cbc57f0
JS
1697Abstract base class for all control-bar related plugins.
1698Note: pointer positions of mouse events sent to plugins
1699are always in the pane's coordinates (the pane to which
1700this plugin is hooked).
1701*/
8e08b761
JS
1702
1703class cbPluginBase : public wxEvtHandler
1704{
4cbc57f0 1705 DECLARE_ABSTRACT_CLASS( cbPluginBase )
8e08b761 1706public:
4cbc57f0
JS
1707 // Back-reference to the frame layout.
1708
1709 wxFrameLayout* mpLayout;
1710
1711 // Specifies panes for which this plugin receives events
1712 // (see pane masks definitions).
8e08b761 1713
4cbc57f0 1714 int mPaneMask;
8e08b761 1715
4cbc57f0 1716 // Is TRUE when plugin is ready to handle events.
8e08b761 1717
4cbc57f0 1718 bool mIsReady;
8e08b761
JS
1719
1720public:
4cbc57f0 1721 // Default constructor.
8e08b761 1722
4cbc57f0 1723 cbPluginBase()
8e08b761 1724
4cbc57f0
JS
1725 : mpLayout ( 0 ),
1726 mPaneMask( wxALL_PANES ),
1727 mIsReady ( FALSE )
1728 {}
8e08b761 1729
4cbc57f0 1730 // Constructor taking layout panel and a mask.
8e08b761 1731
4cbc57f0 1732 cbPluginBase( wxFrameLayout* pPanel, int paneMask = wxALL_PANES )
8e08b761 1733
4cbc57f0
JS
1734 : mpLayout ( pPanel ),
1735 mPaneMask( paneMask ),
1736 mIsReady ( FALSE )
1737 {}
8e08b761 1738
4cbc57f0 1739 // Returns the pane mask.
8e08b761 1740
4cbc57f0 1741 inline int GetPaneMask() { return mPaneMask; }
8e08b761 1742
4cbc57f0 1743 // Destructor. Destroys the whole plugin chain of connected plugins.
8e08b761 1744
4cbc57f0 1745 virtual ~cbPluginBase();
8e08b761 1746
4cbc57f0
JS
1747 // Override this method to do plugin-specific initialization.
1748 // At this point plugin is already attached to the frame layout,
1749 // and pane masks are set.
1750
1751 virtual void OnInitPlugin() { mIsReady = TRUE; }
1752
1753 // Returns TRUE if the plugin is ready to receive events.
1754
1755 bool IsReady() { return mIsReady; }
8e08b761 1756
4cbc57f0
JS
1757 // Overridden to determine whether the target pane specified in the
1758 // event matches the pane mask of this plugin (specific plugins
1759 // do not override this method).
8e08b761 1760
4cbc57f0
JS
1761 virtual bool ProcessEvent(wxEvent& event);
1762};
1763
1764/*
1765Class for mouse left down events.
1766*/
8e08b761
JS
1767
1768class cbLeftDownEvent : public cbPluginEvent
1769{
1770public:
4cbc57f0
JS
1771 wxPoint mPos;
1772
1773 // Constructor, taking mouse position and pane.
8e08b761 1774
4cbc57f0 1775 cbLeftDownEvent( const wxPoint& pos, cbDockPane* pPane )
8e08b761 1776
4cbc57f0
JS
1777 : cbPluginEvent( cbEVT_PL_LEFT_DOWN, pPane ),
1778 mPos( pos )
1779 {}
8e08b761
JS
1780};
1781
4cbc57f0
JS
1782/*
1783Class for mouse left up events.
1784*/
1785
8e08b761
JS
1786class cbLeftUpEvent : public cbPluginEvent
1787{
1788public:
4cbc57f0
JS
1789 wxPoint mPos;
1790
1791 // Constructor, taking mouse position and pane.
8e08b761 1792
4cbc57f0 1793 cbLeftUpEvent( const wxPoint& pos, cbDockPane* pPane )
8e08b761 1794
4cbc57f0
JS
1795 : cbPluginEvent( cbEVT_PL_LEFT_UP, pPane ),
1796 mPos( pos )
1797 {}
8e08b761
JS
1798};
1799
4cbc57f0
JS
1800/*
1801Class for mouse right down events.
1802*/
1803
8e08b761
JS
1804class cbRightDownEvent : public cbPluginEvent
1805{
1806public:
4cbc57f0 1807 wxPoint mPos;
8e08b761 1808
4cbc57f0 1809 // Constructor, taking mouse position and pane.
8e08b761 1810
4cbc57f0
JS
1811 cbRightDownEvent( const wxPoint& pos, cbDockPane* pPane )
1812
1813 : cbPluginEvent( cbEVT_PL_RIGHT_DOWN, pPane ),
1814 mPos( pos )
1815 {}
8e08b761
JS
1816};
1817
4cbc57f0
JS
1818/*
1819Class for mouse right up events.
1820*/
1821
8e08b761
JS
1822class cbRightUpEvent : public cbPluginEvent
1823{
1824public:
4cbc57f0 1825 wxPoint mPos;
8e08b761 1826
4cbc57f0 1827 // Constructor, taking mouse position and pane.
8e08b761 1828
4cbc57f0
JS
1829 cbRightUpEvent( const wxPoint& pos, cbDockPane* pPane )
1830
1831 : cbPluginEvent( cbEVT_PL_RIGHT_UP, pPane ),
1832 mPos( pos )
1833 {}
8e08b761
JS
1834};
1835
4cbc57f0
JS
1836/*
1837Class for mouse motion events.
1838*/
1839
8e08b761
JS
1840class cbMotionEvent : public cbPluginEvent
1841{
1842public:
4cbc57f0
JS
1843 wxPoint mPos;
1844
1845 // Constructor, taking mouse position and pane.
8e08b761 1846
4cbc57f0 1847 cbMotionEvent( const wxPoint& pos, cbDockPane* pPane )
8e08b761 1848
4cbc57f0
JS
1849 : cbPluginEvent( cbEVT_PL_MOTION, pPane ),
1850 mPos( pos )
1851 {}
8e08b761
JS
1852};
1853
4cbc57f0
JS
1854/*
1855Class for mouse left double click events.
1856*/
1857
8e08b761
JS
1858class cbLeftDClickEvent : public cbPluginEvent
1859{
1860public:
4cbc57f0
JS
1861 wxPoint mPos;
1862
1863 // Constructor, taking mouse position and pane.
8e08b761 1864
4cbc57f0 1865 cbLeftDClickEvent( const wxPoint& pos, cbDockPane* pPane )
8e08b761 1866
4cbc57f0
JS
1867 : cbPluginEvent( cbEVT_PL_LEFT_DCLICK, pPane ),
1868 mPos( pos )
1869 {}
8e08b761
JS
1870};
1871
4cbc57f0
JS
1872/*
1873Class for single row layout events.
1874*/
8e08b761
JS
1875
1876class cbLayoutRowEvent : public cbPluginEvent
1877{
1878public:
4cbc57f0 1879 cbRowInfo* mpRow;
8e08b761 1880
4cbc57f0 1881 // Constructor, taking row information and pane.
8e08b761 1882
4cbc57f0
JS
1883 cbLayoutRowEvent( cbRowInfo* pRow, cbDockPane* pPane )
1884
1885 : cbPluginEvent( cbEVT_PL_LAYOUT_ROW, pPane ),
1886 mpRow( pRow )
1887 {}
8e08b761
JS
1888};
1889
4cbc57f0
JS
1890/*
1891Class for row resize events.
1892*/
1893
8e08b761
JS
1894class cbResizeRowEvent : public cbPluginEvent
1895{
1896public:
4cbc57f0
JS
1897 cbRowInfo* mpRow;
1898 int mHandleOfs;
1899 bool mForUpperHandle;
8e08b761 1900
4cbc57f0 1901 // Constructor, taking row information, two parameters of currently unknown use, and pane.
8e08b761 1902
4cbc57f0
JS
1903 cbResizeRowEvent( cbRowInfo* pRow, int handleOfs, bool forUpperHandle, cbDockPane* pPane )
1904
1905 : cbPluginEvent( cbEVT_PL_RESIZE_ROW, pPane ),
1906 mpRow( pRow ),
1907 mHandleOfs( handleOfs ),
1908 mForUpperHandle( forUpperHandle )
1909 {}
8e08b761
JS
1910};
1911
4cbc57f0
JS
1912/*
1913Class for multiple rows layout events.
1914*/
1915
8e08b761
JS
1916class cbLayoutRowsEvent : public cbPluginEvent
1917{
1918public:
1919
4cbc57f0 1920 // Constructor, taking pane.
8e08b761 1921
4cbc57f0
JS
1922 cbLayoutRowsEvent( cbDockPane* pPane )
1923
1924 : cbPluginEvent( cbEVT_PL_LAYOUT_ROWS, pPane )
1925 {}
8e08b761
JS
1926};
1927
4cbc57f0
JS
1928/*
1929Class for bar insertion events.
1930*/
1931
8e08b761
JS
1932class cbInsertBarEvent : public cbPluginEvent
1933{
1934public:
4cbc57f0
JS
1935 cbBarInfo* mpBar;
1936 cbRowInfo* mpRow;
1937
1938 // Constructor, taking bar information, row information, and pane.
8e08b761 1939
4cbc57f0 1940 cbInsertBarEvent( cbBarInfo* pBar, cbRowInfo* pIntoRow, cbDockPane* pPane )
8e08b761 1941
4cbc57f0 1942 : cbPluginEvent( cbEVT_PL_INSERT_BAR, pPane ),
8e08b761 1943
4cbc57f0
JS
1944 mpBar( pBar ),
1945 mpRow( pIntoRow )
1946 {}
8e08b761
JS
1947};
1948
4cbc57f0
JS
1949/*
1950Class for bar resize events.
1951*/
1952
8e08b761
JS
1953class cbResizeBarEvent : public cbPluginEvent
1954{
1955public:
4cbc57f0
JS
1956 cbBarInfo* mpBar;
1957 cbRowInfo* mpRow;
1958
1959 // Constructor, taking bar information, row information, and pane.
8e08b761 1960
4cbc57f0 1961 cbResizeBarEvent( cbBarInfo* pBar, cbRowInfo* pRow, cbDockPane* pPane )
8e08b761 1962
4cbc57f0
JS
1963 : cbPluginEvent( cbEVT_PL_RESIZE_BAR, pPane ),
1964 mpBar( pBar ),
1965 mpRow( pRow )
1966 {}
8e08b761
JS
1967};
1968
4cbc57f0
JS
1969/*
1970Class for bar removal events.
1971*/
1972
8e08b761
JS
1973class cbRemoveBarEvent : public cbPluginEvent
1974{
1975public:
4cbc57f0 1976 cbBarInfo* mpBar;
8e08b761 1977
4cbc57f0 1978 // Constructor, taking bar information and pane.
8e08b761 1979
4cbc57f0
JS
1980 cbRemoveBarEvent( cbBarInfo* pBar, cbDockPane* pPane )
1981
1982 : cbPluginEvent( cbEVT_PL_REMOVE_BAR, pPane ),
1983 mpBar( pBar )
1984 {}
8e08b761
JS
1985};
1986
4cbc57f0
JS
1987/*
1988Class for bar window resize events.
1989*/
1990
8e08b761
JS
1991class cbSizeBarWndEvent : public cbPluginEvent
1992{
1993public:
4cbc57f0
JS
1994 cbBarInfo* mpBar;
1995 wxRect mBoundsInParent;
8e08b761 1996
4cbc57f0 1997 // Constructor, taking bar information and pane.
8e08b761 1998
4cbc57f0
JS
1999 cbSizeBarWndEvent( cbBarInfo* pBar, cbDockPane* pPane )
2000
2001 : cbPluginEvent( cbEVT_PL_SIZE_BAR_WND, pPane ),
2002 mpBar( pBar ),
2003 mBoundsInParent( pBar->mBoundsInParent )
2004 {}
8e08b761
JS
2005};
2006
4cbc57f0
JS
2007/*
2008Class for bar decoration drawing events.
2009*/
2010
8e08b761
JS
2011class cbDrawBarDecorEvent : public cbPluginEvent
2012{
2013public:
4cbc57f0
JS
2014 cbBarInfo* mpBar;
2015 wxDC* mpDc;
2016 wxRect mBoundsInParent;
2017
2018 // Constructor, taking bar information, device context, and pane.
8e08b761 2019
4cbc57f0 2020 cbDrawBarDecorEvent( cbBarInfo* pBar, wxDC& dc, cbDockPane* pPane )
8e08b761 2021
4cbc57f0
JS
2022 : cbPluginEvent( cbEVT_PL_DRAW_BAR_DECOR, pPane ),
2023 mpBar( pBar ),
2024 mpDc( &dc ),
2025 mBoundsInParent( pBar->mBoundsInParent )
2026 {}
8e08b761
JS
2027};
2028
4cbc57f0
JS
2029/*
2030Class for row decoration drawing events.
2031*/
2032
8e08b761
JS
2033class cbDrawRowDecorEvent : public cbPluginEvent
2034{
2035public:
4cbc57f0
JS
2036 cbRowInfo* mpRow;
2037 wxDC* mpDc;
2038
2039 // Constructor, taking row information, device context, and pane.
8e08b761 2040
4cbc57f0 2041 cbDrawRowDecorEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane )
8e08b761 2042
4cbc57f0
JS
2043 : cbPluginEvent( cbEVT_PL_DRAW_ROW_DECOR, pPane ),
2044 mpRow( pRow ),
2045 mpDc( &dc )
2046 {}
8e08b761
JS
2047};
2048
4cbc57f0
JS
2049/*
2050Class for pane decoration drawing events.
2051*/
2052
8e08b761
JS
2053class cbDrawPaneDecorEvent : public cbPluginEvent
2054{
2055public:
4cbc57f0
JS
2056 wxDC* mpDc;
2057
2058 // Constructor, taking device context and pane.
8e08b761 2059
4cbc57f0 2060 cbDrawPaneDecorEvent( wxDC& dc, cbDockPane* pPane )
8e08b761 2061
4cbc57f0
JS
2062 : cbPluginEvent( cbEVT_PL_DRAW_PANE_DECOR, pPane ),
2063 mpDc( &dc )
2064 {}
8e08b761
JS
2065};
2066
4cbc57f0
JS
2067/*
2068Class for bar handles drawing events.
2069*/
2070
8e08b761
JS
2071class cbDrawBarHandlesEvent : public cbPluginEvent
2072{
2073public:
4cbc57f0
JS
2074 cbBarInfo* mpBar;
2075 wxDC* mpDc;
2076
2077 // Constructor, taking bar information, device context, and pane.
8e08b761 2078
4cbc57f0 2079 cbDrawBarHandlesEvent( cbBarInfo* pBar, wxDC& dc, cbDockPane* pPane )
8e08b761 2080
4cbc57f0
JS
2081 : cbPluginEvent( cbEVT_PL_DRAW_BAR_HANDLES, pPane ),
2082 mpBar( pBar ),
2083 mpDc( &dc )
2084 {}
8e08b761
JS
2085};
2086
4cbc57f0
JS
2087/*
2088Class for row handles drawing events.
2089*/
2090
8e08b761
JS
2091class cbDrawRowHandlesEvent : public cbPluginEvent
2092{
2093public:
4cbc57f0
JS
2094 cbRowInfo* mpRow;
2095 wxDC* mpDc;
2096
2097 // Constructor, taking row information, device context, and pane.
8e08b761 2098
4cbc57f0 2099 cbDrawRowHandlesEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane )
8e08b761 2100
4cbc57f0
JS
2101 : cbPluginEvent( cbEVT_PL_DRAW_ROW_HANDLES, pPane ),
2102 mpRow( pRow ),
2103 mpDc( &dc )
2104 {}
8e08b761
JS
2105};
2106
4cbc57f0
JS
2107/*
2108Class for row background drawing events.
2109*/
2110
8e08b761
JS
2111class cbDrawRowBkGroundEvent : public cbPluginEvent
2112{
2113public:
4cbc57f0
JS
2114 cbRowInfo* mpRow;
2115 wxDC* mpDc;
8e08b761 2116
4cbc57f0 2117 // Constructor, taking row information, device context, and pane.
8e08b761 2118
4cbc57f0
JS
2119 cbDrawRowBkGroundEvent( cbRowInfo* pRow, wxDC& dc, cbDockPane* pPane )
2120
2121 : cbPluginEvent( cbEVT_PL_DRAW_ROW_BKGROUND, pPane ),
2122 mpRow( pRow ),
2123 mpDc( &dc )
2124 {}
8e08b761
JS
2125};
2126
4cbc57f0
JS
2127/*
2128Class for pane background drawing events.
2129*/
2130
8e08b761
JS
2131class cbDrawPaneBkGroundEvent : public cbPluginEvent
2132{
2133public:
4cbc57f0 2134 wxDC* mpDc;
8e08b761 2135
4cbc57f0 2136 // Constructor, taking device context and pane.
8e08b761 2137
4cbc57f0
JS
2138 cbDrawPaneBkGroundEvent( wxDC& dc, cbDockPane* pPane )
2139
2140 : cbPluginEvent( cbEVT_PL_DRAW_PANE_BKGROUND, pPane ),
2141 mpDc( &dc )
2142 {}
8e08b761
JS
2143};
2144
4cbc57f0
JS
2145/*
2146Class for start-bar-dragging events.
2147*/
2148
8e08b761
JS
2149class cbStartBarDraggingEvent : public cbPluginEvent
2150{
2151public:
4cbc57f0
JS
2152 cbBarInfo* mpBar;
2153 wxPoint mPos; // is given in frame's coordinates
8e08b761 2154
4cbc57f0 2155 // Constructor, taking bar information, mouse position, and pane.
8e08b761 2156
4cbc57f0
JS
2157 cbStartBarDraggingEvent( cbBarInfo* pBar, const wxPoint& pos, cbDockPane* pPane )
2158
2159 : cbPluginEvent( cbEVT_PL_START_BAR_DRAGGING, pPane ),
2160 mpBar( pBar ),
2161 mPos( pos )
2162 {}
8e08b761
JS
2163};
2164
4cbc57f0
JS
2165/*
2166Class for hint-rectangle drawing events.
2167*/
2168
8e08b761
JS
2169class cbDrawHintRectEvent : public cbPluginEvent
2170{
2171public:
4cbc57f0 2172 wxRect mRect; // is given in frame's coordinates
8e08b761
JS
2173
2174
4cbc57f0
JS
2175 bool mLastTime; // indicates that this event finishes "session" of on-screen drawing,
2176 // thus associated resources can be freed now
2177 bool mEraseRect; // does not have any impact, if recangle is drawn using XOR-mask
8e08b761 2178
4cbc57f0
JS
2179 bool mIsInClient;// in cleint area hint could be drawn differently,
2180 // e.g. with fat/hatched border
8e08b761
JS
2181
2182
4cbc57f0 2183 // Constructor, taking hint rectangle and three flags.
8e08b761 2184
4cbc57f0
JS
2185 cbDrawHintRectEvent( const wxRect& rect, bool isInClient, bool eraseRect, bool lastTime )
2186
2187 : cbPluginEvent( cbEVT_PL_DRAW_HINT_RECT, 0 ),
2188 mRect ( rect ),
2189 mLastTime ( lastTime ),
2190 mEraseRect ( eraseRect ),
2191 mIsInClient( isInClient )
2192 {}
8e08b761
JS
2193};
2194
4cbc57f0
JS
2195/*
2196Class for start drawing in area events.
2197*/
2198
8e08b761
JS
2199class cbStartDrawInAreaEvent : public cbPluginEvent
2200{
2201public:
4cbc57f0
JS
2202 wxRect mArea;
2203 wxDC** mppDc; // points to pointer, where the reference
2204 // to the obtained buffer-context should be placed
2205
2206 // Constructor, taking rectangular area, device context pointer to a pointer, and pane.
8e08b761 2207
4cbc57f0 2208 cbStartDrawInAreaEvent( const wxRect& area, wxDC** ppDCForArea, cbDockPane* pPane )
8e08b761 2209
4cbc57f0
JS
2210 : cbPluginEvent( cbEVT_PL_START_DRAW_IN_AREA, pPane ),
2211 mArea( area ),
2212 mppDc( ppDCForArea )
2213 {}
8e08b761
JS
2214};
2215
4cbc57f0
JS
2216/*
2217Class for finish drawing in area events.
2218*/
2219
8e08b761
JS
2220class cbFinishDrawInAreaEvent : public cbPluginEvent
2221{
2222public:
4cbc57f0
JS
2223 wxRect mArea;
2224
2225 // Constructor, taking rectangular area and pane.
8e08b761 2226
4cbc57f0 2227 cbFinishDrawInAreaEvent( const wxRect& area, cbDockPane* pPane )
8e08b761 2228
4cbc57f0
JS
2229 : cbPluginEvent( cbEVT_PL_FINISH_DRAW_IN_AREA, pPane ),
2230 mArea( area )
2231 {}
8e08b761
JS
2232};
2233
4cbc57f0
JS
2234/*
2235Class for bar customization events.
2236*/
2237
8e08b761
JS
2238class cbCustomizeBarEvent : public cbPluginEvent
2239{
2240public:
4cbc57f0
JS
2241 wxPoint mClickPos; // in parent frame's coordinates
2242 cbBarInfo* mpBar;
2243
2244 // Constructor, taking bar information, mouse position, and pane.
8e08b761 2245
4cbc57f0 2246 cbCustomizeBarEvent( cbBarInfo* pBar, const wxPoint& clickPos, cbDockPane* pPane )
8e08b761 2247
4cbc57f0
JS
2248 : cbPluginEvent( cbEVT_PL_CUSTOMIZE_BAR, pPane ),
2249 mClickPos( clickPos ),
2250 mpBar( pBar )
2251 {}
8e08b761
JS
2252};
2253
4cbc57f0
JS
2254/*
2255Class for layout customization events.
2256*/
2257
8e08b761
JS
2258class cbCustomizeLayoutEvent : public cbPluginEvent
2259{
2260public:
4cbc57f0
JS
2261 wxPoint mClickPos; // in parent frame's coordinates
2262
2263 // Constructor, taking mouse position.
8e08b761 2264
4cbc57f0 2265 cbCustomizeLayoutEvent( const wxPoint& clickPos )
8e08b761 2266
4cbc57f0
JS
2267 : cbPluginEvent( cbEVT_PL_CUSTOMIZE_LAYOUT, 0 ),
2268 mClickPos( clickPos )
2269 {}
8e08b761
JS
2270};
2271
2272#endif /* __CONTROLBAR_G__ */
2273