Bug #2001
closedInconsistent documentation/examples with addStyleClass and multiple style classes
0%
Description
The addStyleClass, removeStyleClass, and toggleStyleClass member functions are documented as taking a styleClass parameter, with no mention that more than one style class can be provided in a single call. However, there are at least two provided examples showing multiple space separated style classes being added with addStyleClass. They are:
- examples/widgetgallery/WidgetGallery.C:94: subMenu->addStyleClass("nav-pills nav-stacked");
- examples/widgetgallery/examples/StyledTable.cpp:61:table->addStyleClass("table form-inline");
Adding multiple style classes in this manner seems to work, but from the documentation, it is not clear that it is supported.
The documentation for the related setStyleClass function is more explicit. The documentation states that it "may set one or more space separated style classes", even though, it also accepts a parameter with the singular name of "styleClass".
To avoid potential confusion, it might be helpful to explicitly document whether (or not) a space separated list of classes is supported for each of these functions.
Updated by Koen Deforche over 11 years ago
- Status changed from New to Resolved
- Assignee set to Koen Deforche
- Target version set to 3.3.1
Hey Bruce,
Thanks for the observation --- we never really thought about it. The implementation does rely on it being a single style class, but addStyleClass() with multiple classes will work when you just created a widget and none of the classes are already assigned to the widget...
So the short answer is: no that's not supported (well) but the implementation is slightly forgiving; I am updating the documentation.
Regards,
koen
Updated by Bruce Toll over 11 years ago
Hi Koen,
Thanks for the detailed explanation. It was very helpful.
Regards,
Bruce
Updated by Koen Deforche over 11 years ago
- Status changed from Resolved to Closed