dtsfan1976 发表于 2022-7-6 07:41:46

How to Center text in Lisp :ed

I would like to find out if I can center text within a dialog edit box.I am populating this edit box from the result of a :popup_list.This information will not be edited and for display only.
 
Here is my code currently.
 
(write-line ":edit_box {" f)
(write-line "edit_width = 10;" f)
(write-line "edit_limit = 9;" f)
(write-line "key = \"mill_disp\";" f)
(write-line "}" f)
 
If this is at all possible please help me out.

MSasu 发表于 2022-7-6 08:05:31

If is just for display you may try to add spaces in front of the said string; the number of spaces will be correlated with the size of currently shown string. Or use a text tile instead.
 
By the way, please edit your post and add the required code tags.

dtsfan1976 发表于 2022-7-6 08:13:01

Can you give an example of how you would use a text tile for this?

MSasu 发表于 2022-7-6 08:32:19

This is what I was thinking about:

(set_tile "mill_disp" (strcat "      " "abc"))(set_tile "mill_disp" (strcat ""       "dtsfan1976"))
Based on your above example that's still pending code tags.

BIGAL 发表于 2022-7-6 08:42:23

A quick look at a old help book talks about right justified when edit_width is zero and goes on to talk about left & right justification only no centre option.
页: [1]
查看完整版本: How to Center text in Lisp :ed