OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Peter2 on June 10, 2016, 03:58:05 AM

Title: Layer Combo Box - multiple entries
Post by: Peter2 on June 10, 2016, 03:58:05 AM
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)
    )
Title: Re: Layer Combo Box - multiple entries
Post by: Tharwat on June 10, 2016, 10:15:55 AM
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
Title: Re: Layer Combo Box - multiple entries
Post by: Peter2 on June 10, 2016, 12:09:42 PM
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, ....
Title: Re: Layer Combo Box - multiple entries
Post by: Tharwat on June 10, 2016, 12:14:17 PM
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 ..........
Title: Re: Layer Combo Box - multiple entries
Post by: owenwengerd on July 01, 2016, 08:58:25 PM
It's a bit of a risky change that could have unintended consequences, but I think this is now fixed for the next build.