Combo Box not Populated

Started by CouchPotato, December 04, 2010, 04:35:41 PM

Previous topic - Next topic

CouchPotato

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

Kerry

#1
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"))
)
Perfection is not optional.
My other home is TheSwamp

Kerry

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 :)
Perfection is not optional.
My other home is TheSwamp

CouchPotato

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,

Kerry

Perfection is not optional.
My other home is TheSwamp