乐筑天下

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

[编程交流] 动作互动程序

[复制链接]

11

主题

28

帖子

17

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
55
发表于 2022-7-6 08:35:51 | 显示全部楼层 |阅读模式
你好
 
我对action tile有问题。当我按下不同的单选按钮时,我想更改popup\u列表中的内容。我已经编写了代码:
 
  1. (action_tile "str_l2"   
  2.     "(start_list "mylist1" 3)
  3.     (mapcar 'add_list myList5)
  4.     (end_list)"   
  5.    )
  6. (action_tile "str_l3"   
  7.     "(start_list "mylist1" 3)
  8.     (mapcar 'add_list myList6)
  9.     (end_list)"   
  10.    )

 
但它不起作用
 
/丹
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2022-7-6 08:42:10 | 显示全部楼层
欢迎来到论坛Dan
 
单选按钮返回值为“1”或“0”
 
  1. (if (eq radiobuttonval  "1")
  2. (start_list "mylist1")(mapcar 'add_list myList5)(end_list);<---- pointing to the same key but different lists
  3. (start_list "mylist1")(mapcar 'add_list myList6)(end_list);<-----
  4. )
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 08:46:21 | 显示全部楼层
你好
 
谢谢你的回答,但我有6个单选按钮。如何使用6个按钮。
 
我还有一个问题。
 
我有两个弹出列表。我希望第二个弹出列表是灰色的。但是当我在第一个弹出列表中进行选择时,我希望第二个弹出列表被激活。
回复

使用道具 举报

11

主题

28

帖子

17

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
55
发表于 2022-7-6 08:55:23 | 显示全部楼层
非常快速的示例:
 
DCL代码(另存为“test.DCL”):
LISP代码:
  1. test : dialog { label = "Example"; spacer;
  2.    : boxed_radio_row { label = "Select List";
  3.        : radio_button { key = "radio1"; label = "List 1"; }
  4.        : radio_button { key = "radio2"; label = "List 2"; }
  5.    }
  6.    spacer; : popup_list { key = "popup"; } spacer;
  7.    ok_only;
  8. }
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 08:59:58 | 显示全部楼层
也许本例将说明如何在action\u tile表达式中启用/禁用tile:
 
DCL代码(另存为“test.DCL”):
  1. (defun c:test ( / FillPopupList lst1 lst2 id )
  2.    (setq lst1 '("One" "Two" "Three" "Four")
  3.          lst2 '("Red" "Yellow" "Green" "Blue")
  4.    )
  5.    (defun FillPopupList ( key lst )
  6.        (start_list key)
  7.        (foreach item lst (add_list item))
  8.        (end_list)
  9.    )
  10.    (cond
  11.        (   (<= (setq id (load_dialog "test.dcl")) 0)
  12.            (princ "\ntest.dcl file not found.")
  13.        )
  14.        (   (not (new_dialog "test" id))
  15.            (princ "\nDialog could not be loaded.")
  16.        )
  17.        (   t
  18.            (FillPopupList "popup" lst1)
  19.            (set_tile "radio1" "1")
  20.            (action_tile "radio1" "(FillPopupList "popup" lst1)")
  21.            (action_tile "radio2" "(FillPopupList "popup" lst2)")
  22.            (start_dialog)            
  23.        )
  24.    )
  25.    (if (< 0 id) (unload_dialog id))
  26.    (princ)
  27. )

 
LISP代码:
  1. (defun FillPopupList ( key lst )
  2.    (start_list key)
  3.    (foreach item lst (add_list item))
  4.    (end_list)
  5.       "(mode_tile "mylist21" 0)"   
  6.    )

 
/丹
回复

使用道具 举报

11

主题

28

帖子

17

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
55
发表于 2022-7-6 09:04:01 | 显示全部楼层
您可以在第一个popup\u列表的action\u tile语句中包含mode\u tile语句。
 
然而,一个popup_列表总是有一个选择(甚至在用户选择某个项目之前),因此用户可能无法直观地看到您想要实现的行为。
 
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 09:08:51 | 显示全部楼层
李为你辩护,
 
我还有一个问题。我想在两个弹出菜单列表“mylist20”和“mylist21”中有不同的内容,具体取决于选择“sp”或“tp”。我写了一个代码,见下文,但它不工作。你能帮助我吗?。
 
  1. 6

 
/丹
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2022-7-6 09:15:29 | 显示全部楼层
action\u tile表达式应该是字符串,但您正在action\u tile语句中嵌套action\u tile语句。。。
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 09:19:46 | 显示全部楼层
回复

使用道具 举报

11

主题

28

帖子

17

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
55
发表于 2022-7-6 09:24:38 | 显示全部楼层
Hello Lee Mac,
 
Sorry for the late answer, have been on a business tripp.
 
I have one more issue. I have 2 pop-up lists the first "Select el.motor" (mylist20) is set to "true" and the second "Select pump"(mylist21) is "false"(greyout). That I want to do is when I have make my choose in the first pop_up I want the second to be activated ("true").  Do you know how to do?.
 
  1. dimdialog5 : dialog { // Förstalabel = "Dimention drawing";: row {: boxed_radio_column {: row {  // Row 1: boxed_radio_column { // Boxed_radio_column 1 label = "Size Cabinet";  key = "size";   : radio_button {         // defines the Lightweight radio button  label = "&Small 2D";  key = "str_s2"; // value = "1";                              } : radio_button {         // defines the old-style polyline radio button  label = "&Medium 2D";  key = "str_m2";         } : radio_button {         // defines the old-style polyline radio button  label = "&Large 2D";  key = "str_l2";                }              : radio_button {         // defines the old-style polyline radio button  label = "&Small 3D";  key = "str_s3";                } : radio_button {         // defines the old-style polyline radio button  label = "&Medium 3D";  key = "str_m3";                } : radio_button {         // defines the old-style polyline radio button  label = "&Large 3D";  key = "str_l3";                }                                                               }// Boxed_radio_column 1: boxed_radio_column { // Boxed_radio_column 2                            : boxed_radio_row {                 label = "Parts";                 key = "S2pop";          value = "0";               is_enabled = true;                : boxed_radio_column {                : popup_list {               key = "mylist20";               label = "&Select el.motor";               fixed_width_font = true;               width = 30;               value = "";         is_enabled = true;         } : popup_list {               key = "mylist21";               label = "&Select pump";               fixed_width_font = true;               width = 30;               value = "";         is_enabled = false;               }}                           : popup_list {               key = "mylist7";               label = "&Select cooler";               fixed_width_font = true;               width = 30;               value = "";        is_enabled = true;                                            }                              }             : boxed_radio_row {               key = "m2pop";        value = "0";               is_enabled = false;               }}               }                    : boxed_radio_row {: row { label = "Panels";: boxed_radio_column { // Boxed_radio_column 1 label = "Panel";      // defines the radio button areas          key = "panel"; : radio_button {         // defines the ActiveX radio button  label = "&Inga paneler";  key = "ej_pan";                } : radio_button {         // defines the ActiveX radio button  label = "Med paneler";  key = "med_pan";  value = "1";                } : radio_button {         // defines the (entmake) radio button  label = "Med paneler+ljudoption";  key = "med_ljudo";             }          } : column {    : radio_button {         // defines the ActiveX radio button  label = "&Singelpump";  key = "sp";  value = "1";                } : radio_button {         // defines the ActiveX radio button  label = "Tandempump";  key = "tp";                }           }                       }                   : row { label = "Spider"; : column {        // defines the radio button areas : radio_button {         // defines the ActiveX radio button  label = "&Ingen spider";  key = "i_spid";  value = "0"; } : radio_button {         // defines the ActiveX radio button  label = "&Placering höger sida";  key = "phs";  value = "1"; } : radio_button {         // defines the ActiveX radio button  label = "&Placering vänster sida";  key = "pvs"; } } : column {    : radio_button {         // defines the ActiveX radio button  label = "&Panel utsida dörr";  value = "1";     key = "pud"; } : radio_button {         // defines the ActiveX radio button  label = "&Panel insida dörr";  key = "pid";                }           }          }                     : boxed_radio_row {               label = "&Replenishment";                 : popup_list {               key = "rep";               label = "&Välj";               fixed_width_font = true;               width = 30;               value = "";         //is_enabled = false;                             }}}}               }: boxed_row {             : button {               key = "accept";               label = " Okay ";               is_default = true;             }             : button {               key = "cancel";               label = " Cancel ";               is_default = false;               is_cancel = true;             }           } } //Sista
 
/Dan
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-7 09:20 , Processed in 0.825694 second(s), 72 queries .

© 2020-2025 乐筑天下

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