Vismut65 发表于 2022-7-6 08:35:51

动作互动程序

你好
 
我对action tile有问题。当我按下不同的单选按钮时,我想更改popup\u列表中的内容。我已经编写了代码:
 
(action_tile "str_l2"   
    "(start_list \"mylist1\" 3)
    (mapcar 'add_list myList5)
    (end_list)"   
   )

(action_tile "str_l3"   
    "(start_list \"mylist1\" 3)
    (mapcar 'add_list myList6)
    (end_list)"   
   )
 
但它不起作用
 
/丹

pBe 发表于 2022-7-6 08:42:10

欢迎来到论坛Dan
 
单选按钮返回值为“1”或“0”
 

(if (eq radiobuttonval"1")
(start_list "mylist1")(mapcar 'add_list myList5)(end_list);<---- pointing to the same key but different lists
(start_list "mylist1")(mapcar 'add_list myList6)(end_list);<-----
)

Lee Mac 发表于 2022-7-6 08:46:21

你好
 
谢谢你的回答,但我有6个单选按钮。如何使用6个按钮。
 
我还有一个问题。
 
我有两个弹出列表。我希望第二个弹出列表是灰色的。但是当我在第一个弹出列表中进行选择时,我希望第二个弹出列表被激活。

Vismut65 发表于 2022-7-6 08:55:23

非常快速的示例:
 
DCL代码(另存为“test.DCL”):
LISP代码:
test : dialog { label = "Example"; spacer;
   : boxed_radio_row { label = "Select List";
       : radio_button { key = "radio1"; label = "List 1"; }
       : radio_button { key = "radio2"; label = "List 2"; }
   }
   spacer; : popup_list { key = "popup"; } spacer;
   ok_only;
}

Lee Mac 发表于 2022-7-6 08:59:58

也许本例将说明如何在action\u tile表达式中启用/禁用tile:
 
DCL代码(另存为“test.DCL”):

(defun c:test ( / FillPopupList lst1 lst2 id )

   (setq lst1 '("One" "Two" "Three" "Four")
         lst2 '("Red" "Yellow" "Green" "Blue")
   )

   (defun FillPopupList ( key lst )
       (start_list key)
       (foreach item lst (add_list item))
       (end_list)
   )

   (cond
       (   (<= (setq id (load_dialog "test.dcl")) 0)
         (princ "\ntest.dcl file not found.")
       )
       (   (not (new_dialog "test" id))
         (princ "\nDialog could not be loaded.")
       )
       (   t
         (FillPopupList "popup" lst1)
         (set_tile "radio1" "1")

         (action_tile "radio1" "(FillPopupList \"popup\" lst1)")
         (action_tile "radio2" "(FillPopupList \"popup\" lst2)")
         (start_dialog)            
       )
   )
   (if (< 0 id) (unload_dialog id))
   (princ)
)
 
LISP代码:
(defun FillPopupList ( key lst )
   (start_list key)
   (foreach item lst (add_list item))
   (end_list)
      "(mode_tile \"mylist21\" 0)"   
   )
 
/丹

Vismut65 发表于 2022-7-6 09:04:01

您可以在第一个popup\u列表的action\u tile语句中包含mode\u tile语句。
 
然而,一个popup_列表总是有一个选择(甚至在用户选择某个项目之前),因此用户可能无法直观地看到您想要实现的行为。
 

Lee Mac 发表于 2022-7-6 09:08:51

李为你辩护,
 
我还有一个问题。我想在两个弹出菜单列表“mylist20”和“mylist21”中有不同的内容,具体取决于选择“sp”或“tp”。我写了一个代码,见下文,但它不工作。你能帮助我吗?。
 
6
 
/丹

pBe 发表于 2022-7-6 09:15:29

action\u tile表达式应该是字符串,但您正在action\u tile语句中嵌套action\u tile语句。。。

Lee Mac 发表于 2022-7-6 09:19:46

Vismut65 发表于 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?.
 

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 buttonlabel = "&Small 2D";key = "str_s2"; // value = "1";                              } : radio_button {         // defines the old-style polyline radio buttonlabel = "&Medium 2D";key = "str_m2";         } : radio_button {         // defines the old-style polyline radio buttonlabel = "&Large 2D";key = "str_l2";                }            : radio_button {         // defines the old-style polyline radio buttonlabel = "&Small 3D";key = "str_s3";                } : radio_button {         // defines the old-style polyline radio buttonlabel = "&Medium 3D";key = "str_m3";                } : radio_button {         // defines the old-style polyline radio buttonlabel = "&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 buttonlabel = "&Inga paneler";key = "ej_pan";                } : radio_button {         // defines the ActiveX radio buttonlabel = "Med paneler";key = "med_pan";value = "1";                } : radio_button {         // defines the (entmake) radio buttonlabel = "Med paneler+ljudoption";key = "med_ljudo";             }          } : column {    : radio_button {         // defines the ActiveX radio buttonlabel = "&Singelpump";key = "sp";value = "1";                } : radio_button {         // defines the ActiveX radio buttonlabel = "Tandempump";key = "tp";                }         }                     }                   : row { label = "Spider"; : column {      // defines the radio button areas : radio_button {         // defines the ActiveX radio buttonlabel = "&Ingen spider";key = "i_spid";value = "0"; } : radio_button {         // defines the ActiveX radio buttonlabel = "&Placering höger sida";key = "phs";value = "1"; } : radio_button {         // defines the ActiveX radio buttonlabel = "&Placering vänster sida";key = "pvs"; } } : column {    : radio_button {         // defines the ActiveX radio buttonlabel = "&Panel utsida dörr";value = "1";   key = "pud"; } : radio_button {         // defines the ActiveX radio buttonlabel = "&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
页: [1] 2
查看完整版本: 动作互动程序