]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/fl/rowlayoutpl.h
f44c74a9d8eb6c348bd2dbd537dc57f07d7f784e
[wxWidgets.git] / contrib / include / wx / fl / rowlayoutpl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: No names yet.
3 // Purpose: Contrib. demo
4 // Author: Aleksandras Gluchovas
5 // Modified by:
6 // Created: 02/10/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __ROWLAYOUTPL_G__
13 #define __ROWLAYOUTPL_G__
14
15 #ifdef __GNUG__
16 #pragma interface "rowlayoutpl.h"
17 #endif
18
19 #include "wx/fl/controlbar.h"
20
21 /*
22 * Simple implementation of plugin, which handles row-layouting
23 * requests sent from Frame Layout
24 */
25
26 class cbRowLayoutPlugin : public cbPluginBase
27 {
28 DECLARE_DYNAMIC_CLASS( cbRowLayoutPlugin )
29 protected:
30 cbDockPane* mpPane; // is set up temorarely, while handling event
31 protected:
32
33 // not-fixed-bars layouting related helpers
34
35 void FitBarsToRange( int from, int till, cbBarInfo* pTheBar, cbRowInfo* pRow );
36 void RelayoutNotFixedBarsAround( cbBarInfo* pTheBar, cbRowInfo* pRow );
37 void MinimzeNotFixedBars( cbRowInfo* pRow, cbBarInfo* pBarToPreserve );
38 int GetRowFreeSpace( cbRowInfo* pRow );
39
40 void RecalcLengthRatios( cbRowInfo* pRow );
41 void ApplyLengthRatios( cbRowInfo* pRow );
42 void ExpandNotFixedBars( cbRowInfo* pRow );
43 void AdjustLengthOfInserted( cbRowInfo* pRow, cbBarInfo* pTheBar );
44
45 void DetectBarHandles( cbRowInfo* pRow );
46 void CheckIfAtTheBoundary( cbBarInfo* pTheBar, cbRowInfo& rowInfo );
47
48
49 // row-layouting helpers (simulate "bar-friction")
50
51 int CalcRowHeight( cbRowInfo& row );
52 void LayoutItemsVertically( cbRowInfo& row );
53
54 void StickRightSideBars( cbBarInfo* pToBar );
55
56 void SlideLeftSideBars ( cbBarInfo* pTheBar );
57 void SlideRightSideBars( cbBarInfo* pTheBar );
58
59 void ShiftLeftTrashold ( cbBarInfo* pTheBar, cbRowInfo& row );
60 void ShiftRightTrashold( cbBarInfo* pTheBar, cbRowInfo& row );
61
62 void InsertBefore( cbBarInfo* pBeforeBar,
63 cbBarInfo* pTheBar,
64 cbRowInfo& row
65 );
66
67 void DoInsertBar( cbBarInfo* pTheBar, cbRowInfo& row );
68
69 public:
70
71 cbRowLayoutPlugin(void);
72
73 cbRowLayoutPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES );
74
75 // event handlers
76
77 void OnResizeRow ( cbResizeRowEvent& event );
78 void OnInsertBar ( cbInsertBarEvent& event );
79 void OnRemoveBar ( cbRemoveBarEvent& event );
80 void OnLayoutRow ( cbLayoutRowEvent& event );
81 void OnLayoutRows( cbLayoutRowsEvent& event );
82
83 DECLARE_EVENT_TABLE()
84 };
85
86 #endif /* __ROWLAYOUTPL_G__ */
87