dear guys,
i'm helping some one to complete the routine with dialog,
there 4 radio bottons, here are some get_tile results: 0 & 1 to present action_tile
example:
------------
1 0
1 0
debug: (1 0 1 0) , ok
0 1
0 1
debug: (0 1 0 1) , ok
but,
1 0
0 1
becomes (0 1 1 0), should be
(1 0 0 1)0 1
1 0
becomes (1 0 0 1), should be
(0 1 1 0)why?
i use 2 variables: *pos* *key*, 4 button radio1, radio2, radioA, radioB
example: (action_tile "$radio" "(setq *pos* $value)"),
ie:
*pos* for radio1 & radio2 , whereas
*key* for radioA, radioB
thanks guys. advise & comments are appreciated
;the slide can be downloaded here
http://www.cadtutor.net/forum/showthread.php?87818-A-lisp-need-some-modify./page2
(if (null *fb_user*)
(setq *fb_user* (mapcar 'itoa '(1 0 1 0)))
) ;_ end of if
(defun c:test (/ radio dcl_id path dcl)
(setq radio '("radio1" "radio2" "radioA" "radioB" )
path (getenv "temp")
)
('((f lst /)
(setq f (open f "w"))
(mapcar ''(($) (write-line $ f)) lst)
(close f)
(setq f nil)
)
(setq dcl (strcat path "\\tmp.dcl"))
'("icon_fbox_img : image {"
" color = 0;"
" width = 40;"
" aspect_ratio = 0.75;"
" allow_accept = true;"
" fixed_height = true;"
" fixed_width = true;"
"}"
""
""
"fbox: dialog {"
"\tlabel=\"Fillet Box settings\";"
" key = \"dcl_title\";"
""
": paragraph{"
" : text_part{"
"\tlabel =\"Choose options \";"
"\t//alignment = centered;"
"}"
" } "
" :column {"
" :row { "
" :column {"
" :icon_fbox_img {key = \"SH-CENTRE\";}"
" }"
" :column { "
" :icon_fbox_img {key = \"SH-EDGE\";}"
" }"
" }"
"}"
" :column{fixed_width=true;//alignment=centered;"
" :boxed_radio_row{label=\"Draw method\";"
"\t:radio_button{label=\"Pick centre \";key=\"radioA\";}//value=\"0\";"
" :radio_button{label=\"Pick side \";key=\"radioB\";}//value=\"1\""
"}"
"}"
" :column {"
" :row { "
" :column {"
" :icon_fbox_img {key = \"SH-P2P\";}"
" } "
" :column {"
" :icon_fbox_img {key = \"SH-C2C\";}"
" }"
" } "
" }"
" "
" spacer_1;"
" :column{fixed_width=true;//alignment=centered;"
" :boxed_radio_row{label=\"Mode\";"
" :radio_button{label=\"A:Edge to Edge \";key=\"radio1\";}//value=\"0\""
" :radio_button{label=\"B:Radii to radii \";key=\"radio2\";}//value=\"1\";"
" }"
"}"
" :column{fixed_width=true;alignment=centered;"
" : paragraph{"
" : text_part{"
"\tlabel =\"Fillet box : hanhphuc 2014\";"
"\talignment = centered;"
"}"
" } "
" :row {"
" \t spacer_0;"
" ok_cancel;"
" }"
"}"
"}"
)
)
(setq dcl_id (load_dialog dcl))
(new_dialog "fbox" dcl_id)
(mapcar ''((a)
('((i sld)
(setq x (dimx_tile i))
(setq y (dimy_tile i))
(start_image i)
(fill_image 0 0 x y -2)
(slide_image 0 0 x y sld)
(end_image)
)
a
(strcat path "\\" a)
)
)
sld
) ;_ end of mapcar
(if
*fb_user*
(mapcar 'set_tile
radio
(setq *fb_user* (apply 'append
(list
(if (= *pos* "Centre")
'("1" "0")
'("0" "1")
) ;_ end of if
(if (= *key* "A")
'("1" "0")
'("0" "1")
) ;_ end of if
) ;_ end of list
) ;_ end of apply
) ;_ end of setq
) ;_ end of mapcar
) ;_ end of if
(setq
*fb_user*
(mapcar ''((k a b) (action_tile k (strcat "(setq " a " \"" b "\" )")))
radio
'("*pos*" "*pos*" "*key*" "*key*")
'("Centre" "Edge" "A" "B")
) ;_ end of mapcar
) ;_ end of setq
(action_tile "accept" "(setq *fb_user* (mapcar 'get_tile radio))
(alert (strcat
\"\nmethod: \"*pos* \"\nmode: \" *key* \"\n\"(vl-princ-to-string *fb_user*)))(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)
(princ)
) ;_ end of defun
;note: no *error* handler & lambda not optimized, just for debug