你好
我有一个lisp来写多行文字,但在它执行之前,用户可以用弹出的弹出菜单从不同的比例中选择。
用户也可以选择另一个,可以是一个数字,可能像123348等。。。等
我错过的是,我不能确切地做到这是进入这个弹出菜单文本“取消”,如果用户选择它,它取消了命令,然后再继续制作多行文字。
这是我弹出窗口的来源。lsp I中没有“取消”。。我只是写了这个例子。
你需要DOSlib
或者当点击ESC时,它就会消失。。。我现在做不到。我必须选择比例
- (Defun PopupScale ()
- (setq x (list "Choose scale:" "" "1:1" "1:2"
- "1:5" "1:10" "1:20" "1:50" "1:100"
- "1:200" "1:500" "" "Another..." [color=red][b]"Cancel"[/b][/color]
- )
- ChoosedScale nil
- scale nil
- controlscale
- nil
- )
- (while (or (not ChoosedScale) (= ChoosedScale 0))
- (setq ChoosedScale (dos_popupmenu x))
- )
- (IF (= ChoosedScale (- (length x) 3))
- (while (not scale)
- (setq scale (dos_getstring "Choose another:" "Write a custom scale:"))
- (IF (wcmatch scale "*=*,*:*")
- (setq scale (substr scale 3))
- )
- (setq controlscale (wcmatch scale "*@*"))
- (IF controlscale
- (Alert "You have typed a wrong number. \nCould be a letter"
- )
- )
- )
- (IF (not (= ChoosedScale (- (length x) 4))) ; last scale
- (setq scale (substr (nth (1+ ChoosedScale) x) 3))
- (setq scale (substr (nth (- (length x) 3) x)
- 3
- )
- )
- )
- )
- )
|