sharpooth Posted November 30, 2010 Posted November 30, 2010 Hello to all, I have two list_boxes in one dialog window. How can I put an item from first list to the second in same session of the dialog window. Thanks! Quote
pBe Posted November 30, 2010 Posted November 30, 2010 I'm sure you have this on your lisp file (or similar) (start_list "1st_Dia");; your key (mapcar 'add_list ftl_);; your list Now using "button" function on your DCL file to transfer the a number of items from the first list to the other list (action_tile .... <your function> <the button key) which includes updating the other list with the same code (start_list "1st_Dia");; your key (mapcar 'add_list ftl_);; your updated list ) something like that... Quote
sharpooth Posted November 30, 2010 Author Posted November 30, 2010 Thank you pBe , now i will try your advice... Quote
sharpooth Posted November 30, 2010 Author Posted November 30, 2010 I'm sure you have this on your lisp file (or similar) (start_list "1st_Dia");; your key (mapcar 'add_list ftl_);; your list Now using "button" function on your DCL file to transfer the a number of items from the first list to the other list (action_tile .... <your function> <the button key) which includes updating the other list with the same code (start_list "1st_Dia");; your key (mapcar 'add_list ftl_);; your updated list ) something like that... Hi pBe i have tryed the code but does not work. My code is (defun c:task ( ) (vl-load-com) (setq listTaskstd (list "1" "2" "3" "4" "5")) (setq dcl (load_dialog "diastd.dcl")) (if not (new_dialog "Tasks" dcl) (exit)) (start_list "listTaskstd") (mapcar 'add_list listTaskStd) (end_list) (action_tile "addTask" "(setq newTask $value) " ) (action_tile "addButton" " (start_list listTaskstd) (mapcar 'add_list newTask ) (end_list) " ) (start_dialog) (unload_dialog dcl) ) // now is dcl code Tasks : dialog { label = "My DCL" ; : boxed_row { : column { : list_box { key = "listTaskstd" ; width = 60 ; height = 15 ; fixed_width = true ; fixed_height = true ; multiple_select = false ; } } } //row : boxed_row { : edit_box { key = "addTask" ; edit_width = 60 ; } : button { label = "Add" ; key = "addButton" ; is_default = true ; alignment = left ; fixed_width = true; mnemonic = "Ä"; } } // row add task : button { label = "OK"; key = "accept"; is_default = true; fixed_width = true; alignment = centered; } } // task Quote
pBe Posted November 30, 2010 Posted November 30, 2010 Hang on.. i'm looking for a link (on this forum) , its the perfect example for what you need Quote
Lee Mac Posted November 30, 2010 Posted November 30, 2010 This question has been asked quite a few times, so I thought I'd post an example on my site: http://lee-mac.com/listboxsync.html Quote
sharpooth Posted December 1, 2010 Author Posted December 1, 2010 Hi Lee, as always, you are giving the right advice!!! Thank you. Quote
pBe Posted December 1, 2010 Posted December 1, 2010 (edited) Hi Lee,as always, you are giving the right advice!!! Thank you. Ouch anyway, just in case you dont understand it yet.. i tweak your code as your reference (defun c:task ( ) (vl-load-com) (if (not listTaskstd_) (setq listTaskstd_ (list "1" "2" "3" "4" "5"))) (setq dcl (load_dialog "diastd.dcl")) (if not (new_dialog "Tasks" dcl) (exit)) (start_list "listTaskstd") (mapcar 'add_list listTaskStd_) (end_list) (action_tile "accept" "(done_dialog 1)") (action_tile "addTask" "(setq ad_to_list $value) (setq listTaskStd_ (acad_strlsort (cons ad_to_list listTaskStd_)))") (action_tile "addButton" "(start_list \"listTaskstd\") (mapcar 'add_list listTaskStd_) (end_list) (set_tile \"addTask\" \"\")") (start_dialog) (unload_dialog dcl) ) Tasks : dialog { label = "My DCL" ; : boxed_row { : column { : list_box { key = "listTaskstd" ; width = 60 ; height = 15 ; fixed_width = true ; fixed_height = true ; multiple_select = false ; } } } //row : boxed_row { : edit_box { key = "addTask" ; edit_width = 60 ; } : button { label = "Add" ; key = "addButton" ; is_default = true ; alignment = left ; fixed_width = true; mnemonic = "Ä"; } } // row add task ok_only ; } // task and in the futrue. avoid using variable names the same as your key Edited December 1, 2010 by pBe tweaked DCL Added Quote
sharpooth Posted December 1, 2010 Author Posted December 1, 2010 Thank pBe for your concern ! I will take your advice in future! If I can help to you with some think, please send an message. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.