Skip to content

Commit

Permalink
fixing #203
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddao committed Jun 28, 2016
1 parent 22557e9 commit 993dec4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cpa/classifier.py
Expand Up @@ -1818,10 +1818,12 @@ def SetupFetchFromGroupSizer(self, group):
validVals = [str(col) for col in validVals]
if group == 'image' or fieldTypes[i] == int or fieldTypes[i] == long:
fieldInp = wx.TextCtrl(self.fetch_panel, -1, value=validVals[0], size=(80, -1))
fieldInp.SetSelection(-1,-1) # Fix #203, textCtrl has different API since wx3
else:
fieldInp = wx.Choice(self.fetch_panel, -1, size=(80, -1),
choices=['__ANY__'] + validVals)
fieldInp.SetSelection(0)
fieldInp.SetSelection(0)

validVals = ['__ANY__'] + validVals
# Create and bind to a text Validator
def ValidateGroupField(evt, validVals=validVals):
Expand Down Expand Up @@ -1879,7 +1881,8 @@ def GetGroupKeyFromGroupSizer(self, group=None):
groupKey = []
for input, ftype in zip(self.groupInputs, fieldTypes):
# GetValue returns unicode from ComboBox, but we need a string
val = str(input.GetStringSelection())
#val = str(input.GetStringSelection())
val = str(input.Value) # Fix issue #203
# if the value is blank, don't bother typing it, it is a wildcard
if val != '__ANY__':
val = ftype(val)
Expand Down

0 comments on commit 993dec4

Please sign in to comment.