]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: rowlayoutpl.h | |
3 | // Purpose: cbRowLayoutPlugin header. | |
4 | // Author: Aleksandras Gluchovas | |
5 | // Modified by: | |
6 | // Created: 02/10/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Aleksandras Gluchovas | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef __ROWLAYOUTPL_G__ | |
13 | #define __ROWLAYOUTPL_G__ | |
14 | ||
15 | #if defined(__GNUG__) && !defined(__APPLE__) | |
16 | #pragma interface "rowlayoutpl.h" | |
17 | #endif | |
18 | ||
19 | #include "wx/fl/controlbar.h" | |
20 | ||
21 | /* | |
22 | Simple implementation of a plugin which handles row layout | |
23 | requests sent from a frame layout. | |
24 | */ | |
25 | ||
26 | class WXDLLIMPEXP_FL cbRowLayoutPlugin : public cbPluginBase | |
27 | { | |
28 | DECLARE_DYNAMIC_CLASS( cbRowLayoutPlugin ) | |
29 | protected: | |
30 | cbDockPane* mpPane; // is set up temporarily, while handling event | |
31 | protected: | |
32 | ||
33 | // Internal helper relating to not-fixed-bars layout. | |
34 | void FitBarsToRange( int from, int till, cbBarInfo* pTheBar, cbRowInfo* pRow ); | |
35 | ||
36 | // Internal helper relating to not-fixed-bars layout. | |
37 | void RelayoutNotFixedBarsAround( cbBarInfo* pTheBar, cbRowInfo* pRow ); | |
38 | ||
39 | // Internal helper relating to not-fixed-bars layout. | |
40 | void MinimzeNotFixedBars( cbRowInfo* pRow, cbBarInfo* pBarToPreserve ); | |
41 | ||
42 | // Internal helper relating to not-fixed-bars layout. | |
43 | int GetRowFreeSpace( cbRowInfo* pRow ); | |
44 | ||
45 | ||
46 | // Internal helper relating to not-fixed-bars layout. | |
47 | void RecalcLengthRatios( cbRowInfo* pRow ); | |
48 | ||
49 | // Internal helper relating to not-fixed-bars layout. | |
50 | void ApplyLengthRatios( cbRowInfo* pRow ); | |
51 | ||
52 | // Internal helper relating to not-fixed-bars layout. | |
53 | void ExpandNotFixedBars( cbRowInfo* pRow ); | |
54 | ||
55 | // Internal helper relating to not-fixed-bars layout. | |
56 | void AdjustLengthOfInserted( cbRowInfo* pRow, cbBarInfo* pTheBar ); | |
57 | ||
58 | ||
59 | // Internal helper relating to not-fixed-bars layout. | |
60 | void DetectBarHandles( cbRowInfo* pRow ); | |
61 | ||
62 | // Internal helper relating to not-fixed-bars layout. | |
63 | void CheckIfAtTheBoundary( cbBarInfo* pTheBar, cbRowInfo& rowInfo ); | |
64 | ||
65 | ||
66 | // Row layout helper simulating bar 'friction'. | |
67 | int CalcRowHeight( cbRowInfo& row ); | |
68 | ||
69 | // Row layout helper simulating bar 'friction'. | |
70 | void LayoutItemsVertically( cbRowInfo& row ); | |
71 | ||
72 | ||
73 | // Row layout helper simulating bar 'friction'. | |
74 | void StickRightSideBars( cbBarInfo* pToBar ); | |
75 | ||
76 | ||
77 | // Row layout helper simulating bar 'friction'. | |
78 | void SlideLeftSideBars ( cbBarInfo* pTheBar ); | |
79 | ||
80 | // Row layout helper simulating bar 'friction'. | |
81 | void SlideRightSideBars( cbBarInfo* pTheBar ); | |
82 | ||
83 | ||
84 | // Row layout helper simulating bar 'friction'. | |
85 | void ShiftLeftTrashold ( cbBarInfo* pTheBar, cbRowInfo& row ); | |
86 | ||
87 | // Row layout helper simulating bar 'friction'. | |
88 | void ShiftRightTrashold( cbBarInfo* pTheBar, cbRowInfo& row ); | |
89 | ||
90 | ||
91 | // Insert the bar before the given row. | |
92 | void InsertBefore( cbBarInfo* pBeforeBar, | |
93 | cbBarInfo* pTheBar, | |
94 | cbRowInfo& row | |
95 | ); | |
96 | ||
97 | // Insert the bar before the given row. | |
98 | void DoInsertBar( cbBarInfo* pTheBar, cbRowInfo& row ); | |
99 | ||
100 | public: | |
101 | // Default constructor. | |
102 | cbRowLayoutPlugin(void); | |
103 | ||
104 | // Constructor taking frame layout pane and pane mask. | |
105 | cbRowLayoutPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); | |
106 | ||
107 | // Responds to row resize event. | |
108 | void OnResizeRow ( cbResizeRowEvent& event ); | |
109 | ||
110 | // Responds to bar insertion event. | |
111 | void OnInsertBar ( cbInsertBarEvent& event ); | |
112 | ||
113 | // Responds to bar removal event. | |
114 | void OnRemoveBar ( cbRemoveBarEvent& event ); | |
115 | ||
116 | // Responds to row layout event. | |
117 | void OnLayoutRow ( cbLayoutRowEvent& event ); | |
118 | ||
119 | // Responds to rows layout event. | |
120 | void OnLayoutRows( cbLayoutRowsEvent& event ); | |
121 | ||
122 | DECLARE_EVENT_TABLE() | |
123 | }; | |
124 | ||
125 | #endif /* __ROWLAYOUTPL_G__ */ | |
126 |