1. ;;-----------------------------------------------------------------------------------------------------------------
    2. ;;说明:获取odclTextbox/ComboBox/ImageComboBox的值,前提设置全局变量*odcl-from*=>(setq *odcl-from* "flagetools/MainFrm/")
    3. ;;参数:*odcl-from*:界面全名称-类型:string
    4. ;;参数:name:str:控件的名称<名称列表>-类型:string
    5. ;;返回:控件值<控件值表>-类型:string
    6. ;;-----------------------------------------------------------------------------------------------------------------
    7. (defun Bf-Odcl-GetText(*odcl-from* name / odcl-gettext)
    8. (defun odcl-GetText(name)
    9. (dcl-Control-GetText (eval (read (strcat *odcl-from* name))))
    10. )
    11. (cond
    12. ((= (type name) 'STR) (odcl-GetText name))
    13. ((= (type name) 'LIST) (mapcar 'odcl-GetText name))
    14. )
    15. )
    16. ;;-----------------------------------------------------------------------------------------------------------------
    17. ;;说明:获取odcl中Textbox/ComboBox/ImageComboBox的值,前提设置全局变量*odcl-from*=>(setq *odcl-from* "flagetools/MainFrm/")
    18. ;;参数:*odcl-from*:界面全名称-类型:string
    19. ;;参数:nameList:控件的名称表-类型:list
    20. ;;返回:控件值表-类型:list
    21. ;;-----------------------------------------------------------------------------------------------------------------
    22. (defun Bf-Odc1-GetText(*odcl-from* nameList)
    23. (if (atom nameList) (setq nameList (list nameList)))
    24. (mapcar (function (lambda(x) (dcl-Control-GetText (eval (read (strcat *odcl-from* x)))))) nameList)
    25. )
    26. ;;-----------------------------------------------------------------------------------------------------------------
    27. ;;说明:设置odcl中Textbox/ComboBox/ImageComboBox的值,前提设置全局变量*odcl-from*=>(setq *odcl-from* "flagetools/MainFrm/")
    28. ;;参数:*odcl-from*:界面全名称-类型:string
    29. ;;参数:name:控件名称<控件名称表>-类型:string
    30. ;;参数:str:控件值<控件值表>-类型:string
    31. ;;返回:bool值 or bool值表
    32. ;;-----------------------------------------------------------------------------------------------------------------
    33. (defun Bf-Odcl-SetText(*odcl-from* name str / odcl-settext)
    34. (defun odcl-SetText(name str)
    35. (dcl-Control-SetText (eval (read (strcat *odcl-from* name))) str)
    36. )
    37. (cond
    38. ((and (= (type name) 'STR) (= (type str) 'STR)) (odcl-SetText name str))
    39. ((and (= (type name) 'LIST) (= (type str) 'LIST) (= (length name) (length str))) (mapcar 'odcl-SetText name str))
    40. ((and (= (type name) 'LIST) (= str nil)) (mapcar '(lambda (x) (apply 'odcl-SetText x)) name))
    41. ((and (= (type name) 'LIST) (= str nil))
    42. (if (vl-member-if 'listp name)
    43. (mapcar '(lambda (x) (apply 'odcl-SetText x)) name)
    44. (apply 'odcl-SetText name)
    45. )
    46. )
    47. )
    48. )
    49. ;;-----------------------------------------------------------------------------------------------------------------
    50. ;;说明:设置odclTextbox/ComboBox/ImageComboBox的值,前提设置全局变量*odcl-from*=>(setq *odcl-from* "flagetools/MainFrm/")
    51. ;;参数:*odcl-from*:界面全名称-类型:string
    52. ;;参数:nameValueList:点表(cons a b)/(list (cons 控件名称 控件值) (cons 控件名称 控件值) ……)
    53. ;;返回:bool or bool值表
    54. (defun Bf-Odc1-SetText1(*odcl-from* nameValueList)
    55. (if (atom (car nameValueList))(setq nameValueList (list nameValueList)))
    56. (foreach Lst nameValueList
    57. (dcl-Control-SetText (eval (read (strcat *odcl-from* (car Lst)))) (cdr Lst))
    58. )
    59. )
    60. ;;-----------------------------------------------------------------------------------------------------------------
    61. ;;说明:设置odcltree空间项的展开状态,前提设置全局变量*odcl-from*=>(setq *odcl-from* "flagetools/MainFrm/")
    62. ;;参数:*odcl-from*:界面全名称-类型:string
    63. ;;参数:name:控件名称<控件名称表>-类型:string
    64. ;;参数:Item:项的句柄或者键值<句柄表或者键值表>-类型:string
    65. ;;参数:value:控件值<控件值表>-类型:INT;<-1:折叠项目;0:切换项目展开状态;1:展开项目;>
    66. ;;返回:bool or bool值表
    67. ;;----------------------
    68. ;;设置tree单个项的展开状态
    69. ;; (Bf-Odcl-ExpandItem *odcl-from* "flangetree" "pnstyle" 0)
    70. ;; (Bf-Odcl-ExpandItem *odcl-from* (list "flangetree" "pnstyle" 0) nil nil)
    71. ;;----------------------
    72. ;;可设置同一个tree多个项的展开状态
    73. ;; (Bf-Odcl-ExpandItem *odcl-from* "flangetree" (list "pnstyle" "classstyle") (list 0 0))
    74. ;; (Bf-Odcl-ExpandItem *odcl-from* "flangetree" (list '("pnstyle" 0) '("classstyle" 0)) nil)
    75. ;;----------------------
    76. ;;可设置多个tree多个项的展开状态
    77. ;; (Bf-Odcl-ExpandItem *odcl-from* (list "flangetree" "flangetree") (list "pnstyle" "classstyle") (list 0 0))
    78. ;; (Bf-Odcl-ExpandItem *odcl-from* (list '("flangetree" "pnstyle" 0) '("flangetree" "classstyle" 0)) nil nil)
    79. ;;-----------------------------------------------------------------------------------------------------------------
    80. (defun Bf-Odcl-ExpandItem(*odcl-from* name Item value / odcl-expanditem1 odcl-expanditem2)
    81. (defun odcl-ExpandItem1(Item value)
    82. (dcl-Tree-ExpandItem (eval (read (strcat *odcl-from* name))) Item value)
    83. )
    84. (defun odcl-ExpandItem2(name1 Item value)
    85. (dcl-Tree-ExpandItem (eval (read (strcat *odcl-from* name1))) Item value)
    86. )
    87. (cond
    88. ((and (= (type name) 'STR) (= (type Item) 'STR) (= (type value) 'INT)) (odcl-ExpandItem1 Item value))
    89. ((and (= (type name) 'STR) (= (type Item) 'LIST) (= (type value) 'LIST) (= (length Item) (length value))) (mapcar 'odcl-ExpandItem1 Item value))
    90. ((and (= (type name) 'LIST) (= (type Item) 'LIST) (= (type value) 'LIST) (= (length name) (length Item) (length value))) (mapcar 'odcl-ExpandItem2 name Item value))
    91. ((and (= (type name) 'LIST) (= Item nil) (= value nil))
    92. (if (vl-member-if 'listp name)
    93. (mapcar '(lambda (x) (apply 'odcl-ExpandItem2 x)) name)
    94. (apply 'odcl-ExpandItem2 name)
    95. )
    96. )
    97. ((and (= (type name) 'STR) (= (type Item) 'LIST) (= value nil))
    98. (if (vl-member-if 'listp Item)
    99. (mapcar '(lambda (x) (apply 'odcl-ExpandItem1 x)) Item)
    100. (apply 'odcl-ExpandItem1 Item)
    101. )
    102. )
    103. )
    104. ;(setq lst (list "flangetree" "pnstyle" 0))
    105. ;(setq lst (list '("flangetree" "pnstyle" 0) '("flangetree" "classstyle" 0)))
    106. ;(defun odcl-ExpandItem2(name1 Item value)
    107. ; (dcl-Tree-ExpandItem (eval (read (strcat *odcl-from* name1))) Item value)
    108. ;)
    109. ;(mapcar '(lambda (x) (apply 'odcl-ExpandItem2 x)) lst)
    110. )
    111. ;(ExpandItem *odcl-from* "flangetree" "pnstyle" 0)
    112. ;(ExpandItem *odcl-from* "flangetree" (list "pnstyle" "classstyle") (list 0 0))
    113. ;((list "flangetree" "pnstyle" 0) (list "flangetree" "classstyle" 0))
    114. ;(vl-member-if 'atom '("flangetree" "pnstyle" 0))
    115. (vl-member-if 'listp (list '("flangetree" "pnstyle" 0) '("flangetree" "classstyle" 0)))
    116. (vl-member-if 'listp '("flangetree" "pnstyle" 0))