Revision: 41321
http://brlcad.svn.sourceforge.net/brlcad/?rev=41321&view=rev
Author: bob1961
Date: 2010-11-10 22:32:19 +0000 (Wed, 10 Nov 2010)
Log Message:
-----------
Added the validTableEntry method for validating CombEditFrame's relative edit
tables entries.
Modified Paths:
--------------
brlcad/trunk/src/tclscripts/archer/CombEditFrame.tcl
Modified: brlcad/trunk/src/tclscripts/archer/CombEditFrame.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/CombEditFrame.tcl 2010-11-10
21:16:56 UTC (rev 41320)
+++ brlcad/trunk/src/tclscripts/archer/CombEditFrame.tcl 2010-11-10
22:32:19 UTC (rev 41321)
@@ -99,6 +99,7 @@
method deleteRow {_type _row}
method setKeypoint {args}
method setKeypointVC {_tname _row _col}
+ method validateTableEntry {_row _col _newval _tname}
# Override what's in GeometryEditFrame
method updateGeometryIfMod {}
@@ -565,7 +566,9 @@
-cols $cols \
-titlerows 1 \
-colstretchmode all \
- -variable [::itcl::scope mMemberData$tname]
+ -variable [::itcl::scope mMemberData$tname] \
+ -validate 1 \
+ -validatecommand [::itcl::code $this validateTableEntry %r %c
%S $tname]
} {}
# Create scrollbars
@@ -934,6 +937,26 @@
}
}
+::itcl::body CombEditFrame::validateTableEntry {_row _col _newval _tname} {
+ if {$_col == 0 || ![info exists mMemberData$_tname\($_row,0)]} {
+ return 0
+ }
+
+ if {$_col == 1} {
+ if {[regexp {[/\?\*\n]} $_newval]} {
+ return 0
+ }
+
+ return 1
+ }
+
+ if {[string is double $_newval])} {
+ return 1
+ }
+
+ return 0
+}
+
::itcl::body CombEditFrame::updateGeometryIfMod {} {
if {$itk_option(-mged) == "" ||
$itk_option(-geometryObject) == ""} {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits