Jump to content

How to update list in dialog boxes?


Recommended Posts

Posted

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!

Posted

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... :)

Posted

Thank you pBe , now i will try your advice...

Posted
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

Posted

Hang on.. i'm looking for a link (on this forum) , its the perfect example for what you need :)

Posted

Hi Lee,

as always, you are giving the right advice!!!

Thank you. :D

Posted (edited)
Hi Lee,

as always, you are giving the right advice!!!

Thank you. :D

 

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 by pBe
tweaked DCL Added
Posted

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.

:)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...