I created 3 actions and assigned them to 3 buttons in a ribbon group. I want the buttons act like a group, one is always down, the others - up. Just like left/center/right align buttons.
I have set groupIndex property of my actions to 1. Help says:
"GroupIndex is used to define groups of actions that act like radio buttons. When GroupIndex is greater than 0, it identifies the group to which the action belongs. When the Checked property of any action in that group is set to true, the Checked property of all other actions in the group is set to false. That is, only one action in the group can be checked at a time."
But it is not working at all.
Any help?
Try to set the property AutoCheck = true for both items. It helped me =)
Without more information the only thing I can suggest is (if you are using tdxRibbon) is to check and make sure the buttonstyle property is set to bsChecked. Although it shouldn't let you set the group index otherwise.
Related
I am using Delphi XE5.
I am trying to workout as per the Delphi's help about TToolButton component.
Delphi Help Says about TToolButton.AllowAllUp property:
Indicates whether all the tool buttons in a group can be un-selected at the same time.
If AllowAllUp is set to true, all of the tool buttons in the group can be unselected. If AllowAllUp is set to false, at least one tool button in the group must be selected at any time. (Determine which tool button is initially selected by setting its Down property to true.)
AllowAllUp is effective only when Grouped is true and Style is set to tbsCheck. Changing the value of AllowAllUp for one button in a group automatically changes the value for all buttons in the group.
What I have done is I have placed a TToolBar on the form and created three TToolButtons in it. Then AllowAllUp and Grouped property is set to True. Also, set Style property to tbsCheck.
When I run the application, and when I go on clicking all buttons one by one, then any one button is showing as selected, if i try to select or click on other TToolButton previous one becomes un-selected.
How to make AllowAllUp property working?
These properties all work as intended. It seems that you are misunderstanding the intent of these properties.
The documentation for the Grouped property says:
When an unbroken sequence of adjacent tool buttons each has its Grouped property set to true and Style set to tbsCheck, then no more than one of the buttons can be selected at the same time.
The AllowAllUp property is related and described like so:
Indicates whether all the tool buttons in a group can be unselected at
the same time.
If AllowAllUp is set to true, all of the tool buttons in the group can
be unselected. If AllowAllUp is set to false, at least one tool button
in the group must be selected at any time. (Determine which tool
button is initially selected by setting its Down property to true.)
AllowAllUp is effective only when Grouped is true and Style is set to
tbsCheck. Changing the value of AllowAllUp for one button in a group
automatically changes the value for all buttons in the group.
This property only has an impact when you group buttons, and what it does is control whether or not you can have zero buttons down. But once you have grouped buttons, never more than one of the group can be down at any one time.
You need to do the following:
Set Grouped to False.
Set AllowAllUp to False, not that it really matters but you may as well restore the default to avoid confusion.
Set the style to tbsCheck.
Once you've done this you can check and uncheck the buttons independently of each other.
(using iOS8.3, Xcode6.3, OSX10.10.3)
Hi, I wonder if a WatchKit WKInterfaceGroup can be a Button ??
In my watchkit-application, I would like to maximize the touch-surface for a particular action.
I know that one can place one or more buttons in a goup (next to other things like labels, images etc). Having such a WKInterfaceGroup (called group) with small items in it - I thought of placing several buttons, all filling out the empty space between the groups container.
But by placing several buttons close to each other in the group, even if they all reference to the very same action, I realised that touching two buttons by the user's finger in the group would not lead me to the desired surface-increase.
The problem is, the user-finger touches more than one button at once and even tough, I gave all the buttons in the group, as just mentioned, the very same action behind, the action does not get fired off.
The solution might be, if possible, to define the entire group as a button. How would that work ?? (...maybe accessibility traits could help ?? or other....???). Or can you somehow overlay a button on to a group ???
Any idea appreciated !
You can use a WKInterfaceButton, change its content type to "group" in the attributes inspector in IB and fill it with whatever content you need.
I have two seemingly identical TcxGrids bound to two different tables. On one grid, when the column header is dragged and dropped to the group panel, a large X appears above the column being dragged, when it is dropped the column is immediately hidden. On the other grid a big circle with a line through it shows and it cannot be dropped on to the group panel. The Options.Grouping for both columns is false. Why the difference in the two behaviors ? I cannot see a property setting difference but I'm sure there must be one somewhere that causes this behavior. What property is it ?
John
Inspect the properties of the column which won't group in the Object Inspector. Probably, you'll find that its DisableGrouping property is set to True. If it is, set it to False. If that doesn't work, a) I'll take this answer down and b) edit your q to add the contents of your DFM.
There are two places in DX grid that control the ability to group columns. First is at the grid level and it takes precedent over the columns' individual Options.Grouping settings. Second is at the column level. Look at .OptionCustomize.ColumnGrouping. It may be set to False.
I have three menu items I would like to toggle between one another with a check.
The first one is default checked = true and the other two are false
I would like to have the check mark show next to the one clicked
I tried setting the group index of the three different from the rest of all the other menu items, but that didn't seem to work. All three menu items have autocheck = true
do I have to manually handle all this by code?
thanx
You need to do the following for each of the three menu items:
Set AutoCheck to True.
Set RadioItem to True.
Set the GroupIndex for all three items to the same value.
This will result in a bullet rather than a tick being placed next to your menu item. That's by design. These menu items operate like radio buttons (hence the bullet) rather than check boxes (which would have ticks).
The help indicates that adding gboGroupStyle to the ButtonOptions on a TButtonGroup:
"Specifies that the buttons should inherit the group style that is set on the container."
But this explanation still leaves me lost - any ideas?
The gboGroupStyle option in the TButtonGroup.ButtonOptions property has nothing to do with GroupIndex as it's known e.g. from TSpeedButton.
Setting of the gboGroupStyle option to True allows you to:
set the TButtonGroup.ItemIndex property, so you can predefine which button will be focused as default, nothing cool
click the buttons with ENTER or SPACE keys, what will fire the TGrpButtonItem.OnClick event of the button item (if assigned), perform its action, or fire the TButtonGroup.OnButtonClicked event
I agree the name of this is quite misleading, but that's what I found in the source code from Delphi-XE2.
gboGroupStyle makes the TButtonGroup act as a group - that means, one and only one button is selected at a given time. It is similar to grouping several TSpeedButtons with the GroupIndex, where only one button inside that group is selected at any time. The currently selected button can be read and written via the ItemIndex property of TButtonGroup. To visualize the selected button one can implement an OnBeforeDrawButton or OnDrawButton handler.
From my experimentation it looks like if gboGroupStyle is used then the ItemIndex property can be set to something other than -1, so that the TButtonGroup remembers the last button that was pressed.