TStyledCategoryButtons - Technical Reference
Overview
TStyledCategoryButtons extends TCategoryButtons with styled button rendering and additional layout options for categorized button lists.
Class Hierarchy
TWinControl
└─ TCategoryButtons
└─ TStyledCategoryButtonsUnit
pascal
Vcl.StyledCategoryButtonsDescription
TStyledCategoryButtons maintains full compatibility with TCategoryButtons while adding modern styling capabilities, image positioning options, caption alignment, and per-item and per-category style customization.
Key Features
- Full TCategoryButtons compatibility: All standard properties and events
- Categorized buttons: Organize buttons into collapsible categories
- Styled button items: StyleFamily/Class/Appearance for each item
- Flexible image positioning: Left, Right, Top, Bottom, Center
- Caption alignment: Left, Center, Right
- Flat appearance option: Modern flat button style
- Per-item and per-category styling: Custom styles
- Notification badges: Badge support for button items
Main Properties
Layout Properties
| Property | Type | Description |
|---|---|---|
ButtonOptions | TCategoryButtonOptions | Layout options (boFullSize, boShowCaptions, boBoldCaptions, boUsePlusMinus, boCaptionLeftAlign) |
ButtonFlow | TCategoryButtonFlow | Button flow (cbfVertical, cbfHorizontal) |
ButtonWidth | Integer | Width of buttons |
ButtonHeight | Integer | Height of buttons |
ImagePosition | TStyledImagePosition | Image position relative to caption |
CaptionAlignment | TStyledCaptionAlignment | Caption alignment |
Flat | Boolean | Flat button appearance |
Styling Properties
| Property | Type | Description |
|---|---|---|
StyleFamily | TStyledButtonFamily | Default style family for all items |
StyleClass | TStyledButtonClass | Default style class for all items |
StyleAppearance | TStyledButtonAppearance | Default appearance for all items |
StyleDrawType | TStyledButtonDrawType | Button shape |
StyleRadius | Integer | Corner radius |
Categories and Items
| Property | Type | Description |
|---|---|---|
Categories | TButtonCategories | Collection of button categories |
SelectedItem | TButtonItem | Currently selected button item |
Images | TCustomImageList | ImageList for button icons |
TButtonCategory Properties
Each category can have:
| Property | Type | Description |
|---|---|---|
Caption | String | Category caption |
Collapsed | Boolean | Category collapsed/expanded state |
Items | TButtonItems | Button items in this category |
TButtonItem Properties
Each button item can have:
| Property | Type | Description |
|---|---|---|
Caption | String | Button caption |
ImageIndex | TImageIndex | Image index |
Hint | String | Hint text |
Enabled | Boolean | Enable/disable item |
StyleFamily | TStyledButtonFamily | Override default style family |
StyleClass | TStyledButtonClass | Override default style class |
StyleAppearance | TStyledButtonAppearance | Override default appearance |
NotificationBadge | TNotificationBadgeAttributes | Badge configuration |
Usage Examples
Basic CategoryButtons
pascal
var
CatButtons: TStyledCategoryButtons;
Cat: TButtonCategory;
Item: TButtonItem;
begin
CatButtons := TStyledCategoryButtons.CreateStyled(Self,
BOOTSTRAP_FAMILY,
btn_primary,
BOOTSTRAP_NORMAL);
CatButtons.Parent := Self;
CatButtons.Align := alLeft;
Cat := CatButtons.Categories.Add;
Cat.Caption := 'File Operations';
Item := Cat.Items.Add;
Item.Caption := 'Open';
Item.ImageIndex := 0;
end;CategoryButtons with Image Positioning
pascal
CatButtons := TStyledCategoryButtons.CreateStyled(Self,
ANGULAR_LIGHT_FAMILY,
acl_primary,
ANGULAR_RAISED);
CatButtons.Parent := Self;
CatButtons.ImagePosition := sipImageLeft;
CatButtons.CaptionAlignment := scaLeft;
CatButtons.ButtonHeight := 40;Per-Item Styling
pascal
CatButtons := TStyledCategoryButtons.CreateStyled(Self,
BOOTSTRAP_FAMILY,
btn_secondary,
BOOTSTRAP_NORMAL);
// Customize specific items
Cat := CatButtons.Categories[0];
Cat.Items[0].StyleClass := btn_primary;
Cat.Items[1].StyleClass := btn_success;
Cat.Items[2].StyleClass := btn_danger;See Also
- TStyledButtonGroup - Simple button group
- TStyledToolbar - Toolbar component
