OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: awybo on April 11, 2014, 06:59:01 AM

Title: Adding Items to a Layer Combo Box
Post by: awybo on April 11, 2014, 06:59:01 AM
Hi guys,

I'm wondering if there is a way to add an entry to a layer combo box (a combo box whose style is 13).

The addlist and addstring methods don't seem to work on a "layer-styled" combobox (which may be intentional?).

Here is why I want to do this:

The built in layer-styled combobox works great but I would like to add in one more item which will be something like "Current". This is part of a configuration menu for a module and if "Current" is selected then later in the code the program will use whatever layer is current when it needs a target layer.

Maybe you have some insight on a better way to do this or have done something similar in the past?
Title: Re: Adding Items to a Layer Combo Box
Post by: Fred Tomke on April 11, 2014, 07:01:18 AM
Have you already tested dcl-ComboBox-AddString method?
Regards, Fred
Title: Re: Adding Items to a Layer Combo Box
Post by: owenwengerd on April 11, 2014, 07:23:23 AM
The current implementation is designed to keep the combo contents synchronized with the layers in the active drawing. I have an idea though, and will look at how AddString could be supported.
Title: Re: Adding Items to a Layer Combo Box
Post by: awybo on April 11, 2014, 10:22:45 AM
Yep, I tested dcl_ComboBox_AddString and dcl_ComboBox_AddList. I use these two methods elsewhere for non layer-type combo box and they work great. It is only with the layer-type combo box that they don't seem to have any effect. Thanks for looking into this.
Title: Re: Adding Items to a Layer Combo Box
Post by: Kerry on June 10, 2016, 01:14:02 AM
Quote from: owenwengerd on April 11, 2014, 07:23:23 AM
The current implementation is designed to keep the combo contents synchronized with the layers in the active drawing. I have an idea though, and will look at how AddString could be supported.

Any joy with this Owen, I'd really like to have control over the layer names that are displayed.
ie : pass a filtered list of names to the control and only have those display.
Title: Re: Adding Items to a Layer Combo Box
Post by: owenwengerd on July 01, 2016, 06:56:01 PM
Quote from: Kerry on June 10, 2016, 01:14:02 AM
Any joy with this Owen, I'd really like to have control over the layer names that are displayed.
ie : pass a filtered list of names to the control and only have those display.

I haven't had time to test, but I'm pretty sure you can now add items to the list, and these are preserved when the list is repopulated. I'm not so sure about deleting items. I guess you probably can delete items, but I'm not sure how complicated it is to keep the unwanted items out as the list is automatically repopulated on document activation changes or changes in the active document layer table.