]>
git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/fl/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__
16 #pragma interface "rowlayoutpl.h"
19 #include "wx/fl/controlbar.h"
22 * Simple implementation of plugin, which handles row-layouting
23 * requests sent from Frame Layout
26 class cbRowLayoutPlugin
: public cbPluginBase
28 DECLARE_DYNAMIC_CLASS( cbRowLayoutPlugin
)
30 cbDockPane
* mpPane
; // is set up temorarely, while handling event
33 // not-fixed-bars layouting related helpers
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
);
40 void RecalcLengthRatios( cbRowInfo
* pRow
);
41 void ApplyLengthRatios( cbRowInfo
* pRow
);
42 void ExpandNotFixedBars( cbRowInfo
* pRow
);
43 void AdjustLengthOfInserted( cbRowInfo
* pRow
, cbBarInfo
* pTheBar
);
45 void DetectBarHandles( cbRowInfo
* pRow
);
46 void CheckIfAtTheBoundary( cbBarInfo
* pTheBar
, cbRowInfo
& rowInfo
);
49 // row-layouting helpers (simulate "bar-friction")
51 int CalcRowHeight( cbRowInfo
& row
);
52 void LayoutItemsVertically( cbRowInfo
& row
);
54 void StickRightSideBars( cbBarInfo
* pToBar
);
56 void SlideLeftSideBars ( cbBarInfo
* pTheBar
);
57 void SlideRightSideBars( cbBarInfo
* pTheBar
);
59 void ShiftLeftTrashold ( cbBarInfo
* pTheBar
, cbRowInfo
& row
);
60 void ShiftRightTrashold( cbBarInfo
* pTheBar
, cbRowInfo
& row
);
62 void InsertBefore( cbBarInfo
* pBeforeBar
,
67 void DoInsertBar( cbBarInfo
* pTheBar
, cbRowInfo
& row
);
71 cbRowLayoutPlugin(void);
73 cbRowLayoutPlugin( wxFrameLayout
* pPanel
, int paneMask
= wxALL_PANES
);
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
);
86 #endif /* __ROWLAYOUTPL_G__ */