;;-----------------------------------------------------------------------------------------------------------------;;说明:获取odcl中Textbox/ComboBox/ImageComboBox的值,前提设置全局变量*odcl-from*=>(setq *odcl-from* "flagetools/MainFrm/");;参数:*odcl-from*:界面全名称-类型:string;;参数:name:str:控件的名称<名称列表>-类型:string;;返回:控件值<控件值表>-类型:string;;-----------------------------------------------------------------------------------------------------------------(defun Bf-Odcl-GetText(*odcl-from* name / odcl-gettext) (defun odcl-GetText(name) (dcl-Control-GetText (eval (read (strcat *odcl-from* name)))) ) (cond ((= (type name) 'STR) (odcl-GetText name)) ((= (type name) 'LIST) (mapcar 'odcl-GetText name)) ));;-----------------------------------------------------------------------------------------------------------------;;说明:获取odcl中Textbox/ComboBox/ImageComboBox的值,前提设置全局变量*odcl-from*=>(setq *odcl-from* "flagetools/MainFrm/");;参数:*odcl-from*:界面全名称-类型:string;;参数:nameList:控件的名称表-类型:list;;返回:控件值表-类型:list;;-----------------------------------------------------------------------------------------------------------------(defun Bf-Odc1-GetText(*odcl-from* nameList) (if (atom nameList) (setq nameList (list nameList))) (mapcar (function (lambda(x) (dcl-Control-GetText (eval (read (strcat *odcl-from* x)))))) nameList));;-----------------------------------------------------------------------------------------------------------------;;说明:设置odcl中Textbox/ComboBox/ImageComboBox的值,前提设置全局变量*odcl-from*=>(setq *odcl-from* "flagetools/MainFrm/");;参数:*odcl-from*:界面全名称-类型:string;;参数:name:控件名称<控件名称表>-类型:string;;参数:str:控件值<控件值表>-类型:string;;返回:bool值 or bool值表;;-----------------------------------------------------------------------------------------------------------------(defun Bf-Odcl-SetText(*odcl-from* name str / odcl-settext) (defun odcl-SetText(name str) (dcl-Control-SetText (eval (read (strcat *odcl-from* name))) str) ) (cond ((and (= (type name) 'STR) (= (type str) 'STR)) (odcl-SetText name str)) ((and (= (type name) 'LIST) (= (type str) 'LIST) (= (length name) (length str))) (mapcar 'odcl-SetText name str)) ((and (= (type name) 'LIST) (= str nil)) (mapcar '(lambda (x) (apply 'odcl-SetText x)) name)) ((and (= (type name) 'LIST) (= str nil)) (if (vl-member-if 'listp name) (mapcar '(lambda (x) (apply 'odcl-SetText x)) name) (apply 'odcl-SetText name) ) ) ));;-----------------------------------------------------------------------------------------------------------------;;说明:设置odcl中Textbox/ComboBox/ImageComboBox的值,前提设置全局变量*odcl-from*=>(setq *odcl-from* "flagetools/MainFrm/");;参数:*odcl-from*:界面全名称-类型:string;;参数:nameValueList:点表(cons a b)/(list (cons 控件名称 控件值) (cons 控件名称 控件值) ……);;返回:bool值 or bool值表(defun Bf-Odc1-SetText1(*odcl-from* nameValueList) (if (atom (car nameValueList))(setq nameValueList (list nameValueList))) (foreach Lst nameValueList (dcl-Control-SetText (eval (read (strcat *odcl-from* (car Lst)))) (cdr Lst)) ));;-----------------------------------------------------------------------------------------------------------------;;说明:设置odcl中tree空间项的展开状态,前提设置全局变量*odcl-from*=>(setq *odcl-from* "flagetools/MainFrm/");;参数:*odcl-from*:界面全名称-类型:string;;参数:name:控件名称<控件名称表>-类型:string;;参数:Item:项的句柄或者键值<句柄表或者键值表>-类型:string;;参数:value:控件值<控件值表>-类型:INT;<-1:折叠项目;0:切换项目展开状态;1:展开项目;>;;返回:bool值 or bool值表;;----------------------;;设置tree单个项的展开状态;; (Bf-Odcl-ExpandItem *odcl-from* "flangetree" "pnstyle" 0);; (Bf-Odcl-ExpandItem *odcl-from* (list "flangetree" "pnstyle" 0) nil nil);;----------------------;;可设置同一个tree多个项的展开状态;; (Bf-Odcl-ExpandItem *odcl-from* "flangetree" (list "pnstyle" "classstyle") (list 0 0));; (Bf-Odcl-ExpandItem *odcl-from* "flangetree" (list '("pnstyle" 0) '("classstyle" 0)) nil);;----------------------;;可设置多个tree多个项的展开状态;; (Bf-Odcl-ExpandItem *odcl-from* (list "flangetree" "flangetree") (list "pnstyle" "classstyle") (list 0 0));; (Bf-Odcl-ExpandItem *odcl-from* (list '("flangetree" "pnstyle" 0) '("flangetree" "classstyle" 0)) nil nil);;-----------------------------------------------------------------------------------------------------------------(defun Bf-Odcl-ExpandItem(*odcl-from* name Item value / odcl-expanditem1 odcl-expanditem2) (defun odcl-ExpandItem1(Item value) (dcl-Tree-ExpandItem (eval (read (strcat *odcl-from* name))) Item value) ) (defun odcl-ExpandItem2(name1 Item value) (dcl-Tree-ExpandItem (eval (read (strcat *odcl-from* name1))) Item value) ) (cond ((and (= (type name) 'STR) (= (type Item) 'STR) (= (type value) 'INT)) (odcl-ExpandItem1 Item value)) ((and (= (type name) 'STR) (= (type Item) 'LIST) (= (type value) 'LIST) (= (length Item) (length value))) (mapcar 'odcl-ExpandItem1 Item value)) ((and (= (type name) 'LIST) (= (type Item) 'LIST) (= (type value) 'LIST) (= (length name) (length Item) (length value))) (mapcar 'odcl-ExpandItem2 name Item value)) ((and (= (type name) 'LIST) (= Item nil) (= value nil)) (if (vl-member-if 'listp name) (mapcar '(lambda (x) (apply 'odcl-ExpandItem2 x)) name) (apply 'odcl-ExpandItem2 name) ) ) ((and (= (type name) 'STR) (= (type Item) 'LIST) (= value nil)) (if (vl-member-if 'listp Item) (mapcar '(lambda (x) (apply 'odcl-ExpandItem1 x)) Item) (apply 'odcl-ExpandItem1 Item) ) ) ) ;(setq lst (list "flangetree" "pnstyle" 0)) ;(setq lst (list '("flangetree" "pnstyle" 0) '("flangetree" "classstyle" 0))) ;(defun odcl-ExpandItem2(name1 Item value) ; (dcl-Tree-ExpandItem (eval (read (strcat *odcl-from* name1))) Item value) ;) ;(mapcar '(lambda (x) (apply 'odcl-ExpandItem2 x)) lst));(ExpandItem *odcl-from* "flangetree" "pnstyle" 0);(ExpandItem *odcl-from* "flangetree" (list "pnstyle" "classstyle") (list 0 0));((list "flangetree" "pnstyle" 0) (list "flangetree" "classstyle" 0));(vl-member-if 'atom '("flangetree" "pnstyle" 0))(vl-member-if 'listp (list '("flangetree" "pnstyle" 0) '("flangetree" "classstyle" 0)))(vl-member-if 'listp '("flangetree" "pnstyle" 0))