乐筑天下

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

[编程交流] Toggle drop down boxes "on & o

[复制链接]

3

主题

20

帖子

17

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-6 11:31:18 | 显示全部楼层 |阅读模式
Hey guys and gals...
Been a while since I visited.
I need some direction on how the toggle selections are done in the routine posted HERE.
 
The Buzzard and CAB were a big help with the creation of this, so if you two could chime in, it would be quite helpful.
Glad to be back!

 
-SlimP
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 11:56:44 | 显示全部楼层
 
Hey Slimp,
 
Been a while.
Below is a simple lisp with a Toggle defaulted to on.
Just unclick or click the toggle and click OK to read
the command prompt responce.
 
Enjoy,
The Buzzard
 
Toggle.dcl
  1. MAIN : dialog {      label = "Toggle";      : boxed_column {        label = "Snap Angle";        : toggle {          label = "On/Off";          key = "TOG1";        }      }      : boxed_column {        label = "Control Buttons";        : button {          label = "&Proceed";          key = "accept";          width = 18;          fixed_width = true;          alignment = right;          is_default = true;        }          : button {          label = "&Exit Program";          key = "cancel";          width = 18;          fixed_width = true;          alignment = right;          is_cancel = true;        }      }    }
 
Toggle.lsp

[code](defun C:TOGGLE (/ TOG1$) (or T:OG1$   (setq T:OG1$ "1")) (setq DCL_ID (load_dialog "TOGGLE.dcl")) (if (not (new_dialog "MAIN" DCL_ID))   (cond     ((
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 12:15:22 | 显示全部楼层
This lisp will operate two functions to give you another idea how to use the toggle.
 
TOGGLE2.DCL
  1. MAIN : dialog {      label = "Toggle2";      : boxed_column {        label = "Snap Angle";        : toggle {          label = "On/Off";          key = "TOG2";        }      }      : boxed_column {        label = "Control Buttons";        : button {          label = "&Proceed";          key = "accept";          width = 18;          fixed_width = true;          alignment = right;          is_default = true;        }          : button {          label = "&Exit Program";          key = "cancel";          width = 18;          fixed_width = true;          alignment = right;          is_cancel = true;        }      }    }
 
TOGGLE2.LSP

[code](defun C:TOGGLE2 (/ TOG2$) (or T:OG2$   (setq T:OG2$ "1")) (setq DCL_ID (load_dialog "TOGGLE2.dcl")) (if (not (new_dialog "MAIN" DCL_ID))   (cond     ((
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 12:42:27 | 显示全部楼层
slimp,
 
I took another look at your question, And I think you might be referring to the operation of mode_tile. If so, I think CAB would be able to explain it better since he wrote those portions of the program for you. I use it also, But a slight bit different than the way he used it in your program. If he does not get back to you, I will try the best I can to explain what he did. Let me know if this is what you are looking to do.
 
At first glance from what I can see due to the amount of action_tiles that would have been required he used a global variable list and in turn this reduced the number of action_tiles needed. This is alot of information for me to try to take in at once. Its very amaziing to me how this was done, But at the same time confusing as well. It is probably one of the reasons why I shy away from global lists. At the beginning when you were working on this program, I was going in a more simpler but longer direction.
 
I appreciate the idea that you gave me any credit for this, However this was all CAB's idea and a much better way to program although more complex for me to deal with. I think it would be best to contact CAB by PM to see if he can shed some light on this for you. I can only touch base with some of whats going on here and not give you a very detailed explaination. I doubt many others who were not involved in that thread at the time may want to go here although I am not certain. I will try my best at it.
But that up to you.
 
The Buzzard
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-7-4 01:10 , Processed in 0.993936 second(s), 60 queries .

© 2020-2025 乐筑天下

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