]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/mac/_core.py
reSWIGged
[wxWidgets.git] / wxPython / src / mac / _core.py
index e19c4d08065c18defb477cb9c86a17eb4d48ae0f..a6ed1991e3bbc86820af92ba9a40b75c278118a4 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
@@ -5671,6 +5720,15 @@ class Window(EvtHandler):
         """
         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)
@@ -5829,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
@@ -6772,22 +6850,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
-        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
-        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.
 
-        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)
 
-    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):
         """
@@ -6800,9 +6879,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):
         """
@@ -6850,9 +6929,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):
         """
@@ -7321,7 +7400,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
@@ -8495,6 +8574,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)
@@ -10405,7 +10493,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: