[OpenLayers-Dev] type toggle confusion -> toggleGroup
bluecarto at gmail.com
Thu Dec 4 05:29:28 EST 2008
Looking at the way control are handle this morning, I'm a bit confused
with the different type.
Currently, here is how we manage control buttons in the Panel control
activateControl method :
- if the activated control is of BUTTON type, we call the button
trigger method, no extra action is done,
- if the activated control is of TOGGLE type, we change activation on
this button, no extra action is done,
- in the other cases, we consider the panel's controls as a group,
and activate/deactivate them all if they are not of TOGGLE type.
In my opinion, the TOGGLE type implies that the control can have 2
states "active" and "inactive". It has nothing to do with groups.
We should introduce a new control property "toggleGroup" that would
let the parent panel manage the control groups.
If a button of type TOGGLE is activated and it has no toggleGroup set,
no extra action is done.
If a button of type TOGGLE is activated, the other buttons within the
same toggleGroup will be deactivated.
Does it make sense ?
I think it's worth putting effort on this in 3.0.
More information about the Dev