Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>
TAdvSmoothPanel
How to add buttons to the layout that span multiple rows or multiple columns.
How to add buttons to the layout that span multiple rows or multiple columns.
On a regular TAdvSmoothExpanderPanel, the buttons are laid out proportionally on the surface of the panel and all buttons have the same size (AdvSmoothExpanderPanel.ButtonWidth, AdvSmoothExpanderPanel.ButtonHeight). When the new AlternativeLayout: Boolean property is set to true, it is possible to add buttons to the layout that span multiple rows or multiple columns or both. This way, buttons with different sizes can be added to the TAdvSmoothExpanderPanel.
To use the new feature, make sure to set TAdvSmoothExpanderPanel.AlternativeLayout = true and set both TAdvSmoothExpanderPanel.Columns, TAdvSmoothExpanderPanel.Rows to a value different from -1. Set the TAdvSmoothExpanderButton.ColumnSpan, TAdvSmoothExpanderButton.RowSpan to values bigger than 1 where larger buttons are desired.
Example:
A default TAdvSmoothExpanderPanel panel initialized with:
var i: integer; begin AdvSmoothExpanderButtonPanel1.AlternativeLayout := true; AdvSmoothExpanderButtonPanel1.Columns := 4; AdvSmoothExpanderButtonPanel1.Rows := 4; AdvSmoothExpanderButtonPanel1.Buttons.Clear; for i := 0 to 9 do AdvSmoothExpanderButtonPanel1.Buttons.Add.Caption := ''Button ''+ inttostr(i); AdvSmoothExpanderButtonPanel1.Buttons[0].ColumnSpan := 2; AdvSmoothExpanderButtonPanel1.Buttons[0].RowSpan := 2; AdvSmoothExpanderButtonPanel1.Buttons[7].ColumnSpan := 2; AdvSmoothExpanderButtonPanel1.Buttons[7].RowSpan := 2; end;