Simultanious autoupdate of tile(s) Autolisp/VisualLisp/DCL

Simultanious autoupdate of tile(s) Autolisp/VisualLisp/DCL

Kycau
Advocate Advocate
1,160 Views
4 Replies
Message 1 of 5

Simultanious autoupdate of tile(s) Autolisp/VisualLisp/DCL

Kycau
Advocate
Advocate

Hello,

I stepped into DCL-implementing into my rountines.
And now, I need your help.
Please find below attached .lsp and .dcl files on which my question is posed.
I want user to make blocks (other routine makes it fine).
I want each time to assign unique blocknames.

In the dcl below, you will find a couple of edit-boxes responsible for that.

I also would like to have a "preview" of the final blockname.

As a way around, I made a "Preview" button for now, responsable for that.
The output of action assigned to "Preview" button is good for me.

But I want to make the dialogue box more elegant, and avoid the "Preview" button, and make the preview auto-update. I see 2 posibilities:
1. the preview will update while characters a typed into edit-boxes 1 by 1 (characters)
2. the preview will update while an edit_box is filled with string, and user switches to another edit_box.

I have little clue how to make any of these variants.
I've searched and read around some similar topics, but still I'm unable to fulfil what I want.



0 Likes
Accepted solutions (1)
1,161 Views
4 Replies
Replies (4)
Message 2 of 5

john.uhden
Mentor
Mentor
Accepted solution

As to obtaining input from an edit_box character by character, I don't think it can be done with AutoLisp/Visual Lisp.  It can be done from the command prompt using grread, but not within a DCL (to my archaic knowledge).

As to an auto-preview, you can have any action process all the input data using the same function you would write to take action on the "Preview" button.

John F. Uhden

0 Likes
Message 3 of 5

Kycau
Advocate
Advocate

@john.uhden 
Thank you.
I thought I checked everything correctly, but it was not so.
After working with code for some time, and putting correct references between tiles, indeed, everything worked according to my 2nd scenario, and according to your advice.


0 Likes
Message 4 of 5

scot-65
Advisor
Advisor
Previewing an edit box value somewhere else is only
possible when focus is switched away from said edit box.

Suggested DCL items to be removed and declared in the LSP file:
value - Use set_tile.
action - Use action_tile.
is_enabled - Use (mode_tile "key" 1).
Programming will be easier to follow when debugging.

Where is cancel?
:button {key="cancel"; label="&Cancel"; is_cancel=true; fixed_width=true; width=12.0;}
Now the user can close using the red 'x' on top.

Only one "is_default" is allowed. The last one wins.

Be careful with allow_accept. I did not view your LSP code to see if
the tiles were initialized as you have 3 places that has allow_accept
and only one of them has a value attribute assigned.

Spacers are your friend.
One can use them to help the dialog's layout.

I usually create 'constants' for layout - to reduce total character count.
swh0 :spacer {width=0.0; height=0.0;} //this is equivalent to an 0.8 spacing
bu12 :button {width=12.0;}

in use:
:row {fixed_width=true; alignment=centered;
:bu12 {key="accept"; label="&OK"; is_default=true;}
swh0;
:bu12 {key="cancel"; label="&Cancel"; is_cancel=true;}
}//row
Since the row is assigned a fixed_width, the buttons do not require this attribute.

I'll check back tomorrow...

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

Message 5 of 5

scot-65
Advisor
Advisor

I gave your DCL a once-over and this is what I have come up with:

 

test-car2.jpg

 

Allow_accept has been addressed.

I have added some code to make the dialog perform better.

All of what I mentioned earlier (to what not to have in the DCL) has been addressed.

Attached files for your review.

 

Scot-65

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes