ButtonMode: Boolean;
ButtonMode: Boolean;
The ButtonMode property determines mode of the button work.
If the property is set to True, the button works in common mode, i.e. the control element -Button- is displayed on the panel, the triangle is displayed to the right of the button. Pressing the button displays the combo box. The menu contains a basic collection of graphic buttons and additional controls related to this button:
If the property is set to False, the button is displayed on the ribbon. Main set of graphic buttons is grouped and displayed on the panel. This button also includes the More button, clicking which displays a combo-box that includes basic graphic buttons and additional controls:
Executing this example requires a form, a button named Button1 positioned on this form, the Ribbon component named Ribbon1, and the ImageList component named PaletteImg. A tab and a panel are created on the ribbon of the Ribbon1 component. A large image with the width multiple of 20 is loaded to PaletteImg.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
RPanel: IRibbonPanel;
RPalette: IRibbonPaletteButton;
ChildElements: IRibbonElementsCollection;
ChildButton: IRibbonButton;
Begin
RPanel := Ribbon1.ActiveCategory.Panels.Item(0);
RPalette := New RibbonPaletteButton.Create;
RPanel.Elements.Add(RPalette);
RPalette.ButtonMode := True;
RPalette.ColumnCount := 4;
RPalette.Images := PaletteImg;
RPalette.IconWidth := 20;
RPalette.ResizeList := RibbonPaletteResize.Both;
RPalette.Text := "Icons";
ChildElements := RPalette.SubItems;
ChildButton := New RibbonButton.Create;
ChildElements.Add(ChildButton);
ChildButton.Text := "Add";
ChildButton.ImageIndex := 0;
End Sub Button1OnClick;
On clicking the button a button that opens a combo-box is created on the ribbon panel. The basic collection of graphic buttons is formed from separate images obtained by dividing the PaletteImg component into separate images 20 pixels wide. An additional button is added after the basic collection of graphic buttons.
See also: