找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 690|回复: 0

[原创]:又一个对话框输入文字的程序。

[复制链接]
发表于 2003-3-5 11:00:41 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
要配合我给的字体噢。

  1. dcl_settings : default_dcl_settings { audit_level = 3; }
  2. unnamed : dialog {
  3. label = "对话框文字输入";
  4.    : row {
  5.       : popup_list {
  6.          list = "上标开始\n下标开始\n上标结束\n下标结束\n上下标开始\n上下标分隔\n上下标结束" ;
  7.          key = "gs" ;
  8.          label = "排版格式" ;
  9.       }
  10.       : popup_list {
  11.          list = "一级钢\n二级钢\n三级钢\n四级钢\n相前一个字符画圈\n相前二个字符画圈\n相前三个字符画圈" ;
  12.          key = "zyfh" ;
  13.          label = "专用符号" ;
  14.       }
  15.       : popup_list {
  16.          list = "罗马数字一\n罗马数字二\n罗马数字三\n罗马数字四\n罗马数字五\n罗马数字六\n罗马数字七\n罗马数字八\n罗马数字九\n罗马数字十\n罗马数字十一\n罗马数字十二" ;
  17.          key = "lm" ;
  18.          label = "罗马数字" ;
  19.       }
  20.    }
  21.    : boxed_row {
  22.       label = "特定符号" ;
  23.       : button {
  24.          key = "pingf" ;
  25.          label = "平方" ;
  26.       }
  27.       : button {
  28.          key = "lif" ;
  29.          label = "立方" ;
  30.       }
  31.       : button {
  32.          key = "zhengf" ;
  33.          label = "正负号" ;
  34.       }
  35.       : button {
  36.          key = "du" ;
  37.          label = "度符号" ;
  38.       }
  39.       : button {
  40.          key = "yuanzhij" ;
  41.          label = "圆直径号" ;
  42.       }
  43.    }
  44.    : boxed_row {
  45.    label = "字符高度";
  46.    : edit_box {
  47.    key = "txth1";
  48.    label = "输入高度";
  49.    }
  50.    : button {
  51.    key = "txth2";
  52.    label = "屏幕选取";
  53.    }
  54.    }
  55.    : edit_box {
  56.       key = "txt" ;
  57.       label = "文字:" ;
  58.       fixed_width = true ;
  59.       width = 80 ;
  60.    }
  61.    : row {
  62.       ok_cancel ;
  63.    : button {
  64.       key = "text" ;
  65.       label = "格式说明<" ;
  66.    }
  67. }
  68. }
  69. shuoming : dialog {
  70.       label= "字符格式说明:";
  71.         fixed_height = true;
  72.         : text_part {
  73.            label = "字符编码                        说明";}
  74.            : text_part {
  75.            label = "%%130                                Ⅰ级钢筋";}
  76.            : text_part {
  77.            label = "%%131                                Ⅱ级钢筋";}
  78.            : text_part {
  79.            label = "%%132                                Ⅲ级钢筋";}
  80.            : text_part {
  81.            label = "%%133                                Ⅳ级钢筋";}
  82.            : text_part {
  83.            label = "%%134                                小于等于≤";}
  84.            : text_part {       
  85.            label = "%%135                                大于等于≥";}
  86.            : text_part {
  87.            label = "%%138                                罗马数字Ⅺ";}
  88.            : text_part {
  89.            label = "%%139                                罗马数字Ⅻ";}
  90.            : text_part {
  91.            label = "%%140                                使后面字串增大1/3";}
  92.            : text_part {
  93.            label = "%%141                                使后面字串缩小1/2";}
  94.            : text_part {
  95.            label = "%%142                                使后面字串增大1/2";}
  96.            : text_part {
  97.            label = "%%143                                使后面字串升高1/2";}
  98.            : text_part {
  99.            label = "%%144                                使后面字串降低1/2";}
  100.            : text_part {
  101.            label = "%%145                                使后面字串升高缩小1/2";}
  102.            : text_part {
  103.            label = "%%146                                使后面字串降低增大1/2";}
  104.            : text_part {
  105.            label = "%%147                                对前一字符画圈";}
  106.            : text_part {
  107.            label = "%%148                                对前两字符画圈";}
  108.            : text_part {
  109.            label = "%%149                                对前三字符画圈";}
  110.            : text_part {
  111.            label = "%%150                                使后面字串缩小1/3";}
  112.            : text_part {
  113.            label = "%%151                                罗马数字Ⅰ";}
  114.            : text_part {
  115.            label = "%%152                                罗马数字Ⅱ";}                     
  116.            : text_part {
  117.            label = "%%153                                罗马数字Ⅲ";}
  118.            : text_part {       
  119.            label = "%%154                                罗马数字Ⅳ";}
  120.            : text_part {
  121.            label = "%%155                                罗马数字Ⅴ";}
  122.            : text_part {
  123.            label = "%%156                                罗马数字Ⅵ";}
  124.            : text_part {
  125.            label = "%%157                                罗马数字Ⅶ";}
  126.            : text_part {
  127.            label = "%%158                                罗马数字Ⅷ";}
  128.            : text_part {
  129.            label = "%%159                                罗马数字Ⅸ";}
  130.            : text_part {
  131.            label = "%%160                                罗马数字Ⅹ";}
  132.            : text_part {
  133.            label = "%%161                                上下标开始";}
  134.            : text_part {
  135.            label = "%%162                                上下标分隔";}
  136.            : text_part {
  137.            label = "%%163                                上下标结束";}
  138.       ok_only;
  139. }

  1. (defun c:ddt (/ whet_next dia_id txt txt3 txth txth2)
  2.   (defun strcat_txt (txt3)
  3.     (setq txt1 (set_tile "txt" (strcat (get_tile "txt") txt3)))
  4.   )
  5.   (defun list_gs ()
  6.     (setq listgs (get_tile "gs"))
  7.     (cond ((= listgs "0") (strcat_txt "%%145"))
  8.           ((= listgs "1") (strcat_txt "%%141"))
  9.           ((= listgs "2") (strcat_txt "%%146"))
  10.           ((= listgs "3") (strcat_txt "%%142"))
  11.           ((= listgs "4") (strcat_txt "%%161"))
  12.           ((= listgs "5") (strcat_txt "%%162"))
  13.           ((= listgs "6") (strcat_txt "%%163"))
  14.     )
  15.   )
  16.   (defun list_zyfh ()
  17.     (setq listzy (get_tile "zyfh"))
  18.     (cond ((= listzy "0") (strcat_txt "%%130"))
  19.           ((= listzy "1") (strcat_txt "%%131"))
  20.           ((= listzy "2") (strcat_txt "%%132"))
  21.           ((= listzy "3") (strcat_txt "%%133"))
  22.           ((= listzy "4") (strcat_txt "%%148"))
  23.           ((= listzy "5") (strcat_txt "%%149"))
  24.           ((= listzy "6") (strcat_txt "%%150"))
  25.     )
  26.   )
  27.   (defun list_lm ()
  28.     (setq listlm (get_tile "lm"))
  29.     (cond ((= listlm "0") (strcat_txt "%%151"))
  30.           ((= listlm "1") (strcat_txt "%%152"))
  31.           ((= listlm "2") (strcat_txt "%%153"))
  32.           ((= listlm "3") (strcat_txt "%%154"))
  33.           ((= listlm "4") (strcat_txt "%%155"))
  34.           ((= listlm "5") (strcat_txt "%%156"))
  35.           ((= listlm "6") (strcat_txt "%%157"))
  36.           ((= listlm "7") (strcat_txt "%%158"))
  37.           ((= listlm "8") (strcat_txt "%%159"))
  38.           ((= listlm "9") (strcat_txt "%%160"))
  39.           ((= listlm "10") (strcat_txt "%%138"))
  40.           ((= listlm "11") (strcat_txt "%%139"))
  41.     )
  42.   )
  43.   (defun td_pingf (/ txt)
  44.     (setq txt1 (set_tile "txt" (strcat (get_tile "txt") "%%1452%%146")))
  45.   )
  46.   (defun td_lif        (/ txt)
  47.     (setq txt1 (set_tile "txt" (strcat (get_tile "txt") "%%1453%%146")))
  48.   )
  49.   (defun td_zhengf (/ txt)
  50.     (setq txt1 (set_tile "txt" (strcat (get_tile "txt") "%%129")))
  51.   )
  52.   (defun td_du (/ txt)
  53.     (setq txt1 (set_tile "txt" (strcat (get_tile "txt") "%%128")))
  54.   )
  55.   (defun td_yuanzhij (/ txt)
  56.     (setq txt1 (set_tile "txt" (strcat (get_tile "txt") "%%127")))
  57.   )
  58.   (defun shuo ()
  59.     (if        (not (new_dialog "shuoming" dia_id))
  60.       (exit)
  61.     )
  62.     (action_tile "accept" "(done_dialog 6)")
  63.     (start_dialog)
  64.   )
  65.   (setq whet_next 6)
  66.   (while (< 2 whet_next)
  67.     (if        (and (not dia_id) (< (setq dia_id (load_dialog "ddtxt")) 0))
  68.       (exit)
  69.     )
  70.     (if        (not (new_dialog "unnamed" dia_id))
  71.       (exit)
  72.     )
  73.     (if        (/= txth nil)
  74.       (progn
  75.         (setq txth1 (set_tile "txth1" txth))
  76.       )
  77.       (if (/= txth1 nil)
  78.         (set_tile "txth1" txth1)
  79.         (set_tile "txth1" "300")
  80.       )
  81.     )
  82.     (if        (/= txt1 nil)
  83.       (set_tile "txt" txt1)
  84.     )
  85.     (action_tile "gs" "(list_gs)")
  86.     (action_tile "zyfh" "(list_zyfh)")
  87.     (ACTION_TILE "lm" "(list_lm)")
  88.     (action_tile "pingf" "(td_pingf)")
  89.     (ACTION_TILE "lif" "(td_lif)")
  90.     (ACTION_TILE "zhengf" "(td_zhengf)")
  91.     (action_tile "du" "(td_du)")
  92.     (action_tile "yuanzhij" "(td_yuanzhij)")
  93.     (action_tile "txth1" "(setq txth1 $value)")
  94.     (action_tile "txth2" "(done_dialog 4)")
  95.     (action_tile "txt" "(setq txt1 $value)")
  96.     (action_tile "accept" "(done_dialog 1)")
  97.     (action_tile "cancel" "(unload_dialog dia_id)")
  98.     (action_tile "text" "(shuo)")
  99.     (setq whet_next (start_dialog))
  100.     (if        (= whet_next 4)
  101.       (setq txth (rtos (getdist "\n请指定高度")))
  102.     )
  103.     (if        (and (= whet_next 1) (/= txt1 nil))
  104.       (progn
  105.         (setq txpt (getpoint "\n文字位置:"))
  106.         (if (= txth1 nil)
  107.           (setq txth2 300)
  108.           (setq txth2 (atof txth1))
  109.         )
  110.         (command "text" txpt txth2 "" txt1 "")
  111.       )
  112.     )
  113.   )
  114. )
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-26 09:48 , Processed in 0.177496 second(s), 33 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表