Update of /cvsroot/q-lang/qcalc
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13310
Modified Files:
qcalc.q
Log Message:
proper conversion of spinbox values set from calclib::setval
Index: qcalc.q
===================================================================
RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v
retrieving revision 1.97
retrieving revision 1.98
diff -C2 -d -r1.97 -r1.98
*** qcalc.q 6 Nov 2007 20:08:50 -0000 1.97
--- qcalc.q 7 Nov 2007 01:39:14 -0000 1.98
***************
*** 1988,1993 ****
= qt X "isDown" ()
if C = "QPushButton";
! = printf "unkown GUI element %s\n" C || 0
! otherwise;
spinbox_value S = X if checknum 'X where 'X = valq S;
--- 1988,1993 ----
= qt X "isDown" ()
if C = "QPushButton";
! = //printf "unknown GUI element %s\n" C ||
! 0 otherwise; // default value
spinbox_value S = X if checknum 'X where 'X = valq S;
***************
*** 2022,2027 ****
STEP = qt X "lineStep" (),
Y = min MAX $ (Y-MIN) div STEP*STEP+MIN
! // XXXFIXME: need to convert floats first
! if checknum 'Y where 'Y = valq S
if C = "QSpinBox";
= if Y<>Y0 then recursive (qt X "setValue" Y)
--- 2022,2026 ----
STEP = qt X "lineStep" (),
Y = min MAX $ (Y-MIN) div STEP*STEP+MIN
! where Y:Int = make_spinbox_value X S
if C = "QSpinBox";
= if Y<>Y0 then recursive (qt X "setValue" Y)
***************
*** 2036,2041 ****
if (C = "QPushButton") and then qt X "isToggleButton" ();
= () if C = "QPushButton";
! = printf "unkown GUI element %s\n" C
! otherwise;
/* Finish off editing a GUI element when the user hits Return. */
--- 2035,2048 ----
if (C = "QPushButton") and then qt X "isToggleButton" ();
= () if C = "QPushButton";
! = //printf "bad value %s for GUI element %s\n" (str S,C) ||
! () otherwise;
!
! make_spinbox_value X S:String
! = MIN if not null S and then (S=S1)
! where S1:String = qt X "specialValueText" (),
! MIN = qt X "minValue" ()
! if checkstr 'S where 'S = valq S;
! = V where t2v T2V = qt_cb X "mapTextToValue", V:Int = T2V S;
! = val S otherwise;
/* Finish off editing a GUI element when the user hits Return. */
|