X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2813725c9c8d409b3b99768abc2dcf9ee1fa76f..bc50a2ae95f2ab36b16ceedc7902a9cbfb2f70ea:/wxPython/src/mac/_core.py diff --git a/wxPython/src/mac/_core.py b/wxPython/src/mac/_core.py index 66cd8e452b..18d204f336 100644 --- a/wxPython/src/mac/_core.py +++ b/wxPython/src/mac/_core.py @@ -1,4 +1,4 @@ -# This file was created automatically by SWIG. +# This file was created automatically by SWIG 1.3.27. # Don't modify this file, modify the SWIG interface instead. import _core_ @@ -161,6 +161,7 @@ SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT SIZE_AUTO = _core_.SIZE_AUTO SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE +SIZE_FORCE = _core_.SIZE_FORCE PORTRAIT = _core_.PORTRAIT LANDSCAPE = _core_.LANDSCAPE PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH @@ -169,6 +170,7 @@ PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT ID_ANY = _core_.ID_ANY ID_SEPARATOR = _core_.ID_SEPARATOR +ID_NONE = _core_.ID_NONE ID_LOWEST = _core_.ID_LOWEST ID_OPEN = _core_.ID_OPEN ID_CLOSE = _core_.ID_CLOSE @@ -596,6 +598,56 @@ PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA PAPER_A2 = _core_.PAPER_A2 PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE +PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD +PAPER_A6 = _core_.PAPER_A6 +PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2 +PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3 +PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3 +PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4 +PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED +PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED +PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED +PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED +PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED +PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED +PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED +PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED +PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED +PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED +PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED +PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED +PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED +PAPER_B6_JIS = _core_.PAPER_B6_JIS +PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED +PAPER_12X11 = _core_.PAPER_12X11 +PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4 +PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED +PAPER_P16K = _core_.PAPER_P16K +PAPER_P32K = _core_.PAPER_P32K +PAPER_P32KBIG = _core_.PAPER_P32KBIG +PAPER_PENV_1 = _core_.PAPER_PENV_1 +PAPER_PENV_2 = _core_.PAPER_PENV_2 +PAPER_PENV_3 = _core_.PAPER_PENV_3 +PAPER_PENV_4 = _core_.PAPER_PENV_4 +PAPER_PENV_5 = _core_.PAPER_PENV_5 +PAPER_PENV_6 = _core_.PAPER_PENV_6 +PAPER_PENV_7 = _core_.PAPER_PENV_7 +PAPER_PENV_8 = _core_.PAPER_PENV_8 +PAPER_PENV_9 = _core_.PAPER_PENV_9 +PAPER_PENV_10 = _core_.PAPER_PENV_10 +PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED +PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED +PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED +PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED +PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED +PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED +PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED +PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED +PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED +PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED +PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED +PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED +PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL @@ -623,8 +675,12 @@ HT_MAX = _core_.HT_MAX MOD_NONE = _core_.MOD_NONE MOD_ALT = _core_.MOD_ALT MOD_CONTROL = _core_.MOD_CONTROL +MOD_ALTGR = _core_.MOD_ALTGR MOD_SHIFT = _core_.MOD_SHIFT +MOD_META = _core_.MOD_META MOD_WIN = _core_.MOD_WIN +MOD_CMD = _core_.MOD_CMD +MOD_ALL = _core_.MOD_ALL UPDATE_UI_NONE = _core_.UPDATE_UI_NONE UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE @@ -652,7 +708,9 @@ class Object(object): Deletes the C++ object this Python object is a proxy for. """ - return _core_.Object_Destroy(*args, **kwargs) + val = _core_.Object_Destroy(*args, **kwargs) + args[0].thisown = 0 + return val class ObjectPtr(Object): @@ -1263,7 +1321,7 @@ class Rect(object): """ Offset(self, Point pt) - Same as OffsetXY but uses dx,dy from Point + Same as `OffsetXY` but uses dx,dy from Point """ return _core_.Rect_Offset(*args, **kwargs) @@ -1339,6 +1397,16 @@ class Rect(object): """ return _core_.Rect_Intersects(*args, **kwargs) + def CenterIn(*args, **kwargs): + """ + CenterIn(self, Rect r, int dir=BOTH) -> Rect + + Center this rectangle within the one passed to the method, which is + usually, but not necessarily, the larger one. + """ + return _core_.Rect_CenterIn(*args, **kwargs) + + CentreIn = CenterIn x = property(_core_.Rect_x_get, _core_.Rect_x_set) y = property(_core_.Rect_y_get, _core_.Rect_y_set) width = property(_core_.Rect_width_get, _core_.Rect_width_set) @@ -2095,6 +2163,80 @@ class ImageHandlerPtr(ImageHandler): self.__class__ = ImageHandler _core_.ImageHandler_swigregister(ImageHandlerPtr) +class PyImageHandler(ImageHandler): + """ + This is the base class for implementing image file loading/saving, and + image creation from data, all written in Python. To create a custom + image handler derive a new class from wx.PyImageHandler and provide + the following methods:: + + def DoCanRead(self, stream) --> bool + '''Check if this handler can read the image on the stream''' + + def LoadFile(self, image, stream, verbose, index) --> bool + '''Load image data from the stream and load it into image.''' + + def SaveFile(self, image, stream, verbose) --> bool + '''Save the iamge data in image to the stream using + this handler's image file format.''' + + def GetImageCount(self, stream) --> int + '''If this image format can hold more than one image, + how many does the image on the stream have?''' + + To activate your handler create an instance of it and pass it to + `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and + `SetExtension` from your constructor. + + """ + def __repr__(self): + return "<%s.%s; proxy of C++ wxPyImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __init__(self, *args, **kwargs): + """ + __init__(self) -> PyImageHandler + + This is the base class for implementing image file loading/saving, and + image creation from data, all written in Python. To create a custom + image handler derive a new class from wx.PyImageHandler and provide + the following methods:: + + def DoCanRead(self, stream) --> bool + '''Check if this handler can read the image on the stream''' + + def LoadFile(self, image, stream, verbose, index) --> bool + '''Load image data from the stream and load it into image.''' + + def SaveFile(self, image, stream, verbose) --> bool + '''Save the iamge data in image to the stream using + this handler's image file format.''' + + def GetImageCount(self, stream) --> int + '''If this image format can hold more than one image, + how many does the image on the stream have?''' + + To activate your handler create an instance of it and pass it to + `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and + `SetExtension` from your constructor. + + """ + newobj = _core_.new_PyImageHandler(*args, **kwargs) + self.this = newobj.this + self.thisown = 1 + del newobj.thisown + self._SetSelf(self) + + def _SetSelf(*args, **kwargs): + """_SetSelf(self, PyObject self)""" + return _core_.PyImageHandler__SetSelf(*args, **kwargs) + + +class PyImageHandlerPtr(PyImageHandler): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = PyImageHandler +_core_.PyImageHandler_swigregister(PyImageHandlerPtr) + class ImageHistogram(object): """Proxy of C++ ImageHistogram class""" def __repr__(self): @@ -2165,6 +2307,66 @@ def ImageHistogram_MakeKey(*args, **kwargs): """ return _core_.ImageHistogram_MakeKey(*args, **kwargs) +class Image_RGBValue(object): + """ + An object that contains values for red, green and blue which represent + the value of a color. It is used by `wx.Image.HSVtoRGB` and + `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB + color space. + """ + def __repr__(self): + return "<%s.%s; proxy of C++ wxImage_RGBValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __init__(self, *args, **kwargs): + """ + __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue + + Constructor. + """ + newobj = _core_.new_Image_RGBValue(*args, **kwargs) + self.this = newobj.this + self.thisown = 1 + del newobj.thisown + red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set) + green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set) + blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set) + +class Image_RGBValuePtr(Image_RGBValue): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = Image_RGBValue +_core_.Image_RGBValue_swigregister(Image_RGBValuePtr) + +class Image_HSVValue(object): + """ + An object that contains values for hue, saturation and value which + represent the value of a color. It is used by `wx.Image.HSVtoRGB` and + `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB + color space. + """ + def __repr__(self): + return "<%s.%s; proxy of C++ wxImage_HSVValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __init__(self, *args, **kwargs): + """ + __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue + + Constructor. + """ + newobj = _core_.new_Image_HSVValue(*args, **kwargs) + self.this = newobj.this + self.thisown = 1 + del newobj.thisown + hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set) + saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set) + value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set) + +class Image_HSVValuePtr(Image_HSVValue): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = Image_HSVValue +_core_.Image_HSVValue_swigregister(Image_HSVValuePtr) + class Image(Object): """ A platform-independent image class. An image can be created from @@ -2225,7 +2427,9 @@ class Image(Object): Destroys the image data. """ - return _core_.Image_Destroy(*args, **kwargs) + val = _core_.Image_Destroy(*args, **kwargs) + args[0].thisown = 0 + return val def Scale(*args, **kwargs): """ @@ -2747,6 +2951,16 @@ class Image(Object): """ return _core_.Image_Replace(*args, **kwargs) + def ConvertToGreyscale(*args, **kwargs): + """ + ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image + + Convert to greyscale image. Uses the luminance component (Y) of the + image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb), + defaults to ITU-T BT.601 + """ + return _core_.Image_ConvertToGreyscale(*args, **kwargs) + def ConvertToMono(*args, **kwargs): """ ConvertToMono(self, byte r, byte g, byte b) -> Image @@ -2842,6 +3056,33 @@ class Image(Object): """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) + def RotateHue(*args, **kwargs): + """ + RotateHue(self, double angle) + + Rotates the hue of each pixel of the image. Hue is a double in the + range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees + """ + return _core_.Image_RotateHue(*args, **kwargs) + + def RGBtoHSV(*args, **kwargs): + """ + RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue + + Converts a color in RGB color space to HSV color space. + """ + return _core_.Image_RGBtoHSV(*args, **kwargs) + + RGBtoHSV = staticmethod(RGBtoHSV) + def HSVtoRGB(*args, **kwargs): + """ + HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue + + Converts a color in HSV color space to RGB color space. + """ + return _core_.Image_HSVtoRGB(*args, **kwargs) + + HSVtoRGB = staticmethod(HSVtoRGB) def __nonzero__(self): return self.Ok() class ImagePtr(Image): @@ -2980,6 +3221,22 @@ def Image_GetImageExtWildcard(*args, **kwargs): """ return _core_.Image_GetImageExtWildcard(*args, **kwargs) +def Image_RGBtoHSV(*args, **kwargs): + """ + Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue + + Converts a color in RGB color space to HSV color space. + """ + return _core_.Image_RGBtoHSV(*args, **kwargs) + +def Image_HSVtoRGB(*args, **kwargs): + """ + Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue + + Converts a color in HSV color space to RGB color space. + """ + return _core_.Image_HSVtoRGB(*args, **kwargs) + def InitAllImageHandlers(): """ The former functionality of InitAllImageHanders is now done internal to @@ -3353,7 +3610,9 @@ class EvtHandler(Object): def _setOORInfo(*args, **kwargs): """_setOORInfo(self, PyObject _self, bool incref=True)""" - return _core_.EvtHandler__setOORInfo(*args, **kwargs) + val = _core_.EvtHandler__setOORInfo(*args, **kwargs) + args[0].thisown = 0 + return val def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): """ @@ -3539,7 +3798,8 @@ wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE -wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL +wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED +wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP @@ -3695,7 +3955,7 @@ EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, wxEVT_SCROLL_PAGEDOWN, wxEVT_SCROLL_THUMBTRACK, wxEVT_SCROLL_THUMBRELEASE, - wxEVT_SCROLL_ENDSCROLL, + wxEVT_SCROLL_CHANGED, ]) EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) @@ -3706,8 +3966,9 @@ EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) -EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL ) - +EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) +EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED + # Scrolling from wx.Slider and wx.ScrollBar, with an id EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, wxEVT_SCROLL_BOTTOM, @@ -3717,7 +3978,7 @@ EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, wxEVT_SCROLL_PAGEDOWN, wxEVT_SCROLL_THUMBTRACK, wxEVT_SCROLL_THUMBRELEASE, - wxEVT_SCROLL_ENDSCROLL, + wxEVT_SCROLL_CHANGED, ], 1) EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) @@ -3728,7 +3989,8 @@ EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) -EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1) +EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) +EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) @@ -4846,6 +5108,21 @@ class KeyEvent(Event): self.this = newobj.this self.thisown = 1 del newobj.thisown + def GetModifiers(*args, **kwargs): + """ + GetModifiers(self) -> int + + Returns a bitmask of the current modifier settings. Can be used to + check if the key event has exactly the given modifiers without having + to explicitly check that the other modifiers are not down. For + example:: + + if event.GetModifers() == wx.MOD_CONTROL: + DoSomething() + + """ + return _core_.KeyEvent_GetModifiers(*args, **kwargs) + def ControlDown(*args, **kwargs): """ ControlDown(self) -> bool @@ -5485,7 +5762,10 @@ class CloseEvent(Event): """ GetLoggingOff(self) -> bool - Returns true if the user is logging off. + Returns ``True`` if the user is logging off or ``False`` if the + system is shutting down. This method can only be called for end + session and query end session events, it doesn't make sense for close + window event. """ return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) @@ -5762,6 +6042,14 @@ class UpdateUIEvent(CommandEvent): """ return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) + def GetShown(*args, **kwargs): + """ + GetShown(self) -> bool + + Returns ``True`` if the UI element should be shown. + """ + return _core_.UpdateUIEvent_GetShown(*args, **kwargs) + def GetText(*args, **kwargs): """ GetText(self) -> String @@ -5797,6 +6085,15 @@ class UpdateUIEvent(CommandEvent): """ return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) + def GetSetShown(*args, **kwargs): + """ + GetSetShown(self) -> bool + + Returns ``True`` if the application has called `Show`. For wxWidgets + internal use only. + """ + return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs) + def Check(*args, **kwargs): """ Check(self, bool check) @@ -5813,6 +6110,14 @@ class UpdateUIEvent(CommandEvent): """ return _core_.UpdateUIEvent_Enable(*args, **kwargs) + def Show(*args, **kwargs): + """ + Show(self, bool show) + + Show or hide the UI element. + """ + return _core_.UpdateUIEvent_Show(*args, **kwargs) + def SetText(*args, **kwargs): """ SetText(self, String text) @@ -6343,8 +6648,15 @@ _core_.WindowCreateEvent_swigregister(WindowCreateEventPtr) class WindowDestroyEvent(CommandEvent): """ - The EVT_WINDOW_DESTROY event is sent right before the window is - destroyed. + The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor + when the GUI window is destroyed. + + When a class derived from `wx.Window` is destroyed its destructor will + have already run by the time this event is sent. Therefore this event + will not usually be received at all by the window itself. Since it is + received after the destructor has run, an object should not try to + handle its own wx.WindowDestroyEvent, but it can be used to get + notification of the destruction of another window. """ def __repr__(self): return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) @@ -6352,8 +6664,15 @@ class WindowDestroyEvent(CommandEvent): """ __init__(self, Window win=None) -> WindowDestroyEvent - The EVT_WINDOW_DESTROY event is sent right before the window is - destroyed. + The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor + when the GUI window is destroyed. + + When a class derived from `wx.Window` is destroyed its destructor will + have already run by the time this event is sent. Therefore this event + will not usually be received at all by the window itself. Since it is + received after the destructor has run, an object should not try to + handle its own wx.WindowDestroyEvent, but it can be used to get + notification of the destruction of another window. """ newobj = _core_.new_WindowDestroyEvent(*args, **kwargs) self.this = newobj.this @@ -7612,6 +7931,30 @@ def EventLoop_SetActive(*args, **kwargs): """EventLoop_SetActive(EventLoop loop)""" return _core_.EventLoop_SetActive(*args, **kwargs) +class EventLoopActivator(object): + """Proxy of C++ EventLoopActivator class""" + def __repr__(self): + return "<%s.%s; proxy of C++ wxEventLoopActivator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __init__(self, *args, **kwargs): + """__init__(self, EventLoop evtLoop) -> EventLoopActivator""" + newobj = _core_.new_EventLoopActivator(*args, **kwargs) + self.this = newobj.this + self.thisown = 1 + del newobj.thisown + def __del__(self, destroy=_core_.delete_EventLoopActivator): + """__del__(self)""" + try: + if self.thisown: destroy(self) + except: pass + + +class EventLoopActivatorPtr(EventLoopActivator): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = EventLoopActivator +_core_.EventLoopActivator_swigregister(EventLoopActivatorPtr) + #--------------------------------------------------------------------------- class AcceleratorEntry(object): @@ -7822,7 +8165,9 @@ class Window(EvtHandler): Returns True if the window has either been successfully deleted, or it has been added to the list of windows pending real deletion. """ - return _core_.Window_Destroy(*args, **kwargs) + val = _core_.Window_Destroy(*args, **kwargs) + args[0].thisown = 0 + return val def DestroyChildren(*args, **kwargs): """ @@ -7841,22 +8186,6 @@ class Window(EvtHandler): """ return _core_.Window_IsBeingDeleted(*args, **kwargs) - def SetTitle(*args, **kwargs): - """ - SetTitle(self, String title) - - Sets the window's title. Applicable only to frames and dialogs. - """ - return _core_.Window_SetTitle(*args, **kwargs) - - def GetTitle(*args, **kwargs): - """ - GetTitle(self) -> String - - Gets the window's title. Applicable only to frames and dialogs. - """ - return _core_.Window_GetTitle(*args, **kwargs) - def SetLabel(*args, **kwargs): """ SetLabel(self, String label) @@ -8036,8 +8365,8 @@ class Window(EvtHandler): """ Raise(self) - Raises the window to the top of the window hierarchy if it is a - managed window (dialog or frame). + Raises the window to the top of the window hierarchy. In current + version of wxWidgets this works both for manage and child windows. """ return _core_.Window_Raise(*args, **kwargs) @@ -8045,8 +8374,8 @@ class Window(EvtHandler): """ Lower(self) - Lowers the window to the bottom of the window hierarchy if it is a - managed window (dialog or frame). + Lowers the window to the bottom of the window hierarchy. In current + version of wxWidgets this works both for manage and child windows. """ return _core_.Window_Lower(*args, **kwargs) @@ -8246,15 +8575,6 @@ class Window(EvtHandler): return _core_.Window_Center(*args, **kwargs) Centre = Center - def CenterOnScreen(*args, **kwargs): - """ - CenterOnScreen(self, int dir=BOTH) - - Center on screen (only works for top level windows) - """ - return _core_.Window_CenterOnScreen(*args, **kwargs) - - CentreOnScreen = CenterOnScreen def CenterOnParent(*args, **kwargs): """ CenterOnParent(self, int dir=BOTH) @@ -9755,9 +10075,13 @@ class Window(EvtHandler): SetAutoLayout(self, bool autoLayout) Determines whether the Layout function will be called automatically - when the window is resized. It is called implicitly by SetSizer but - if you use SetConstraints you should call it manually or otherwise the - window layout won't be correctly updated when its size changes. + when the window is resized. lease note that this only happens for the + windows usually used to contain children, namely `wx.Panel` and + `wx.TopLevelWindow` (and the classes deriving from them). + + This method is called implicitly by `SetSizer` but if you use + `SetConstraints` you should call it manually or otherwise the window + layout won't be correctly updated when its size changes. """ return _core_.Window_SetAutoLayout(*args, **kwargs) @@ -9886,6 +10210,9 @@ class Window(EvtHandler): if hasattr(self, '_setCallbackInfo'): self._setCallbackInfo(self, self.__class__) + def SendSizeEvent(self): + self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1))) + class WindowPtr(Window): def __init__(self, this): @@ -10242,7 +10569,9 @@ class Menu(EvtHandler): Deletes the C++ object this Python object is a proxy for. """ - return _core_.Menu_Destroy(*args, **kwargs) + val = _core_.Menu_Destroy(*args, **kwargs) + args[0].thisown = 0 + return val def DestroyId(*args, **kwargs): """ @@ -10250,7 +10579,9 @@ class Menu(EvtHandler): Deletes the C++ object this Python object is a proxy for. """ - return _core_.Menu_DestroyId(*args, **kwargs) + val = _core_.Menu_DestroyId(*args, **kwargs) + args[0].thisown = 0 + return val def DestroyItem(*args, **kwargs): """ @@ -10258,7 +10589,9 @@ class Menu(EvtHandler): Deletes the C++ object this Python object is a proxy for. """ - return _core_.Menu_DestroyItem(*args, **kwargs) + val = _core_.Menu_DestroyItem(*args, **kwargs) + args[0].thisown = 0 + return val def GetMenuItemCount(*args, **kwargs): """GetMenuItemCount(self) -> size_t""" @@ -10491,6 +10824,16 @@ class MenuBar(Window): """Detach(self)""" return _core_.MenuBar_Detach(*args, **kwargs) + def SetAutoWindowMenu(*args, **kwargs): + """SetAutoWindowMenu(bool enable)""" + return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) + + SetAutoWindowMenu = staticmethod(SetAutoWindowMenu) + def GetAutoWindowMenu(*args, **kwargs): + """GetAutoWindowMenu() -> bool""" + return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) + + GetAutoWindowMenu = staticmethod(GetAutoWindowMenu) class MenuBarPtr(MenuBar): def __init__(self, this): @@ -10499,6 +10842,14 @@ class MenuBarPtr(MenuBar): self.__class__ = MenuBar _core_.MenuBar_swigregister(MenuBarPtr) +def MenuBar_SetAutoWindowMenu(*args, **kwargs): + """MenuBar_SetAutoWindowMenu(bool enable)""" + return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) + +def MenuBar_GetAutoWindowMenu(*args, **kwargs): + """MenuBar_GetAutoWindowMenu() -> bool""" + return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) + #--------------------------------------------------------------------------- class MenuItem(Object): @@ -10616,6 +10967,14 @@ class MenuItem(Object): """SetAccel(self, AcceleratorEntry accel)""" return _core_.MenuItem_SetAccel(*args, **kwargs) + def SetBitmap(*args, **kwargs): + """SetBitmap(self, Bitmap bitmap)""" + return _core_.MenuItem_SetBitmap(*args, **kwargs) + + def GetBitmap(*args, **kwargs): + """GetBitmap(self) -> Bitmap""" + return _core_.MenuItem_GetBitmap(*args, **kwargs) + def SetFont(*args, **kwargs): """SetFont(self, Font font)""" return _core_.MenuItem_SetFont(*args, **kwargs) @@ -10677,14 +11036,6 @@ class MenuItem(Object): """ResetOwnerDrawn(self)""" return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) - def SetBitmap(*args, **kwargs): - """SetBitmap(self, Bitmap bitmap)""" - return _core_.MenuItem_SetBitmap(*args, **kwargs) - - def GetBitmap(*args, **kwargs): - """GetBitmap(self) -> Bitmap""" - return _core_.MenuItem_GetBitmap(*args, **kwargs) - class MenuItemPtr(MenuItem): def __init__(self, this): @@ -11047,6 +11398,12 @@ class SizerItem(Object): self.this = newobj.this self.thisown = 1 del newobj.thisown + def __del__(self, destroy=_core_.delete_SizerItem): + """__del__(self)""" + try: + if self.thisown: destroy(self) + except: pass + def DeleteWindows(*args, **kwargs): """ DeleteWindows(self) @@ -11310,6 +11667,14 @@ class SizerItem(Object): """ return _core_.SizerItem_GetUserData(*args, **kwargs) + def SetUserData(*args, **kwargs): + """ + SetUserData(self, PyObject userData) + + Associate a Python object with this sizer item. + """ + return _core_.SizerItem_SetUserData(*args, **kwargs) + class SizerItemPtr(SizerItem): def __init__(self, this): @@ -11384,6 +11749,12 @@ class Sizer(Object): def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __del__(self, destroy=_core_.delete_Sizer): + """__del__(self)""" + try: + if self.thisown: destroy(self) + except: pass + def _setOORInfo(*args, **kwargs): """_setOORInfo(self, PyObject _self)""" return _core_.Sizer__setOORInfo(*args, **kwargs) @@ -11448,7 +11819,7 @@ class Sizer(Object): Returns the `wx.SizerItem` which holds the *item* given. The *item* parameter can be either a window, a sizer, or the zero-based index of - the item to be detached. + the item to be found. """ return _core_.Sizer_GetItem(*args, **kwargs) @@ -11732,7 +12103,7 @@ class Sizer(Object): """ IsShown(self, item) - Determines if the item is currently shown. sizer. To make a sizer + Determines if the item is currently shown. To make a sizer item disappear or reappear, use Show followed by `Layout`. The *item* parameter can be either a window, a sizer, or the zero-based index of the item. @@ -12307,6 +12678,12 @@ class GBPosition(object): self.this = newobj.this self.thisown = 1 del newobj.thisown + def __del__(self, destroy=_core_.delete_GBPosition): + """__del__(self)""" + try: + if self.thisown: destroy(self) + except: pass + def GetRow(*args, **kwargs): """GetRow(self) -> int""" return _core_.GBPosition_GetRow(*args, **kwargs) @@ -12386,6 +12763,12 @@ class GBSpan(object): self.this = newobj.this self.thisown = 1 del newobj.thisown + def __del__(self, destroy=_core_.delete_GBSpan): + """__del__(self)""" + try: + if self.thisown: destroy(self) + except: pass + def GetRowspan(*args, **kwargs): """GetRowspan(self) -> int""" return _core_.GBSpan_GetRowspan(*args, **kwargs) @@ -12466,6 +12849,12 @@ class GBSizerItem(SizerItem): self.this = newobj.this self.thisown = 1 del newobj.thisown + def __del__(self, destroy=_core_.delete_GBSizerItem): + """__del__(self)""" + try: + if self.thisown: destroy(self) + except: pass + def GetPos(*args, **kwargs): """ GetPos(self) -> GBPosition @@ -13339,3 +13728,4 @@ _core_._wxPyFixStockObjects() #---------------------------------------------------------------------------- +