Kye 发表于 2014-9-19 22:55:09

动态DCL页面如何实现左右两列或多列显示?

本帖最后由 Kye 于 2014-9-19 23:00 编辑

请教各位大侠,有很多数据,动态DCL页面一列显示不开,希望多列显示,图片为下面程序运行结果:boxed_column没有分成两列而还是两行?前一个程序为转为LISP前的DCL,请哪位能否提供个类似例子学习下,谢谢!http://bbs.mjtd.com/data/attachment/album/201409/19/223820joiere4e62qxdtqe.gif

choice : dialog {label = "test" ;

                                                   :boxed_row {            
                                                                         :row    { //:boxed_column//:boxed_row


                                                                                        :edit_box { label="【位】";width=6;key="editpartname01";}
         

                                                                                        }
         
                                                                        }
                                                      spacer;

      
                                                   ok_cancel ;
                                       }


(defun c:test(/ CAVLST CAVLST1 EDITPARTLST01 FNAME FN DCL_ID RESULT)

(setq Cavlst '( "a0" "a1" "a2" "a3""a4" "a5" "a6"))

(setq Cavlst1 '( ("a0" "a1" "a2" "a3")("a4" "a5" "a6" )));_将Cavlst分成两个表


(setq editpartlst01 '(("a1c1"); "a1c2" "a1c3")
          ("a2c1" "a2c2"); "a2c3")
          ("a3c1" "a3c2" "a3c3")
               )
)



;__________________________________________________________________________
(setq fname (vl-filename-mktemp nil nil ".dcl"))
(setq fn (open fname "w"))



               (write-line "choice : dialog {label = \"test\" ;" fn)

(foreach Cavlst2 Cavlst1 (if Cavlst2
            (progn(write-line "   :boxed_column{             " fn)
          (foreach n Cavlst2 (if n (progn

                  (write-line "               :row{ //:boxed_column//:boxed_row" fn)
               (write-line (strcat "      :edit_box { label=" (addw (strcat n"【位】"))";width=6;key="(addw (strcat "editpartname01" n) ) ";}" )fn)
               (write-line "               }" fn)

                );_progn
                   );_if
            );_内层foreach
         
            (write-line "             }" fn)
          );_progn
      );_if
);_外层foreach

                (write-line "      ok_cancel ;" fn)
                (write-line "    }" fn)


(close fn)
(setq fn (open fname "r"))
(setq dcl_id (load_dialog fname))
;____________________________________________________________________________



(if (not (new_dialog "choice" dcl_id))
    (exit)
)


(foreach n Cavlst (if n
          (set_tile (strcat "editpartname01" n) (nth 0 (nth 0 editpartlst01)) )
         )   
            
)         

(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(setq result (start_dialog))
(unload_dialog dcl_id)


(if (= 1 result)
    (alert
      (strcat "NIHAO! ")
    )
)
;; do your mojo here
(princ)
)
(princ "\n *****c: test ()** ")


(defun addw(a / );_将\加到字符两侧

(strcat "\"" a "\"")

)

ZZXXQQ 发表于 2014-9-20 08:37:50

(defun c:test(/ CAVLST CAVLST1 EDITPARTLST01 FNAME FN DCL_ID RESULT)
(setq Cavlst '( "a0" "a1" "a2" "a3""a4" "a5" "a6"))
(setq Cavlst1 '( ("a0" "a1" "a2" "a3")("a4" "a5" "a6" )));_将Cavlst分成两个表
(setq editpartlst01 '(("a1c1"); "a1c2" "a1c3")
          ("a2c1" "a2c2"); "a2c3")
          ("a3c1" "a3c2" "a3c3")
               )
)
;__________________________________________________________________________
(setq fname (vl-filename-mktemp nil nil ".dcl"))
(setq fn (open fname "w"))
(write-line "choice:dialog {label=\"test\" ;" fn)
(write-line " :row{" fn)
(foreach Cavlst2 Cavlst1
(if Cavlst2 (progn
   (write-line ":boxed_column{" fn)
    (foreach n Cavlst2
   (if n (progn
      (write-line "   :row{ //:boxed_column//:boxed_row" fn)
      (write-line
       (strcat "    :edit_box {label=" (addw (strcat n"【位】"))
       ";width=6;key="(addw (strcat "editpartname01" n) ) ";}" )fn)
      (write-line "   }" fn)
   ));_if
    );_内层foreach
    (write-line "}" fn)
));_if
);_外层foreach
(write-line " }" fn)
(write-line " ok_cancel;" fn)
(write-line "}" fn)
(close fn)
(setq fn (open fname "r"))
(setq dcl_id (load_dialog fname))
;____________________________________________________________________________
(if (not (new_dialog "choice" dcl_id)) (exit))
(foreach n Cavlst
   (if n (set_tile (strcat "editpartname01" n) (caar editpartlst01)))   
)
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(setq result (start_dialog))
(unload_dialog dcl_id)
(if (= 1 result) (alert (strcat "NIHAO! ")))
;; do your mojo here
(princ)
)
(princ "\n *****c: test ()** ")
(defun addw(a / );_将\加到字符两侧
(strcat "\"" a "\"")
)

Kye 发表于 2014-9-20 20:13:04

ZZXXQQ 发表于 2014-9-20 08:37 static/image/common/back.gif


来明经学习Z版的程序最多,能得到Z版的亲自指导,深感荣幸,谢谢Z版
页: [1]
查看完整版本: 动态DCL页面如何实现左右两列或多列显示?