TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Visual DCL Programming => Topic started by: curmudgeon on February 22, 2012, 01:39:15 PM

Title: set_tile from edit_box
Post by: curmudgeon on February 22, 2012, 01:39:15 PM
subject line kind of says it.

I want to link to edit boxes so that an action tile for one sets the content of the other.
maybe I can't do this thing.

Lee has a WONDERFUL routine for updating list boxes, and maybe I reconsider the entire layout of my dialog box,
but even if I do, I would still like to understand whether I cannot do this, or simply don't know how yet.

as an action_tile for an edit box,
(action_tile "key" "(set_tile "otherkey" "(get_tile \"key\")")

something like that, but I have not had any success yet.
thanks.
Title: Re: set_tile from edit_box
Post by: TimSpangler on February 22, 2012, 01:51:43 PM
What I like to do is incorporate a sub to update the dialog. Then I call this sub every time there is a change to a variable or in your case an edit box. Then the sub updates everything

So you would have something like:

Code: [Select]
(action_tile "sometile" "(setq MyVar $value)(UpdateDialog)")

Then the sub:

Code: [Select]
(defun UpdateDialg (/)

(if (= MayVar "Whatever")
 (set_tile "NewTile"  "ToThis")
 (set_tile "NewTile"  "ToThat")
)

You could go as far as to have an argument for the sub so that the sub only execute a certain portion of code based on the argument supplied. (this can cut down on the unneeded execution of code)

TIM
Title: Re: set_tile from edit_box
Post by: curmudgeon on February 22, 2012, 02:22:09 PM
just beginning to work with dialog boxes.
I appreciate creating a function as you did with UpdateDialog.

in the code I have studied, the use of $value has been inconsistent at best,
and I am unsure of all the ramifications. probably pretty simple.

I am guessing here - the dialog being called would have value = $value as an attribute of "NewTile"?
and if so, is the $ important, necessary, superfluous?

I guess I am asking if just any old (setq item myvalue) work as well.

I won't get to play any more until Thursday, thanks.
Title: Re: set_tile from edit_box
Post by: Lee Mac on February 22, 2012, 02:35:21 PM
I am guessing here - the dialog being called would have value = $value as an attribute of "NewTile"?
and if so, is the $ important, necessary, superfluous?

Read the following section in the VLIDE Help Documentation:

Code: [Select]
AutoLISP Developer's Guide
        Working with Programmable Dialog Boxes
                Managing Dialog Boxes
                        Action Expressions & Callbacks
                                Action Expressions
Title: Re: set_tile from edit_box
Post by: TimSpangler on February 22, 2012, 03:10:56 PM
If you are just starting out on dialogs, they can be very overwhelming, not only to create but to control.  $value represents the value of that specific tile when an action is taken on it, ie, a radio button or edit box, etc.  Each tile type has a diffarent value type, it a depends on the type of tile that you are using.

As Lee suggested, read the vlide or what I found helpful with dialogs is <THIS> (http://www.amazon.com/AutoLISP-Programming-Rod-Rawls/dp/1566374170)

This along with Afralisp were great resources.
Title: Re: set_tile from edit_box
Post by: curmudgeon on February 26, 2012, 07:23:38 PM
Sunday evening and I am just now having time to play.
Thanks guys, I don't OWN IT yet, but the $value concept is working here.

The first dialog I want to use the concept on, drawing windows in elevation.
I need both the dimensions and type, and in a separate edit box, designator text (catalog logic).

I can use the catalog logic to set dimensions and type, or build the designator text from dimensions and type.
And I am sure that when I conquer here, I will think of lots of other stuff. Thanks.
Title: Re: set_tile from edit_box
Post by: TimSpangler on February 27, 2012, 08:31:34 AM
Once you get something together, post it up and we can help.

TIM