幻燈片影像對話框的範例

  • Share this:

程式名稱 : bsd.vlx 載入指令 : (load "bsd") 執行指令 : bsd

請輸入 bsd , 以執行 [ 影像 ] 內定程式.

此為幻燈片影像對話框的範例, 原始碼檔案附在壓縮檔中, bsd.lsp 和 bsd.dcl. 可依自己的需求, 修改為自己的 .lsp 和 .dcl 檔.

每個幻燈片都對應一個阿貴的 AUTOLISP 程式:

arc_plank.VLX arc_plank_with_straight.VLX bend_angle.VLX bend_angle_with_radius.VLX bend_channel.VLX bend_channel_with_radius.VLX bnc.VLX bns.VLX channel__inner_straight.VLX channel__out_straight.VLX plate_with_inner_wing.VLX plate_with_out_wing.VLX plate_with_trumpet.VLX roll_arc.VLX roll_arc_with_straight.VLX rpl.VLX

*** 這些程式的幻燈片檔都放在相同程式名稱 的壓縮檔內 ( XXXXXX.rar ). ***

*** 此檔僅作展示 AUTOLISP 影像對話框 ***

;; 2013.12.12 Ya-Kuei

;; 2013.12.14 modified

(defun c:bsd ()

(setvar "cmdecho" 0)

(dcl_bsd)

(prin1)

)

(defun dcl_bsd ()

(setq dcl_id (load_dialog "bsd"))

(new_dialog "bsd_dcl" dcl_id)

(def_bsd)

(setq w (dimx_tile "img") h (dimy_tile "img") )

(start_image "img")

(fill_image 0 0 w h 2)

(end_image)

(action_tile "kimage11" "(setq ddtype 11) (set_tile \"error\" \"請按 [ 確定 ] 執行 角鐵 展開程式...\")" )

(action_tile "kimage12" "(setq ddtype 12) (set_tile \"error\" \"請按 [ 確定 ] 執行 壓小圓弧的角鐵 展開程式...\")" )

(action_tile "kimage13" "(setq ddtype 13) (set_tile \"error\" \"請按 [ 確定 ] 執行 槽鐵 展開程式...\")" )

(action_tile "kimage14" "(setq ddtype 14) (set_tile \"error\" \"請按 [ 確定 ] 執行 壓小圓弧的槽鐵 展開程式...\")" )

(action_tile "kimage21" "(setq ddtype 21) (set_tile \"error\" \"請按 [ 確定 ] 執行 壓向內折短邊的槽鐵 展開程式...\")" )

(action_tile "kimage22" "(setq ddtype 22) (set_tile \"error\" \"請按 [ 確定 ] 執行 壓向外折短邊的槽鐵 展開程式...\")" )

(action_tile "kimage23" "(setq ddtype 23) (set_tile \"error\" \"請按 [ 確定 ] 執行 中間為水平或垂直的 N 型鐵 展開程式...\")" )

(action_tile "kimage24" "(setq ddtype 24) (set_tile \"error\" \"請按 [ 確定 ] 執行 兩側為水平或垂直的 N 型鐵 展開程式...\")" )

(action_tile "kimage31" "(setq ddtype 31) (set_tile \"error\" \"請按 [ 確定 ] 執行 矩形盤 展開程式...\")" )

(action_tile "kimage32" "(setq ddtype 32) (set_tile \"error\" \"請按 [ 確定 ] 執行 壓帶有內折短邊的矩形盤 展開程式...\")" )

(action_tile "kimage33" "(setq ddtype 33) (set_tile \"error\" \"請按 [ 確定 ] 執行 壓帶有外折短邊的矩形盤 展開程式...\")" )

(action_tile "kimage34" "(setq ddtype 34) (set_tile \"error\" \"請按 [ 確定 ] 執行 喇叭開口的矩形盤 展開程式...\")" )

(action_tile "kimage41" "(setq ddtype 41) (set_tile \"error\" \"請按 [ 確定 ] 執行畫 月眉板 的程式...\")" )

(action_tile "kimage42" "(setq ddtype 42) (set_tile \"error\" \"請按 [ 確定 ] 執行畫 帶有直部的月眉板 程式...\")" )

(action_tile "kimage43" "(setq ddtype 43) (set_tile \"error\" \"請按 [ 確定 ] 執行 平板捲圓弧形 展開程式...\")" )

(action_tile "kimage44" "(setq ddtype 44) (set_tile \"error\" \"請按 [ 確定 ] 執行 平板捲帶有直部圓弧形 的展開程式...\")" )

(action_tile "accept" "(done_dialog 1)")

(setq dd (start_dialog))

(if (= dd 1) (show_bsd) )

)

(defun def_bsd ()

(setq sldkey_list '("kimage11" "kimage12" "kimage13" "kimage14" "kimage21" "kimage22" "kimage23" "kimage24" "kimage31" "kimage32" "kimage33" "kimage34" "kimage41" "kimage42" "kimage43" "kimage44" ) )

(setq sld_list '("bend_angle_no_radius.sld" "bend_angle_with_radius.sld" "bend_channel.sld" "bend_channel_with_radius.sld" "channel__inner_straight.sld" "channel__out_straight.sld" "bnc.sld" "bns.sld" "rpl.sld" "plate_with_inner_wing.sld" "plate_with_out_wing.sld" "plate_with_trumpet.sld" "arc_plank.sld" "arc_plank_with_straight.sld" "roll_arc.sld" "roll_arc_with_straight.sld" ) )

(mapcar 'show_sld sldkey_list sld_list)

(setq ddtype 1)

(mode_tile "kimage1" 2)

(set_tile "error" " *** 請先點選 成型 的示意圖像, 再按 [ 確定 ] 來執行該程式...")

)

(defun show_list (key newlist)

(start_list key)

(mapcar 'add_list newlist)

(end_list)

)

(defun show_sld (key sld)

(setq x (dimx_tile key))

(setq y (dimy_tile key))

(start_image key)

(fill_image 0 0 x y -2)

(slide_image 0 0 x y sld)

(end_image)

)

(defun show_bsd ()

(cond

((= ddtype 11) (load "bend_angle_no_radius") (c:bend_angle_no_radius))

((= ddtype 12) (load "bend_angle_with_radius") (c:bend_angle_with_radius) )

((= ddtype 13) (load "bend_channel") (c:bend_channel))

((= ddtype 14) (load "bend_channel_with_radius") (c:bend_channel_with_radius) )

((= ddtype 21) (load "channel__inner_straight") (c:channel__inner_straight) )

((= ddtype 22) (load "channel__out_straight") (c:channel__out_straight) )

((= ddtype 23) (load "bnc") (c:bnc))

((= ddtype 24) (load "bns") (c:bns) )

((= ddtype 31) (load "rpl") (c:rpl))

((= ddtype 32) (load "plate_with_inner_wing") (c:plate_with_inner_wing) )

((= ddtype 33) (load "plate_with_out_wing") (c:plate_with_out_wing) )

((= ddtype 34) (load "plate_with_trumpet") (c:plate_with_trumpet) )

((= ddtype 41) (load "arc_plank") (c:arc_plank))

((= ddtype 42) (load "arc_plank_with_straight") (c:arc_plank_with_straight) )

((= ddtype 43) (load "roll_arc") (c:roll_arc))

((= ddtype 44) (load "roll_arc_with_straight") (c:roll_arc_with_straight) )

(T nil)

)

)

bsd_dcl:dialog{ label="常用板金類型的展開程式";

:boxed_row{ label="成型的示意圖像";

:column{ :text{label="角鐵";alignment=centered;}

:image_button { key = "kimage11"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="壓小圓弧的角鐵";alignment=centered;}

:image_button { key = "kimage12"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="槽鐵";alignment=centered;}

:image_button { key = "kimage13"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="壓小圓弧的槽鐵";alignment=centered;}

:image_button { key = "kimage14"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

}

:column{ :text{label="壓內折邊的槽鐵";alignment=centered;}

:image_button { key = "kimage21"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="壓外折邊的槽鐵";alignment=centered;}

:image_button { key = "kimage22"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="中間N型鐵";alignment=centered;}

:image_button { key = "kimage23"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="兩側N型鐵";alignment=centered;}

:image_button { key = "kimage24"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

}

:column{ :text{label="矩形盤";alignment=centered;}

:image_button { key = "kimage31"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="壓內折邊的矩形盤";alignment=centered;}

:image_button { key = "kimage32"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="壓外折邊的矩形盤";alignment=centered;}

:image_button { key = "kimage33"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="喇叭矩形盤";alignment=centered;}

:image_button { key = "kimage34"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

}

:column{ :text{label="月眉板";alignment=centered;}

:image_button { key = "kimage41"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="有直部月眉板";alignment=centered;}

:image_button { key = "kimage42"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="捲圓弧";alignment=centered;}

:image_button { key = "kimage43"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

:text{label="捲有直部圓弧";alignment=centered;}

:image_button { key = "kimage44"; color = -2; width = 20; aspect_ratio = 0.66; allow_accept = true; }

}

}

spacer_1; ok_cancel_err ; //predifined OK/Cancel/err :

row { : image {key = "img"; height = 1.0 ; width = 1.0;}

: paragraph{ : text_part{label = "Design and Created by Ya-Kuei, v.2013.12.14"; }

: text_part{label = "E-mail : [email protected]"; }

}

}

}


Tags: