import arcpy import pythonaddins class ComboBoxClass1(object): """Implementation for Comboboxes_addin.combobox (ComboBox)""" def __init__(self): self.items = ["Forestry", "OW", "Urban", "Fire", "ED/PR", "PD", "Media"] self.editable = True self.enabled = True self.dropdownWidth = 'WWWWWWWWW' self.width = 'WWWWWWWWWWWW' def onSelChange(self, selection): if selection == "Forestry": combobox_1.items = ["SP", "SPR", "MP", "AR", "ARO", "ATF", "ATN", "ACF", "TT", "RC", "RV", "AIR", "AP", "FHS", "FSU", "BMP"] combobox_1.value = combobox_1.items[0] combobox_1.refresh() elif selection == "OW": combobox_1.items = ["AOS", "AO", "AIO", "PO", "TGO", "TRO"] combobox_1.value = combobox_1.items[0] combobox_1.refresh() def onEditChange(self, text): itemsarray = [" ", "Forestry", "OW", "Urban", "Fire", "ED/PR", "PD", "Media"] if text not in itemsarray: combobox_1.items = [""] combobox_1.value = combobox_1.items[0] combobox_1.refresh() pythonaddins.MessageBox("Please use only the items listed in the dropdown", "Warning", 0) combobox.value = " " def onFocus(self, focused): pass def onEnter(self): pass def refresh(self): pass class ComboBoxClass2(object): """Implementation for Comboboxes_addin.combobox_1 (ComboBox)""" def __init__(self): self.items = [" ", " ", "", " ", "", "", "", "", "", "", "", "", "", "", "", ""] self.editable = True self.enabled = True self.dropdownWidth = 'WWWWWW' self.width = 'WWWWWW' self.refresh() def onSelChange(self, selection): self.refresh() def onEditChange(self, text): pass def onFocus(self, focused): self.refresh() def onEnter(self): pass def refresh(self): pass
Hi,
did you get a solution fo this ?
best regards,
Guillaume