09-18-2016, 02:12 PM
This is my project with radio buttons, and I don't understand the unusual behavior. First, if I bounce between the various buttons, occasionally two will be selected. If I do a slow double-click on a button or its text, it will deselect, leaving no buttons chosen. If I do a rapid double-click, it flashes but nothing changes. I thought the group's setDefaultButton function would set the target button as selected when the group first appears, but none are selected unless I explicitly setChosen on a button. Here's the code:
I'm using Xcode 7 for Mac CS6. My code looks a lot like Gaxx's, but I'm having other issues. Am I doing something incorrectly or is this a bug?
Thanks -- Rick
Code:
hdi::core::RadioButton VHbtn(hdi::core::Point(marginWidth,marginHeight+rowHeight), "Vertical and horizontal", fullLabelWidth);
VHbtn.setClickCallback(HDI_CORE_CALLBACK(panel::Plugin, this, __VHbtnCB));
this->__docPanel.addWidget(VHbtn);
hdi::core::RadioButton PrefConstBtn(hdi::core::Point(marginWidth,marginHeight+(rowHeight*2)), "Preferences constrain angle", fullLabelWidth);
PrefConstBtn.setClickCallback(HDI_CORE_CALLBACK(panel::Plugin, this, __PrefConstBtnCB));
this->__docPanel.addWidget(PrefConstBtn);
hdi::core::RadioButton DomAxisBtn(hdi::core::Point(marginWidth,marginHeight+(rowHeight*3)), "Object's dominant axis", fullLabelWidth);
DomAxisBtn.setClickCallback(HDI_CORE_CALLBACK(panel::Plugin, this, __DomAxisBtnCB));
this->__docPanel.addWidget(DomAxisBtn);
hdi::core::RadioButton CollapseCtlBtn(hdi::core::Point(marginWidth,marginHeight+(rowHeight*4)), "Just collapse control handles", fullLabelWidth);
CollapseCtlBtn.setClickCallback(HDI_CORE_CALLBACK(panel::Plugin, this, __CollapseCtlBtnCB));
this->__docPanel.addWidget(CollapseCtlBtn);
hdi::core::RadioButtonGroup BtnGrp;
BtnGrp.add(VHbtn);
BtnGrp.add(PrefConstBtn);
BtnGrp.add(DomAxisBtn);
BtnGrp.add(CollapseCtlBtn);
BtnGrp.setDefaultButton(VHbtn);
VHbtn.setChosen(true);
I'm using Xcode 7 for Mac CS6. My code looks a lot like Gaxx's, but I'm having other issues. Am I doing something incorrectly or is this a bug?
Thanks -- Rick