Getting Color index >7 in Combo box - Color

Started by copter · 2009-05-27 20:35 UTC · 3 replies · SMF topic #772

Hello

I can set a color to a Combo box:
(defun set_color (ctrl coul)
  (if (not (dcl_ComboBox_FindColor mycbox color))
    (dcl_ComboBox_AddColor mycbox color)
  ) 
  (dcl_ComboBox_SetCurSel mycbox (dcl_ComboBox_FindColor mycbox color))
)
Now I want to write a get_color function.
But how can I get the acad color index, when the color index is > 7 ?
I tried with (dcl_ComboBox_GetEBText mycbox) but how can I manage the results since ODCL is localized ?
I mean "Color 130" can be "Couleur 130" and 'Green" can be "Vert" or "Grün" and so on ...
Thanks for your help !
Copter
Try the (dcl_ComboBox_GetItemData) function. This should return the AutoCAD color number.
I tried it:
dcl_Control_GetItemData returns nil while dcl_ComboBox_GetCurSel returns 0 and dcl_ComboBox_GetEBText returns "Color 130" ...
Any idea ?
OK I get it:
(dcl_ComboBox_GetItemData Mycbox ItemIndex) -> It works now !

Thanks for your help !