]> 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 90b1f7df19094aee086b72ea0ef113f0f7f6538c..ff910a841feb01845e8243b1302166f09b15242e 100644 (file)
@@ -3376,6 +3376,20 @@ class MouseEvent(Event):
         """ShiftDown(self) -> bool"""
         return _core_.MouseEvent_ShiftDown(*args, **kwargs)
 
         """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)
     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)
 
         """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)
     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 
         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)
     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
     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):
         self.parent = None
 
     def SetParent(self, parent):
@@ -5010,12 +5041,11 @@ class PyOnDemandOutputWindow:
 
 
     def CreateOutputWindow(self, st):
 
 
     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, "",
         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.text.AppendText(st)
-        self.frame.SetSize((450, 300))
         self.frame.Show(True)
         EVT_CLOSE(self.frame, self.OnCloseWindow)
         
         self.frame.Show(True)
         EVT_CLOSE(self.frame, self.OnCloseWindow)
         
@@ -5051,6 +5081,10 @@ class PyOnDemandOutputWindow:
             wx.CallAfter(self.frame.Close)
 
 
             wx.CallAfter(self.frame.Close)
 
 
+    def flush(self):
+        pass
+    
+
 
 #----------------------------------------------------------------------
 
 
 #----------------------------------------------------------------------
 
@@ -5189,6 +5223,21 @@ your Mac."""
         _sys.stdout, _sys.stderr = self.saveStdio
 
 
         _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
 
 # change from wx.PyApp_XX to wx.App_XX
 App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
@@ -5671,6 +5720,15 @@ class Window(EvtHandler):
         """
         return _core_.Window_MoveXY(*args, **kwargs)
 
         """
         return _core_.Window_MoveXY(*args, **kwargs)
 
+    def SetBestFittingSize(*args, **kwargs):
+        """
+        SetBestFittingSize(self, Size size=DefaultSize)
+
+        A 'Smart' SetSize that will fill in default size components with the
+        window's *best size* values.  Also set's the minsize for use with sizers.
+        """
+        return _core_.Window_SetBestFittingSize(*args, **kwargs)
+
     def Raise(*args, **kwargs):
         """
         Raise(self)
     def Raise(*args, **kwargs):
         """
         Raise(self)
@@ -5829,6 +5887,26 @@ class Window(EvtHandler):
         """
         return _core_.Window_GetBestSizeTuple(*args, **kwargs)
 
         """
         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
     def GetAdjustedBestSize(*args, **kwargs):
         """
         GetAdjustedBestSize(self) -> Size
@@ -6245,6 +6323,30 @@ class Window(EvtHandler):
         """
         return _core_.Window_Navigate(*args, **kwargs)
 
         """
         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
     def GetChildren(*args, **kwargs):
         """
         GetChildren(self) -> PyObject
@@ -6772,22 +6874,23 @@ class Window(EvtHandler):
         Sets the background colour of the window.  Returns True if the colour
         was changed.  The background colour is usually painted by the default
         EVT_ERASE_BACKGROUND event handler function under Windows and
         Sets the background colour of the window.  Returns True if the colour
         was changed.  The background colour is usually painted by the default
         EVT_ERASE_BACKGROUND event handler function under Windows and
-        automatically under GTK.
+        automatically under GTK.  Using `wx.NullColour` will reset the window
+        to the default background colour.
 
         Note that setting the background colour may not cause an immediate
 
         Note that setting the background colour may not cause an immediate
-        refresh, so you may wish to call ClearBackground or Refresh after
+        refresh, so you may wish to call `ClearBackground` or `Refresh` after
         calling this function.
 
         calling this function.
 
-        Use this function with care under GTK+ as the new appearance of the
-        window might not look equally well when used with themes, i.e GTK+'s
-        ability to change its look as the user wishes with run-time loadable
-        modules.
+        Using this function will disable attempts to use themes for this
+        window, if the system supports them.  Use with care since usually the
+        themes represent the appearance chosen by the user to be used for all
+        applications on the system.
         """
         return _core_.Window_SetBackgroundColour(*args, **kwargs)
 
         """
         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):
         """
 
     def SetForegroundColour(*args, **kwargs):
         """
@@ -6800,9 +6903,9 @@ class Window(EvtHandler):
         """
         return _core_.Window_SetForegroundColour(*args, **kwargs)
 
         """
         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):
         """
 
     def GetBackgroundColour(*args, **kwargs):
         """
@@ -6850,9 +6953,9 @@ class Window(EvtHandler):
         """
         return _core_.Window_SetFont(*args, **kwargs)
 
         """
         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):
         """
 
     def GetFont(*args, **kwargs):
         """
@@ -7334,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
         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
         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
@@ -8241,7 +8344,20 @@ class Control(Window):
         return _core_.Control_SetLabel(*args, **kwargs)
 
     def GetClassDefaultAttributes(*args, **kwargs):
         return _core_.Control_SetLabel(*args, **kwargs)
 
     def GetClassDefaultAttributes(*args, **kwargs):
-        """GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes"""
+        """
+        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)
 
     GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
         return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
 
     GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
@@ -8265,7 +8381,20 @@ def PreControl(*args, **kwargs):
     return val
 
 def Control_GetClassDefaultAttributes(*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)
 
 #---------------------------------------------------------------------------
     return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
 
 #---------------------------------------------------------------------------
@@ -8538,6 +8667,15 @@ class SizerItem(Object):
         """
         return _core_.SizerItem_GetMinSize(*args, **kwargs)
 
         """
         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)
     def SetInitSize(*args, **kwargs):
         """SetInitSize(self, int x, int y)"""
         return _core_.SizerItem_SetInitSize(*args, **kwargs)
@@ -10448,7 +10586,7 @@ def CallAfter(callable, *args, **kw):
     :see: `wx.FutureCall`
     """
     app = wx.GetApp()
     :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:
 
     global _wxPyCallAfterId
     if _wxPyCallAfterId is None: