X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/15665b4790c94192130f032508de2b3b8c6a2c97..365271b573e3d0ab7512471358f98a589f18c104:/wxPython/src/gtk/_core.py diff --git a/wxPython/src/gtk/_core.py b/wxPython/src/gtk/_core.py index 48fa5b8045..bcdab6ff04 100644 --- a/wxPython/src/gtk/_core.py +++ b/wxPython/src/gtk/_core.py @@ -3847,6 +3847,15 @@ class PyEventBinder(object): 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): """ @@ -8396,7 +8405,7 @@ class Window(EvtHandler): 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) @@ -8405,7 +8414,7 @@ class Window(EvtHandler): 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) @@ -8800,6 +8809,14 @@ class Window(EvtHandler): """ 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 @@ -8913,6 +8930,15 @@ class Window(EvtHandler): """ 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) @@ -10337,7 +10363,6 @@ class Window(EvtHandler): 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`") @@ -10712,9 +10737,15 @@ class Menu(EvtHandler): """Remove(self, int id) -> MenuItem""" return _core_.Menu_Remove(*args, **kwargs) - def RemoveItem(*args, **kwargs): + def RemoveItem(self, item): """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""" @@ -11020,13 +11051,14 @@ class MenuItem(Object): __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; + def Destroy(self): pass def GetMenu(*args, **kwargs): """GetMenu(self) -> Menu""" return _core_.MenuItem_GetMenu(*args, **kwargs) @@ -13302,6 +13334,16 @@ class GridBagSizer(FlexGridSizer): """ 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 @@ -13692,7 +13734,10 @@ if default == 'ascii': 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()