reSWIGged

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42105 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-10-18 23:51:19 +00:00
parent 72156afeb5
commit 24f6c4e865
9 changed files with 2373 additions and 1555 deletions
+443 -95
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+291 -2
View File
@@ -2615,6 +2615,98 @@ class ArtProvider(object):
...
return bmp
Identifying art resources
-------------------------
Every bitmap is known to wx.ArtProvider under an unique ID that is
used when requesting a resource from it. The IDs can have one of the
following predefined values. Additionally, any string recognized by
custom art providers registered using `Push` may be used.
GTK+ Note
---------
When running under GTK+ 2, GTK+ stock item IDs (e.g. 'gtk-cdrom') may be used
as well. Additionally, if wxGTK was compiled against GTK+ >= 2.4, then it is
also possible to load icons from current icon theme by specifying their name
without the extension and directory components. Icon themes recognized by GTK+
follow the freedesktop.org Icon Themes specification. Note that themes are
not guaranteed to contain all icons, so wx.ArtProvider may return wx.NullBitmap
or wx.NullIcon. The default theme is typically installed in /usr/share/icons/hicolor.
* wx.ART_ADD_BOOKMARK
* wx.ART_DEL_BOOKMARK
* wx.ART_HELP_SIDE_PANEL
* wx.ART_HELP_SETTINGS
* wx.ART_HELP_BOOK
* wx.ART_HELP_FOLDER
* wx.ART_HELP_PAGE
* wx.ART_GO_BACK
* wx.ART_GO_FORWARD
* wx.ART_GO_UP
* wx.ART_GO_DOWN
* wx.ART_GO_TO_PARENT
* wx.ART_GO_HOME
* wx.ART_FILE_OPEN
* wx.ART_FILE_SAVE
* wx.ART_FILE_SAVE_AS
* wx.ART_PRINT
* wx.ART_HELP
* wx.ART_TIP
* wx.ART_REPORT_VIEW
* wx.ART_LIST_VIEW
* wx.ART_NEW_DIR
* wx.ART_HARDDISK
* wx.ART_FLOPPY
* wx.ART_CDROM
* wx.ART_REMOVABLE
* wx.ART_FOLDER
* wx.ART_FOLDER_OPEN
* wx.ART_GO_DIR_UP
* wx.ART_EXECUTABLE_FILE
* wx.ART_NORMAL_FILE
* wx.ART_TICK_MARK
* wx.ART_CROSS_MARK
* wx.ART_ERROR
* wx.ART_QUESTION
* wx.ART_WARNING
* wx.ART_INFORMATION
* wx.ART_MISSING_IMAGE
* wx.ART_COPY
* wx.ART_CUT
* wx.ART_PASTE
* wx.ART_DELETE
* wx.ART_NEW
* wx.ART_UNDO
* wx.ART_REDO
* wx.ART_QUIT
* wx.ART_FIND
* wx.ART_FIND_AND_REPLACE
Clients
-------
The Client is the entity that calls wx.ArtProvider's `GetBitmap` or
`GetIcon` function. Client IDs serve as a hint to wx.ArtProvider
that is supposed to help it to choose the best looking bitmap. For
example it is often desirable to use slightly different icons in menus
and toolbars even though they represent the same action (e.g.
wx.ART_FILE_OPEN). Remember that this is really only a hint for
wx.ArtProvider -- it is common that `wx.ArtProvider.GetBitmap` returns
identical bitmap for different client values!
* wx.ART_TOOLBAR
* wx.ART_MENU
* wx.ART_FRAME_ICON
* wx.ART_CMN_DIALOG
* wx.ART_HELP_BROWSER
* wx.ART_MESSAGE_BOX
* wx.ART_BUTTON
* wx.ART_OTHER (used for all requests that don't fit into any
of the categories above)
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
@@ -2639,6 +2731,98 @@ class ArtProvider(object):
...
return bmp
Identifying art resources
-------------------------
Every bitmap is known to wx.ArtProvider under an unique ID that is
used when requesting a resource from it. The IDs can have one of the
following predefined values. Additionally, any string recognized by
custom art providers registered using `Push` may be used.
GTK+ Note
---------
When running under GTK+ 2, GTK+ stock item IDs (e.g. 'gtk-cdrom') may be used
as well. Additionally, if wxGTK was compiled against GTK+ >= 2.4, then it is
also possible to load icons from current icon theme by specifying their name
without the extension and directory components. Icon themes recognized by GTK+
follow the freedesktop.org Icon Themes specification. Note that themes are
not guaranteed to contain all icons, so wx.ArtProvider may return wx.NullBitmap
or wx.NullIcon. The default theme is typically installed in /usr/share/icons/hicolor.
* wx.ART_ADD_BOOKMARK
* wx.ART_DEL_BOOKMARK
* wx.ART_HELP_SIDE_PANEL
* wx.ART_HELP_SETTINGS
* wx.ART_HELP_BOOK
* wx.ART_HELP_FOLDER
* wx.ART_HELP_PAGE
* wx.ART_GO_BACK
* wx.ART_GO_FORWARD
* wx.ART_GO_UP
* wx.ART_GO_DOWN
* wx.ART_GO_TO_PARENT
* wx.ART_GO_HOME
* wx.ART_FILE_OPEN
* wx.ART_FILE_SAVE
* wx.ART_FILE_SAVE_AS
* wx.ART_PRINT
* wx.ART_HELP
* wx.ART_TIP
* wx.ART_REPORT_VIEW
* wx.ART_LIST_VIEW
* wx.ART_NEW_DIR
* wx.ART_HARDDISK
* wx.ART_FLOPPY
* wx.ART_CDROM
* wx.ART_REMOVABLE
* wx.ART_FOLDER
* wx.ART_FOLDER_OPEN
* wx.ART_GO_DIR_UP
* wx.ART_EXECUTABLE_FILE
* wx.ART_NORMAL_FILE
* wx.ART_TICK_MARK
* wx.ART_CROSS_MARK
* wx.ART_ERROR
* wx.ART_QUESTION
* wx.ART_WARNING
* wx.ART_INFORMATION
* wx.ART_MISSING_IMAGE
* wx.ART_COPY
* wx.ART_CUT
* wx.ART_PASTE
* wx.ART_DELETE
* wx.ART_NEW
* wx.ART_UNDO
* wx.ART_REDO
* wx.ART_QUIT
* wx.ART_FIND
* wx.ART_FIND_AND_REPLACE
Clients
-------
The Client is the entity that calls wx.ArtProvider's `GetBitmap` or
`GetIcon` function. Client IDs serve as a hint to wx.ArtProvider
that is supposed to help it to choose the best looking bitmap. For
example it is often desirable to use slightly different icons in menus
and toolbars even though they represent the same action (e.g.
wx.ART_FILE_OPEN). Remember that this is really only a hint for
wx.ArtProvider -- it is common that `wx.ArtProvider.GetBitmap` returns
identical bitmap for different client values!
* wx.ART_TOOLBAR
* wx.ART_MENU
* wx.ART_FRAME_ICON
* wx.ART_CMN_DIALOG
* wx.ART_HELP_BROWSER
* wx.ART_MESSAGE_BOX
* wx.ART_BUTTON
* wx.ART_OTHER (used for all requests that don't fit into any
of the categories above)
"""
_misc_.ArtProvider_swiginit(self,_misc_.new_ArtProvider(*args, **kwargs))
self._setCallbackInfo(self, ArtProvider)
@@ -4628,6 +4812,29 @@ class DataFormat(object):
example, pasting data from the clipboard only if the data is in a
format the program understands. A data format is is used to uniquely
identify this format.
On the system level, a data format is usually just a number, (which
may be the CLIPFORMAT under Windows or Atom under X11, for example.)
The standard format IDs are:
================ =====================================
wx.DF_INVALID An invalid format
wx.DF_TEXT Text format
wx.DF_BITMAP A bitmap (wx.Bitmap)
wx.DF_METAFILE A metafile (wx.Metafile, Windows only)
wx.DF_FILENAME A list of filenames
wx.DF_HTML An HTML string. This is only valid on
Windows and non-unicode builds
================ =====================================
Besies the standard formats, the application may also use custom
formats which are identified by their names (strings) and not numeric
identifiers. Although internally custom format must be created (or
registered) first, you shouldn't care about it because it is done
automatically the first time the wxDataFormat object corresponding to
a given format name is created.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
@@ -4718,6 +4925,39 @@ class DataObject(object):
you should instead derive from `wx.PyDataObjectSimple` or use
`wx.CustomDataObject`.
Not surprisingly, being 'smart' comes at a price of added
complexity. This is reasonable for the situations when you really need
to support multiple formats, but may be annoying if you only want to
do something simple like cut and paste text.
To provide a solution for both cases, wxWidgets has two predefined
classes which derive from wx.DataObject: `wx.DataObjectSimple` and
`wx.DataObjectComposite`. `wx.DataObjectSimple` is the simplest
wx.DataObject possible and only holds data in a single format (such as
text or bitmap) and `wx.DataObjectComposite` is the simplest way to
implement a wx.DataObject which supports multiple simultaneous formats
because it achievs this by simply holding several
`wx.DataObjectSimple` objects.
Please note that the easiest way to use drag and drop and the
clipboard with multiple formats is by using `wx.DataObjectComposite`,
but it is not the most efficient one as each `wx.DataObjectSimple`
would contain the whole data in its respective formats. Now imagine
that you want to paste 200 pages of text in your proprietary format,
as well as Word, RTF, HTML, Unicode and plain text to the clipboard
and even today's computers are in trouble. For this case, you will
have to derive from wx.DataObject directly and make it enumerate its
formats and provide the data in the requested format on
demand. (**TODO**: This is currently not possible from Python. Make
it so.)
Note that the platform transfer mechanisms for the clipboard and drag
and drop, do not copy any data out of the source application until
another application actually requests the data. This is in contrast to
the 'feel' offered to the user of a program who would normally think
that the data resides in the clipboard after having pressed 'Copy' -
in reality it is only declared to be available.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
def __init__(self): raise AttributeError, "No constructor defined"
@@ -4776,6 +5016,7 @@ class DataObject(object):
GetDataHere(self, DataFormat format) -> String
Get the data bytes in the specified format, returns None on failure.
:todo: This should use the python buffer interface isntead...
"""
return _misc_.DataObject_GetDataHere(*args, **kwargs)
@@ -4785,6 +5026,7 @@ class DataObject(object):
Set the data in the specified format from the bytes in the the data string.
:todo: This should use the python buffer interface isntead...
"""
return _misc_.DataObject_SetData(*args, **kwargs)
@@ -4872,6 +5114,29 @@ class PyDataObjectSimple(DataObjectSimple):
class and overload `GetDataSize`, `GetDataHere` and `SetData` when you
need to create your own simple single-format type of `wx.DataObject`.
Here is a simple example::
class MyDataObject(wx.PyDataObjectSimple):
def __init__(self):
wx.PyDataObjectSimple.__init__(
self, wx.CustomDataFormat('MyDOFormat'))
self.data = ''
def GetDataSize(self):
return len(self.data)
def GetDataHere(self):
return self.data # returns a string
def SetData(self, data):
self.data = data
return True
Note that there is already a `wx.CustomDataObject` class that behaves
very similarly to this example. The value of creating your own
derived class like this is to be able to do additional things when the
data is requested or given via the clipboard or drag and drop
operation, such as generate the data value or decode it into needed
data structures.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
@@ -4885,6 +5150,29 @@ class PyDataObjectSimple(DataObjectSimple):
class and overload `GetDataSize`, `GetDataHere` and `SetData` when you
need to create your own simple single-format type of `wx.DataObject`.
Here is a simple example::
class MyDataObject(wx.PyDataObjectSimple):
def __init__(self):
wx.PyDataObjectSimple.__init__(
self, wx.CustomDataFormat('MyDOFormat'))
self.data = ''
def GetDataSize(self):
return len(self.data)
def GetDataHere(self):
return self.data # returns a string
def SetData(self, data):
self.data = data
return True
Note that there is already a `wx.CustomDataObject` class that behaves
very similarly to this example. The value of creating your own
derived class like this is to be able to do additional things when the
data is requested or given via the clipboard or drag and drop
operation, such as generate the data value or decode it into needed
data structures.
"""
_misc_.PyDataObjectSimple_swiginit(self,_misc_.new_PyDataObjectSimple(*args, **kwargs))
self._setCallbackInfo(self, PyDataObjectSimple)
@@ -5050,6 +5338,7 @@ class BitmapDataObject(DataObjectSimple):
data. It can be used without change to paste data into the `wx.Clipboard`
or a `wx.DropSource`.
:see: `wx.PyBitmapDataObject` if you wish to override `GetBitmap` to increase efficiency.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
@@ -6623,8 +6912,8 @@ def AboutBox(*args, **kwargs):
This function shows the standard about dialog containing the
information specified in ``info``. If the current platform has a
native about dialog which is capable of showing all the fields in
``info``, the native dialog is used, otherwise the function falls back
to the generic wxWidgets version of the dialog.
`wx.AboutDialogInfo`, the native dialog is used, otherwise the
function falls back to the generic wxWidgets version of the dialog.
"""
return _misc_.AboutBox(*args, **kwargs)
+102 -94
View File
@@ -4441,88 +4441,6 @@ def MemoryDCFromDC(*args, **kwargs):
#---------------------------------------------------------------------------
BUFFER_VIRTUAL_AREA = _gdi_.BUFFER_VIRTUAL_AREA
BUFFER_CLIENT_AREA = _gdi_.BUFFER_CLIENT_AREA
class BufferedDC(MemoryDC):
"""
This simple class provides a simple way to avoid flicker: when drawing
on it, everything is in fact first drawn on an in-memory buffer (a
`wx.Bitmap`) and then copied to the screen only once, when this object
is destroyed.
It can be used in the same way as any other device context.
wx.BufferedDC itself typically replaces `wx.ClientDC`, if you want to
use it in your EVT_PAINT handler, you should look at
`wx.BufferedPaintDC`.
Please note that GTK+ 2.0 and OS X provide double buffering themselves
natively. wxBufferedDC is aware of this however, and will bypass the buffering
unless an explicit buffer bitmap is given.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, DC dc, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedDC
__init__(self, DC dc, Size area, int style=BUFFER_CLIENT_AREA) -> BufferedDC
Constructs a buffered DC.
"""
_gdi_.BufferedDC_swiginit(self,_gdi_.new_BufferedDC(*args))
self.__dc = args[0] # save a ref so the other dc will not be deleted before self
__swig_destroy__ = _gdi_.delete_BufferedDC
__del__ = lambda self : None;
def UnMask(*args, **kwargs):
"""
UnMask(self)
Blits the buffer to the dc, and detaches the dc from the buffer (so it
can be effectively used once only). This is usually only called in
the destructor.
"""
return _gdi_.BufferedDC_UnMask(*args, **kwargs)
_gdi_.BufferedDC_swigregister(BufferedDC)
class BufferedPaintDC(BufferedDC):
"""
This is a subclass of `wx.BufferedDC` which can be used inside of an
EVT_PAINT event handler. Just create an object of this class instead
of `wx.PaintDC` and that's all you have to do to (mostly) avoid
flicker. The only thing to watch out for is that if you are using this
class together with `wx.ScrolledWindow`, you probably do **not** want
to call `wx.Window.PrepareDC` on it as it already does this internally
for the real underlying `wx.PaintDC`.
If your window is already fully buffered in a `wx.Bitmap` then your
EVT_PAINT handler can be as simple as just creating a
``wx.BufferedPaintDC`` as it will `Blit` the buffer to the window
automatically when it is destroyed. For example::
def OnPaint(self, event):
dc = wx.BufferedPaintDC(self, self.buffer)
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window window, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedPaintDC
Create a buffered paint DC. As with `wx.BufferedDC`, you may either
provide the bitmap to be used for buffering or let this object create
one internally (in the latter case, the size of the client part of the
window is automatically used).
"""
_gdi_.BufferedPaintDC_swiginit(self,_gdi_.new_BufferedPaintDC(*args, **kwargs))
_gdi_.BufferedPaintDC_swigregister(BufferedPaintDC)
#---------------------------------------------------------------------------
class ScreenDC(DC):
"""
A wxScreenDC can be used to paint anywhere on the screen. This should
@@ -4664,20 +4582,110 @@ _gdi_.PaintDC_swigregister(PaintDC)
#---------------------------------------------------------------------------
if 'wxMac' in wx.PlatformInfo or 'gtk2' in wx.PlatformInfo:
_AutoBufferedPaintDCBase = PaintDC
else:
_AutoBufferedPaintDCBase = BufferedPaintDC
class AutoBufferedPaintDC(_AutoBufferedPaintDCBase):
BUFFER_VIRTUAL_AREA = _gdi_.BUFFER_VIRTUAL_AREA
BUFFER_CLIENT_AREA = _gdi_.BUFFER_CLIENT_AREA
class BufferedDC(MemoryDC):
"""
This simple class provides a simple way to avoid flicker: when drawing
on it, everything is in fact first drawn on an in-memory buffer (a
`wx.Bitmap`) and then copied to the screen only once, when this object
is destroyed.
It can be used in the same way as any other device context.
wx.BufferedDC itself typically replaces `wx.ClientDC`, if you want to
use it in your EVT_PAINT handler, you should look at
`wx.BufferedPaintDC`.
Please note that GTK+ 2.0 and OS X provide double buffering themselves
natively. wxBufferedDC is aware of this however, and will bypass the buffering
unless an explicit buffer bitmap is given.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, DC dc, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedDC
__init__(self, DC dc, Size area, int style=BUFFER_CLIENT_AREA) -> BufferedDC
Constructs a buffered DC.
"""
_gdi_.BufferedDC_swiginit(self,_gdi_.new_BufferedDC(*args))
self.__dc = args[0] # save a ref so the other dc will not be deleted before self
__swig_destroy__ = _gdi_.delete_BufferedDC
__del__ = lambda self : None;
def UnMask(*args, **kwargs):
"""
UnMask(self)
Blits the buffer to the dc, and detaches the dc from the buffer (so it
can be effectively used once only). This is usually only called in
the destructor.
"""
return _gdi_.BufferedDC_UnMask(*args, **kwargs)
_gdi_.BufferedDC_swigregister(BufferedDC)
class BufferedPaintDC(BufferedDC):
"""
This is a subclass of `wx.BufferedDC` which can be used inside of an
EVT_PAINT event handler. Just create an object of this class instead
of `wx.PaintDC` and that's all you have to do to (mostly) avoid
flicker. The only thing to watch out for is that if you are using this
class together with `wx.ScrolledWindow`, you probably do **not** want
to call `wx.Window.PrepareDC` on it as it already does this internally
for the real underlying `wx.PaintDC`.
If your window is already fully buffered in a `wx.Bitmap` then your
EVT_PAINT handler can be as simple as just creating a
``wx.BufferedPaintDC`` as it will `Blit` the buffer to the window
automatically when it is destroyed. For example::
def OnPaint(self, event):
dc = wx.BufferedPaintDC(self, self.buffer)
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window window, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedPaintDC
Create a buffered paint DC. As with `wx.BufferedDC`, you may either
provide the bitmap to be used for buffering or let this object create
one internally (in the latter case, the size of the client part of the
window is automatically used).
"""
_gdi_.BufferedPaintDC_swiginit(self,_gdi_.new_BufferedPaintDC(*args, **kwargs))
_gdi_.BufferedPaintDC_swigregister(BufferedPaintDC)
#---------------------------------------------------------------------------
class AutoBufferedPaintDC(DC):
"""
If the current platform double buffers by default then this DC is the
same as a plain `wx.PaintDC`, otherwise it is a `wx.BufferedPaintDC`.
:see: `wx.AutoBufferedPaintDCFactory`
"""
def __init__(self, window):
_AutoBufferedPaintDCBase.__init__(self, window)
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window win) -> AutoBufferedPaintDC
If the current platform double buffers by default then this DC is the
same as a plain `wx.PaintDC`, otherwise it is a `wx.BufferedPaintDC`.
:see: `wx.AutoBufferedPaintDCFactory`
"""
_gdi_.AutoBufferedPaintDC_swiginit(self,_gdi_.new_AutoBufferedPaintDC(*args, **kwargs))
_gdi_.AutoBufferedPaintDC_swigregister(AutoBufferedPaintDC)
def AutoBufferedPaintDCFactory(*args, **kwargs):
@@ -4685,10 +4693,10 @@ def AutoBufferedPaintDCFactory(*args, **kwargs):
AutoBufferedPaintDCFactory(Window window) -> DC
Checks if the window is natively double buffered and will return a
`wx.PaintDC` if it is, a `wx.BufferedPaintDC` otherwise. The
advantage of this function over `wx.AutoBufferedPaintDC` is that this
function will check if the the specified window supports has
double-buffering enabled rather than just going by platform defaults.
`wx.PaintDC` if it is, a `wx.BufferedPaintDC` otherwise. The advantage of
this function over `wx.AutoBufferedPaintDC` is that this function will check
if the the specified window has double-buffering enabled rather than just
going by platform defaults.
"""
return _gdi_.AutoBufferedPaintDCFactory(*args, **kwargs)
#---------------------------------------------------------------------------
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -6631,8 +6631,8 @@ def AboutBox(*args, **kwargs):
This function shows the standard about dialog containing the
information specified in ``info``. If the current platform has a
native about dialog which is capable of showing all the fields in
``info``, the native dialog is used, otherwise the function falls back
to the generic wxWidgets version of the dialog.
`wx.AboutDialogInfo`, the native dialog is used, otherwise the
function falls back to the generic wxWidgets version of the dialog.
"""
return _misc_.AboutBox(*args, **kwargs)
+102 -94
View File
@@ -4535,88 +4535,6 @@ def MemoryDCFromDC(*args, **kwargs):
#---------------------------------------------------------------------------
BUFFER_VIRTUAL_AREA = _gdi_.BUFFER_VIRTUAL_AREA
BUFFER_CLIENT_AREA = _gdi_.BUFFER_CLIENT_AREA
class BufferedDC(MemoryDC):
"""
This simple class provides a simple way to avoid flicker: when drawing
on it, everything is in fact first drawn on an in-memory buffer (a
`wx.Bitmap`) and then copied to the screen only once, when this object
is destroyed.
It can be used in the same way as any other device context.
wx.BufferedDC itself typically replaces `wx.ClientDC`, if you want to
use it in your EVT_PAINT handler, you should look at
`wx.BufferedPaintDC`.
Please note that GTK+ 2.0 and OS X provide double buffering themselves
natively. wxBufferedDC is aware of this however, and will bypass the buffering
unless an explicit buffer bitmap is given.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, DC dc, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedDC
__init__(self, DC dc, Size area, int style=BUFFER_CLIENT_AREA) -> BufferedDC
Constructs a buffered DC.
"""
_gdi_.BufferedDC_swiginit(self,_gdi_.new_BufferedDC(*args))
self.__dc = args[0] # save a ref so the other dc will not be deleted before self
__swig_destroy__ = _gdi_.delete_BufferedDC
__del__ = lambda self : None;
def UnMask(*args, **kwargs):
"""
UnMask(self)
Blits the buffer to the dc, and detaches the dc from the buffer (so it
can be effectively used once only). This is usually only called in
the destructor.
"""
return _gdi_.BufferedDC_UnMask(*args, **kwargs)
_gdi_.BufferedDC_swigregister(BufferedDC)
class BufferedPaintDC(BufferedDC):
"""
This is a subclass of `wx.BufferedDC` which can be used inside of an
EVT_PAINT event handler. Just create an object of this class instead
of `wx.PaintDC` and that's all you have to do to (mostly) avoid
flicker. The only thing to watch out for is that if you are using this
class together with `wx.ScrolledWindow`, you probably do **not** want
to call `wx.Window.PrepareDC` on it as it already does this internally
for the real underlying `wx.PaintDC`.
If your window is already fully buffered in a `wx.Bitmap` then your
EVT_PAINT handler can be as simple as just creating a
``wx.BufferedPaintDC`` as it will `Blit` the buffer to the window
automatically when it is destroyed. For example::
def OnPaint(self, event):
dc = wx.BufferedPaintDC(self, self.buffer)
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window window, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedPaintDC
Create a buffered paint DC. As with `wx.BufferedDC`, you may either
provide the bitmap to be used for buffering or let this object create
one internally (in the latter case, the size of the client part of the
window is automatically used).
"""
_gdi_.BufferedPaintDC_swiginit(self,_gdi_.new_BufferedPaintDC(*args, **kwargs))
_gdi_.BufferedPaintDC_swigregister(BufferedPaintDC)
#---------------------------------------------------------------------------
class ScreenDC(DC):
"""
A wxScreenDC can be used to paint anywhere on the screen. This should
@@ -4758,20 +4676,110 @@ _gdi_.PaintDC_swigregister(PaintDC)
#---------------------------------------------------------------------------
if 'wxMac' in wx.PlatformInfo or 'gtk2' in wx.PlatformInfo:
_AutoBufferedPaintDCBase = PaintDC
else:
_AutoBufferedPaintDCBase = BufferedPaintDC
class AutoBufferedPaintDC(_AutoBufferedPaintDCBase):
BUFFER_VIRTUAL_AREA = _gdi_.BUFFER_VIRTUAL_AREA
BUFFER_CLIENT_AREA = _gdi_.BUFFER_CLIENT_AREA
class BufferedDC(MemoryDC):
"""
This simple class provides a simple way to avoid flicker: when drawing
on it, everything is in fact first drawn on an in-memory buffer (a
`wx.Bitmap`) and then copied to the screen only once, when this object
is destroyed.
It can be used in the same way as any other device context.
wx.BufferedDC itself typically replaces `wx.ClientDC`, if you want to
use it in your EVT_PAINT handler, you should look at
`wx.BufferedPaintDC`.
Please note that GTK+ 2.0 and OS X provide double buffering themselves
natively. wxBufferedDC is aware of this however, and will bypass the buffering
unless an explicit buffer bitmap is given.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, DC dc, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedDC
__init__(self, DC dc, Size area, int style=BUFFER_CLIENT_AREA) -> BufferedDC
Constructs a buffered DC.
"""
_gdi_.BufferedDC_swiginit(self,_gdi_.new_BufferedDC(*args))
self.__dc = args[0] # save a ref so the other dc will not be deleted before self
__swig_destroy__ = _gdi_.delete_BufferedDC
__del__ = lambda self : None;
def UnMask(*args, **kwargs):
"""
UnMask(self)
Blits the buffer to the dc, and detaches the dc from the buffer (so it
can be effectively used once only). This is usually only called in
the destructor.
"""
return _gdi_.BufferedDC_UnMask(*args, **kwargs)
_gdi_.BufferedDC_swigregister(BufferedDC)
class BufferedPaintDC(BufferedDC):
"""
This is a subclass of `wx.BufferedDC` which can be used inside of an
EVT_PAINT event handler. Just create an object of this class instead
of `wx.PaintDC` and that's all you have to do to (mostly) avoid
flicker. The only thing to watch out for is that if you are using this
class together with `wx.ScrolledWindow`, you probably do **not** want
to call `wx.Window.PrepareDC` on it as it already does this internally
for the real underlying `wx.PaintDC`.
If your window is already fully buffered in a `wx.Bitmap` then your
EVT_PAINT handler can be as simple as just creating a
``wx.BufferedPaintDC`` as it will `Blit` the buffer to the window
automatically when it is destroyed. For example::
def OnPaint(self, event):
dc = wx.BufferedPaintDC(self, self.buffer)
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window window, Bitmap buffer=NullBitmap, int style=BUFFER_CLIENT_AREA) -> BufferedPaintDC
Create a buffered paint DC. As with `wx.BufferedDC`, you may either
provide the bitmap to be used for buffering or let this object create
one internally (in the latter case, the size of the client part of the
window is automatically used).
"""
_gdi_.BufferedPaintDC_swiginit(self,_gdi_.new_BufferedPaintDC(*args, **kwargs))
_gdi_.BufferedPaintDC_swigregister(BufferedPaintDC)
#---------------------------------------------------------------------------
class AutoBufferedPaintDC(DC):
"""
If the current platform double buffers by default then this DC is the
same as a plain `wx.PaintDC`, otherwise it is a `wx.BufferedPaintDC`.
:see: `wx.AutoBufferedPaintDCFactory`
"""
def __init__(self, window):
_AutoBufferedPaintDCBase.__init__(self, window)
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window win) -> AutoBufferedPaintDC
If the current platform double buffers by default then this DC is the
same as a plain `wx.PaintDC`, otherwise it is a `wx.BufferedPaintDC`.
:see: `wx.AutoBufferedPaintDCFactory`
"""
_gdi_.AutoBufferedPaintDC_swiginit(self,_gdi_.new_AutoBufferedPaintDC(*args, **kwargs))
_gdi_.AutoBufferedPaintDC_swigregister(AutoBufferedPaintDC)
def AutoBufferedPaintDCFactory(*args, **kwargs):
@@ -4779,10 +4787,10 @@ def AutoBufferedPaintDCFactory(*args, **kwargs):
AutoBufferedPaintDCFactory(Window window) -> DC
Checks if the window is natively double buffered and will return a
`wx.PaintDC` if it is, a `wx.BufferedPaintDC` otherwise. The
advantage of this function over `wx.AutoBufferedPaintDC` is that this
function will check if the the specified window supports has
double-buffering enabled rather than just going by platform defaults.
`wx.PaintDC` if it is, a `wx.BufferedPaintDC` otherwise. The advantage of
this function over `wx.AutoBufferedPaintDC` is that this function will check
if the the specified window has double-buffering enabled rather than just
going by platform defaults.
"""
return _gdi_.AutoBufferedPaintDCFactory(*args, **kwargs)
#---------------------------------------------------------------------------
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -6631,8 +6631,8 @@ def AboutBox(*args, **kwargs):
This function shows the standard about dialog containing the
information specified in ``info``. If the current platform has a
native about dialog which is capable of showing all the fields in
``info``, the native dialog is used, otherwise the function falls back
to the generic wxWidgets version of the dialog.
`wx.AboutDialogInfo`, the native dialog is used, otherwise the
function falls back to the generic wxWidgets version of the dialog.
"""
return _misc_.AboutBox(*args, **kwargs)