dcl_ComboBox_SetDroppedWidth isn't working for me. I've tried it with the event OnDropDown and several other ways, too. Using latest stable version, 5.1.2.3.
Seems to work for me PROVIDING the Dropdown width is greater than the Control ..
(vl-load-com)
(command "OPENDCL")
;; Test Code
;; 20091125 kdub@home
;|<<MAIN>>|;
;;;---------------------------------------------------------------------------
;;; (findfile "Test1125A.ODCL")
;;;---------------------------------------------------------------------------
;;;
(defun c:doit (/ dialogreturn)
(dcl_project_load "Test1125A.ODCL" t)
;; Show the main form
(setq dialogreturn (dcl_form_show test1125a_main))
;;------
(princ)
)
;;;---------------------------------------------------------------------------
;;;
;|<<SUPPORT>>|;
;;;---------------------------------------------------------------------------
;;;
;|<<OPENDCL Handlers Event>>|;
(defun c:Test1125A_Main_OnInitialize (/)
(setq combocontent '("AddColor" "AddList" "AddPath"
"AddString" "Clear" "ClearEdit"
)
)
(dcl_ComboBox_AddList Test1125A_Main_ComboBox1 combocontent)
)
;;;-------------------------------------------
(defun c:Test1125A_Main_ComboBox1_OnDropDown (/)
(dcl_ComboBox_SetDroppedWidth Test1125A_Main_ComboBox1 300)
;;(dcl_ComboBox_SetDroppedWidth Test1125A_Main_ComboBox1 70)
)
;;;-------------------------------------------
;;;---------------------------------------------------------------------------
;;;
(prompt "\n DOIT to run.")
(princ)
regards
Kerry
I assume this is the sort of thing you're trying to acomplish ...
;;;---------------------------------------------------------------------------
;;;
;|<<OPENDCL Handlers Event>>|;
(defun c:test1125a_main_oninitialize (/)
(setq
combocontent '("AddColor"
"AddList"
"AddPath"
"AddString1"
"123456789012345678901234567890123456789012345"
"Clear"
"ClearEdit"
)
)
(dcl_combobox_addlist test1125a_main_combobox1 combocontent)
)
;;;-------------------------------------------
(defun c:Test1125A_Main_ComboBox1_OnDropDown (/)
(dcl_combobox_setdroppedwidth
test1125a_main_combobox1
(atoi (rtos (* 6.6 (apply 'max (mapcar 'strlen combocontent))) 2 0)
)
)
)
;;;-------------------------------------------
Yup, that's what I was trying. Thanks!