REMOVE ByLayer and ByBlock items from the COLOR COMBO BOX

Started by domenicomaria · 2024-03-18 06:57 UTC · 2 replies · SMF topic #2918

;         -         -         -         -         -         -         -         -         -         -         -
(defun :DCL-COMBOBOX-COLOR-INIT (prj-name frm-name ctrl-key col-no bylyr-byblk / col-pos 0-clr-nth 256-clr-nth )
 
  (if(not bylyr-byblk)
      (progn
        (if(setq 0-clr-nth  (dcl-ComboBox-FindColor prj-name frm-name ctrl-key 0  ) )
            (dcl-combobox-deleteitem prj-name frm-name ctrl-key 0-clr-nth  )
        )
        (if(setq 256-clr-nth (dcl-ComboBox-FindColor prj-name frm-name ctrl-key 256 ) )
            (dcl-combobox-deleteitem prj-name frm-name ctrl-key 256-clr-nth )
        )
      )
  )
 
  (if(not (setq col-pos (dcl-ComboBox-FindColor prj-name frm-name ctrl-key col-no) ) )
      (progn
        (dcl-ComboBox-AddColor    prj-name frm-name ctrl-key col-no )
        (setq col-pos (dcl-ComboBox-FindColor prj-name frm-name ctrl-key col-no) )
      )
  )
  (dcl-combobox-setcursel prj-name frm-name ctrl-key col-pos )
)



I want REMOVE ByLayer and ByBlock items from the COLOR COMBO BOX

dcl-combobox-deleteitem returns T but doesnt remove anything !

where am I wrong ?

The color combo is implemented by the host app, so its behavior is not necessarily controlled by OpenDCL. However, I just checked a color combo box with the Combo Box Lab sample, and there I am able to delete the ByBlock and ByLayer list items in both BricsCAD V24 and Acad 2024.
Yes

I can remove byBlock and ByLayer

but when I choose "select color"

immediately after
byBlock and ByLayer
are automatically added to the list again