Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to mix Text and Edit_Boxes on same row in DCL

3 REPLIES 3
Reply
Message 1 of 4
AR12
462 Views, 3 Replies

How to mix Text and Edit_Boxes on same row in DCL

Hi All,

I'm working on a program and what I'm trying to do is limit the user to inputting whole and decimal numbers seperately as eventually the program will convert them to a string that does not show the decimal place. However if you look at the attached screenshot, the DCL file is putting the decimal place in between the edit boxes as I want, however it's got way too much space between the edit_boxes and the decimal point. How do I fix that?

Thanks,
Adam Richardson

If needed: AutoCAD 2017 User using Visual LISP for editing LISP and DCL files
3 REPLIES 3
Message 2 of 4
doni49
in reply to: AR12


@AR12 wrote:

Hi All,

I'm working on a program and what I'm trying to do is limit the user to inputting whole and decimal numbers seperately as eventually the program will convert them to a string that does not show the decimal place. However if you look at the attached screenshot, the DCL file is putting the decimal place in between the edit boxes as I want, however it's got way too much space between the edit_boxes and the decimal point. How do I fix that?


1) Instead of using rows, use columns.  First column will have all the text.  Second column will have the first text box.  Third column will have the decimal.  Fourth column will have the second edit box.

2) Having said that, I'll offer a little bit of commentary.  It will be much easier for the user if there is ONE edit box and then you can get the whole number and decimal number portions programattically.  You can make it so that pressing the OK button causes a function to run that will validate each edit box.  If a problem is found, display an error message (like to place a text label near the ok button called "Error") and don't close the dialog box.  If there is NO problem found, then close the dialog and perform the needed calculations.

 

Besides besides being easier for the user, it'll be easier for you to program. 



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 3 of 4
doni49
in reply to: doni49

Also even if you do go with the two edit boxes as you're planning, you'll still need to validate the data to ensure the user did NOT enter a decimal number in those fields anyway.



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 4 of 4
scot-65
in reply to: AR12

Use text_part.
:text_part {key="Tex101"; width=0.5;} //play with the width...
Now in your LSP program, set tile area:
(set_tile "Tex101" ".")

You may want to add fixed_width=true; in your row,
then add :spacer {width=5.8;} in the mix, similar as a tab would behave.
If you do add fixed_width to your row, the width attribute in the text_part
is mandatory, otherwise it will disappear altogether!

Also, I see text before the edit boxes. Is it the label attribute of the edit_box?
If so, remove it and replace with text_part. Then, assign each text_part to have
the same width. Start by making each row fixed_width=true; then tinker until
finished, then remove the fixed_width and see what happens. As a rule with text
and radio buttons, etc. the longer the text, the more margin is created at the
right side. Because of this, I tend to only use text_part as shown above to
populate the dialog box and never use the label attribute of the tiles.

Are you working with an on-screen ruler? I use "Ruler v1.4" by Jeff Key.
There are others out there, but I like this one the best.

The column method as doni suggested is a little trickier to do,
but can be done. Again, play with the spacer height attribute.

To further minimize user input error, and if it is possible, try
using a popup_list or list_box to get desired values. One additional
benefit to this is default values can be accepted without further
interaction.

Hope this helps.

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


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost