]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/masked/maskededit.py
reSWIGged
[wxWidgets.git] / wxPython / wx / lib / masked / maskededit.py
index 3bde5a3ca58ac9e7b5e53d425f924a64388a3a08..ec0d1de1fc4f53bf394626bee5c70577bb4899f6 100644 (file)
@@ -1915,9 +1915,8 @@ class MaskedEditMixin:
 
             if self._autofit:
 ##                dbg('setting client size to:', self._CalcSize())
-                size = self._CalcSize()
-                self.SetSizeHints(size)
-                self.SetClientSize(size)
+                self.SetClientSize(self._CalcSize())
+                self.SetSizeHints(self.GetSize())
 
             # Set value/type-specific formatting
             self._applyFormatting()
@@ -1992,9 +1991,8 @@ class MaskedEditMixin:
                 self._SetInitialValue()
 
                 if self._autofit:
-                    size = self._CalcSize()
-                    self.SetSizeHints(size)
-                    self.SetClientSize(size)
+                    self.SetClientSize(self._CalcSize())
+                    self.SetSizeHints(self.GetSize())
 
             # Set value/type-specific formatting
             self._applyFormatting()
@@ -3091,7 +3089,7 @@ class MaskedEditMixin:
     def _OnCtrl_A(self,event=None):
         """ Handles ctrl-a keypress in control. Should return False to skip other processing. """
         end = self._goEnd(getPosOnly=True)
-        if not event or event.ShiftDown():
+        if not event or (isinstance(event, wx.KeyEvent) and event.ShiftDown()):
             wx.CallAfter(self._SetInsertionPoint, 0)
             wx.CallAfter(self._SetSelection, 0, self._masklength)
         else: