1 Attachment(s)
I broke it... and am blind
code worked...
added stuff unrelated...
now only GRIPSIZE is broken in the lisp (think dcl is not the problem)...
can not see how i broke it...
help a blind man to see please...
Code:
//Tip1518B: BSIZE.DCL Size Cursor (c)1999, Amy Ang
bsize : dialog {
label = "Control Box Size";
: column {
: boxed_row {
label = "Crosshair Size: 1-100";
// height = 2.5;
// :edit_box {
// alignment = center;
// key = "ctxt";
// edit_width = 2;
// }
// :spacer_1 {}
:slider {
edit_width = 15;
min_value = 1;
max_value = 100;
small_increment = 1;
key=csize;
}
:text {
key = "ctxt";
width = 3;
}
}
:row {
:toggle {
key = "apbox";
label = "&Aperture Box";
}
}
: boxed_row {
label = "Aperture Size: 1-50";
:slider {
edit_width = 15;
min_value = 1;
max_value = 50;
small_increment = 1;
key=osize;
}
:text {
key = "otxt";
edit_width = 3;
}
}
: boxed_row {
label = "AutoSnap Size: 1-20";
:slider {
edit_width = 15;
min_value = 1;
max_value = 20;
small_increment = 1;
key=asize;
}
:text {
key = "atxt";
edit_width = 3;
}
}
: boxed_row {
label = "Pickbox Size: 1-50";
:slider {
edit_width = 15;
min_value = 1;
max_value = 50;
small_increment = 1;
key=psize;
}
:text {
key = "ptxt";
edit_width = 3;
}
}
:row {
:toggle {
key = "grp";
label = "Enable Grips";
}
}
:row {
:toggle {
key = "grpblk";
label = "Enable Grips within Blocks";
}
}
: boxed_row {
label = "Grip Size: 1-255";
:slider {
edit_width = 15;
min_value = 1;
max_value = 255;
small_increment = 1;
key=gsize;
}
:text {
key = "gtxt";
edit_width = 3;
}
}
}
:spacer_1 {}
ok_cancel;
}
RE: I broke it... and am blind
Hi todw
Check in help:
GRIPSIZE
Type: Integer
Saved in: Registry
Initial value: 5
Sets the size of the grip box in pixels. The valid range is 1 to 255.
Thank you
f.
RE: I broke it... and am blind
Hi todw, here is one way to solve your problem.
Let the action_tile set a *global* variable for you, rewrite your line to
(action_tile "gsize" "(setq *GRIPSIZE* (atoi $value)) (set_tile "gtxt" $value)" )
then after the (start_dialog) line
append this line
(if *GRIPSIZE* (setvar "GRIPSIZE" *GRIPSIZE* ) ( ) )
: ) Happy Computing !
kennet
RE: I broke it... and am blind
Here is a modified version. Something to play with.
No warranties. :)
Code:
;;; Tip1518A: BSIZE.LSP Size Cursor (c)1999, Amy Ang
;;;
;;; Modified by Tod Winn
;;; Modified by CAB 12/29/2005
;;;
;;; Now includes "AutoSnapSize" variable.
(defun C:BSIZE (/ DAT GRIPSIZE)
;; reset the values to the forst time the routine was run today
(defun do_reset()
(if bsize_data
(progn
(setvar "cursorsize" (nth 0 bsize_data))
(setenv "AutoSnapSize" (nth 1 bsize_data))
(setvar "pickbox" (nth 2 bsize_data))
(setvar "aperture" (nth 3 bsize_data))
(setq GRIPSIZE (nth 4 bsize_data))
(setvar "pickbox" (nth 5 bsize_data))
(setvar "apbox" (nth 6 bsize_data))
(dcl_set)
)
)
)
;; do all the set_tiles
(defun dcl_set()
(set_tile "ctxt" (itoa (getvar "cursorsize")))
(set_tile "atxt" (getenv "AutoSnapSize"))
(set_tile "ptxt" (itoa (getvar "pickbox")))
(set_tile "otxt" (itoa (getvar "aperture")))
(set_tile "gtxt" (itoa (getvar "gripsize")))
(set_tile "csize" (itoa (getvar "cursorsize")))
(set_tile "asize" (getenv "AutoSnapSize"))
(set_tile "psize" (itoa (getvar "pickbox")))
(set_tile "osize" (itoa (getvar "aperture")))
(set_tile "gsize" (if GRIPSIZE (itoa GRIPSIZE) (itoa (getvar "gripsize"))))
(set_tile "apbox" (itoa (getvar "apbox")))
)
;; set original values first time through
(or bsize_data
(setq bsize_data
(list
(getvar "cursorsize")
(getenv "AutoSnapSize")
(getvar "pickbox")
(getvar "aperture")
(getvar "gripsize")
(getvar "pickbox")
(getvar "apbox")
)
)
)
(setq DAT (load_dialog "bsize.dcl"))
(if (not (new_dialog "bsize" DAT)) (exit))
(dcl_set)
(action_tile "csize" "(setvar \"cursorsize\" (atoi $value)) (set_tile \"ctxt\" $value)")
(action_tile "ctxt" "(setvar \"cursorsize\" (atoi $value)) (set_tile \"csize\" $value)")
(action_tile "psize" "(setvar \"pickbox\" (atoi $value)) (set_tile \"ptxt\" $value)")
(action_tile "asize" "(setenv \"AutoSnapSize\" $value) (set_tile \"atxt\" $value)")
(action_tile "osize" "(setvar \"aperture\" (atoi $value)) (set_tile \"otxt\" $value)")
(action_tile "gsize" "(setq GRIPSIZE (atoi $value)) (set_tile \"gtxt\" $value)" )
(action_tile "apbox" "(setvar \"apbox\" (atoi $value))")
(action_tile "reset" "(do_reset)")
(action_tile "accept" "(done_dialog)")
(action_tile "cancel" "(done_dialog) (exit)")
(start_dialog)
(unload_dialog DAT)
(if GRIPSIZE (setvar "GRIPSIZE" GRIPSIZE))
(princ)
) ;_ end of DEFUN
Code:
//Tip1518B: BSIZE.DCL Size Cursor (c)1999, Amy Ang
// CAB modified 12/29/2005
//
// general dcl settings
//
dcl_settings : default_dcl_settings { audit_level = 3; }
//
// sub assembly definitions
//
slide : slider { width = 30; min_value = 1; small_increment = 1;}
txt :text { width = 3;}
//
// dialog definition
//
bsize : dialog { label = "Control Box Size";
: column {
: boxed_row { label = "Crosshair Size: 1-100"; /* height = 2.5; */
// :edit_box { alignment = center; key = "ctxt"; edit_width = 2;}
// :spacer_1 {}
:slide { key = "csize"; max_value = 100;}
:txt { key = "ctxt";}
}
:toggle { key = "apbox"; label = "&Aperture Box";}
: boxed_row { label = "Aperture Size: 1-50";
:slide { key = "osize"; max_value = 50;}
:txt { key = "otxt";}
}
: boxed_row { label = "AutoSnap Size: 1-20";
:slide { key = "asize"; max_value = 20;}
:txt { key = "atxt";}
}
: boxed_row { label = "Pickbox Size: 1-50";
:slide { key = "psize"; max_value = 50;}
:txt { key = "ptxt";}
}
:toggle { key = "grp"; label = "Enable Grips";}
:toggle { key = "grpblk"; label = "Enable Grips within Blocks";}
: boxed_row { label = "Grip Size: 1-255";
:slide { key = "gsize"; max_value = 255;}
:txt { key = "gtxt";}
}
:spacer_1 {}
: row {
: button{ label ="Reset"; key ="reset"; fixed_width = true;}
: ok_button { label = "Done"; is_cancel = true;}
}
}
}
RE: I broke it... and am blind
thanks kennet and cab. i was thinking of setting variable for all the functions, removing most of the action_tiles and placing them as sub-functions of "accept".
as it stands you can make changes and hit OK or CANCEL and the changes still take place, so setting variables will not be an issue. (or just moving the current code to under "accept")
what was so puzzling is that before i placed the ":toggle"s it worked just fine. the GRIPSIZE slider worked, changed the number beside it and set the variable to the new value. no probs.
I dunno. maybe i'll take it all apart again and start in a fresh direction. This routine is just a toy anyway. it's helping me play with DCL code for other stuff i want to do.
anyways...
thanks again