]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/mac/_misc.py
forward declare wxPyTaskBarIcon
[wxWidgets.git] / wxPython / src / mac / _misc.py
index a8e6ecea5e13c0273501f75dca1904e3f0a6118f..38bbef794f9f209f417ae2a1c70928fc3eee94e5 100644 (file)
@@ -205,6 +205,8 @@ class SystemOptionsPtr(SystemOptions):
         if not hasattr(self,"thisown"): self.thisown = 0
         self.__class__ = SystemOptions
 _misc_.SystemOptions_swigregister(SystemOptionsPtr)
+cvar = _misc_.cvar
+WINDOW_DEFAULT_VARIANT = cvar.WINDOW_DEFAULT_VARIANT
 
 def SystemOptions_SetOption(*args, **kwargs):
     """SystemOptions_SetOption(String name, String value)"""
@@ -241,6 +243,18 @@ def GetCurrentId(*args, **kwargs):
     """GetCurrentId() -> long"""
     return _misc_.GetCurrentId(*args, **kwargs)
 
+def IsStockID(*args, **kwargs):
+    """IsStockID(int id) -> bool"""
+    return _misc_.IsStockID(*args, **kwargs)
+
+def IsStockLabel(*args, **kwargs):
+    """IsStockLabel(int id, String label) -> bool"""
+    return _misc_.IsStockLabel(*args, **kwargs)
+
+def GetStockLabel(*args, **kwargs):
+    """GetStockLabel(int id) -> String"""
+    return _misc_.GetStockLabel(*args, **kwargs)
+
 def Bell(*args, **kwargs):
     """Bell()"""
     return _misc_.Bell(*args, **kwargs)
@@ -295,9 +309,14 @@ def Sleep(*args, **kwargs):
     """Sleep(int secs)"""
     return _misc_.Sleep(*args, **kwargs)
 
-def Usleep(*args, **kwargs):
-    """Usleep(unsigned long milliseconds)"""
-    return _misc_.Usleep(*args, **kwargs)
+def MilliSleep(*args, **kwargs):
+    """MilliSleep(unsigned long milliseconds)"""
+    return _misc_.MilliSleep(*args, **kwargs)
+
+def MicroSleep(*args, **kwargs):
+    """MicroSleep(unsigned long microseconds)"""
+    return _misc_.MicroSleep(*args, **kwargs)
+Usleep = MilliSleep 
 
 def EnableTopLevelWindows(*args, **kwargs):
     """EnableTopLevelWindows(bool enable)"""
@@ -527,7 +546,6 @@ class MutexGuiLockerPtr(MutexGuiLocker):
         if not hasattr(self,"thisown"): self.thisown = 0
         self.__class__ = MutexGuiLocker
 _misc_.MutexGuiLocker_swigregister(MutexGuiLockerPtr)
-cvar = _misc_.cvar
 FileSelectorPromptStr = cvar.FileSelectorPromptStr
 FileSelectorDefaultWildcardStr = cvar.FileSelectorDefaultWildcardStr
 DirSelectorPromptStr = cvar.DirSelectorPromptStr
@@ -775,7 +793,7 @@ class FileHistory(_core.Object):
     def __repr__(self):
         return "<%s.%s; proxy of C++ wxFileHistory instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
     def __init__(self, *args, **kwargs):
-        """__init__(self, int maxFiles=9) -> FileHistory"""
+        """__init__(self, int maxFiles=9, int idBase=ID_FILE1) -> FileHistory"""
         newobj = _misc_.new_FileHistory(*args, **kwargs)
         self.this = newobj.this
         self.thisown = 1
@@ -2450,6 +2468,7 @@ ART_FRAME_ICON = cvar.ART_FRAME_ICON
 ART_CMN_DIALOG = cvar.ART_CMN_DIALOG
 ART_HELP_BROWSER = cvar.ART_HELP_BROWSER
 ART_MESSAGE_BOX = cvar.ART_MESSAGE_BOX
+ART_BUTTON = cvar.ART_BUTTON
 ART_OTHER = cvar.ART_OTHER
 ART_ADD_BOOKMARK = cvar.ART_ADD_BOOKMARK
 ART_DEL_BOOKMARK = cvar.ART_DEL_BOOKMARK
@@ -3273,7 +3292,11 @@ class DateTime(object):
 
     GetWeekDayName = staticmethod(GetWeekDayName)
     def GetAmPmStrings(*args, **kwargs):
-        """GetAmPmStrings() -> (am, pm)"""
+        """
+        GetAmPmStrings() -> (am, pm)
+
+        Get the AM and PM strings in the current locale (may be empty)
+        """
         return _misc_.DateTime_GetAmPmStrings(*args, **kwargs)
 
     GetAmPmStrings = staticmethod(GetAmPmStrings)
@@ -3418,6 +3441,14 @@ class DateTime(object):
         """GetWeek(self, int numWeek, int weekday=Mon, int flags=Monday_First) -> DateTime"""
         return _misc_.DateTime_GetWeek(*args, **kwargs)
 
+    SetToTheWeek = wx._deprecated(SetToTheWeek, "SetToTheWeek is deprecated, use (static) SetToWeekOfYear instead")
+    GetWeek = wx._deprecated(GetWeek, "GetWeek is deprecated, use GetWeekOfYear instead")
+
+    def SetToWeekOfYear(*args, **kwargs):
+        """SetToWeekOfYear(int year, int numWeek, int weekday=Mon) -> DateTime"""
+        return _misc_.DateTime_SetToWeekOfYear(*args, **kwargs)
+
+    SetToWeekOfYear = staticmethod(SetToWeekOfYear)
     def SetToLastMonthDay(*args, **kwargs):
         """SetToLastMonthDay(self, int month=Inv_Month, int year=Inv_Year) -> DateTime"""
         return _misc_.DateTime_SetToLastMonthDay(*args, **kwargs)
@@ -3747,7 +3778,11 @@ def DateTime_GetWeekDayName(*args, **kwargs):
     return _misc_.DateTime_GetWeekDayName(*args, **kwargs)
 
 def DateTime_GetAmPmStrings(*args, **kwargs):
-    """GetAmPmStrings() -> (am, pm)"""
+    """
+    GetAmPmStrings() -> (am, pm)
+
+    Get the AM and PM strings in the current locale (may be empty)
+    """
     return _misc_.DateTime_GetAmPmStrings(*args, **kwargs)
 
 def DateTime_IsDSTApplicable(*args, **kwargs):
@@ -3801,6 +3836,10 @@ def DateTimeFromDMY(*args, **kwargs):
     val.thisown = 1
     return val
 
+def DateTime_SetToWeekOfYear(*args, **kwargs):
+    """DateTime_SetToWeekOfYear(int year, int numWeek, int weekday=Mon) -> DateTime"""
+    return _misc_.DateTime_SetToWeekOfYear(*args, **kwargs)
+
 class TimeSpan(object):
     def __repr__(self):
         return "<%s.%s; proxy of C++ wxTimeSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
@@ -4854,7 +4893,11 @@ class FileDataObject(DataObjectSimple):
         self.thisown = 1
         del newobj.thisown
     def GetFilenames(*args, **kwargs):
-        """GetFilenames(self) -> [names]"""
+        """
+        GetFilenames(self) -> [names]
+
+        Returns a list of file names.
+        """
         return _misc_.FileDataObject_GetFilenames(*args, **kwargs)
 
     def AddFile(*args, **kwargs):
@@ -5340,6 +5383,15 @@ class Clipboard(_core.Object):
         """
         return _misc_.Clipboard_UsePrimarySelection(*args, **kwargs)
 
+    def Get(*args, **kwargs):
+        """
+        Get() -> Clipboard
+
+        Returns global instance (wxTheClipboard) of the object.
+        """
+        return _misc_.Clipboard_Get(*args, **kwargs)
+
+    Get = staticmethod(Get)
 
 class ClipboardPtr(Clipboard):
     def __init__(self, this):
@@ -5348,6 +5400,31 @@ class ClipboardPtr(Clipboard):
         self.__class__ = Clipboard
 _misc_.Clipboard_swigregister(ClipboardPtr)
 
+def Clipboard_Get(*args, **kwargs):
+    """
+    Clipboard_Get() -> Clipboard
+
+    Returns global instance (wxTheClipboard) of the object.
+    """
+    return _misc_.Clipboard_Get(*args, **kwargs)
+
+class _wxPyDelayedInitWrapper(object):
+    def __init__(self, initfunc, *args, **kwargs):
+        self._initfunc = initfunc
+        self._args = args
+        self._kwargs = kwargs
+        self._instance = None
+    def _checkInstance(self):
+        if self._instance is None:
+            self._instance = self._initfunc(*self._args, **self._kwargs)        
+    def __getattr__(self, name):
+        self._checkInstance()
+        return getattr(self._instance, name)
+    def __repr__(self):
+        self._checkInstance()
+        return repr(self._instance)
+TheClipboard = _wxPyDelayedInitWrapper(Clipboard.Get)
+
 class ClipboardLocker(object):
     """
     A helpful class for opening the clipboard and automatically
@@ -5388,7 +5465,6 @@ class ClipboardLockerPtr(ClipboardLocker):
         if not hasattr(self,"thisown"): self.thisown = 0
         self.__class__ = ClipboardLocker
 _misc_.ClipboardLocker_swigregister(ClipboardLockerPtr)
-TheClipboard = cvar.TheClipboard
 
 #---------------------------------------------------------------------------
 
@@ -5589,7 +5665,22 @@ class Display(object):
         """
         ChangeMode(self, VideoMode mode=DefaultVideoMode) -> bool
 
-        Change current mode, return true if succeeded, false otherwise
+        Changes the video mode of this display to the mode specified in the
+        mode parameter.
+
+        If wx.DefaultVideoMode is passed in as the mode parameter, the defined
+        behaviour is that wx.Display will reset the video mode to the default
+        mode used by the display.  On Windows, the behavior is normal.
+        However, there are differences on other platforms. On Unix variations
+        using X11 extensions it should behave as defined, but some
+        irregularities may occur.
+
+        On wxMac passing in wx.DefaultVideoMode as the mode parameter does
+        nothing.  This happens because Carbon no longer has access to
+        DMUseScreenPrefs, an undocumented function that changed the video mode
+        to the system default by using the system's 'scrn' resource.
+
+        Returns True if succeeded, False otherwise
         """
         return _misc_.Display_ChangeMode(*args, **kwargs)