def __init__(self, parent = None): ReadBase.__init__(self, parent) # Generic read self.input = 0 self.index = 0 self.propNames = ["Input","Quantity"] self.is_input = True self.is_visible = True self.config = ["input","index"]
def edit_label(self, event, pos): ReadBase.edit_label(self, event, pos) if pos==1: event.Veto() br = self.host.GetBoundingRect(self.get_property_node(1)) w = ChoicePopup(self.host,-1,choices=self.inlist[self.input].qtynames,pos=br.GetPosition(), size=br.GetSize(), style=wx.CB_DROPDOWN|wx.CB_READONLY) w.SetSelection(self.index) w.Bind(wx.EVT_CHOICE,self.onSelectIndex) w.SetFocus() if wx.Platform == '__WXMSW__': w.Bind(wx.EVT_KILL_FOCUS,self.onSelectIndex)
def refresh(self): ReadBase.refresh(self) if self.index<0: self.index=0 if self.index>=len(self.inlist[self.input].qtynames): self.index = len(self.inlist[self.input].qtynames)-1
def __init__(self, parent = None): ReadBase.__init__(self, parent) self.is_visible = True