Grouping buttons of toolbar in different group lazarus / 31-LCL ---------------------------------------------------------------------- simsee · 2017-02-01 10:33 Dear all, I have a Toolbar menu, with some buttons of style tbsCheck. I need to group them in different groups, but how can I specify the group of each button? ---------------------------------------------------------------------- wp · 2017-02-01 11:25 Work with actions, they have a GroupIndex. Here are short instructions in case if you never have used actions before: Add a TActionList, doubleclick to open the actionlist editor, "+" for each action, assign code to the OnExecute event, set GroupIndex, usually set AutoCheck to true. Assign the action to the Action property of the toolbutton, menuitem, context menu item which is intended to use this action. ---------------------------------------------------------------------- simsee · 2017-02-01 11:30 Thanks. I will use this solution. ---------------------------------------------------------------------- simsee · 2017-02-01 14:11 Another question about same topic (thanks for patience): How divider/separator influence grouping of tbsCheck button in toolbars? It seems to me that set of buttons divided/separated toggle indipendendly? Is correct? ---------------------------------------------------------------------- Blaazen · 2017-02-01 16:21 Dividers and separators are just for visual separation, nothing else. If you need more logical groups, you have to set them different GroupIndex, the first group tbsCheck buttons will have 101, the second 102 etc. (Numbers 101, 102 have no special meaning, they just must be unique.) ---------------------------------------------------------------------- wp · 2017-02-01 16:29 Blaazen, this was the original question: Toolbuttons don't have a GroupIndex, only a boolean Grouped. ---------------------------------------------------------------------- simsee · 2017-02-01 17:03 So, divider/separator don't affect grouping, but are useful only for visualization needs. Thanks for explanations. ---------------------------------------------------------------------- Blaazen · 2017-02-01 17:24 @wp Thanks, really, there's no GroupIndex property on TToolButton. So there's another way if someone needs more groups: TCoolBar where each band has its own TToolBar. ---------------------------------------------------------------------- simsee · 2017-02-01 17:43 I did the following experiment (see attach): I inserted two couple of tbsCheck button, all with grouped=true, separated by a divider. Why buttons of each couple toggles indipendently? Seems to me that divider has also a semantic value, partitioning behavior of buttons... May be I'm wrong... ---------------------------------------------------------------------- Blaazen · 2017-02-01 18:24 Yes, your demo work, I was wrong. I tested cbsSeparator too. Both cbsDivider and cbsSeparator logically separates groups of toolbars. I'm sorry for confusion. Anyway, you can give a try to TCoolBar too. ---------------------------------------------------------------------- simsee · 2017-02-01 18:54 Don't worry! In fact, I had some problems in grouping with divider in a more complex scenario, with many groups of different check button, where this approach seems to fail. My toolbutton has been modified many times usig visual composer. I don't know if my problem is due to a bug of tool or of my application (likely the last hypothesis...) From this situation arises my original question. Thanks to all.