OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: AutoKAD on November 24, 2009, 10:37:29 PM

Title: SetDroppedWidth
Post by: AutoKAD on November 24, 2009, 10:37:29 PM
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.
Title: Re: SetDroppedWidth
Post by: Kerry on November 24, 2009, 11:08:19 PM

Seems to work for me PROVIDING the Dropdown width is greater than the Control ..

Code (autolisp) Select


(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
Title: Re: SetDroppedWidth
Post by: Kerry on November 24, 2009, 11:22:59 PM
I assume this is the sort of thing you're trying to acomplish ...

Code (autolisp) Select


;;;---------------------------------------------------------------------------
;;;
;|<<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)
   )
 )  
)

;;;-------------------------------------------
Title: Re: SetDroppedWidth
Post by: AutoKAD on November 25, 2009, 08:57:54 AM
Yup, that's what I was trying.  Thanks!