#4901 closed enhancement (fixed)
Presets: add checkbox type
Reported by: | AM909 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | tested |
Keywords: | presets fuel source_tag radiobutton | Cc: | lists@… |
Description (last modified by )
I'd like to propose the following extensions to the presets to make them more flexible and reduce the number of keystrokes/mouse clicks for common tasks:
Add radiobutton and checkbox types (in addition to text and combo).
A type="radio" group should allow 0 or 1 buttons to be selected.
A type="check" group should allow 0 or more buttons to be selected.
A radiobutton definition example:
<cbgroup type="radio" key="restriction" > <label text="Restriction" /> <button value="no_u_turn" tooltip="No U-turn" icon="restriction_no_u_turn.png" default="yes" /> <button value="no_left_turn" tooltip="No left turn" icon="restriction_no_left_turn.png" /> ... </cbgroup>
The button with default="yes" is selected by default. The result is to create a tag for the selected item with the specified key and the value associated with the selected button (e.g. restriction="no_u_turn" if no change is made to the default above).
A checkbox example:
<cbgroup type="check" key="source" > <label text="Source" /> <button value="usgs_imagery" tooltip="USGS" icon="USGS.png" default="yes" /> <button value="yahoo_imagery" tooltip="Yahoo" icon="Yahoo.png" /> <button value="survey" tooltip="Survey" icon="survey.png" default="yes" /> <button value="image" tooltip="Image" icon="image.png" default="yes" /> ... </cbgroup>
Any buttons with default="yes" are selected by default. In this case, where a key is specified in the cbgroup tag, the result is to create a tag for the selected item with the specified key and all the values associated with the selected buttons, delimited by semicolons (e.g. source="usgs_imagery;survey;image" if no change is made to the defaults above).
Another checkbox example:
<cbgroup type="check" > <label text="Available fuels" /> <button key="propane" values="yes" tooltip="Propane" icon="propane.png" /> <button key="diesel" values="yes" tooltip="Diesel" icon="diesel.png" /> <button key="atm" values="no,yes," tooltip="ATM" icon="ATM.png" /> ... </cbgroup>
In this case, where there is no key specified in the cbgroup tag, each button has its own associated key and values. If one value is specified, it should be a two-state button, and the tag is created with the specified value if selected. If two values are specified, it should be a two-state button, and the tag is created with the first specified value if not selected, and the second specified value if selected. If three values are specified, it should be a three-state button, and the tag is created with the first/second/third values when de-selected/selected/third-state respectively. A value specified as empty (as in the third value for the third button above) should cause no tag to be created if chosen. Note this "multi-key" setup should work with type="radio" as well.
I'm picturing tool-button (like those that appear on toolbars) controls in order to conserve space. The controls for each cbgroup tag should be surrounded by a thin-line frame to visually group them together. The default should be to render them horizontally, but further extensions could be made to affect layout.
More traditional radiobutton and checkbox groups could be rendered as one choice per line, but would take more space. Might be easier to develop, though.
As always, thanks to those dedicated developers for listening, and making JOSM the great tool it is :)
Attachments (0)
Change History (6)
comment:1 by , 13 years ago
Description: | modified (diff) |
---|---|
Summary: | Proposed extensions to preset definitions → Presets: add radiobutton and checkbox types |
comment:2 by , 12 years ago
Keywords: | fuel source_tag added |
---|
comment:3 by , 11 years ago
Keywords: | radiobutton added |
---|---|
Summary: | Presets: add radiobutton and checkbox types → Presets: add radiobutton type |
comment:4 by , 11 years ago
Cc: | added |
---|
comment:5 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I don't think the missing radio buttons are a good addition at all.
comment:6 by , 11 years ago
Summary: | Presets: add radiobutton type → Presets: add checkbox type |
---|
Checkboxes have been added, they can even be regrouped:
Radiobutton has not been added yet.