Layer Combo Box - multiple entries

Started by Peter2, June 10, 2016, 03:58:05 AM

Previous topic - Next topic

Peter2

I have a Layer Combo Box (style 13), and every time I start the dialogue the layer list is "doubled" - after three starts of dialogue I have 3 times Layer 0, 3 times layer Defpoints, .....

At the moment I don't see where it is coming from - the only code which is related to the list is
a) where I select an entry from the list and save the value
b) select an entry based of an existing value.

The detection of the layer is done by OpenDCL.

Code (autolisp) Select
    (setq lst_layer             (dcl-ComboBox-GetLBText Formator/main/lst_layer (dcl-ComboBox-GetCurSel Formator/main/lst_layer)))
......
    (if (and lst_layer
             (tblsearch "layer" lst_layer))
        (dcl-ComboBox-SetCurSel Formator/main/lst_layer (dcl-ComboBox-FindString Formator/main/lst_layer lst_layer))
        (dcl-ComboBox-SetCurSel Formator/main/lst_layer 0)
    )
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

Tharwat

Hi,

I already faced this problem before so you can clear the comboBox at the start up to avoid duplicates with the use of function: dcl-ComboBox-Clear

Peter2

Quote from: Tharwat on June 10, 2016, 10:15:55 AM
... with the use of function: dcl-ComboBox-Clear
I will try, but at the moment I have to search the right place for the code: when loading, when closing, ....
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

Tharwat

Quote from: Peter2 on June 10, 2016, 12:09:42 PM
I will try, but at the moment I have to search the right place for the code: when loading, when closing, ....

Quote from: Tharwat on June 10, 2016, 10:15:55 AM
you can clear the comboBox at the start up to avoid duplicates ..........

owenwengerd

It's a bit of a risky change that could have unintended consequences, but I think this is now fixed for the next build.