1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: cbRowLayoutPlugin header.
4 // Author: Aleksandras Gluchovas
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __ROWLAYOUTPL_G__
13 #define __ROWLAYOUTPL_G__
15 #include "wx/fl/controlbar.h"
18 Simple implementation of a plugin which handles row layout
19 requests sent from a frame layout.
22 class WXDLLIMPEXP_FL cbRowLayoutPlugin
: public cbPluginBase
24 DECLARE_DYNAMIC_CLASS( cbRowLayoutPlugin
)
26 cbDockPane
* mpPane
; // is set up temporarily, while handling event
29 // Internal helper relating to not-fixed-bars layout.
30 void FitBarsToRange( int from
, int till
, cbBarInfo
* pTheBar
, cbRowInfo
* pRow
);
32 // Internal helper relating to not-fixed-bars layout.
33 void RelayoutNotFixedBarsAround( cbBarInfo
* pTheBar
, cbRowInfo
* pRow
);
35 // Internal helper relating to not-fixed-bars layout.
36 void MinimzeNotFixedBars( cbRowInfo
* pRow
, cbBarInfo
* pBarToPreserve
);
38 // Internal helper relating to not-fixed-bars layout.
39 int GetRowFreeSpace( cbRowInfo
* pRow
);
42 // Internal helper relating to not-fixed-bars layout.
43 void RecalcLengthRatios( cbRowInfo
* pRow
);
45 // Internal helper relating to not-fixed-bars layout.
46 void ApplyLengthRatios( cbRowInfo
* pRow
);
48 // Internal helper relating to not-fixed-bars layout.
49 void ExpandNotFixedBars( cbRowInfo
* pRow
);
51 // Internal helper relating to not-fixed-bars layout.
52 void AdjustLengthOfInserted( cbRowInfo
* pRow
, cbBarInfo
* pTheBar
);
55 // Internal helper relating to not-fixed-bars layout.
56 void DetectBarHandles( cbRowInfo
* pRow
);
58 // Internal helper relating to not-fixed-bars layout.
59 void CheckIfAtTheBoundary( cbBarInfo
* pTheBar
, cbRowInfo
& rowInfo
);
62 // Row layout helper simulating bar 'friction'.
63 int CalcRowHeight( cbRowInfo
& row
);
65 // Row layout helper simulating bar 'friction'.
66 void LayoutItemsVertically( cbRowInfo
& row
);
69 // Row layout helper simulating bar 'friction'.
70 void StickRightSideBars( cbBarInfo
* pToBar
);
73 // Row layout helper simulating bar 'friction'.
74 void SlideLeftSideBars ( cbBarInfo
* pTheBar
);
76 // Row layout helper simulating bar 'friction'.
77 void SlideRightSideBars( cbBarInfo
* pTheBar
);
80 // Row layout helper simulating bar 'friction'.
81 void ShiftLeftTrashold ( cbBarInfo
* pTheBar
, cbRowInfo
& row
);
83 // Row layout helper simulating bar 'friction'.
84 void ShiftRightTrashold( cbBarInfo
* pTheBar
, cbRowInfo
& row
);
87 // Insert the bar before the given row.
88 void InsertBefore( cbBarInfo
* pBeforeBar
,
93 // Insert the bar before the given row.
94 void DoInsertBar( cbBarInfo
* pTheBar
, cbRowInfo
& row
);
97 // Default constructor.
98 cbRowLayoutPlugin(void);
100 // Constructor taking frame layout pane and pane mask.
101 cbRowLayoutPlugin( wxFrameLayout
* pPanel
, int paneMask
= wxALL_PANES
);
103 // Responds to row resize event.
104 void OnResizeRow ( cbResizeRowEvent
& event
);
106 // Responds to bar insertion event.
107 void OnInsertBar ( cbInsertBarEvent
& event
);
109 // Responds to bar removal event.
110 void OnRemoveBar ( cbRemoveBarEvent
& event
);
112 // Responds to row layout event.
113 void OnLayoutRow ( cbLayoutRowEvent
& event
);
115 // Responds to rows layout event.
116 void OnLayoutRows( cbLayoutRowsEvent
& event
);
118 DECLARE_EVENT_TABLE()
121 #endif /* __ROWLAYOUTPL_G__ */