Layer Combo Box - multiple entries

Started by Peter2 · 2016-06-10 10:58 UTC · 4 replies · SMF topic #2377

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.

    (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)
    )
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
author=Tharwat link=topic=2377.msg11909#msg11909 date=1465578955 wrote:
... 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, ....
author=Peter2 link=topic=2377.msg11910#msg11910 date=1465585782 wrote:
I will try, but at the moment I have to search the right place for the code: when loading, when closing, ....


author=Tharwat link=topic=2377.msg11909#msg11909 date=1465578955 wrote:
you can clear the comboBox at the start up to avoid duplicates ..........
It's a bit of a risky change that could have unintended consequences, but I think this is now fixed for the next build.