乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 17|回复: 4

[编程交流] How to Center text in Lisp :ed

[复制链接]

1

主题

2

帖子

1

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 07:41:46 | 显示全部楼层 |阅读模式
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.
回复

使用道具 举报

35

主题

2471

帖子

2447

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
174
发表于 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.
回复

使用道具 举报

1

主题

2

帖子

1

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 08:13:01 | 显示全部楼层
Can you give an example of how you would use a text tile for this?
回复

使用道具 举报

35

主题

2471

帖子

2447

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
174
发表于 2022-7-6 08:32:19 | 显示全部楼层
This is what I was thinking about:
  1. (set_tile "mill_disp" (strcat "        " "abc"))(set_tile "mill_disp" (strcat "  "       "dtsfan1976"))
Based on your above example that's still pending code tags.
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 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.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-9 20:56 , Processed in 0.504159 second(s), 73 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表