INITIALIZE a COMBO-BOX with STYLE = "4 - Colors"

Started by domenicomaria, February 07, 2024, 08:47:23 AM

Previous topic - Next topic

domenicomaria

How to INITIALIZE a
COMBO-BOX with STYLE = "4 - Colors"
to a SPECIFIC INITIAL COLOR?

DCL-COMBOBOX-SETCURSEL wants an INTEGER

and this doesn't work
with this type of COMBO-BOX

domenicomaria

Quote from: domenicomaria on February 07, 2024, 09:29:26 AM(defun =><=  (valx start-val end-val) (and (>= valx start-val) (<= valx end-val)))

(if(=><= col-no 0 7)
   (dcl-combobox-setcursel ctrl-name (+ col-no 1) )
   (progn
      (dcl-ComboBox-AddColor  ctrl-name col-no)
      (dcl-combobox-setcursel ctrl-name 0)
   )
)

this works

the previuos it is wrong !

(defun DCL-COMBOBOX-COLOR-INIT ( ctrl-name col-no / col-pos )
(if(not (setq col-pos (dcl-ComboBox-FindColor ctrl-name col-no) ) )
(progn
(dcl-ComboBox-AddColor ctrl-name col-no )
(setq col-pos (dcl-ComboBox-FindColor ctrl-name col-no) )
)
)
(dcl-combobox-setcursel ctrl-name col-pos )
)

while this one seems to be good !