STATIC_BORDER = _core_.STATIC_BORDER
TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
NO_BORDER = _core_.NO_BORDER
+DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
WANTS_CHARS = _core_.WANTS_CHARS
POPUP_WINDOW = _core_.POPUP_WINDOW
CENTER_FRAME = _core_.CENTER_FRAME
CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
-ED_CLIENT_MARGIN = _core_.ED_CLIENT_MARGIN
-ED_BUTTONS_BOTTOM = _core_.ED_BUTTONS_BOTTOM
-ED_BUTTONS_RIGHT = _core_.ED_BUTTONS_RIGHT
-ED_STATIC_LINE = _core_.ED_STATIC_LINE
-EXT_DIALOG_STYLE = _core_.EXT_DIALOG_STYLE
CLIP_CHILDREN = _core_.CLIP_CHILDREN
CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
+WXK_COMMAND = _core_.WXK_COMMAND
+WXK_SPECIAL1 = _core_.WXK_SPECIAL1
+WXK_SPECIAL2 = _core_.WXK_SPECIAL2
+WXK_SPECIAL3 = _core_.WXK_SPECIAL3
+WXK_SPECIAL4 = _core_.WXK_SPECIAL4
+WXK_SPECIAL5 = _core_.WXK_SPECIAL5
+WXK_SPECIAL6 = _core_.WXK_SPECIAL6
+WXK_SPECIAL7 = _core_.WXK_SPECIAL7
+WXK_SPECIAL8 = _core_.WXK_SPECIAL8
+WXK_SPECIAL9 = _core_.WXK_SPECIAL9
+WXK_SPECIAL10 = _core_.WXK_SPECIAL10
+WXK_SPECIAL11 = _core_.WXK_SPECIAL11
+WXK_SPECIAL12 = _core_.WXK_SPECIAL12
+WXK_SPECIAL13 = _core_.WXK_SPECIAL13
+WXK_SPECIAL14 = _core_.WXK_SPECIAL14
+WXK_SPECIAL15 = _core_.WXK_SPECIAL15
+WXK_SPECIAL16 = _core_.WXK_SPECIAL16
+WXK_SPECIAL17 = _core_.WXK_SPECIAL17
+WXK_SPECIAL18 = _core_.WXK_SPECIAL18
+WXK_SPECIAL19 = _core_.WXK_SPECIAL19
+WXK_SPECIAL20 = _core_.WXK_SPECIAL20
PAPER_NONE = _core_.PAPER_NONE
PAPER_LETTER = _core_.PAPER_LETTER
PAPER_LEGAL = _core_.PAPER_LEGAL
"""MemoryFSHandler_RemoveFile(String filename)"""
return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
+IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
+IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
+IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
#---------------------------------------------------------------------------
class ImageHandler(Object):
"""
return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
+ def GetCount(*args, **kwargs):
+ """
+ GetCount(self, unsigned long key) -> unsigned long
+
+ Returns the pixel count for the given key. Use `MakeKey` to create a
+ key value from a RGB tripple.
+ """
+ return _core_.ImageHistogram_GetCount(*args, **kwargs)
+
+ def GetCountRGB(*args, **kwargs):
+ """
+ GetCountRGB(self, unsigned char r, unsigned char g, unsigned char b) -> unsigned long
+
+ Returns the pixel count for the given RGB values.
+ """
+ return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
+
+ def GetCountColour(*args, **kwargs):
+ """
+ GetCountColour(self, Colour colour) -> unsigned long
+
+ Returns the pixel count for the given `wx.Colour` value.
+ """
+ return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
+
class ImageHistogramPtr(ImageHistogram):
def __init__(self, this):
"""
return _core_.Image_InitAlpha(*args, **kwargs)
+ def IsTransparent(*args, **kwargs):
+ """
+ IsTransparent(self, int x, int y, unsigned char threshold=IMAGE_ALPHA_THRESHOLD) -> bool
+
+ Returns True if this pixel is masked or has an alpha value less than
+ the spcified threshold.
+ """
+ return _core_.Image_IsTransparent(*args, **kwargs)
+
def FindFirstUnusedColour(*args, **kwargs):
"""
FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
def ConvertAlphaToMask(*args, **kwargs):
"""
- ConvertAlphaToMask(self, byte threshold=128) -> bool
+ ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
If the image has alpha channel, this method converts it to mask. All pixels
with alpha value less than ``threshold`` are replaced with mask colour and the
return _core_.Image_Paste(*args, **kwargs)
def GetData(*args, **kwargs):
- """GetData(self) -> PyObject"""
+ """
+ GetData(self) -> PyObject
+
+ Returns a string containing a copy of the RGB bytes of the image.
+ """
return _core_.Image_GetData(*args, **kwargs)
def SetData(*args, **kwargs):
- """SetData(self, PyObject data)"""
+ """
+ SetData(self, buffer data)
+
+ Resets the Image's RGB data from a buffer of RGB bytes. Accepts
+ either a string or a buffer object holding the data and the length of
+ the data must be width*height*3.
+ """
return _core_.Image_SetData(*args, **kwargs)
def GetDataBuffer(*args, **kwargs):
- """GetDataBuffer(self) -> PyObject"""
+ """
+ GetDataBuffer(self) -> PyObject
+
+ Returns a writable Python buffer object that is pointing at the RGB
+ image data buffer inside the wx.Image.
+ """
return _core_.Image_GetDataBuffer(*args, **kwargs)
def SetDataBuffer(*args, **kwargs):
- """SetDataBuffer(self, PyObject data)"""
+ """
+ SetDataBuffer(self, buffer data)
+
+ Sets the internal image data pointer to point at a Python buffer
+ object. This can save a copy of the data but you must ensure that the
+ buffer object lives longer than the wx.Image does.
+ """
return _core_.Image_SetDataBuffer(*args, **kwargs)
def GetAlphaData(*args, **kwargs):
- """GetAlphaData(self) -> PyObject"""
+ """
+ GetAlphaData(self) -> PyObject
+
+ Returns a string containing a copy of the alpha bytes of the image.
+ """
return _core_.Image_GetAlphaData(*args, **kwargs)
def SetAlphaData(*args, **kwargs):
- """SetAlphaData(self, PyObject data)"""
+ """
+ SetAlphaData(self, buffer alpha)
+
+ Resets the Image's alpha data from a buffer of bytes. Accepts either
+ a string or a buffer object holding the data and the length of the
+ data must be width*height.
+ """
return _core_.Image_SetAlphaData(*args, **kwargs)
def GetAlphaBuffer(*args, **kwargs):
return _core_.Image_GetAlphaBuffer(*args, **kwargs)
def SetAlphaBuffer(*args, **kwargs):
- """SetAlphaBuffer(self, PyObject data)"""
+ """SetAlphaBuffer(self, buffer alpha)"""
return _core_.Image_SetAlphaBuffer(*args, **kwargs)
def SetMaskColour(*args, **kwargs):
return val
def EmptyImage(*args, **kwargs):
- """EmptyImage(int width=0, int height=0, bool clear=True) -> Image"""
+ """
+ EmptyImage(int width=0, int height=0, bool clear=True) -> Image
+
+ Construct an empty image of a given size, optionally setting all
+ pixels to black.
+ """
val = _core_.new_EmptyImage(*args, **kwargs)
val.thisown = 1
return val
def ImageFromBitmap(*args, **kwargs):
- """ImageFromBitmap(Bitmap bitmap) -> Image"""
+ """
+ ImageFromBitmap(Bitmap bitmap) -> Image
+
+ Construct an Image from a `wx.Bitmap`.
+ """
val = _core_.new_ImageFromBitmap(*args, **kwargs)
val.thisown = 1
return val
def ImageFromData(*args, **kwargs):
- """ImageFromData(int width, int height, unsigned char data) -> Image"""
+ """
+ ImageFromData(int width, int height, buffer data) -> Image
+
+ Construct an Image from a buffer of RGB bytes. Accepts either a
+ string or a buffer object holding the data and the length of the data
+ must be width*height*3.
+ """
val = _core_.new_ImageFromData(*args, **kwargs)
val.thisown = 1
return val
def ImageFromDataWithAlpha(*args, **kwargs):
- """ImageFromDataWithAlpha(int width, int height, unsigned char data, unsigned char alpha) -> Image"""
+ """
+ ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
+
+ Construct an Image from a buffer of RGB bytes with an Alpha channel.
+ Accepts either a string or a buffer object holding the data and the
+ length of the data must be width*height*3.
+ """
val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
val.thisown = 1
return val
wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
wxEVT_SIZING = _core_.wxEVT_SIZING
wxEVT_MOVING = _core_.wxEVT_MOVING
+wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
+EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
def Hide(self, item, recursive=False):
"""
- A convenience method for Show(item, False, recursive).
+ A convenience method for `Show`(item, False, recursive).
"""
return self.Show(item, False, recursive)
# different on different platforms. For example, please see
# http://www.alanwood.net/demos/charsetdiffs.html for differences
# between the common latin/roman encodings.
-import locale
-default = locale.getdefaultlocale()[1]
+
+default = _sys.getdefaultencoding()
+if default == 'ascii':
+ import locale
+ import codecs
+ try:
+ default = locale.getdefaultlocale()[1]
+ codecs.lookup(default)
+ except (ValueError, LookupError):
+ default = _sys.getdefaultencoding()
+ del locale
+ del codecs
if default:
wx.SetDefaultPyEncoding(default)
del default
-del locale
#----------------------------------------------------------------------------