Hello to all and happy New Year:)
I am OpenDCL rookie and OpenDCL Runtime [7.0.0.2] does not work the way I want :oops:
What is wrong in my code:
(setq lst (list "A" "B" "C"))
(dcl_ComboBox_AddList MyComboBox lst)
returns an empty ComboBox list (???)
(dcl_ComboBox_AddList MyComboBox (list "A" "B" "C"))
works OK.
Who is making a mistake, me or OpenDCL Runtime?
Quote from: topograph on January 10, 2012, 06:05:48 AM
Who is making a mistake, me or OpenDCL Runtime?
The odds are not in your favor, but you'll need to provide more information (such as a simple .odcl file and .lsp) to demonstrate the problem.
Quote from: owenwengerd on January 10, 2012, 11:04:18 AM
The odds are not in your favor...
...as usual, when my lisps is not working well:)
I figured, both work well, I'm wrong because I do not know all the events and methods of the ComboBox control.
I tried to do this:
(defun C:test (/ cmdecho)
(setq cmdecho (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(command "_OPENDCL")
(dcl_Project_Load "D:\\MyProject.odcl")
(dcl_Form_Show Form1)
(setq lst1 (list "1" "2"))
(setq lst2 (list "a" "b" "c" "d"))
(setq lst3 (list "e" "f" "g" "h" "i"))
)
What is the next step?
Sorry for my bad lisp/OpenDCL, I am not programmer.
You did a good job of creating a simple example, except I think you forgot to include code that shows the actual problem.
Yes, I made a good job of simple example with copy/paste/edit method:), but I do not know next steps.
I tried this code but not working
(defun c:ComboBox1_OnSelChanged (ItemIndexOrCount Value /)
(cond
((= (dcl_ComboBox_GetEBText ComboBox1) (car lst1)) ;when I select 1st item
(dcl_ComboBox_AddList ComboBox2 lst2) ;I want to put members of the lst2 as items of ComboBox2
)
((= (dcl_ComboBox_GetEBText ComboBox1) (cadr lst1)) ;when I select 2nd item
(dcl_ComboBox_AddList ComboBox2 lst3) ;I want to put members of the lst3 as items of ComboBox2
)
)
)
I got result from the pictures so I put in the LIST Property of ComboBox2 (in Studio/Dialog Editor) content of lists lst2 and lst3 (with "|" separator") but my wish is to do this from my lisp.
Sorry for my "Google translator English" but I hope you understand me;)
Your English is fine. First, make sure the event name set in the .odcl matches the function name. Next, set your lst1, lst2, and lst3 variables *before* you call (dcl_Form_Show). Then, I think it will work as you expect.
By the way, I think that you probably want to use 'Value' instead of '(dcl_ComboBox_GetEBText ComboBox1)' in your event handler.
I hope that helps.
Yes, it works (I think I'll have to modify my lisp, but that's it). Thank you for your time Owen.