Arcpy addin editable textbox on tool bar

المشرف العام

Administrator
طاقم الإدارة
I would like to add an editable toolbox on an arcpy addin toolbar. This would be used to change values of a threshold but I don't think this is currently available. (What I would really like is a slider!)

My current work around is to use a combobox which does 80% of what I want it to do except display an initial value and update the displayed value when altered programatically. As can be seen in my code I have a + and - button that can change the value stored in the combo box items variable.

import arcpyimport pythonaddinsimport osclass decreaseBottom(object): """Implementation for alterRange.btn1 (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): firstBreak.items[0] -= 1 if firstBreak.items[0] < 0: firstBreak.items[0] = 0 firstBreak.refresh()class decreaseTop(object): """Implementation for alterRange.btn3 (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): firstBreak.items[0] += 1 if firstBreak.items[0] > 100: firstBreak.items[0] = 100 firstBreak.refresh()class firstBreak(object): """Implementation for alterRange.firstBreak (ComboBox)""" def __init__(self): self.items = [30] self.editable = True self.enabled = True self.dropdownWidth = 'WWWWWW' self.width = 'WWWWWW' def onSelChange(self, selection): pass def onEditChange(self, text): pass def onFocus(self, focused): pass def onEnter(self): pass def refresh(self): passIs there a variable in the __init__ of the combo box that can do this?



أكثر...
 
أعلى