This unit contains definition of XSplitPanel and XStatus classes and
several other classes needed to its implementation. XSplitPanel is requiring of
XAligns.pas and calls UseAligner in its constructor.
Using of XSplitPanel allows to place controls more easy, dividing its area
onto several mouse-sizeable panels vertically or horizontally. It is possible to set
initial size of inner panels and its ability to be sizeable with mouse. Do not forget to
call UseSplitSizer to allow sizing with mouse.
XSplitPanel
XSplitPanel properties:
- if Side is assigned to sdRight, then inner panels are aligned to right (bottom) and placed from right (bottom) to left (top). Accordinately, when form is resizing, only last of inner panel is resizing which is placed now leftmost (topmost). |
- Number of inner panels. Default is 1. But I recommend to assign value to this property even if it is 1 (to provide its autosizing). |
- set it to False before changing the Count property to make newly created inner
panels not sizeable with mouse by default. And next three properties also are to set some properties of newly created inner panels by default. |
While working with XSplitPanel, it is possible to access its inner panels using property Panels[ Idx ].
CAUTION! Panels are enumerated starting from 1 not from 0. |
Inner panels are read only, but it is useful to know its ascendency and main properties. Inner panels are derived from XPanel (and have Caption property as well as its ancestor) and have additional properties:
- same named as usual but it is override old Align property to hide it from changing; |
- it is recommended to use this property instead Width or Height (depends on Direction property of parent XSplitPanel). |
- default 0. Set it to desired value to prevent sizing less then MinSize. |
- default 0, which means that no maximum size restriction (excluding width/height of parent XSplitPanel). Set it to strict maximal size of inner panel. |
- set it to False to prevent sizing of inner panel with mouse. |
XStatus is very similar to TStatusBar in VCL. But it is more power, because it is derived from XSplitPanel and allows to resize its inner panels with mouse.
XStatus properties are the same as XSplitPanel ones. The single difference is that XStatus is created bottom-aligned with certain (not too large) heihgt.
TASKS
Creating statusbar using XStatus is very easy task:
var SB : XStatus; ... SB := XStatus.Create( Applet.MainForm ); ... |
All that You need to provide XStatus or
XSplitPanel with ability to be resizeable using mouse is to call UseSplitSizer anywhere in
Your project. This will turn on add-on XSplitSizing.pas, which also calls UseStdMouse.
For those of You, who see the first time term "add-on", please read
more carefully introduction. I only remind that XCL in differ to Delphi VCL, allows to
create extending modules for existing classes, which can expand capabilities of such
classes without creating of parallel branch in class tree. These mudules, called
"add-on's" can be used in applet optionally or not used at all, and in that last
case no code is added to executable. So, in XCL You can choose if to equip your applet
with some additional capabilities or to economy its size.
And in case of this add-on XSplitSizing, You can either use it and allow to
resize inner panels with mouse or not to use it and economy size of your exe-file.