]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/_core.py
update the text of a read-only combobox (and hence wxChoice) when selection is change...
[wxWidgets.git] / wxPython / src / gtk / _core.py
index 6bee06db91e92496ccd7fa07eff0cf5d4c9cba8e..bcdab6ff04982301e5ba054fcaf452399bbef468 100644 (file)
@@ -2070,7 +2070,7 @@ class FileSystemHandler(CPPFileSystemHandler):
     def __init__(self, *args, **kwargs): 
         """__init__(self) -> FileSystemHandler"""
         _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
     def __init__(self, *args, **kwargs): 
         """__init__(self) -> FileSystemHandler"""
         _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
-        self._setCallbackInfo(self, FileSystemHandler)
+        FileSystemHandler._setCallbackInfo(self, self, FileSystemHandler)
 
     def _setCallbackInfo(*args, **kwargs):
         """_setCallbackInfo(self, PyObject self, PyObject _class)"""
 
     def _setCallbackInfo(*args, **kwargs):
         """_setCallbackInfo(self, PyObject self, PyObject _class)"""
@@ -3769,7 +3769,7 @@ class EvtHandler(Object):
     def _setOORInfo(*args, **kwargs):
         """_setOORInfo(self, PyObject _self, bool incref=True)"""
         val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
     def _setOORInfo(*args, **kwargs):
         """_setOORInfo(self, PyObject _self, bool incref=True)"""
         val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
-        args[0].thisown = 0
+        args[0].this.own(False)
         return val
 
     def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
         return val
 
     def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
@@ -3847,6 +3847,15 @@ class PyEventBinder(object):
             success += target.Disconnect(id1, id2, et)
         return success != 0
 
             success += target.Disconnect(id1, id2, et)
         return success != 0
 
+    def _getEvtType(self):
+        """
+        Make it easy to get to the default wxEventType typeID for this
+        event binder.
+        """
+        return self.evtType[0]
+    
+    typeId = property(_getEvtType)
+
     
     def __call__(self, *args):
         """
     
     def __call__(self, *args):
         """
@@ -7007,13 +7016,12 @@ class PyApp(EvtHandler):
         Create a new application object, starting the bootstrap process.
         """
         _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
         Create a new application object, starting the bootstrap process.
         """
         _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
-        self._setCallbackInfo(self, PyApp, False)
-        self._setOORInfo(self, False)
+        self._setOORInfo(self, False);PyApp._setCallbackInfo(self, self, PyApp)
 
     __swig_destroy__ = _core_.delete_PyApp
     __del__ = lambda self : None;
     def _setCallbackInfo(*args, **kwargs):
 
     __swig_destroy__ = _core_.delete_PyApp
     __del__ = lambda self : None;
     def _setCallbackInfo(*args, **kwargs):
-        """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
+        """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)"""
         return _core_.PyApp__setCallbackInfo(*args, **kwargs)
 
     def GetAppName(*args, **kwargs):
         return _core_.PyApp__setCallbackInfo(*args, **kwargs)
 
     def GetAppName(*args, **kwargs):
@@ -7248,7 +7256,7 @@ class PyApp(EvtHandler):
 
     def SetUseBestVisual(*args, **kwargs):
         """
 
     def SetUseBestVisual(*args, **kwargs):
         """
-        SetUseBestVisual(self, bool flag)
+        SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
 
         Set whether the app should try to use the best available visual on
         systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
 
         Set whether the app should try to use the best available visual on
         systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
@@ -8397,7 +8405,7 @@ class Window(EvtHandler):
         Raise(self)
 
         Raises the window to the top of the window hierarchy.  In current
         Raise(self)
 
         Raises the window to the top of the window hierarchy.  In current
-        version of wxWidgets this works both for manage and child windows.
+        version of wxWidgets this works both for managed and child windows.
         """
         return _core_.Window_Raise(*args, **kwargs)
 
         """
         return _core_.Window_Raise(*args, **kwargs)
 
@@ -8406,7 +8414,7 @@ class Window(EvtHandler):
         Lower(self)
 
         Lowers the window to the bottom of the window hierarchy.  In current
         Lower(self)
 
         Lowers the window to the bottom of the window hierarchy.  In current
-        version of wxWidgets this works both for manage and child windows.
+        version of wxWidgets this works both for managed and child windows.
         """
         return _core_.Window_Lower(*args, **kwargs)
 
         """
         return _core_.Window_Lower(*args, **kwargs)
 
@@ -8801,6 +8809,14 @@ class Window(EvtHandler):
         """
         return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
 
         """
         return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
 
+    def GetWindowBorderSize(*args, **kwargs):
+        """
+        GetWindowBorderSize(self) -> Size
+
+        Return the size of the left/right and top/bottom borders.
+        """
+        return _core_.Window_GetWindowBorderSize(*args, **kwargs)
+
     def GetBestVirtualSize(*args, **kwargs):
         """
         GetBestVirtualSize(self) -> Size
     def GetBestVirtualSize(*args, **kwargs):
         """
         GetBestVirtualSize(self) -> Size
@@ -8914,6 +8930,15 @@ class Window(EvtHandler):
         """
         return _core_.Window_IsRetained(*args, **kwargs)
 
         """
         return _core_.Window_IsRetained(*args, **kwargs)
 
+    def ToggleWindowStyle(*args, **kwargs):
+        """
+        ToggleWindowStyle(self, int flag) -> bool
+
+        Turn the flag on if it had been turned off before and vice versa,
+        returns True if the flag is turned on by this function call.
+        """
+        return _core_.Window_ToggleWindowStyle(*args, **kwargs)
+
     def SetExtraStyle(*args, **kwargs):
         """
         SetExtraStyle(self, long exStyle)
     def SetExtraStyle(*args, **kwargs):
         """
         SetExtraStyle(self, long exStyle)
@@ -10332,13 +10357,12 @@ class Window(EvtHandler):
         if hasattr(self, '_setOORInfo'):
             self._setOORInfo(self)
         if hasattr(self, '_setCallbackInfo'):
         if hasattr(self, '_setOORInfo'):
             self._setOORInfo(self)
         if hasattr(self, '_setCallbackInfo'):
-            self._setCallbackInfo(self, self.__class__)
+            self._setCallbackInfo(self, pre.__class__)
 
     def SendSizeEvent(self):
         self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
 
     AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`") 
 
     def SendSizeEvent(self):
         self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
 
     AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`") 
-    AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`") 
     AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`") 
     BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`") 
     BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`") 
     AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`") 
     BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`") 
     BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`") 
@@ -10601,12 +10625,10 @@ class PyValidator(Validator):
     def __init__(self, *args, **kwargs): 
         """__init__(self) -> PyValidator"""
         _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
     def __init__(self, *args, **kwargs): 
         """__init__(self) -> PyValidator"""
         _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
-        
-        self._setCallbackInfo(self, PyValidator, 1)
-        self._setOORInfo(self)
+        self._setOORInfo(self);PyValidator._setCallbackInfo(self, self, PyValidator)
 
     def _setCallbackInfo(*args, **kwargs):
 
     def _setCallbackInfo(*args, **kwargs):
-        """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
+        """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)"""
         return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
 
 _core_.PyValidator_swigregister(PyValidator)
         return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
 
 _core_.PyValidator_swigregister(PyValidator)
@@ -10715,9 +10737,15 @@ class Menu(EvtHandler):
         """Remove(self, int id) -> MenuItem"""
         return _core_.Menu_Remove(*args, **kwargs)
 
         """Remove(self, int id) -> MenuItem"""
         return _core_.Menu_Remove(*args, **kwargs)
 
-    def RemoveItem(*args, **kwargs):
+    def RemoveItem(self, item):
         """RemoveItem(self, MenuItem item) -> MenuItem"""
         """RemoveItem(self, MenuItem item) -> MenuItem"""
-        return _core_.Menu_RemoveItem(*args, **kwargs)
+        #// The return object is always the parameter, so return that 
+        #// proxy instead of the new one
+        val = _core_.Menu_RemoveItem(self, item)
+        item.this.own(val.this.own())
+        val.this.disown()
+        return item
+
 
     def Delete(*args, **kwargs):
         """Delete(self, int id) -> bool"""
 
     def Delete(*args, **kwargs):
         """Delete(self, int id) -> bool"""
@@ -11023,13 +11051,14 @@ class MenuItem(Object):
     __repr__ = _swig_repr
     def __init__(self, *args, **kwargs): 
         """
     __repr__ = _swig_repr
     def __init__(self, *args, **kwargs): 
         """
-        __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString, 
+        __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString, 
             String help=EmptyString, int kind=ITEM_NORMAL, 
             Menu subMenu=None) -> MenuItem
         """
         _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
     __swig_destroy__ = _core_.delete_MenuItem
     __del__ = lambda self : None;
             String help=EmptyString, int kind=ITEM_NORMAL, 
             Menu subMenu=None) -> MenuItem
         """
         _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
     __swig_destroy__ = _core_.delete_MenuItem
     __del__ = lambda self : None;
+    def Destroy(self): pass 
     def GetMenu(*args, **kwargs):
         """GetMenu(self) -> Menu"""
         return _core_.MenuItem_GetMenu(*args, **kwargs)
     def GetMenu(*args, **kwargs):
         """GetMenu(self) -> Menu"""
         return _core_.MenuItem_GetMenu(*args, **kwargs)
@@ -11377,7 +11406,7 @@ class ItemContainer(object):
 
     def Insert(*args, **kwargs):
         """
 
     def Insert(*args, **kwargs):
         """
-        Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
+        Insert(self, String item, int pos, PyObject clientData=None) -> int
 
         Insert an item into the control before the item at the ``pos`` index,
         optionally associating some data object with the item.
 
         Insert an item into the control before the item at the ``pos`` index,
         optionally associating some data object with the item.
@@ -11394,7 +11423,7 @@ class ItemContainer(object):
 
     def Delete(*args, **kwargs):
         """
 
     def Delete(*args, **kwargs):
         """
-        Delete(self, unsigned int n)
+        Delete(self, int n)
 
         Deletes the item at the zero-based index 'n' from the control. Note
         that it is an error (signalled by a `wx.PyAssertionError` exception if
 
         Deletes the item at the zero-based index 'n' from the control. Note
         that it is an error (signalled by a `wx.PyAssertionError` exception if
@@ -11405,7 +11434,7 @@ class ItemContainer(object):
 
     def GetClientData(*args, **kwargs):
         """
 
     def GetClientData(*args, **kwargs):
         """
-        GetClientData(self, unsigned int n) -> PyObject
+        GetClientData(self, int n) -> PyObject
 
         Returns the client data associated with the given item, (if any.)
         """
 
         Returns the client data associated with the given item, (if any.)
         """
@@ -11413,7 +11442,7 @@ class ItemContainer(object):
 
     def SetClientData(*args, **kwargs):
         """
 
     def SetClientData(*args, **kwargs):
         """
-        SetClientData(self, unsigned int n, PyObject clientData)
+        SetClientData(self, int n, PyObject clientData)
 
         Associate the given client data with the item at position n.
         """
 
         Associate the given client data with the item at position n.
         """
@@ -11421,7 +11450,7 @@ class ItemContainer(object):
 
     def GetCount(*args, **kwargs):
         """
 
     def GetCount(*args, **kwargs):
         """
-        GetCount(self) -> unsigned int
+        GetCount(self) -> int
 
         Returns the number of items in the control.
         """
 
         Returns the number of items in the control.
         """
@@ -11437,7 +11466,7 @@ class ItemContainer(object):
 
     def GetString(*args, **kwargs):
         """
 
     def GetString(*args, **kwargs):
         """
-        GetString(self, unsigned int n) -> String
+        GetString(self, int n) -> String
 
         Returns the label of the item with the given index.
         """
 
         Returns the label of the item with the given index.
         """
@@ -11449,7 +11478,7 @@ class ItemContainer(object):
 
     def SetString(*args, **kwargs):
         """
 
     def SetString(*args, **kwargs):
         """
-        SetString(self, unsigned int n, String s)
+        SetString(self, int n, String s)
 
         Sets the label for the given item.
         """
 
         Sets the label for the given item.
         """
@@ -12432,7 +12461,7 @@ class PySizer(Sizer):
         class.
         """
         _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
         class.
         """
         _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
-        self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
+        self._setOORInfo(self);PySizer._setCallbackInfo(self, self, PySizer)
 
     def _setCallbackInfo(*args, **kwargs):
         """_setCallbackInfo(self, PyObject self, PyObject _class)"""
 
     def _setCallbackInfo(*args, **kwargs):
         """_setCallbackInfo(self, PyObject self, PyObject _class)"""
@@ -13305,6 +13334,16 @@ class GridBagSizer(FlexGridSizer):
         """
         return _core_.GridBagSizer_FindItem(*args)
 
         """
         return _core_.GridBagSizer_FindItem(*args)
 
+    def GetItem(self, item):
+        gbsi = None
+        si = wx.FlexGridSizer.GetItem(self, item)
+        if not si:
+            return None
+        if type(item) is not int:
+            gbsi = self.FindItem(item)
+        if gbsi: return gbsi
+        return si
+
     def FindItemAtPosition(*args, **kwargs):
         """
         FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
     def FindItemAtPosition(*args, **kwargs):
         """
         FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
@@ -13695,7 +13734,10 @@ if default == 'ascii':
     import locale
     import codecs
     try:
     import locale
     import codecs
     try:
-        default = locale.getdefaultlocale()[1]
+        if hasattr(locale, 'getpreferredencoding'):
+            default = locale.getpreferredencoding()
+        else:
+            default = locale.getdefaultlocale()[1]
         codecs.lookup(default)
     except (ValueError, LookupError, TypeError):
         default = _sys.getdefaultencoding()
         codecs.lookup(default)
     except (ValueError, LookupError, TypeError):
         default = _sys.getdefaultencoding()