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