OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: CouchPotato on December 04, 2010, 04:35:41 PM

Title: Combo Box not Populated
Post by: CouchPotato on December 04, 2010, 04:35:41 PM
I'm pulling my hair out, (what little there is).  I finally went through the tutorial, so I thought I woudl try some stuff at home.  I created a combo box at the office that initialized just fine.  I then tried to create it at home and nothing shows up in the drop down.  I even copied the form and lisp from the ofiice.  When I load the form at home the combo box is not  populated with the "initialize" values.

Here is the LISP code and I've attached the odcl file.  What is missing??

Code (autolisp) Select
(defun c:Invertest ()
  (command "_opendcl")
  (dcl_project_load "pipecalcs" T)
  (dcl_form_show pipecalcs_invertcalcs)
)


(defun c:PipeCalcs_InvertCalcs_OnInitialize (/)
  (dcl_ComboBox_AddList PipeCalcs_InvertCalcs_MHSize "48" "60")
  (dcl_ComboBox_AddList PipeCalcs_InvertCalcs_ComboBox1 "70" "60")
)
Title: Re: Combo Box not Populated
Post by: Kerry on December 04, 2010, 07:09:32 PM
From help
(dcl_ComboBox_AddList PipeCalcs_InvertCalcs_MHSize NewItems [as List of Strings])


AND The event name in the code is not the same as the name in the dialog, so your dialog initialize event wasnt able to fing the defined name ..

try ..
Code (autolisp) Select


(command "_opendcl")

(defun c:Invertest ()
 (dcl_project_load "pipecalcs" T)
 (dcl_form_show pipecalcs_invertcalcs)
)


;; (defun c:PipeCalcs_InvertCalcs_OnInitialize (/)
;; (defun c:PipeInvertCalc_InvertCalcs_OnInitialize ()
(defun c:PipeCalcs_InvertCalcs_OnInitialize (/)

(setq index  (dcl_ComboBox_AddList PipeCalcs_InvertCalcs_MHSize (list "48" "60")))
 (dcl_ComboBox_AddList PipeCalcs_InvertCalcs_ComboBox1 (list "70" "60"))
)
Title: Re: Combo Box not Populated
Post by: Kerry on December 04, 2010, 07:16:35 PM
OR better still, deselect and reselect the event toggle in the odcl editor so that the event is named to match the fileName_controlName_Action

Note: there is a command on the Toolbar->Tools->Reset Event Names which does the same thing for ALL controls.

MisNamed events is one of the most frequent design errors in ODCL, and usually the first place to look :)
Title: Re: Combo Box not Populated
Post by: CouchPotato on December 05, 2010, 01:38:06 PM
I thought I had done the reload of the commands from the control browser but apparently not enough of them.  All seems to be well, for now.  I'm sure I will be back for more.  Thanks again,
Title: Re: Combo Box not Populated
Post by: Kerry on December 05, 2010, 06:18:36 PM

You're welcome :)

Have fun !!