Ticket #278 (assigned defect)

Opened 5 years ago

Last modified 4 years ago

wxGUI: don't allow for negative column number

Reported by: msieczka Owned by: martinl
Priority: minor Milestone: 7.0.0
Component: wxGUI Version: svn-trunk
Keywords: parser Cc: grass-dev@…
Platform: All CPU: 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

range-undef.diff Download (0.9 KB) - added by martinl 5 years ago.
parse undef;min/max ranges

Change History

Changed 5 years ago by martinl

  • keywords parser added
  • component changed from wxGUI to default

The attached patch allows to define ranges:

1- -> <1; undef)
-1- -> <-1; undef)
-1 -> (undef, 1>
--1 -> (undef, -1>

Changed 5 years ago by martinl

parse undef;min/max ranges

Changed 5 years ago by marisn

  • component changed from default to wxGUI

Changed 4 years ago by martinl

  • cc grass-dev@… added
  • owner changed from grass-dev@… to martinl
  • status changed from new to assigned

...any comments or objections to committing the patch?

Changed 4 years ago by hamish

  • priority changed from major to minor
  • version changed from svn-develbranch6 to svn-trunk
  • milestone changed from 6.4.0 to 7.0.0

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

Note: See TracTickets for help on using tickets.