Bläddra i källkod

fix combobox size

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38053 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 16 år sedan
förälder
incheckning
6e2bbfff90
1 ändrade filer med 7 tillägg och 6 borttagningar
  1. 7 6
      gui/wxpython/gui_modules/prompt.py

+ 7 - 6
gui/wxpython/gui_modules/prompt.py

@@ -220,7 +220,7 @@ class PromptListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
         listmix.ListCtrlAutoWidthMixin.__init__(self)
         
 class TextCtrlAutoComplete(wx.ComboBox, listmix.ColumnSorterMixin):
-    def __init__ (self, parent, statusbar, 
+    def __init__ (self, parent, statusbar,
                   id = wx.ID_ANY, choices = [], **kwargs):
         """!Constructor works just like wx.TextCtrl except you can pass in a
         list of choices.  You can also change the choice list at any time
@@ -236,7 +236,7 @@ class TextCtrlAutoComplete(wx.ComboBox, listmix.ColumnSorterMixin):
             kwargs['style'] = wx.TE_PROCESS_ENTER
         
         wx.ComboBox.__init__(self, parent, id, **kwargs)
-
+        
         # some variables
         self._choices = choices
         self._hideOnNoMatch = True
@@ -269,14 +269,15 @@ class TextCtrlAutoComplete(wx.ComboBox, listmix.ColumnSorterMixin):
             self._choicesMap[type] = grass.list_strings(type = type[:4])
         # first search for GRASS module
         self.SetChoices(self._choicesCmd)
-
+        
+        self.SetMinSize(self.GetSize())
         # read history
         self.SetHistoryItems()
         
         # bindings...
-        self.Bind(wx.EVT_KILL_FOCUS, self.OnControlChanged, self)
-        self.Bind(wx.EVT_TEXT, self.OnEnteredText, self)
-        self.Bind(wx.EVT_KEY_DOWN , self.OnKeyDown, self)
+        self.Bind(wx.EVT_KILL_FOCUS, self.OnControlChanged)
+        self.Bind(wx.EVT_TEXT, self.OnEnteredText)
+        self.Bind(wx.EVT_KEY_DOWN , self.OnKeyDown)
 
         # if need drop down on left click
         self.dropdown.Bind(wx.EVT_LISTBOX , self.OnListItemSelected, self.dropdownlistbox)