summaryrefslogtreecommitdiffstats
path: root/src/bltConfig.C
diff options
context:
space:
mode:
authorjoye <joye>2014-01-07 19:14:27 (GMT)
committerjoye <joye>2014-01-07 19:14:27 (GMT)
commita6ba7234bf14a9491b6e95fbe63c874918eeca10 (patch)
tree4d1e2848ed31241028dee2a119ed7ec57cfaf27f /src/bltConfig.C
parent90f4cfbba09517a8facf0aa019073580b66f5f92 (diff)
downloadblt-a6ba7234bf14a9491b6e95fbe63c874918eeca10.zip
blt-a6ba7234bf14a9491b6e95fbe63c874918eeca10.tar.gz
blt-a6ba7234bf14a9491b6e95fbe63c874918eeca10.tar.bz2
*** empty log message ***
Diffstat (limited to 'src/bltConfig.C')
-rw-r--r--src/bltConfig.C87
1 files changed, 0 insertions, 87 deletions
diff --git a/src/bltConfig.C b/src/bltConfig.C
index 1fc6e9f..ffe0da0 100644
--- a/src/bltConfig.C
+++ b/src/bltConfig.C
@@ -389,93 +389,6 @@ Blt_GetDashesFromObj(
return TCL_OK;
}
-int
-Blt_GetLimitsFromObj(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr,
- Blt_Limits *limitsPtr)
-{
- int values[3];
- int nValues;
- int limitsFlags;
-
- /* Initialize limits to default values */
- values[2] = LIMITS_NOM;
- values[1] = LIMITS_MAX;
- values[0] = LIMITS_MIN;
- limitsFlags = 0;
- nValues = 0;
- if (objPtr != NULL) {
- Tcl_Obj **objv;
- int objc;
- int i;
-
- if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
- return TCL_ERROR;
- }
- if (objc > 3) {
- Tcl_AppendResult(interp, "wrong # limits \"", Tcl_GetString(objPtr),
- "\"", (char *)NULL);
- return TCL_ERROR;
- }
- for (i = 0; i < objc; i++) {
- const char *string;
- int size;
-
- string = Tcl_GetString(objv[i]);
- if (string[0] == '\0') {
- continue; /* Empty string: use default value */
- }
- limitsFlags |= (1 << i);
- if (Tk_GetPixelsFromObj(interp, tkwin, objv[i], &size) != TCL_OK) {
- return TCL_ERROR;
- }
- if ((size < LIMITS_MIN) || (size > LIMITS_MAX)) {
- Tcl_AppendResult(interp, "bad limit \"", string, "\"",
- (char *)NULL);
- return TCL_ERROR;
- }
- values[i] = size;
- }
- nValues = objc;
- }
- /*
- * Check the limits specified. We can't check the requested size of
- * widgets.
- */
- switch (nValues) {
- case 1:
- limitsFlags |= (LIMITS_MIN_SET | LIMITS_MAX_SET);
- values[1] = values[0]; /* Set minimum and maximum to value */
- break;
-
- case 2:
- if (values[1] < values[0]) {
- Tcl_AppendResult(interp, "bad range \"", Tcl_GetString(objPtr),
- "\": min > max", (char *)NULL);
- return TCL_ERROR; /* Minimum is greater than maximum */
- }
- break;
-
- case 3:
- if (values[1] < values[0]) {
- Tcl_AppendResult(interp, "bad range \"", Tcl_GetString(objPtr),
- "\": min > max", (char *)NULL);
- return TCL_ERROR; /* Minimum is greater than maximum */
- }
- if ((values[2] < values[0]) || (values[2] > values[1])) {
- Tcl_AppendResult(interp, "nominal value \"", Tcl_GetString(objPtr),
- "\" out of range", (char *)NULL);
- return TCL_ERROR; /* Nominal is outside of range defined
- * by minimum and maximum */
- }
- break;
- }
- limitsPtr->min = values[0];
- limitsPtr->max = values[1];
- limitsPtr->nom = values[2];
- limitsPtr->flags = limitsFlags;
- return TCL_OK;
-}
-
/* Configuration option helper routines */
/*