woodman78 发表于 2022-7-6 11:26:22

DCL单选按钮

你好
 
我试图编写一个dcl文件来创建一个对话框,其中有一个由2列2个单选按钮组成的对话框,在该对话框下有一个分别由2列7个单选按钮组成的对话框。dcl中不断出现错误。有人能帮忙吗??
 
谢谢

The Buzzard 发表于 2022-7-6 11:31:19

你能把dcl和lsp文件寄出去吗。

The Buzzard 发表于 2022-7-6 11:35:31

 
 
根据您的描述,我将此作为示例发布。
我希望你张贴你的,这样它可以被修复。
 
example : dialog {                               //*dialog name
         label = "Example Dialog" ;             //*give it a label
         : row {                              //*define row
         : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "A Buttons" ;            //*give it a label
               : radio_button {               //*define radio_button
               key = "A1";                  //*give it a name
               label = "A1";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "A2";                  //*give it a name
               label = "A2";                  //*give it a label
               }                              //*end radio_button
             }                                  //*end boxed_radio_column
         }                                    //*end column
         : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "B Buttons" ;            //*give it a label
               : radio_button {               //*define radio_button
               key = "B1";                  //*give it a name
               label = "B1";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B2";                  //*give it a name
               label = "B2";                  //*give it a label
               }                              //*end radio_button
             }                                  //*end boxed_radio_column
         }                                    //*end column
         }                                    //*end row
         : row {                              //*define row
         : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "C Buttons" ;            //*give it a label
               : radio_button {               //*define radio_button
               key = "C1";                  //*give it a name
               label = "C1";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "C2";                  //*give it a name
               label = "C2";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "C3";                  //*give it a name
               label = "C3";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "C4";                  //*give it a name
               label = "C4";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "C5";                  //*give it a name
               label = "C5";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "C6";                  //*give it a name
               label = "C6";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "C7";                  //*give it a name
               label = "C7";                  //*give it a label
               }                              //*end radio_button
             }                                  //*end boxed_radio_column
         }                                    //*end column
         : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "D Buttons" ;            //*give it a label
               : radio_button {               //*define radio_button
               key = "D1";                  //*give it a name
               label = "D1";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "D2";                  //*give it a name
               label = "D2";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "D3";                  //*give it a name
               label = "D3";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "D4";                  //*give it a name
               label = "D4";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "D5";                  //*give it a name
               label = "D5";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "D6";                  //*give it a name
               label = "D6";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "D7";                  //*give it a name
               label = "D7";                  //*give it a label
               }                              //*end radio_button
             }                                  //*end boxed_radio_column
         }                                    //*end column
         }                                    //*end row
         ok_cancel ;                            //*predifined OK/Cancel
         : row {                              //*define row
         : paragraph {                        //*define paragraph
             : text_part {                      //*define text
               label = "Designed by BD";      //*give it some text
             }                                  //*end text
             : text_part {                      //*define more text
               label = "for CCC NNRDO";         //*some more text
             }                                  //*end text
         }                                    //*end paragraph
         }                                    //*end row
       }                                        //*end dialog

woodman78 发表于 2022-7-6 11:36:36

秃鹰,
这是我使用的代码:
 

radio : dialog {    //dialog name
   label = "Existing Storm Sewers" ;//give it a label
      :boxed_radio_column_1 {   //*define radio column
      label = "Choose a Type" ;    //*give it a label
       :row{
       : radio_button {   //*define radion button
       key = "T1" ;    //*give it a name
       label = "Type &1" ;   //*give it a label
       //value = "1" ;    //*switch it on
       }   //*end definition
   : radio_button {   //*define radio button
       key = "T2" ;    //*give it a name
       label = "Type &2" ;//*give it a label
   }   //*end definition
          }
   :Row{
: radio_button {   //*define radio button
       key = "T3" ;    //*give it a name
       label = "Type &3" ; //*give it a label
       }   //*end definition
   : radio_button {   //*define radio button
       key = "T4" ;    //*give it a name
       label = "Type &4" ;//*give it a label
   }   //*end definition
          }
       }   //*end radio column
   
      :boxed_radio_column_2 {   //*define radio column
      label = "Choose a Size" ;    //*give it a label
       :row{
       : radio_button {   //*define radion button
       key = "S1" ;    //*give it a name
       label = "1500mm" ;   //*give it a label
       //value = "1" ;    //*switch it on
       }   //*end definition
   : radio_button {   //*define radio button
       key = "S2" ;    //*give it a name
       label = "1350mm" ;//*give it a label
   }   //*end definition
          }
   :Row{
: radio_button {   //*define radio button
       key = "S3" ;    //*give it a name
       label = "1200mm" ; //*give it a label
       }   //*end definition
   : radio_button {   //*define radio button
       key = "S4" ;    //*give it a name
       label = "1050mm" ;//*give it a label
   }   //*end definition
          }
       }
ok_cancel ;    //predifined OK/Cancel
    : row {   //define row

    : paragraph {    //define paragraph
    : text_part {    //define text
    label = "Designed by Brian Deasy";//give it some text
    }      //end text
    : text_part {    //define more text
    label = "for CCC NNRDO";   //some more text
    }      //end text
    }      //end paragraph
    }      //end row
   
    }      //end dialog

 
你的例子很好。我想做的一件不同的事是,我希望每行只有一个框,但要保持按钮布局,这样第一个框中有4个,第二个框中有14个。
 
谢谢

The Buzzard 发表于 2022-7-6 11:41:07

 
你能把Lisp程序也发出来吗。

woodman78 发表于 2022-7-6 11:43:39

我只是使用lisp加载对话框,只是为了首先获得正确的布局。在我知道这是否可能之前,我还没有开始。

The Buzzard 发表于 2022-7-6 11:48:31

 
我正在进行你的第一次描述,但是你似乎希望现在做不同的事情,我不确定你在描述什么。我还需要你用来测试dcl的lisp。我不在乎它是否完整。你说你测试过了,所以你一定有什么东西?
 
我只是想帮你,但你需要在你的帖子里说清楚。

The Buzzard 发表于 2022-7-6 11:50:08

 
从上面的描述中,我认为这就是你想要的。
不确定,但我不推荐这种布局,因为它的高度太长。让我知道。
 
example : dialog {                               //*dialog name
         label = "Example Dialog" ;             //*give it a label
         : row {                              //*define row
         : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "A Buttons" ;            //*give it a label
               : radio_button {               //*define radio_button
               key = "A1";                  //*give it a name
               label = "A1";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "A2";                  //*give it a name
               label = "A2";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "A3";                  //*give it a name
               label = "A3";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "A4";                  //*give it a name
               label = "A4";                  //*give it a label
               }                              //*end radio_button
             }                                  //*end boxed_radio_column
         }                                    //*end column
         }                                    //*end row
         : row {                              //*define row
         : column {                           //*define column
             : boxed_radio_column {             //*define radio column
               label = "B Buttons" ;            //*give it a label
               : radio_button {               //*define radio_button
               key = "B1";                  //*give it a name
               label = "B1";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B2";                  //*give it a name
               label = "B2";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B3";                  //*give it a name
               label = "B3";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B4";                  //*give it a name
               label = "B4";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B5";                  //*give it a name
               label = "B5";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B6";                  //*give it a name
               label = "B6";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B7";                  //*give it a name
               label = "B7";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B8";                  //*give it a name
               label = "B8";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B9";                  //*give it a name
               label = "B9";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B10";                  //*give it a name
               label = "B10";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B11";                  //*give it a name
               label = "B11";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B12";                  //*give it a name
               label = "B12";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B13";                  //*give it a name
               label = "B13";                  //*give it a label
               }                              //*end radio_button
               : radio_button {               //*define radio_button
               key = "B14";                  //*give it a name
               label = "B14";                  //*give it a label
               }                              //*end radio_button
             }                                  //*end boxed_radio_column
         }                                    //*end column
         }                                    //*end row
         : row {                              //*define row
         ok_cancel ;                            //*predifined OK/Cancel
         : paragraph {                        //*define paragraph
             : text_part {                      //*define text
               label = "Designed by BD";      //*give it some text
             }                                  //*end text
             : text_part {                      //*define more text
               label = "for CCC NNRDO";         //*some more text
             }                                  //*end text
         }                                    //*end paragraph
         }                                    //*end row
       }                                        //*end dialog

The Buzzard 发表于 2022-7-6 11:54:32

这是我为测试提供的dcl和lsp。
您的主要问题是命名boxed\u radio\u列,您将其称为boxed\u radio\u column\u 1等等。
还有一些行放错了位置,没有列。
请尝试开发一个更整洁的格式,这将有助于避免一些错误。
 
我会让你完成剩下的。使用我上面提供的示例。
如果你被卡住了,请告诉我。
 
DCL
radio : dialog {    //dialog name
       label = "Existing Storm Sewers" ;//give it a label
       : row {
         : column {
         : boxed_radio_column {   //*define radio column
             label = "Choose a Type" ;    //*give it a label
             : radio_button {   //*define radion button
               key = "T1" ;    //*give it a name
               label = "Type &1" ;   //*give it a label
               //value = "1" ;    //*switch it on
             }   //*end definition
             : radio_button {   //*define radio button
               key = "T2" ;    //*give it a name
               label = "Type &2" ;//*give it a label
             }   //*end definition
         }
         }
         : column {
         : boxed_radio_column {   //*define radio column
             : radio_button {   //*define radio button
               key = "T3" ;    //*give it a name
               label = "Type &3" ; //*give it a label
             }   //*end definition
             : radio_button {   //*define radio button
               key = "T4" ;    //*give it a name
               label = "Type &4" ;//*give it a label
             }   //*end definition
         }
         }   //*end column
       }   //*end row
       : row {
         : column {
         : boxed_radio_column {   //*define radio column
             label = "Choose a Size" ;    //*give it a label
             : radio_button {   //*define radion button
               key = "S1" ;    //*give it a name
               label = "1500mm" ;   //*give it a label
               //value = "1" ;    //*switch it on
             }   //*end definition
             : radio_button {   //*define radio button
               key = "S2" ;    //*give it a name
               label = "1350mm" ;//*give it a label
             }   //*end definition
         }
         }
         : column {
         : boxed_radio_column {   //*define radio column
             label = "?" ;    //*give it a label
             : radio_button {   //*define radio button
               key = "S3" ;    //*give it a name
               label = "1200mm" ; //*give it a label
             }   //*end definition
             : radio_button {   //*define radio button
               key = "S4" ;    //*give it a name
               label = "1050mm" ;//*give it a label
             }   //*end definition
         }
         }
       }
       : row {   //define row
         ok_cancel ;    //predifined OK/Cancel
         : paragraph {    //define paragraph
         : text_part {    //define text
             label = "Designed by Brian Deasy";//give it some text
         }      //end text
         : text_part {    //define more text
             label = "for CCC NNRDO";   //some more text
         }      //end text
         }      //end paragraph
       }      //end row
   }      //end dialog
 
LSP
(defun C:RADIO ()
(setq dcl_id (load_dialog "radio.dcl")) ;load dialog
(if
   (not (new_dialog "radio" dcl_id) ;test for dialog
   );not
   (progn
   (alert "Can not find your dcl file")
   (exit) ;exit if no dialog
   )
);if
(action_tile "cancel" ;if cancel button pressed
"(done_dialog)(setq userclick nil)" ;close dialog, set flag
);action_tile
(action_tile "accept" ;if O.K. pressed
"(done_dialog)(setq userclick T))" ;??? Is this standard code.
);action tile
(start_dialog) ;start dialog
(unload_dialog dcl_id) ;unload


)

The Buzzard 发表于 2022-7-6 11:57:30

这是上面的代码格式,我认为是你想要的方式。
如果可以的话,请告诉我。
所有新增单选按钮都有(?)用于标签。我没有这个信息。
 
无线电广播dcl
radio : dialog {                                 //*dialog name
       label = "Existing Storm Sewers";         //*give it a label
       : row {                                  //*define row
         : column {                           //*define column
         : boxed_radio_column {               //*define radio column
             label = "Choose a Type";         //*give it a label
             : radio_button {                   //*define radion button
               key = "T1";                      //*give it a name
               label = "Type &1";               //*give it a label
             //value = "1";                     //*switch it on
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "T2";                      //*give it a name
               label = "Type &2";               //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "T3";                      //*give it a name
               label = "Type &3";               //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "T4" ;                     //*give it a name
               label = "Type &4";               //*give it a label
             }                                  //*end definition
         }                                    //*end boxed_radio_column
         }                                    //*end column
       }                                        //*end row
       : row {                                  //*define row
         : column {                           //*define column
         : boxed_radio_column {               //*define radio column
             label = "Choose a Size";         //*give it a label
             : radio_button {                   //*define radion button
               key = "S1" ;                     //*give it a name
               label = "1500mm";                //*give it a label
             //value = "1";                     //*switch it on
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S2";                      //*give it a name
               label = "1350mm";                //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S3";                      //*give it a name
               label = "1200mm";                //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S4";                      //*give it a name
               label = "1050mm";                //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S5";                      //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S6";                      //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S7";                      //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S8";                      //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S9";                      //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S10";                     //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S11";                     //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S12";                     //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S13";                     //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
             : radio_button {                   //*define radio button
               key = "S14";                     //*give it a name
               label = "?";                     //*give it a label
             }                                  //*end definition
         }                                    //*end boxed_radio_column
         }                                    //*end column
       }                                        //*end row
       : row {                                    //*define row
         : column {                               //*define column
         ok_cancel ;                            //*predifined OK/Cancel
         : paragraph {                        //*define paragraph
             : text_part {                        //*define text
               label = "Designed by Brian Deasy"; //*give it some text
             }                                    //*end text
             : text_part {                        //*define more text
               label = "for CCC NNRDO";         //*some more text
             }                                    //*end text
         }                                    //*end paragraph
         }                                        //*end column
       }                                          //*end row
   }                                          //*end dialog
 
下面的lisp文件仅用于测试上述dcl的外观。
 
无线电广播lsp
(defun C:RADIO ()
(setq dcl_id (load_dialog "radio.dcl")) ;load dialog
(if
   (not (new_dialog "radio" dcl_id)      ;test for dialog
   )                                     ;not
   (progn
   (alert "Can not find your dcl file")
   (exit)                              ;exit if no dialog
   )
)                                       ;if
(action_tile "cancel"                   ;if cancel button pressed
"(done_dialog)(setq userclick nil)"    ;close dialog, set flag
)                                       ;action_tile
(action_tile "accept"                   ;if O.K. pressed
"(done_dialog)(setq userclick T))"   ;??? Is this standard code.
)                                       ;action tile
(start_dialog)                        ;start dialog
(unload_dialog dcl_id)                  ;unload
)
页: [1] 2
查看完整版本: DCL单选按钮