Opened 16 years ago
Last modified 6 years ago
#278 assigned enhancement
wxGUI: don't allow for negative column number
Reported by: | msieczka | Owned by: | martinl |
---|---|---|---|
Priority: | minor | Milestone: | 8.0.0 |
Component: | wxGUI | Version: | svn-trunk |
Keywords: | parser | Cc: | grass-dev@… |
CPU: | All | Platform: | All |
Description
A command that requires a data table column number input, should not allow to enter a negative value. For example, in v.in.ascii one shouldn't be able to enter or select with the spin box e.g. z=-32 cat=-8.
Attachments (1)
Change History (14)
comment:1 by , 16 years ago
Component: | wxGUI → default |
---|---|
Keywords: | parser added |
comment:2 by , 16 years ago
Component: | default → wxGUI |
---|
comment:3 by , 16 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
...any comments or objections to committing the patch?
comment:4 by , 16 years ago
Milestone: | 6.4.0 → 7.0.0 |
---|---|
Priority: | major → minor |
Version: | svn-develbranch6 → svn-trunk |
the syntax is still a bit complicated / vague / tricky to me, e.g. how to set int_opt=-1 when you want to set just -1.0?
is the patch to help the programmer set opt_xcol->options = ">=1"; ? if so, why not add some magic code to parse <>= instead of a new & unintuitive "--1" "-1-" syntax? (ie not to say it is broken, just that it fails the transferable knowledge test badly)
for v.in.ascii, column >=0 checks added in r34608, r34609.
At this stage, we should not make new non-critical changes to lib/gis/parser.c in devbr6 IMHO. As the specific reported issue of v.in.ascii is fixed, changing bug's target to g7.
I leave GUI spinbox controls to others, but guess that it is dependent on parser support for ->options as above.
Hamish
comment:5 by , 10 years ago
In GRASS, values > 0
should be now specified in C as:
... opt->options = "1-";
and in Python as:
... #% options: 1-
So, v.in.ascii needs this fix, so that standard Parser mechanism is used instead of custom error handling.
GUI now allows to input negative numbers but label contains "valid range 1-" and Run gives an standard error message generated by module (parser):
ERROR: Value <-4> out of range for parameter <x> Legal range: 1-
GUI would not allow to input values out of range if both limits would be specified. GUI needs to be improved, so it can handle also range with min or max only.
Modules using custom range handling, such as v.in.ascii
, should be chanaged to use parser.
comment:6 by , 9 years ago
Milestone: | 7.0.0 → 7.0.5 |
---|
comment:7 by , 8 years ago
Milestone: | 7.0.5 → 7.0.6 |
---|
comment:8 by , 7 years ago
Milestone: | 7.0.6 → 7.0.7 |
---|
comment:9 by , 6 years ago
Milestone: | 7.0.7 → 7.4.2 |
---|
comment:13 by , 6 years ago
Milestone: | 7.4.5 → 8.0.0 |
---|---|
Type: | defect → enhancement |
The attached patch allows to define ranges: