]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/_core.py
Little tweaks to match recent CVS changes.
[wxWidgets.git] / wxPython / src / msw / _core.py
index 0ba42d94c4a5f01f10b7d93a9d5a824b6940ceb3..ff910a841feb01845e8243b1302166f09b15242e 100644 (file)
@@ -3376,6 +3376,20 @@ class MouseEvent(Event):
         """ShiftDown(self) -> bool"""
         return _core_.MouseEvent_ShiftDown(*args, **kwargs)
 
+    def CmdDown(*args, **kwargs):
+        """
+        CmdDown(self) -> bool
+
+        "Cmd" is a pseudo key which is the same as Control for PC and Unix
+        platforms but the special "Apple" (a.k.a as "Command") key on
+        Macs: it makes often sense to use it instead of, say, `ControlDown`
+        because Cmd key is used for the same thing under Mac as Ctrl
+        elsewhere. The Ctrl still exists, it's just not used for this
+        purpose. So for non-Mac platforms this is the same as `ControlDown`
+        and Macs this is the same as `MetaDown`.
+        """
+        return _core_.MouseEvent_CmdDown(*args, **kwargs)
+
     def LeftDown(*args, **kwargs):
         """LeftDown(self) -> bool"""
         return _core_.MouseEvent_LeftDown(*args, **kwargs)
@@ -3572,6 +3586,20 @@ class KeyEvent(Event):
         """ShiftDown(self) -> bool"""
         return _core_.KeyEvent_ShiftDown(*args, **kwargs)
 
+    def CmdDown(*args, **kwargs):
+        """
+        CmdDown(self) -> bool
+
+        "Cmd" is a pseudo key which is the same as Control for PC and Unix
+        platforms but the special "Apple" (a.k.a as "Command") key on
+        Macs: it makes often sense to use it instead of, say, `ControlDown`
+        because Cmd key is used for the same thing under Mac as Ctrl
+        elsewhere. The Ctrl still exists, it's just not used for this
+        purpose. So for non-Mac platforms this is the same as `ControlDown`
+        and Macs this is the same as `MetaDown`.
+        """
+        return _core_.KeyEvent_CmdDown(*args, **kwargs)
+
     def HasModifiers(*args, **kwargs):
         """HasModifiers(self) -> bool"""
         return _core_.KeyEvent_HasModifiers(*args, **kwargs)
@@ -3581,10 +3609,11 @@ class KeyEvent(Event):
         return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
 
     KeyCode = GetKeyCode 
-    def GetUniChar(*args, **kwargs):
-        """GetUniChar(self) -> int"""
-        return _core_.KeyEvent_GetUniChar(*args, **kwargs)
+    def GetUnicodeKey(*args, **kwargs):
+        """GetUnicodeKey(self) -> int"""
+        return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
 
+    GetUniChar = GetUnicodeKey 
     def GetRawKeyCode(*args, **kwargs):
         """GetRawKeyCode(self) -> unsigned int"""
         return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
@@ -5002,6 +5031,8 @@ class PyOnDemandOutputWindow:
     def __init__(self, title = "wxPython: stdout/stderr"):
         self.frame  = None
         self.title  = title
+        self.pos    = wx.DefaultPosition
+        self.size   = (450, 300)
         self.parent = None
 
     def SetParent(self, parent):
@@ -5010,12 +5041,11 @@ class PyOnDemandOutputWindow:
 
 
     def CreateOutputWindow(self, st):
-        self.frame = wx.Frame(self.parent, -1, self.title,
-                              style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
+        self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
+                              style=wx.DEFAULT_FRAME_STYLE)
         self.text  = wx.TextCtrl(self.frame, -1, "",
-                                 style = wx.TE_MULTILINE | wx.TE_READONLY)
+                                 style=wx.TE_MULTILINE|wx.TE_READONLY)
         self.text.AppendText(st)
-        self.frame.SetSize((450, 300))
         self.frame.Show(True)
         EVT_CLOSE(self.frame, self.OnCloseWindow)
         
@@ -5051,6 +5081,10 @@ class PyOnDemandOutputWindow:
             wx.CallAfter(self.frame.Close)
 
 
+    def flush(self):
+        pass
+    
+
 
 #----------------------------------------------------------------------
 
@@ -5189,6 +5223,21 @@ your Mac."""
         _sys.stdout, _sys.stderr = self.saveStdio
 
 
+    def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
+        """
+        Set the title, position and/or size of the output window if
+        the stdio has been redirected.
+        """
+        if self.stdioWin:
+            if title is not None:
+                self.stdioWin.title = title
+            if pos is not None:
+                self.stdioWin.pos = pos
+            if size is not None:
+                self.stdioWin.size = size
+            
+
+
 
 # change from wx.PyApp_XX to wx.App_XX
 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
@@ -5838,6 +5887,26 @@ class Window(EvtHandler):
         """
         return _core_.Window_GetBestSizeTuple(*args, **kwargs)
 
+    def InvalidateBestSize(*args, **kwargs):
+        """
+        InvalidateBestSize(self)
+
+        Reset the cached best size value so it will be recalculated the next
+        time it is needed.
+        """
+        return _core_.Window_InvalidateBestSize(*args, **kwargs)
+
+    def GetBestFittingSize(*args, **kwargs):
+        """
+        GetBestFittingSize(self) -> Size
+
+        This function will merge the window's best size into the window's
+        minimum size, giving priority to the min size components, and returns
+        the results.
+
+        """
+        return _core_.Window_GetBestFittingSize(*args, **kwargs)
+
     def GetAdjustedBestSize(*args, **kwargs):
         """
         GetAdjustedBestSize(self) -> Size
@@ -6254,6 +6323,30 @@ class Window(EvtHandler):
         """
         return _core_.Window_Navigate(*args, **kwargs)
 
+    def MoveAfterInTabOrder(*args, **kwargs):
+        """
+        MoveAfterInTabOrder(self, Window win)
+
+        Moves this window in the tab navigation order after the specified
+        sibling window.  This means that when the user presses the TAB key on
+        that other window, the focus switches to this window.
+
+        The default tab order is the same as creation order.  This function
+        and `MoveBeforeInTabOrder` allow to change it after creating all the
+        windows.
+
+        """
+        return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
+
+    def MoveBeforeInTabOrder(*args, **kwargs):
+        """
+        MoveBeforeInTabOrder(self, Window win)
+
+        Same as `MoveAfterInTabOrder` except that it inserts this window just
+        before win instead of putting it right after it.
+        """
+        return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
+
     def GetChildren(*args, **kwargs):
         """
         GetChildren(self) -> PyObject
@@ -6795,9 +6888,9 @@ class Window(EvtHandler):
         """
         return _core_.Window_SetBackgroundColour(*args, **kwargs)
 
-    def SetDefaultBackgroundColour(*args, **kwargs):
-        """SetDefaultBackgroundColour(self, Colour colour)"""
-        return _core_.Window_SetDefaultBackgroundColour(*args, **kwargs)
+    def SetOwnBackgroundColour(*args, **kwargs):
+        """SetOwnBackgroundColour(self, Colour colour)"""
+        return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
 
     def SetForegroundColour(*args, **kwargs):
         """
@@ -6810,9 +6903,9 @@ class Window(EvtHandler):
         """
         return _core_.Window_SetForegroundColour(*args, **kwargs)
 
-    def SetDefaultForegroundColour(*args, **kwargs):
-        """SetDefaultForegroundColour(self, Colour colour)"""
-        return _core_.Window_SetDefaultForegroundColour(*args, **kwargs)
+    def SetOwnForegroundColour(*args, **kwargs):
+        """SetOwnForegroundColour(self, Colour colour)"""
+        return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
 
     def GetBackgroundColour(*args, **kwargs):
         """
@@ -6860,9 +6953,9 @@ class Window(EvtHandler):
         """
         return _core_.Window_SetFont(*args, **kwargs)
 
-    def SetDefaultFont(*args, **kwargs):
-        """SetDefaultFont(self, Font font)"""
-        return _core_.Window_SetDefaultFont(*args, **kwargs)
+    def SetOwnFont(*args, **kwargs):
+        """SetOwnFont(self, Font font)"""
+        return _core_.Window_SetOwnFont(*args, **kwargs)
 
     def GetFont(*args, **kwargs):
         """
@@ -7344,7 +7437,7 @@ class Window(EvtHandler):
         By 'intelligently' the following is meant: by default, all windows use
         their own default attributes. However if some of the parent's
         attributes are explicitly changed (that is, using SetFont and not
-        SetDefaultFont) and if the corresponding attribute hadn't been
+        SetOwnFont) and if the corresponding attribute hadn't been
         explicitly set for this window itself, then this window takes the same
         value as used by the parent. In addition, if the window overrides
         ShouldInheritColours to return false, the colours will not be changed
@@ -8250,27 +8343,21 @@ class Control(Window):
         """
         return _core_.Control_SetLabel(*args, **kwargs)
 
-    def GetAdjustMinSizeFlag(*args, **kwargs):
-        """
-        GetAdjustMinSizeFlag(self) -> bool
-
-        Returns whether the minsize should be adjusted for this control when
-        `SetLabel` or `SetFont` are called.
+    def GetClassDefaultAttributes(*args, **kwargs):
         """
-        return _core_.Control_GetAdjustMinSizeFlag(*args, **kwargs)
+        GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
 
-    def SetAdjustMinSizeFlag(*args, **kwargs):
-        """
-        SetAdjustMinSizeFlag(self, bool adjust)
+        Get the default attributes for this class.  This is useful if you want
+        to use the same font or colour in your own control as in a standard
+        control -- which is a much better idea than hard coding specific
+        colours or fonts which might look completely out of place on the
+        user's system, especially if it uses themes.
 
-        By default controls will readjust their size and minsize when
-        `SetLabel` or `SetFont` are called.  This flag will allow you to
-        control this behavior.
+        The variant parameter is only relevant under Mac currently and is
+        ignore under other platforms. Under Mac, it will change the size of
+        the returned font. See `wx.Window.SetWindowVariant` for more about
+        this.
         """
-        return _core_.Control_SetAdjustMinSizeFlag(*args, **kwargs)
-
-    def GetClassDefaultAttributes(*args, **kwargs):
-        """GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes"""
         return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
 
     GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
@@ -8294,7 +8381,20 @@ def PreControl(*args, **kwargs):
     return val
 
 def Control_GetClassDefaultAttributes(*args, **kwargs):
-    """Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes"""
+    """
+    Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
+
+    Get the default attributes for this class.  This is useful if you want
+    to use the same font or colour in your own control as in a standard
+    control -- which is a much better idea than hard coding specific
+    colours or fonts which might look completely out of place on the
+    user's system, especially if it uses themes.
+
+    The variant parameter is only relevant under Mac currently and is
+    ignore under other platforms. Under Mac, it will change the size of
+    the returned font. See `wx.Window.SetWindowVariant` for more about
+    this.
+    """
     return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
 
 #---------------------------------------------------------------------------
@@ -8567,6 +8667,15 @@ class SizerItem(Object):
         """
         return _core_.SizerItem_GetMinSize(*args, **kwargs)
 
+    def GetMinSizeWithBorder(*args, **kwargs):
+        """
+        GetMinSizeWithBorder(self) -> Size
+
+        Get the minimum size needed for the item with space for the borders
+        added, if needed.
+        """
+        return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
+
     def SetInitSize(*args, **kwargs):
         """SetInitSize(self, int x, int y)"""
         return _core_.SizerItem_SetInitSize(*args, **kwargs)
@@ -10477,7 +10586,7 @@ def CallAfter(callable, *args, **kw):
     :see: `wx.FutureCall`
     """
     app = wx.GetApp()
-    assert app, 'No wxApp created yet'
+    assert app is not None, 'No wx.App created yet'
 
     global _wxPyCallAfterId
     if _wxPyCallAfterId is None: