]>
git.saurik.com Git - wxWidgets.git/blob - utils/framelayout/src/rowlayoutpl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Contrib. demo
4 // Author: Aleksandras Gluchovas
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __ROWLAYOUTPL_G__
13 #define __ROWLAYOUTPL_G__
15 #include "controlbar.h"
18 * Simple implementaiton of plugin, which handles row-layouting
19 * requests sent from Frame Layout
22 class cbRowLayoutPlugin
: public cbPluginBase
24 DECLARE_DYNAMIC_CLASS( cbRowLayoutPlugin
)
26 cbDockPane
* mpPane
; // is set up temorarely, while handling event
29 // not-fixed-bars layouting related helpers
31 void FitBarsToRange( int from
, int till
, cbBarInfo
* pTheBar
, cbRowInfo
* pRow
);
32 void RelayoutNotFixedBarsAround( cbBarInfo
* pTheBar
, cbRowInfo
* pRow
);
33 void MinimzeNotFixedBars( cbRowInfo
* pRow
, cbBarInfo
* pBarToPreserve
);
34 int GetRowFreeSpace( cbRowInfo
* pRow
);
36 void RecalcLenghtRatios( cbRowInfo
* pRow
);
37 void ApplyLenghtRatios( cbRowInfo
* pRow
);
38 void ExpandNotFixedBars( cbRowInfo
* pRow
);
39 void AdjustLenghtOfInserted( cbRowInfo
* pRow
, cbBarInfo
* pTheBar
);
41 void DetectBarHandles( cbRowInfo
* pRow
);
42 void CheckIfAtTheBoundary( cbBarInfo
* pTheBar
, cbRowInfo
& rowInfo
);
45 // row-layouting helpers (simulate "bar-friction")
47 int CalcRowHeight( cbRowInfo
& row
);
48 void LayoutItemsVertically( cbRowInfo
& row
);
50 void StickRightSideBars( cbBarInfo
* pToBar
);
52 void SlideLeftSideBars ( cbBarInfo
* pTheBar
);
53 void SlideRightSideBars( cbBarInfo
* pTheBar
);
55 void ShiftLeftTrashold ( cbBarInfo
* pTheBar
, cbRowInfo
& row
);
56 void ShiftRightTrashold( cbBarInfo
* pTheBar
, cbRowInfo
& row
);
58 void InsertBefore( cbBarInfo
* pBeforeBar
,
63 void DoInsertBar( cbBarInfo
* pTheBar
, cbRowInfo
& row
);
67 cbRowLayoutPlugin(void);
69 cbRowLayoutPlugin( wxFrameLayout
* pPanel
, int paneMask
= wxALL_PANES
);
73 void OnResizeRow ( cbResizeRowEvent
& event
);
74 void OnInsertBar ( cbInsertBarEvent
& event
);
75 void OnRemoveBar ( cbRemoveBarEvent
& event
);
76 void OnLayoutRow ( cbLayoutRowEvent
& event
);
77 void OnLayoutRows( cbLayoutRowsEvent
& event
);