Some docstring additions, reformats and epydoc markup.

Removed RefDoc macros, instead made all the normal Docstring macros
take an extra parameter to be used for the optional details postion of
the docstring.  The intent is that the docstrings put in the generated
.py files checked in to CVS and delivered in releases will be only a
paragraph or two, but when used for generating the epydoc reference
docs they can optionally contain a lot more details.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-05-12 00:17:48 +00:00
parent 0b9c95225e
commit d07d2bc9d0
41 changed files with 1657 additions and 1537 deletions

View File

@@ -101,6 +101,11 @@ SWIG = "swig" # The swig executable to use.
BUILD_RENAMERS = 1 # Should we build the renamer modules too?
FULL_DOCS = 0 # Some docstrings are split into a basic docstring and a
# details string. Setting this flag to 1 will
# cause the two strings to be combined and output
# as the full docstring.
UNICODE = 0 # This will pass the 'wxUSE_UNICODE' flag to SWIG and
# will ensure that the right headers are found and the
# right libs are linked.
@@ -211,6 +216,7 @@ for flag in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
'BUILD_GIZMOS', 'BUILD_DLLWIDGET', 'BUILD_IEWIN', 'BUILD_ACTIVEX',
'CORE_ONLY', 'PREP_ONLY', 'USE_SWIG', 'UNICODE',
'UNDEF_NDEBUG', 'NO_SCRIPTS', 'NO_HEADERS', 'BUILD_RENAMERS',
'FULL_DOCS',
'FINAL', 'HYBRID', ]:
for x in range(len(sys.argv)):
if sys.argv[x].find(flag) == 0:
@@ -741,6 +747,10 @@ swig_args = ['-c++',
if UNICODE:
swig_args.append('-DwxUSE_UNICODE')
if FULL_DOCS:
swig_args.append('-D_DO_FULL_DOCS')
swig_deps = [ 'src/my_typemaps.i',
'src/common.swg',
'src/pyrun.swg',

View File

@@ -246,13 +246,10 @@ def doDocStrings(parentNode, srcNode):
autodoc = getAttr(srcNode, "python_autodoc")
docstr = getAttr(srcNode, "feature_docstring")
refdoc = getAttr(srcNode, "feature_refdoc")
if autodoc:
parentNode.addChild(makeDocElement("autodoc", autodoc))
if docstr:
parentNode.addChild(makeDocElement("docstring", docstr))
if refdoc:
parentNode.addChild(makeDocElement("refdoc", refdoc))

View File

@@ -36,14 +36,14 @@ programs can choose to use wx.AcceleratorEntry objects, but using a
list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
as well. See `__init__` for details of the tuple values.
:see: `wx.AcceleratorTable`");
:see: `wx.AcceleratorTable`", "");
class wxAcceleratorEntry {
public:
DocCtorStr(
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmdID = 0/*, wxMenuItem *menuitem = NULL*/),
"Construct a wx.AcceleratorEntry.
"Construct a wx.AcceleratorEntry.",
"
:param flags: A bitmask of wx.ACCEL_ALT, wx.ACCEL_SHIFT,
wx.ACCEL_CTRL or wx.ACCEL_NORMAL used to specify
which modifier keys are held down.
@@ -56,7 +56,7 @@ public:
DocDeclStr(
void , Set(int flags, int keyCode, int cmd/*, wxMenuItem *menuItem = NULL*/),
"(Re)set the attributes of a wx.AcceleratorEntry.
:see `__init__`");
:see `__init__`", "");
// void SetMenuItem(wxMenuItem *item);
@@ -64,15 +64,15 @@ public:
DocDeclStr(
int , GetFlags(),
"Get the AcceleratorEntry's flags.");
"Get the AcceleratorEntry's flags.", "");
DocDeclStr(
int , GetKeyCode(),
"Get the AcceleratorEntry's keycode.");
"Get the AcceleratorEntry's keycode.", "");
DocDeclStr(
int , GetCommand(),
"Get the AcceleratorEntry's command ID.");
"Get the AcceleratorEntry's command ID.", "");
};
@@ -83,7 +83,7 @@ DocStr(wxAcceleratorTable,
"An accelerator table allows the application to specify a table of
keyboard shortcuts for menus or other commands. On Windows, menu or
button commands are supported; on GTK, only menu commands are
supported.
supported.", "
The object ``wx.NullAcceleratorTable`` is defined to be a table with
no data, and is the initial accelerator table for a window.
@@ -113,7 +113,7 @@ public:
"Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
items or or of 3-tuples (flags, keyCode, cmdID)
:see: `wx.AcceleratorEntry`");
:see: `wx.AcceleratorEntry`", "");
wxAcceleratorTable(int n, const wxAcceleratorEntry* entries);
~wxAcceleratorTable();

View File

@@ -42,7 +42,7 @@ enum
DocStr(wxPyApp,
"The ``wx.PyApp`` class is an *implementation detail*, please use the
`wx.App` class (or some other derived class) instead.");
`wx.App` class (or some other derived class) instead.", "");
class wxPyApp : public wxEvtHandler {
public:
@@ -52,7 +52,7 @@ public:
self._setOORInfo(self)";
DocStr(wxPyApp,
"Create a new application object, starting the bootstrap process.");
"Create a new application object, starting the bootstrap process.", "");
%extend {
wxPyApp() {
wxPythonApp = new wxPyApp();
@@ -67,27 +67,27 @@ public:
DocDeclStr(
wxString, GetAppName() const,
"Get the application name.");
"Get the application name.", "");
DocDeclStr(
void, SetAppName(const wxString& name),
"Set the application name. This value may be used automatically by
`wx.Config` and such.");
`wx.Config` and such.", "");
DocDeclStr(
wxString, GetClassName() const,
"Get the application's class name.");
"Get the application's class name.", "");
DocDeclStr(
void, SetClassName(const wxString& name),
"Set the application's class name. This value may be used for
X-resources if applicable for the platform");
X-resources if applicable for the platform", "");
DocDeclStr(
const wxString&, GetVendorName() const,
"Get the application's vendor name.");
"Get the application's vendor name.", "");
DocDeclStr(
void, SetVendorName(const wxString& name),
"Set the application's vendor name. This value may be used
automatically by `wx.Config` and such.");
automatically by `wx.Config` and such.", "");
DocDeclStr(
@@ -99,14 +99,14 @@ CreateTraits() and returning his own traits object) or which is
GUI/console dependent as then wx.AppTraits allows us to abstract the
differences behind the common facade.
:todo: Add support for overriding CreateAppTraits in wxPython.");
:todo: Add support for overriding CreateAppTraits in wxPython.", "");
DocDeclStr(
virtual void, ProcessPendingEvents(),
"Process all events in the Pending Events list -- it is necessary to
call this function to process posted events. This normally happens
during each event loop iteration.");
during each event loop iteration.", "");
DocDeclStr(
@@ -118,73 +118,74 @@ recursively unless the value of ``onlyIfNeeded`` is True.
:warning: This function is dangerous as it can lead to unexpected
reentrancies (i.e. when called from an event handler it may
result in calling the same event handler again), use with
_extreme_ care or, better, don't use at all!
extreme care or, better, don't use at all!
:see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`");
:see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
", "");
DocDeclStr(
virtual void, WakeUpIdle(),
"Make sure that idle events are sent again.
:see: `wx.WakeUpIdle`");
:see: `wx.WakeUpIdle`", "");
DocDeclStr(
virtual int, MainLoop(),
"Execute the main GUI loop, the function doesn't normally return until
all top level windows have been closed and destroyed.");
all top level windows have been closed and destroyed.", "");
DocDeclStr(
virtual void, Exit(),
"Exit the main loop thus terminating the application.
:see: `wx.Exit`");
:see: `wx.Exit`", "");
DocDeclStr(
virtual void, ExitMainLoop(),
"Exit the main GUI loop during the next iteration of the main
loop, (i.e. it does not stop the program immediately!)");
loop, (i.e. it does not stop the program immediately!)", "");
DocDeclStr(
virtual bool, Pending(),
"Returns True if there are unprocessed events in the event queue.");
"Returns True if there are unprocessed events in the event queue.", "");
DocDeclStr(
virtual bool, Dispatch(),
"Process the first event in the event queue (blocks until an event
appears if there are none currently)");
appears if there are none currently)", "");
DocDeclStr(
virtual bool, ProcessIdle(),
"Called from the MainLoop when the application becomes idle (there are
no pending events) and sends a `wx.IdleEvent` to all interested
parties. Returns True if more idle events are needed, False if not.");
parties. Returns True if more idle events are needed, False if not.", "");
DocDeclStr(
virtual bool, SendIdleEvents(wxWindow* win, wxIdleEvent& event),
"Send idle event to window and all subwindows. Returns True if more
idle time is requested.");
idle time is requested.", "");
DocDeclStr(
virtual bool, IsActive() const,
"Return True if our app has focus.");
"Return True if our app has focus.", "");
DocDeclStr(
void, SetTopWindow(wxWindow *win),
"Set the *main* top level window");
"Set the *main* top level window", "");
DocDeclStr(
virtual wxWindow*, GetTopWindow() const,
"Return the *main* top level window (if it hadn't been set previously
with SetTopWindow(), will return just some top level window and, if
there not any, will return None)");
there not any, will return None)", "");
DocDeclStr(
@@ -193,12 +194,12 @@ there not any, will return None)");
loop (and so, usually, terminate) when the last top-level program
window is deleted. Beware that if you disable this behaviour (with
SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
explicitly from somewhere.");
explicitly from somewhere.", "");
DocDeclStr(
bool, GetExitOnFrameDelete() const,
"Get the current exit behaviour setting.");
"Get the current exit behaviour setting.", "");
#if 0
// Get display mode that is in use. This is only used in framebuffer
@@ -215,11 +216,11 @@ explicitly from somewhere.");
DocDeclStr(
void, SetUseBestVisual( bool flag ),
"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.)");
systems where more than one is available, (Sun, SGI, XFree86 4, etc.)", "");
DocDeclStr(
bool, GetUseBestVisual() const,
"Get current UseBestVisual setting.");
"Get current UseBestVisual setting.", "");
// set/get printing mode: see wxPRINT_XXX constants.
@@ -232,8 +233,8 @@ systems where more than one is available, (Sun, SGI, XFree86 4, etc.)");
DocDeclStr(
void, SetAssertMode(int mode),
"Set the OnAssert behaviour for debug and hybrid builds. The following
flags may be or'd together:
"Set the OnAssert behaviour for debug and hybrid builds.",
"The following flags may be or'd together:
========================= =======================================
wx.PYAPP_ASSERT_SUPPRESS Don't do anything
@@ -247,7 +248,7 @@ flags may be or'd together:
DocDeclStr(
int, GetAssertMode(),
"Get the current OnAssert behaviour setting.");
"Get the current OnAssert behaviour setting.", "");
static bool GetMacSupportPCMenuShortcuts();
@@ -265,11 +266,11 @@ flags may be or'd together:
DocDeclStr(
void, _BootstrapApp(),
"For internal use only");
"For internal use only", "");
DocStr(GetComCtl32Version,
"Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
it wasn't found at all. Raises an exception on non-Windows platforms.");
it wasn't found at all. Raises an exception on non-Windows platforms.", "");
#ifdef __WXMSW__
static int GetComCtl32Version();
#else
@@ -288,16 +289,16 @@ it wasn't found at all. Raises an exception on non-Windows platforms.");
DocDeclStr(
void, wxExit(),
"Force an exit of the application. Convenience for wx.GetApp().Exit()");
"Force an exit of the application. Convenience for wx.GetApp().Exit()", "");
DocDeclStr(
bool, wxYield(),
"Yield to other apps/messages. Convenience for wx.GetApp().Yield()");
"Yield to other apps/messages. Convenience for wx.GetApp().Yield()", "");
DocDeclStr(
bool, wxYieldIfNeeded(),
"Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)");
"Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)", "");
DocDeclStr(
@@ -308,24 +309,24 @@ re-enables it again afterwards. If ``win`` is not None, this window
will remain enabled, allowing the implementation of some limited user
interaction.
:Returns: the result of the call to `wx.Yield`.");
:Returns: the result of the call to `wx.Yield`.", "");
DocDeclStr(
void, wxWakeUpIdle(),
"Cause the message queue to become empty again, so idle events will be
sent.");
sent.", "");
DocDeclStr(
void, wxPostEvent(wxEvtHandler *dest, wxEvent& event),
"Send an event to a window or other wx.EvtHandler to be processed
later.");
later.", "");
DocStr(wxApp_CleanUp,
"For internal use only, it is used to cleanup after wxWindows when
Python shuts down.");
"For internal use only, it is used to cleanup after wxWidgets when
Python shuts down.", "");
%inline %{
void wxApp_CleanUp() {
__wxPyCleanup();
@@ -334,7 +335,7 @@ Python shuts down.");
DocStr(wxGetApp,
"Return a reference to the current wx.App object.");
"Return a reference to the current wx.App object.", "");
%inline %{
wxPyApp* wxGetApp() {
return (wxPyApp*)wxTheApp;

View File

@@ -122,7 +122,7 @@ method and register the provider with wx.ArtProvider.PushProvider::
def CreateBitmap(self, artid, client, size):
...
return bmp
", "
Identifying art resources
-------------------------
@@ -197,18 +197,18 @@ public:
DocDeclStr(
static void , PushProvider(wxPyArtProvider *provider),
"Add new provider to the top of providers stack.");
"Add new provider to the top of providers stack.", "");
DocDeclStr(
static bool , PopProvider(),
"Remove latest added provider and delete it.");
"Remove latest added provider and delete it.", "");
DocDeclStr(
static bool , RemoveProvider(wxPyArtProvider *provider),
"Remove provider. The provider must have been added previously! The
provider is _not_ deleted.");
provider is _not_ deleted.", "");
DocDeclStr(
@@ -216,7 +216,7 @@ provider is _not_ deleted.");
const wxString& client = wxPyART_OTHER,
const wxSize& size = wxDefaultSize),
"Query the providers for bitmap with given ID and return it. Return
wx.NullBitmap if no provider provides it.");
wx.NullBitmap if no provider provides it.", "");
DocDeclStr(
@@ -224,7 +224,7 @@ wx.NullBitmap if no provider provides it.");
const wxString& client = wxPyART_OTHER,
const wxSize& size = wxDefaultSize),
"Query the providers for icon with given ID and return it. Return
wx.NullIcon if no provider provides it.");
wx.NullIcon if no provider provides it.", "");
%extend { void Destroy() { delete self; }}

View File

@@ -49,7 +49,7 @@ bitmap. It can be either monochrome or colour, and either loaded from
a file or created dynamically. A bitmap can be selected into a memory
device context (instance of `wx.MemoryDC`). This enables the bitmap to
be copied to a window or memory device context using `wx.DC.Blit`, or
to be used as a drawing surface.
to be used as a drawing surface.", "
The BMP and XMP image file formats are supported on all platforms by
wx.Bitmap. Other formats are automatically loaded by `wx.Image` and
@@ -70,8 +70,8 @@ class wxBitmap : public wxGDIObject
public:
DocCtorStr(
wxBitmap(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_ANY),
"Loads a bitmap from a file.
"Loads a bitmap from a file.",
"
:param name: Name of the file to load the bitmap from.
:param type: The type of image to expect. Can be one of the following
constants (assuming that the neccessary `wx.Image` handlers are
@@ -105,12 +105,12 @@ public:
wxBitmap(int width, int height, int depth=-1),
"Creates a new bitmap of the given size. A depth of -1 indicates the
depth of the current screen or visual. Some platforms only support 1
for monochrome and -1 for the current colour setting.",
for monochrome and -1 for the current colour setting.", "",
EmptyBitmap);
DocCtorStrName(
wxBitmap(const wxIcon& icon),
"Create a new bitmap from a `wx.Icon` object.",
"Create a new bitmap from a `wx.Icon` object.", "",
BitmapFromIcon);
DocCtorStrName(
@@ -119,13 +119,13 @@ for monochrome and -1 for the current colour setting.",
actually display a `wx.Image` as you cannot draw an image directly on
a window. The resulting bitmap will use the provided colour depth (or
that of the current screen colour depth if depth is -1) which entails
that a colour reduction may have to take place.",
that a colour reduction may have to take place.", "",
BitmapFromImage);
%extend {
DocStr(wxBitmap(PyObject* listOfStrings),
"Construct a Bitmap from a list of strings formatted as XPM data.");
"Construct a Bitmap from a list of strings formatted as XPM data.", "");
%name(BitmapFromXPMData) wxBitmap(PyObject* listOfStrings) {
char** cArray = NULL;
wxBitmap* bmp;
@@ -142,7 +142,7 @@ that a colour reduction may have to take place.",
"Creates a bitmap from an array of bits. You should only use this
function for monochrome bitmaps (depth 1) in portable programs: in
this case the bits parameter should contain an XBM image. For other
bit depths, the behaviour is platform dependent.");
bit depths, the behaviour is platform dependent.", "");
%name(BitmapFromBits) wxBitmap(PyObject* bits, int width, int height, int depth=1 ) {
char* buf;
int length;
@@ -168,23 +168,23 @@ bit depths, the behaviour is platform dependent.");
DocDeclStr(
int , GetWidth(),
"Gets the width of the bitmap in pixels.");
"Gets the width of the bitmap in pixels.", "");
DocDeclStr(
int , GetHeight(),
"Gets the height of the bitmap in pixels.");
"Gets the height of the bitmap in pixels.", "");
DocDeclStr(
int , GetDepth(),
"Gets the colour depth of the bitmap. A value of 1 indicates a
monochrome bitmap.");
monochrome bitmap.", "");
%extend {
DocStr(GetSize, "Get the size of the bitmap.");
DocStr(GetSize, "Get the size of the bitmap.", "");
wxSize GetSize() {
wxSize size(self->GetWidth(), self->GetHeight());
return size;
@@ -196,7 +196,7 @@ monochrome bitmap.");
virtual wxImage , ConvertToImage() const,
"Creates a platform-independent image from a platform-dependent
bitmap. This preserves mask information so that bitmaps and images can
be converted back and forth without loss in that respect.");
be converted back and forth without loss in that respect.", "");
DocDeclStr(
@@ -205,7 +205,7 @@ be converted back and forth without loss in that respect.");
file or explpicitly set for the bitmap.
:see: `SetMask`, `wx.Mask`
");
", "");
DocDeclStr(
@@ -213,12 +213,12 @@ file or explpicitly set for the bitmap.
"Sets the mask for this bitmap.
:see: `GetMask`, `wx.Mask`
");
", "");
%extend {
DocStr(SetMaskColour,
"Create a Mask based on a specified colour in the Bitmap.");
"Create a Mask based on a specified colour in the Bitmap.", "");
void SetMaskColour(const wxColour& colour) {
wxMask *mask = new wxMask(*self, colour);
self->SetMask(mask);
@@ -230,20 +230,20 @@ file or explpicitly set for the bitmap.
virtual wxBitmap , GetSubBitmap(const wxRect& rect) const,
"Returns a sub-bitmap of the current one as long as the rect belongs
entirely to the bitmap. This function preserves bit depth and mask
information.");
information.", "");
DocDeclStr(
virtual bool , SaveFile(const wxString &name, wxBitmapType type,
wxPalette *palette = NULL),
"Saves a bitmap in the named file. See `__init__` for a description of
the ``type`` parameter.");
the ``type`` parameter.", "");
DocDeclStr(
virtual bool , LoadFile(const wxString &name, wxBitmapType type),
"Loads a bitmap from a file. See `__init__` for a description of the
``type`` parameter.");
``type`` parameter.", "");
@@ -257,21 +257,21 @@ the ``type`` parameter.");
DocDeclStr(
virtual void , SetHeight(int height),
"Set the height property (does not affect the existing bitmap data).");
"Set the height property (does not affect the existing bitmap data).", "");
DocDeclStr(
virtual void , SetWidth(int width),
"Set the width property (does not affect the existing bitmap data).");
"Set the width property (does not affect the existing bitmap data).", "");
DocDeclStr(
virtual void , SetDepth(int depth),
"Set the depth property (does not affect the existing bitmap data).");
"Set the depth property (does not affect the existing bitmap data).", "");
%extend {
DocStr(SetSize, "Set the bitmap size (does not affect the existing bitmap data).");
DocStr(SetSize, "Set the bitmap size (does not affect the existing bitmap data).", "");
void SetSize(const wxSize& size) {
self->SetWidth(size.x);
self->SetHeight(size.y);
@@ -304,8 +304,7 @@ will be drawn, and the masked area will not be drawn.
A mask may be associated with a `wx.Bitmap`. It is used in
`wx.DC.DrawBitmap` or `wx.DC.Blit` when the source device context is a
`wx.MemoryDC` with a `wx.Bitmap` selected into it that contains a
mask.
");
mask.", "");
class wxMask : public wxObject {
public:
@@ -317,7 +316,7 @@ the pixels in ``bitmap`` that match ``colour`` will be the transparent
portions of the mask. If no ``colour`` or an invalid ``colour`` is
passed then BLACK is used.
:see: `wx.Bitmap`, `wx.Colour`");
:see: `wx.Bitmap`, `wx.Colour`", "");
%extend {
wxMask(const wxBitmap& bitmap, const wxColour& colour = wxNullColour) {

View File

@@ -19,7 +19,7 @@
DocStr(wxBrush,
"A brush is a drawing tool for filling in areas. It is used for
painting the background of rectangles, ellipses, etc. when drawing on
a `wx.DC`. It has a colour and a style.
a `wx.DC`. It has a colour and a style.", "
:warning: Do not create instances of wx.Brush before the `wx.App`
object has been created because, depending on the platform,
@@ -37,8 +37,8 @@ class wxBrush : public wxGDIObject {
public:
DocCtorStr(
wxBrush(const wxColour& colour, int style=wxSOLID),
"Constructs a brush from a `wx.Colour` object and a style. The style
parameter may be one of the following:
"Constructs a brush from a `wx.Colour` object and a style.",
"The style parameter may be one of the following:
=================== =============================
Style Meaning
@@ -61,36 +61,36 @@ parameter may be one of the following:
DocDeclStr(
virtual void , SetColour(const wxColour& col),
"Set the brush's `wx.Colour`.");
"Set the brush's `wx.Colour`.", "");
DocDeclStr(
virtual void , SetStyle(int style),
"Sets the style of the brush. See `__init__` for a listing of styles.");
"Sets the style of the brush. See `__init__` for a listing of styles.", "");
DocDeclStr(
virtual void , SetStipple(const wxBitmap& stipple),
"Sets the stipple `wx.Bitmap`.");
"Sets the stipple `wx.Bitmap`.", "");
DocDeclStr(
wxColour , GetColour() const,
"Returns the `wx.Colour` of the brush.");
"Returns the `wx.Colour` of the brush.", "");
DocDeclStr(
int , GetStyle() const,
"Returns the style of the brush. See `__init__` for a listing of
styles.");
styles.", "");
DocDeclStr(
wxBitmap *, GetStipple() const,
"Returns the stiple `wx.Bitmap` of the brush. If the brush does not
have a wx.STIPPLE style, then the return value may be non-None but an
uninitialised bitmap (`wx.Bitmap.Ok` returns False).");
uninitialised bitmap (`wx.Bitmap.Ok` returns False).", "");
DocDeclStr(
bool , Ok(),
"Returns True if the brush is initialised and valid.");
"Returns True if the brush is initialised and valid.", "");
#ifdef __WXMAC__

View File

@@ -33,7 +33,7 @@ enum {
DocStr(wxButton,
"A button is a control that contains a text string, and is one of the most
common elements of a GUI. It may be placed on a dialog box or panel, or
indeed almost any other window.
indeed almost any other window.", "
Window Styles
-------------
@@ -65,7 +65,6 @@ public:
%pythonAppend wxButton() ""
RefDoc(wxButton, "");
DocCtorStr(
wxButton(wxWindow* parent, wxWindowID id, const wxString& label,
const wxPoint& pos = wxDefaultPosition,
@@ -73,11 +72,11 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPyButtonNameStr),
"Create and show a button.");
"Create and show a button.", "");
DocCtorStrName(
wxButton(),
"Precreate a Button for 2-phase creation.",
"Precreate a Button for 2-phase creation.", "",
PreButton);
DocDeclStr(
@@ -87,18 +86,18 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPyButtonNameStr),
"Acutally create the GUI Button for 2-phase creation.");
"Acutally create the GUI Button for 2-phase creation.", "");
DocDeclStr(
void , SetDefault(),
"This sets the button to be the default item for the panel or dialog box.");
"This sets the button to be the default item for the panel or dialog box.", "");
DocDeclStr(
static wxSize , GetDefaultSize(),
"Returns the default button size for this platform.");
"Returns the default button size for this platform.", "");
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
@@ -113,7 +112,7 @@ DocStr(wxBitmapButton,
"A Button that contains a bitmap. A bitmap button can be supplied with a
single bitmap, and wxWidgets will draw all button states using this bitmap. If
the application needs more control, additional bitmaps for the selected state,
unpressed focused state, and greyed-out state may be supplied.
unpressed focused state, and greyed-out state may be supplied.", "
Window Styles
-------------
@@ -150,8 +149,6 @@ public:
%pythonAppend wxBitmapButton "self._setOORInfo(self)"
%pythonAppend wxBitmapButton() ""
RefDoc(wxBitmapButton, ""); // turn it off for the ctors
DocCtorStr(
wxBitmapButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition,
@@ -159,11 +156,11 @@ public:
long style = wxBU_AUTODRAW,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPyButtonNameStr),
"Create and show a button with a bitmap for the label.");
"Create and show a button with a bitmap for the label.", "");
DocCtorStrName(
wxBitmapButton(),
"Precreate a BitmapButton for 2-phase creation.",
"Precreate a BitmapButton for 2-phase creation.", "",
PreBitmapButton);
DocDeclStr(
@@ -173,46 +170,46 @@ public:
long style = wxBU_AUTODRAW,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPyButtonNameStr),
"Acutally create the GUI BitmapButton for 2-phase creation.");
"Acutally create the GUI BitmapButton for 2-phase creation.", "");
DocDeclStr(
wxBitmap , GetBitmapLabel(),
"Returns the label bitmap (the one passed to the constructor).");
"Returns the label bitmap (the one passed to the constructor).", "");
DocDeclStr(
wxBitmap , GetBitmapDisabled(),
"Returns the bitmap for the disabled state.");
"Returns the bitmap for the disabled state.", "");
DocDeclStr(
wxBitmap , GetBitmapFocus(),
"Returns the bitmap for the focused state.");
"Returns the bitmap for the focused state.", "");
DocDeclStr(
wxBitmap , GetBitmapSelected(),
"Returns the bitmap for the selected state.");
"Returns the bitmap for the selected state.", "");
DocDeclStr(
void , SetBitmapDisabled(const wxBitmap& bitmap),
"Sets the bitmap for the disabled button appearance.");
"Sets the bitmap for the disabled button appearance.", "");
DocDeclStr(
void , SetBitmapFocus(const wxBitmap& bitmap),
"Sets the bitmap for the button appearance when it has the keyboard focus.");
"Sets the bitmap for the button appearance when it has the keyboard focus.", "");
DocDeclStr(
void , SetBitmapSelected(const wxBitmap& bitmap),
"Sets the bitmap for the selected (depressed) button appearance.");
"Sets the bitmap for the selected (depressed) button appearance.", "");
DocDeclStr(
void , SetBitmapLabel(const wxBitmap& bitmap),
"Sets the bitmap label for the button. This is the bitmap used for the
unselected state, and for all other states if no other bitmaps are provided.");
unselected state, and for all other states if no other bitmaps are provided.", "");
void SetMargins(int x, int y);

View File

@@ -49,7 +49,7 @@ DocStr(wxCheckBox,
checkmark is visible) or off (no checkmark). Optionally (When the
wx.CHK_3STATE style flag is set) it can have a third state, called the
mixed or undetermined state. Often this is used as a \"Does Not
Apply\" state.
Apply\" state.", "
Window Styles
-------------
@@ -84,8 +84,6 @@ public:
%pythonAppend wxCheckBox "self._setOORInfo(self)"
%pythonAppend wxCheckBox() ""
RefDoc(wxCheckBox, ""); // turn it off for the ctors
DocCtorStr(
wxCheckBox(wxWindow* parent, wxWindowID id, const wxString& label,
const wxPoint& pos = wxDefaultPosition,
@@ -93,11 +91,11 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPyCheckBoxNameStr),
"Creates and shows a CheckBox control");
"Creates and shows a CheckBox control", "");
DocCtorStrName(
wxCheckBox(),
"Precreate a CheckBox for 2-phase creation.",
"Precreate a CheckBox for 2-phase creation.", "",
PreCheckBox);
@@ -108,30 +106,30 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPyCheckBoxNameStr),
"Actually create the GUI CheckBox for 2-phase creation.");
"Actually create the GUI CheckBox for 2-phase creation.", "");
DocDeclStr(
bool, GetValue(),
"Gets the state of a 2-state CheckBox. Returns True if it is checked,
False otherwise.");
False otherwise.", "");
DocDeclStr(
bool, IsChecked(),
"Similar to GetValue, but raises an exception if it is not a 2-state
CheckBox.");
CheckBox.", "");
DocDeclStr(
void, SetValue(const bool state),
"Set the state of a 2-state CheckBox. Pass True for checked, False for
unchecked.");
unchecked.", "");
DocDeclStr(
wxCheckBoxState, Get3StateValue() const,
"Returns wx.CHK_UNCHECKED when the CheckBox is unchecked,
wx.CHK_CHECKED when it is checked and wx.CHK_UNDETERMINED when it's in
the undetermined state. Raises an exceptiion when the function is
used with a 2-state CheckBox.");
used with a 2-state CheckBox.", "");
DocDeclStr(
void, Set3StateValue(wxCheckBoxState state),
@@ -139,16 +137,16 @@ used with a 2-state CheckBox.");
of the following: wx.CHK_UNCHECKED (Check is off), wx.CHK_CHECKED (the
Check is on) or wx.CHK_UNDETERMINED (Check is mixed). Raises an
exception when the CheckBox is a 2-state checkbox and setting the
state to wx.CHK_UNDETERMINED.");
state to wx.CHK_UNDETERMINED.", "");
DocDeclStr(
bool, Is3State() const,
"Returns whether or not the CheckBox is a 3-state CheckBox.");
"Returns whether or not the CheckBox is a 3-state CheckBox.", "");
DocDeclStr(
bool, Is3rdStateAllowedForUser() const,
"Returns whether or not the user can set the CheckBox to the third
state.");
state.", "");
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);

View File

@@ -24,7 +24,7 @@ MAKE_CONST_WXSTRING(ChoiceNameStr);
DocStr(wxChoice,
"A Choice control is used to select one of a list of strings.
Unlike a `wx.ListBox`, only the selection is visible until the
user pulls down the menu of choices.
user pulls down the menu of choices.", "
Events
------
@@ -40,8 +40,6 @@ public:
%pythonAppend wxChoice "self._setOORInfo(self)"
%pythonAppend wxChoice() ""
RefDoc(wxChoice, ""); // turn it off for the ctors
DocCtorAStr(
wxChoice(wxWindow *parent, wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition,
@@ -53,11 +51,11 @@ public:
"__init__(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize,
List choices=[], long style=0, Validator validator=DefaultValidator,
String name=ChoiceNameStr) -> Choice",
"Create and show a Choice control");
"Create and show a Choice control", "");
DocCtorStrName(
wxChoice(),
"Precreate a Choice control for 2-phase creation.",
"Precreate a Choice control for 2-phase creation.", "",
PreChoice);
@@ -72,7 +70,7 @@ public:
"Create(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize,
List choices=[], long style=0, Validator validator=DefaultValidator,
String name=ChoiceNameStr) -> bool",
"Actually create the GUI Choice control for 2-phase creation");
"Actually create the GUI Choice control for 2-phase creation", "");
// // These are only meaningful on wxMotif...
@@ -82,15 +80,15 @@ public:
DocDeclStr(
void , SetSelection(const int n),
"Select the n'th item (zero based) in the list.");
"Select the n'th item (zero based) in the list.", "");
DocDeclStr(
bool , SetStringSelection(const wxString& string),
"Select the item with the specifed string");
"Select the item with the specifed string", "");
DocDeclStr(
void , SetString(int n, const wxString& string),
"Set the label for the n'th item (zero based) in the list.");
"Set the label for the n'th item (zero based) in the list.", "");
%pythoncode { Select = SetSelection }

View File

@@ -33,7 +33,7 @@ clipboard and relinquish ownership. You should keep the clipboard open
only momentarily.
:see: `wx.DataObject`
");
", "");
@@ -41,7 +41,7 @@ class wxClipboard : public wxObject {
public:
DocCtorStr(
wxClipboard(),
"");
"", "");
~wxClipboard();
@@ -51,17 +51,17 @@ public:
"Call this function to open the clipboard before calling SetData and
GetData. Call Close when you have finished with the clipboard. You
should keep the clipboard open for only a very short time. Returns
True on success.");
True on success.", "");
DocDeclStr(
virtual void , Close(),
"Closes the clipboard.");
"Closes the clipboard.", "");
DocDeclStr(
virtual bool , IsOpened() const,
"Query whether the clipboard is opened");
"Query whether the clipboard is opened", "");
@@ -74,7 +74,7 @@ call this function repeatedly after having cleared the clipboard.
After this function has been called, the clipboard owns the data, so
do not delete the data explicitly.
:see: `wx.DataObject`");
:see: `wx.DataObject`", "");
DocDeclStr(
@@ -82,7 +82,7 @@ do not delete the data explicitly.
"Set the clipboard data, this is the same as `Clear` followed by
`AddData`.
:see: `wx.DataObject`");
:see: `wx.DataObject`", "");
%clear wxDataObject *data;
@@ -90,18 +90,18 @@ do not delete the data explicitly.
DocDeclStr(
virtual bool , IsSupported( const wxDataFormat& format ),
"Returns True if the given format is available in the data object(s) on
the clipboard.");
the clipboard.", "");
DocDeclStr(
virtual bool , GetData( wxDataObject& data ),
"Call this function to fill data with data on the clipboard, if
available in the required format. Returns true on success.");
available in the required format. Returns true on success.", "");
DocDeclStr(
virtual void , Clear(),
"Clears data from the clipboard object and also the system's clipboard
if possible.");
if possible.", "");
DocDeclStr(
@@ -109,14 +109,14 @@ if possible.");
"Flushes the clipboard: this means that the data which is currently on
clipboard will stay available even after the application exits,
possibly eating memory, otherwise the clipboard will be emptied on
exit. Returns False if the operation is unsuccesful for any reason.");
exit. Returns False if the operation is unsuccesful for any reason.", "");
DocDeclStr(
virtual void , UsePrimarySelection( bool primary = True ),
"On platforms supporting it (the X11 based platforms), selects the
so called PRIMARY SELECTION as the clipboard as opposed to the
normal clipboard, if primary is True.");
normal clipboard, if primary is True.", "");
};
@@ -131,7 +131,7 @@ wxClipboard* const wxTheClipboard;
DocStr(wxClipboardLocker,
"A helpful class for opening the clipboard and automatically
closing it when the locker is destroyed.");
closing it when the locker is destroyed.", "");
class wxClipboardLocker
{
@@ -141,7 +141,7 @@ public:
DocStr(__nonzero__,
"A ClipboardLocker instance evaluates to True if the clipboard was
successfully opened.")
successfully opened.", "");
%extend {
bool __nonzero__() { return !!(*self); }
}

View File

@@ -29,13 +29,13 @@ MAKE_CONST_WXSTRING(MessageBoxCaptionStr);
DocStr(wxColourData,
"This class holds a variety of information related to the colour
chooser dialog, used to transfer settings and results to and from the
`wx.ColourDialog`.");
`wx.ColourDialog`.", "");
class wxColourData : public wxObject {
public:
DocCtorStr(
wxColourData(),
"Constructor, sets default values.");
"Constructor, sets default values.", "");
~wxColourData();
@@ -44,33 +44,33 @@ public:
bool , GetChooseFull(),
"Under Windows, determines whether the Windows colour dialog will
display the full dialog with custom colour selection controls. Has no
meaning under other platforms. The default value is true.");
meaning under other platforms. The default value is true.", "");
DocDeclStr(
wxColour , GetColour(),
"Gets the colour (pre)selected by the dialog.");
"Gets the colour (pre)selected by the dialog.", "");
DocDeclStr(
wxColour , GetCustomColour(int i),
"Gets the i'th custom colour associated with the colour dialog. i
should be an integer between 0 and 15. The default custom colours are
all white.");
all white.", "");
DocDeclStr(
void , SetChooseFull(int flag),
"Under Windows, tells the Windows colour dialog to display the full
dialog with custom colour selection controls. Under other platforms,
has no effect. The default value is true.");
has no effect. The default value is true.", "");
DocDeclStr(
void , SetColour(const wxColour& colour),
"Sets the default colour for the colour dialog. The default colour is
black.");
black.", "");
DocDeclStr(
void , SetCustomColour(int i, const wxColour& colour),
"Sets the i'th custom colour for the colour dialog. i should be an
integer between 0 and 15. The default custom colours are all white.");
integer between 0 and 15. The default custom colours are all white.", "");
};
@@ -78,7 +78,7 @@ integer between 0 and 15. The default custom colours are all white.");
DocStr(wxColourDialog,
"This class represents the colour chooser dialog.");
"This class represents the colour chooser dialog.", "");
class wxColourDialog : public wxDialog {
public:
@@ -88,11 +88,11 @@ public:
wxColourDialog(wxWindow* parent, wxColourData* data = NULL),
"Constructor. Pass a parent window, and optionally a `wx.ColourData`,
which will be copied to the colour dialog's internal ColourData
instance.");
instance.", "");
DocDeclStr(
wxColourData& , GetColourData(),
"Returns a reference to the `wx.ColourData` used by the dialog.");
"Returns a reference to the `wx.ColourData` used by the dialog.", "");
};
@@ -101,8 +101,7 @@ instance.");
DocStr(wxDirDialog,
"wx.DirDialog allows the user to select a directory by browising the
file system.
file system.", "
Window Styles
--------------
@@ -118,8 +117,6 @@ class wxDirDialog : public wxDialog {
public:
%pythonAppend wxDirDialog "self._setOORInfo(self)"
RefDoc(wxDirDialog, ""); // turn it off for the ctors
DocCtorStr(
wxDirDialog(wxWindow* parent,
const wxString& message = wxPyDirSelectorPromptStr,
@@ -128,28 +125,28 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxPyDirDialogNameStr),
"Constructor. Use ShowModal method to show the dialog.");
"Constructor. Use ShowModal method to show the dialog.", "");
DocDeclStr(
wxString , GetPath(),
"Returns the default or user-selected path.");
"Returns the default or user-selected path.", "");
DocDeclStr(
wxString , GetMessage(),
"Returns the message that will be displayed on the dialog.");
"Returns the message that will be displayed on the dialog.", "");
DocDeclStr(
long , GetStyle(),
"Returns the dialog style.");
"Returns the dialog style.", "");
DocDeclStr(
void , SetMessage(const wxString& message),
"Sets the message that will be displayed on the dialog.");
"Sets the message that will be displayed on the dialog.", "");
DocDeclStr(
void , SetPath(const wxString& path),
"Sets the default path.");
"Sets the default path.", "");
};
@@ -158,7 +155,7 @@ public:
DocStr(wxFileDialog,
"wx.FileDialog allows the user to select one or more files from the
filesystem.
filesystem.", "
In Windows, this is the common file selector dialog. On X based
platforms a generic alternative is used. The path and filename are
@@ -169,7 +166,7 @@ displayed in the file selector, and file extension supplies a type
extension for the required filename.
Both the X and Windows versions implement a wildcard filter. Typing a
filename containing wildcards (*, ?) in the filename text item, and
filename containing wildcards (\*, ?) in the filename text item, and
clicking on Ok, will result in only those files matching the pattern
being displayed. The wildcard may be a specification for multiple
types of file with a description for each, such as::
@@ -179,7 +176,7 @@ types of file with a description for each, such as::
Window Styles
--------------
================== ==========================================
=================== ==========================================
wx.OPEN This is an open dialog.
wx.SAVE This is a save dialog.
@@ -196,7 +193,7 @@ Window Styles
wx.CHANGE_DIR Change the current working directory to the
directory where the file(s) chosen by the user
are.
================== ==========================================
=================== ==========================================
");
@@ -205,8 +202,6 @@ class wxFileDialog : public wxDialog {
public:
%pythonAppend wxFileDialog "self._setOORInfo(self)"
RefDoc(wxFileDialog, ""); // turn it off for the ctors
DocCtorStr(
wxFileDialog(wxWindow* parent,
const wxString& message = wxPyFileSelectorPromptStr,
@@ -215,25 +210,25 @@ public:
const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
long style = 0,
const wxPoint& pos = wxDefaultPosition),
"Constructor. Use ShowModal method to show the dialog.");
"Constructor. Use ShowModal method to show the dialog.", "");
DocDeclStr(
void , SetMessage(const wxString& message),
"Sets the message that will be displayed on the dialog.");
"Sets the message that will be displayed on the dialog.", "");
DocDeclStr(
void , SetPath(const wxString& path),
"Sets the path (the combined directory and filename that will be
returned when the dialog is dismissed).");
returned when the dialog is dismissed).", "");
DocDeclStr(
void , SetDirectory(const wxString& dir),
"Sets the default directory.");
"Sets the default directory.", "");
DocDeclStr(
void , SetFilename(const wxString& name),
"Sets the default filename.");
"Sets the default filename.", "");
DocDeclStr(
void , SetWildcard(const wxString& wildCard),
@@ -241,58 +236,58 @@ returned when the dialog is dismissed).");
example::
\"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif\"
");
", "");
DocDeclStr(
void , SetStyle(long style),
"Sets the dialog style.");
"Sets the dialog style.", "");
DocDeclStr(
void , SetFilterIndex(int filterIndex),
"Sets the default filter index, starting from zero.");
"Sets the default filter index, starting from zero.", "");
DocDeclStr(
wxString , GetMessage() const,
"Returns the message that will be displayed on the dialog.");
"Returns the message that will be displayed on the dialog.", "");
DocDeclStr(
wxString , GetPath() const,
"Returns the full path (directory and filename) of the selected file.");
"Returns the full path (directory and filename) of the selected file.", "");
DocDeclStr(
wxString , GetDirectory() const,
"Returns the default directory.");
"Returns the default directory.", "");
DocDeclStr(
wxString , GetFilename() const,
"Returns the default filename.");
"Returns the default filename.", "");
DocDeclStr(
wxString , GetWildcard() const,
"Returns the file dialog wildcard.");
"Returns the file dialog wildcard.", "");
DocDeclStr(
long , GetStyle() const,
"Returns the dialog style.");
"Returns the dialog style.", "");
DocDeclStr(
int , GetFilterIndex() const,
"Returns the index into the list of filters supplied, optionally, in
the wildcard parameter. Before the dialog is shown, this is the index
which will be used when the dialog is first displayed. After the
dialog is shown, this is the index selected by the user.");
dialog is shown, this is the index selected by the user.", "");
DocStr(GetFilenames,
"Returns a list of filenames chosen in the dialog. This function
should only be used with the dialogs which have wx.MULTIPLE style, use
GetFilename for the others.");
GetFilename for the others.", "");
DocStr(GetPaths,
"Fills the array paths with the full paths of the files chosen. This
function should only be used with the dialogs which have wx.MULTIPLE
style, use GetPath for the others.");
style, use GetPath for the others.", "");
%extend {
PyObject* GetFilenames() {
@@ -337,7 +332,7 @@ enum { wxCHOICEDLG_STYLE };
DocStr(wxMultiChoiceDialog,
"A simple dialog with a multi selection listbox.");
"A simple dialog with a multi selection listbox.", "");
class wxMultiChoiceDialog : public wxDialog
{
@@ -354,18 +349,18 @@ public:
"__init__(Window parent, String message, String caption,
List choices=[], long style=CHOICEDLG_STYLE,
Point pos=DefaultPosition) -> MultiChoiceDialog",
"Constructor. Use ShowModal method to show the dialog.");
"Constructor. Use ShowModal method to show the dialog.", "");
DocDeclAStr(
void, SetSelections(const wxArrayInt& selections),
"SetSelections(List selections)",
"Specify the items in the list that should be selected, using a list of
integers.");
integers.", "");
DocAStr(GetSelections,
"GetSelections() -> [selections]",
"Returns a list of integers representing the items that are selected.");
"Returns a list of integers representing the items that are selected.", "");
%extend {
PyObject* GetSelections() {
return wxArrayInt2PyList_helper(self->GetSelections());
@@ -377,7 +372,7 @@ integers.");
//---------------------------------------------------------------------------
DocStr(wxSingleChoiceDialog,
"A simple dialog with a single selection listbox.");
"A simple dialog with a single selection listbox.", "");
class wxSingleChoiceDialog : public wxDialog {
public:
@@ -387,7 +382,7 @@ public:
"__init__(Window parent, String message, String caption,
List choices=[], long style=CHOICEDLG_STYLE,
Point pos=DefaultPosition) -> SingleChoiceDialog",
"Constructor. Use ShowModal method to show the dialog.");
"Constructor. Use ShowModal method to show the dialog.", "");
%extend {
// TODO: ignoring clientData for now... FIX THIS
@@ -406,22 +401,22 @@ public:
DocDeclStr(
int , GetSelection(),
"Get the index of teh currently selected item.");
"Get the index of teh currently selected item.", "");
DocDeclStr(
wxString , GetStringSelection(),
"Returns the string value of the currently selected item");
"Returns the string value of the currently selected item", "");
DocDeclStr(
void , SetSelection(int sel),
"Set the current selected item to sel");
"Set the current selected item to sel", "");
};
//---------------------------------------------------------------------------
DocStr(wxTextEntryDialog,
"A dialog with text control, [ok] and [cancel] buttons");
"A dialog with text control, [ok] and [cancel] buttons", "");
class wxTextEntryDialog : public wxDialog {
public:
@@ -434,16 +429,16 @@ public:
const wxString& defaultValue = wxPyEmptyString,
long style = wxOK | wxCANCEL | wxCENTRE,
const wxPoint& pos = wxDefaultPosition),
"Constructor. Use ShowModal method to show the dialog.");
"Constructor. Use ShowModal method to show the dialog.", "");
DocDeclStr(
wxString , GetValue(),
"Returns the text that the user has entered if the user has pressed OK,
or the original value if the user has pressed Cancel.");
or the original value if the user has pressed Cancel.", "");
DocDeclStr(
void , SetValue(const wxString& value),
"Sets the default text value.");
"Sets the default text value.", "");
};
//---------------------------------------------------------------------------
@@ -451,7 +446,7 @@ or the original value if the user has pressed Cancel.");
DocStr(wxFontData,
"This class holds a variety of information related to font dialogs and
is used to transfer settings to and results from a `wx.FontDialog`.");
is used to transfer settings to and results from a `wx.FontDialog`.", "");
class wxFontData : public wxObject {
@@ -463,65 +458,65 @@ public:
void , EnableEffects(bool enable),
"Enables or disables 'effects' under MS Windows only. This refers to
the controls for manipulating colour, strikeout and underline
properties. The default value is true.");
properties. The default value is true.", "");
DocDeclStr(
bool , GetAllowSymbols(),
"Under MS Windows, returns a flag determining whether symbol fonts can
be selected. Has no effect on other platforms. The default value is
true.");
true.", "");
DocDeclStr(
wxColour , GetColour(),
"Gets the colour associated with the font dialog. The default value is
black.");
black.", "");
DocDeclStr(
wxFont , GetChosenFont(),
"Gets the font chosen by the user.");
"Gets the font chosen by the user.", "");
DocDeclStr(
bool , GetEnableEffects(),
"Determines whether 'effects' are enabled under Windows.");
"Determines whether 'effects' are enabled under Windows.", "");
DocDeclStr(
wxFont , GetInitialFont(),
"Gets the font that will be initially used by the font dialog. This
should have previously been set by the application.");
should have previously been set by the application.", "");
DocDeclStr(
bool , GetShowHelp(),
"Returns true if the Help button will be shown (Windows only). The
default value is false.");
default value is false.", "");
DocDeclStr(
void , SetAllowSymbols(bool allowSymbols),
"Under MS Windows, determines whether symbol fonts can be selected. Has
no effect on other platforms. The default value is true.");
no effect on other platforms. The default value is true.", "");
DocDeclStr(
void , SetChosenFont(const wxFont& font),
"Sets the font that will be returned to the user (normally for internal
use only).");
use only).", "");
DocDeclStr(
void , SetColour(const wxColour& colour),
"Sets the colour that will be used for the font foreground colour. The
default colour is black.");
default colour is black.", "");
DocDeclStr(
void , SetInitialFont(const wxFont& font),
"Sets the font that will be initially used by the font dialog.");
"Sets the font that will be initially used by the font dialog.", "");
DocDeclStr(
void , SetRange(int min, int max),
"Sets the valid range for the font point size (Windows only). The
default is 0, 0 (unrestricted range).");
default is 0, 0 (unrestricted range).", "");
DocDeclStr(
void , SetShowHelp(bool showHelp),
"Determines whether the Help button will be displayed in the font
dialog (Windows only). The default value is false.");
dialog (Windows only). The default value is false.", "");
};
@@ -531,7 +526,7 @@ DocStr(wxFontDialog,
"wx.FontDialog allows the user to select a system font and its attributes.
:see: `wx.FontData`
");
", "");
class wxFontDialog : public wxDialog {
public:
@@ -541,14 +536,14 @@ public:
"Constructor. Pass a parent window and the `wx.FontData` object to be
used to initialize the dialog controls. Call `ShowModal` to display
the dialog. If ShowModal returns ``wx.ID_OK`` then you can fetch the
results with via the `wx.FontData` returned by `GetFontData`.");
results with via the `wx.FontData` returned by `GetFontData`.", "");
wxFontDialog(wxWindow* parent, const wxFontData& data);
DocDeclStr(
wxFontData& , GetFontData(),
"Returns a reference to the internal `wx.FontData` used by the
wx.FontDialog.");
wx.FontDialog.", "");
};
@@ -557,12 +552,11 @@ wx.FontDialog.");
DocStr(wxMessageDialog,
"This class provides a simple dialog that shows a single or multi-line
message, with a choice of OK, Yes, No and/or Cancel buttons.
message, with a choice of OK, Yes, No and/or Cancel buttons.", "
Window Styles
--------------
================= =============================================
=================== =============================================
wx.OK Show an OK button.
wx.CANCEL Show a Cancel button.
wx.YES_NO Show Yes and No buttons.
@@ -577,7 +571,7 @@ Window Styles
wx.STAY_ON_TOP The message box stays on top of all other
window, even those of the other applications
(Windows only).
================= =============================================
=================== =============================================
");
@@ -585,15 +579,13 @@ class wxMessageDialog : public wxDialog {
public:
%pythonAppend wxMessageDialog "self._setOORInfo(self)"
RefDoc(wxMessageDialog, ""); // turn it off for the ctors
DocCtorStr(
wxMessageDialog(wxWindow* parent,
const wxString& message,
const wxString& caption = wxPyMessageBoxCaptionStr,
long style = wxOK | wxCANCEL | wxCENTRE,
const wxPoint& pos = wxDefaultPosition),
"Constructor, use `ShowModal` to display the dialog.");
"Constructor, use `ShowModal` to display the dialog.", "");
};
@@ -602,11 +594,11 @@ public:
DocStr(wxProgressDialog,
"A dialog that shows a short message and a progress bar. Optionally, it
can display an ABORT button.
can display an ABORT button.", "
Window Styles
--------------
================= =============================================
==================== =============================================
wx.PD_APP_MODAL Make the progress dialog modal. If this flag is
not given, it is only \"locally\" modal -
that is the input to the parent window is
@@ -629,7 +621,7 @@ Window Styles
wx.PD_REMAINING_TIME This flag tells the dialog that it should show
remaining time.
================= =============================================
==================== =============================================
");
@@ -637,8 +629,6 @@ class wxProgressDialog : public wxFrame {
public:
%pythonAppend wxProgressDialog "self._setOORInfo(self)"
RefDoc(wxProgressDialog, ""); // turn it off for the ctors
DocCtorStr(
wxProgressDialog(const wxString& title,
const wxString& message,
@@ -647,7 +637,7 @@ public:
int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL ),
"Constructor. Creates the dialog, displays it and disables user input
for other windows, or, if wx.PD_APP_MODAL flag is not given, for its
parent window only.");
parent window only.", "");
DocDeclStr(
virtual bool , Update(int value, const wxString& newmsg = wxPyEmptyString),
@@ -657,12 +647,12 @@ button has been pressed.
If false is returned, the application can either immediately destroy
the dialog or ask the user for the confirmation and if the abort is
not confirmed the dialog may be resumed with Resume function.");
not confirmed the dialog may be resumed with Resume function.", "");
DocDeclStr(
void , Resume(),
"Can be used to continue with the dialog, after the user had chosen to
abort.");
abort.", "");
};
@@ -722,7 +712,7 @@ EVT_COMMAND_FIND_CLOSE = EVT_FIND_CLOSE
DocStr(wxFindDialogEvent,
"Events for the FindReplaceDialog");
"Events for the FindReplaceDialog", "");
class wxFindDialogEvent : public wxCommandEvent
{
@@ -732,32 +722,32 @@ public:
DocDeclStr(
int , GetFlags(),
"Get the currently selected flags: this is the combination of
wx.FR_DOWN, wx.FR_WHOLEWORD and wx.FR_MATCHCASE flags.");
wx.FR_DOWN, wx.FR_WHOLEWORD and wx.FR_MATCHCASE flags.", "");
DocDeclStr(
const wxString& , GetFindString(),
"Return the string to find (never empty).");
"Return the string to find (never empty).", "");
DocDeclStr(
const wxString& , GetReplaceString(),
"Return the string to replace the search string with (only for replace
and replace all events).");
and replace all events).", "");
DocDeclStr(
wxFindReplaceDialog *, GetDialog(),
"Return the pointer to the dialog which generated this event.");
"Return the pointer to the dialog which generated this event.", "");
DocDeclStr(
void , SetFlags(int flags),
"");
"", "");
DocDeclStr(
void , SetFindString(const wxString& str),
"");
"", "");
DocDeclStr(
void , SetReplaceString(const wxString& str),
"");
"", "");
};
@@ -770,7 +760,7 @@ time a `wx.FindDialogEvent` is generated so instead of using the
`wx.FindDialogEvent` methods you can also directly query this object.
Note that all SetXXX() methods may only be called before showing the
dialog and calling them has no effect later.
dialog and calling them has no effect later.", "
Flags
-----
@@ -793,34 +783,34 @@ class wxFindReplaceData : public wxObject
public:
DocCtorStr(
wxFindReplaceData(int flags=0),
"Constuctor initializes the flags to default value (0).");
"Constuctor initializes the flags to default value (0).", "");
~wxFindReplaceData();
DocDeclStr(
const wxString& , GetFindString(),
"Get the string to find.");
"Get the string to find.", "");
DocDeclStr(
const wxString& , GetReplaceString(),
"Get the replacement string.");
"Get the replacement string.", "");
DocDeclStr(
int , GetFlags(),
"Get the combination of flag values.");
"Get the combination of flag values.", "");
DocDeclStr(
void , SetFlags(int flags),
"Set the flags to use to initialize the controls of the dialog.");
"Set the flags to use to initialize the controls of the dialog.", "");
DocDeclStr(
void , SetFindString(const wxString& str),
"Set the string to find (used as initial value by the dialog).");
"Set the string to find (used as initial value by the dialog).", "");
DocDeclStr(
void , SetReplaceString(const wxString& str),
"Set the replacement string (used as initial value by the dialog).");
"Set the replacement string (used as initial value by the dialog).", "");
};
@@ -834,7 +824,7 @@ something else). The actual searching is supposed to be done in the
owner window which is the parent of this dialog. Note that it means
that unlike for the other standard dialogs this one must have a parent
window. Also note that there is no way to use this dialog in a modal
way; it is always, by design and implementation, modeless.
way; it is always, by design and implementation, modeless.", "
Window Styles
@@ -856,35 +846,33 @@ public:
%pythonAppend wxFindReplaceDialog "self._setOORInfo(self)"
%pythonAppend wxFindReplaceDialog() ""
RefDoc(wxFindReplaceDialog, ""); // turn it off for the ctors
DocCtorStr(
wxFindReplaceDialog(wxWindow *parent,
wxFindReplaceData *data,
const wxString &title,
int style = 0),
"Create a FindReplaceDialog. The parent and data parameters must be
non-None. Use Show to display the dialog.");
non-None. Use Show to display the dialog.", "");
DocCtorStrName(
wxFindReplaceDialog(),
"Precreate a FindReplaceDialog for 2-phase creation",
"Precreate a FindReplaceDialog for 2-phase creation", "",
PreFindReplaceDialog);
DocDeclStr(
bool , Create(wxWindow *parent, wxFindReplaceData *data,
const wxString &title, int style = 0),
"Create the dialog, for 2-phase create.");
"Create the dialog, for 2-phase create.", "");
DocDeclStr(
const wxFindReplaceData *, GetData(),
"Get the FindReplaceData object used by this dialog.");
"Get the FindReplaceData object used by this dialog.", "");
DocDeclStr(
void , SetData(wxFindReplaceData *data),
"Set the FindReplaceData object used by this dialog.");
"Set the FindReplaceData object used by this dialog.", "");
};

View File

@@ -18,96 +18,104 @@
DocStr(wxColour,
"A colour is an object representing a combination of Red, Green, and Blue (RGB)
intensity values, and is used to determine drawing colours, window colours,
etc. Valid RGB values are in the range 0 to 255.
"A colour is an object representing a combination of Red, Green, and
Blue (RGB) intensity values, and is used to determine drawing colours,
window colours, etc. Valid RGB values are in the range 0 to 255.
In wxPython there are typemaps that will automatically convert from a colour
name, or from a '#RRGGBB' colour hex value string to a wx.Colour object when
calling C++ methods that expect a wxColour. This means that the following are
all equivallent:
In wxPython there are typemaps that will automatically convert from a
colour name, or from a '#RRGGBB' colour hex value string to a
wx.Colour object when calling C++ methods that expect a wxColour.
This means that the following are all equivallent::
win.SetBackgroundColour(wxColour(0,0,255))
win.SetBackgroundColour('BLUE')
win.SetBackgroundColour('#0000FF')
You can retrieve the various current system colour settings with
wx.SystemSettings.GetColour.");
Additional colour names and their coresponding values can be added
using `wx.ColourDatabase`. Various system colours (as set in the
user's system preferences) can be retrieved with
`wx.SystemSettings.GetColour`.
", "");
class wxColour : public wxObject {
public:
DocCtorStr(
wxColour(unsigned char red=0, unsigned char green=0, unsigned char blue=0),
"Constructs a colour from red, green and blue values.");
wxColour(byte red=0, byte green=0, byte blue=0),
"Constructs a colour from red, green and blue values.
:see: Alternate constructors `wx.NamedColour` and `wx.ColourRGB`.
", "");
DocCtorStrName(
wxColour( const wxString& colorName),
"Constructs a colour object using a colour name listed in wx.TheColourDatabase.",
"Constructs a colour object using a colour name listed in
``wx.TheColourDatabase``.", "",
NamedColour);
DocCtorStrName(
wxColour( unsigned long colRGB ),
"Constructs a colour from a packed RGB value.",
"Constructs a colour from a packed RGB value.", "",
ColourRGB);
~wxColour();
DocDeclStr(
unsigned char , Red(),
"Returns the red intensity.");
byte , Red(),
"Returns the red intensity.", "");
DocDeclStr(
unsigned char , Green(),
"Returns the green intensity.");
byte , Green(),
"Returns the green intensity.", "");
DocDeclStr(
unsigned char , Blue(),
"Returns the blue intensity.");
byte , Blue(),
"Returns the blue intensity.", "");
DocDeclStr(
bool , Ok(),
"Returns True if the colour object is valid (the colour has been\n"
"initialised with RGB values).");
"Returns True if the colour object is valid (the colour has been
initialised with RGB values).", "");
DocDeclStr(
void , Set(unsigned char red, unsigned char green, unsigned char blue),
"Sets the RGB intensity values.");
void , Set(byte red, byte green, byte blue),
"Sets the RGB intensity values.", "");
DocDeclStrName(
void , Set(unsigned long colRGB),
"Sets the RGB intensity values from a packed RGB value.",
"Sets the RGB intensity values from a packed RGB value.", "",
SetRGB);
DocDeclStrName(
void , InitFromName(const wxString& colourName),
"Sets the RGB intensity values using a colour name listed in wx.TheColourDatabase.",
"Sets the RGB intensity values using a colour name listed in
``wx.TheColourDatabase``.", "",
SetFromName);
DocDeclStr(
long , GetPixel() const,
"Returns a pixel value which is platform-dependent. On Windows, a\n"
"COLORREF is returned. On X, an allocated pixel value is returned.\n"
"-1 is returned if the pixel is invalid (on X, unallocated).");
"Returns a pixel value which is platform-dependent. On Windows, a
COLORREF is returned. On X, an allocated pixel value is returned. -1
is returned if the pixel is invalid (on X, unallocated).", "");
DocDeclStr(
bool , operator==(const wxColour& colour) const,
"Compare colours for equality");
"Compare colours for equality", "");
DocDeclStr(
bool , operator!=(const wxColour& colour) const,
"Compare colours for inequality");
"Compare colours for inequality", "");
%extend {
DocAStr(Get,
"Get() -> (r, g, b)",
"Returns the RGB intensity values as a tuple.");
"Returns the RGB intensity values as a tuple.", "");
PyObject* Get() {
PyObject* rv = PyTuple_New(3);
int red = -1;
@@ -125,7 +133,7 @@ public:
}
DocStr(GetRGB,
"Return the colour as a packed RGB value");
"Return the colour as a packed RGB value", "");
unsigned long GetRGB() {
return self->Red() | (self->Green() << 8) | (self->Blue() << 16);
}
@@ -133,9 +141,9 @@ public:
%pythoncode {
asTuple = Get
def __str__(self): return str(self.asTuple())
def __repr__(self): return 'wx.Colour' + str(self.asTuple())
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.Colour' + str(self.Get())
def __nonzero__(self): return self.Ok()
__safe_for_unpickling__ = True
def __reduce__(self): return (Colour, self.Get())

View File

@@ -22,28 +22,36 @@ MAKE_CONST_WXSTRING(ComboBoxNameStr);
DocStr(wxComboBox,
"A combobox is like a combination of an edit control and a listbox. It can be
displayed as static list with editable or read-only text field; or a drop-down
list with text field.");
"A combobox is like a combination of an edit control and a
listbox. It can be displayed as static list with editable or
read-only text field; or a drop-down list with text field.
A combobox permits a single selection only. Combobox items are
numbered from zero.", "
RefDoc(wxComboBox, "
Styles
wx.CB_SIMPLE: Creates a combobox with a permanently displayed list.
Windows only.
------
================ ===============================================
wx.CB_SIMPLE Creates a combobox with a permanently
displayed list. Windows only.
wx.CB_DROPDOWN: Creates a combobox with a drop-down list.
wx.CB_DROPDOWN Creates a combobox with a drop-down list.
wx.CB_READONLY: Same as wxCB_DROPDOWN but only the strings specified as
the combobox choices can be selected, it is impossible
to select (even from a program) a string which is not in
the choices list.
wx.CB_READONLY Same as wxCB_DROPDOWN but only the strings
specified as the combobox choices can be
selected, it is impossible to select
(even from a program) a string which is
not in the choices list.
wx.CB_SORT: Sorts the entries in the list alphabetically.
wx.CB_SORT Sorts the entries in the list alphabetically.
================ ===============================================
Events
EVT_COMBOBOX: Sent when an item on the list is selected.
EVT_TEXT: Sent when the combobox text changes.
-------
================ ===============================================
EVT_COMBOBOX Sent when an item on the list is selected.
EVT_TEXT Sent when the combobox text changes.
================ ===============================================
");
@@ -58,8 +66,6 @@ public:
%pythonAppend wxComboBox "self._setOORInfo(self)"
%pythonAppend wxComboBox() ""
RefDoc(wxComboBox, ""); // turn it off for the ctors
DocCtorAStr(
wxComboBox(wxWindow* parent, wxWindowID id=-1,
const wxString& value = wxPyEmptyString,
@@ -69,15 +75,15 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPyComboBoxNameStr),
"__init__(Window parent, int id, String value=EmptyString,\n"
" Point pos=DefaultPosition, Size size=DefaultSize,\n"
" List choices=[], long style=0, Validator validator=DefaultValidator,\n"
" String name=ComboBoxNameStr) -> ComboBox",
"Constructor, creates and shows a ComboBox control.");
"__init__(Window parent, int id, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
List choices=[], long style=0, Validator validator=DefaultValidator,
String name=ComboBoxNameStr) -> ComboBox",
"Constructor, creates and shows a ComboBox control.", "");
DocCtorStrName(
wxComboBox(),
"Precreate a ComboBox control for 2-phase creation.",
"Precreate a ComboBox control for 2-phase creation.", "",
PreComboBox);
@@ -90,81 +96,81 @@ public:
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPyChoiceNameStr),
"Create(Window parent, int id, String value=EmptyString,\n"
" Point pos=DefaultPosition, Size size=DefaultSize,\n"
" List choices=[], long style=0, Validator validator=DefaultValidator,\n"
" String name=ChoiceNameStr) -> bool",
"Actually create the GUI wxComboBox control for 2-phase creation");
"Create(Window parent, int id, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
List choices=[], long style=0, Validator validator=DefaultValidator,
String name=ChoiceNameStr) -> bool",
"Actually create the GUI wxComboBox control for 2-phase creation", "");
DocDeclStr(
virtual wxString , GetValue() const,
"Returns the current value in the combobox text field.");
"Returns the current value in the combobox text field.", "");
DocDeclStr(
virtual void , SetValue(const wxString& value),
"");
"", "");
DocDeclStr(
virtual void , Copy(),
"Copies the selected text to the clipboard.");
"Copies the selected text to the clipboard.", "");
DocDeclStr(
virtual void , Cut(),
"Copies the selected text to the clipboard and removes the selection.");
"Copies the selected text to the clipboard and removes the selection.", "");
DocDeclStr(
virtual void , Paste(),
"Pastes text from the clipboard to the text field.");
"Pastes text from the clipboard to the text field.", "");
DocDeclStr(
virtual void , SetInsertionPoint(long pos),
"Sets the insertion point in the combobox text field.");
"Sets the insertion point in the combobox text field.", "");
DocDeclStr(
virtual long , GetInsertionPoint() const,
"Returns the insertion point for the combobox's text field.");
"Returns the insertion point for the combobox's text field.", "");
DocDeclStr(
virtual long , GetLastPosition() const,
"Returns the last position in the combobox text field.");
"Returns the last position in the combobox text field.", "");
DocDeclStr(
virtual void , Replace(long from, long to, const wxString& value),
"Replaces the text between two positions with the given text, in the\n"
"combobox text field.");
"Replaces the text between two positions with the given text, in the
combobox text field.", "");
DocDeclStr(
void , SetSelection(int n),
"Sets the item at index 'n' to be the selected item.");
"Sets the item at index 'n' to be the selected item.", "");
DocDeclStrName(
virtual void , SetSelection(long from, long to),
"Selects the text between the two positions in the combobox text field.",
"Selects the text between the two positions in the combobox text field.", "",
SetMark);
DocDeclStr(
bool , SetStringSelection(const wxString& string),
"Select the item with the specifed string");
"Select the item with the specifed string", "");
DocDeclStr(
void , SetString(int n, const wxString& string),
"Set the label for the n'th item (zero based) in the list.");
"Set the label for the n'th item (zero based) in the list.", "");
DocDeclStr(
virtual void , SetEditable(bool editable),
"");
"", "");
DocDeclStr(
virtual void , SetInsertionPointEnd(),
"Sets the insertion point at the end of the combobox text field.");
"Sets the insertion point at the end of the combobox text field.", "");
DocDeclStr(
virtual void , Remove(long from, long to),
"Removes the text between the two positions in the combobox text field.");
"Removes the text between the two positions in the combobox text field.", "");
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);

View File

@@ -47,24 +47,23 @@ enum
DocStr(wxConfigBase,
"wx.ConfigBase class defines the basic interface of all config
classes. It can not be used by itself (it is an abstract base
class) and you will always use one of its derivations: wx.Config
or wx.FileConfig.
classes. It can not be used by itself (it is an abstract base class)
and you will always use one of its derivations: wx.Config or
wx.FileConfig.
wx.ConfigBase organizes the items in a tree-like structure,
modeled after the Unix/Dos filesystem. There are groups that act
like directories and entries, key/value pairs that act like
files. There is always one current group given by the current
path. As in the file system case, to specify a key in the config
class you must use a path to it. Config classes also support the
notion of the current group, which makes it possible to use
relative paths.
wx.ConfigBase organizes the items in a tree-like structure, modeled
after the Unix/Dos filesystem. There are groups that act like
directories and entries, key/value pairs that act like files. There
is always one current group given by the current path. As in the file
system case, to specify a key in the config class you must use a path
to it. Config classes also support the notion of the current group,
which makes it possible to use relative paths.
Keys are pairs \"key_name = value\" where value may be of string,
integer floating point or boolean, you can not store binary data
without first encoding it as a string. For performance reasons
items should be kept small, no more than a couple kilobytes.
");
without first encoding it as a string. For performance reasons items
should be kept small, no more than a couple kilobytes.
", "");
class wxConfigBase {
@@ -88,50 +87,51 @@ public:
DocDeclStr(
static wxConfigBase *, Set(wxConfigBase *config),
"Sets the global config object (the one returned by Get) and\n"
"returns a reference to the previous global config object.");
"Sets the global config object (the one returned by Get) and returns a
reference to the previous global config object.", "");
DocDeclStr(
static wxConfigBase *, Get(bool createOnDemand = True),
"Returns the current global config object, creating one if neccessary.");
"Returns the current global config object, creating one if neccessary.", "");
DocDeclStr(
static wxConfigBase *, Create(),
"Create and return a new global config object. This function will\n"
"create the \"best\" implementation of wx.Config available for the\n"
"current platform.");
"Create and return a new global config object. This function will
create the \"best\" implementation of wx.Config available for the
current platform.", "");
DocDeclStr(
static void , DontCreateOnDemand(),
"Should Get() try to create a new log object if there isn't a current one?");
"Should Get() try to create a new log object if there isn't a current
one?", "");
DocDeclStr(
virtual void , SetPath(const wxString& path),
"Set current path: if the first character is '/', it's the absolute path,\n"
"otherwise it's a relative path. '..' is supported. If the strPath\n"
"doesn't exist it is created.");
"Set current path: if the first character is '/', it's the absolute
path, otherwise it's a relative path. '..' is supported. If the
strPath doesn't exist it is created.", "");
DocDeclStr(
virtual const wxString& , GetPath() const,
"Retrieve the current path (always as absolute path)");
"Retrieve the current path (always as absolute path)", "");
%extend {
DocAStr(GetFirstGroup,
"GetFirstGroup() -> (more, value, index)",
"Allows enumerating the subgroups in a config object. Returns\n"
"a tuple containing a flag indicating there are more items, the\n"
"name of the current item, and an index to pass to GetNextGroup to\n"
"fetch the next item.");
"Allows enumerating the subgroups in a config object. Returns a tuple
containing a flag indicating there are more items, the name of the
current item, and an index to pass to GetNextGroup to fetch the next
item.", "");
PyObject* GetFirstGroup() {
bool cont;
long index = 0;
@@ -145,10 +145,10 @@ public:
DocAStr(GetNextGroup,
"GetNextGroup(long index) -> (more, value, index)",
"Allows enumerating the subgroups in a config object. Returns\n"
"a tuple containing a flag indicating there are more items, the\n"
"name of the current item, and an index to pass to GetNextGroup to\n"
"fetch the next item.");
"Allows enumerating the subgroups in a config object. Returns a tuple
containing a flag indicating there are more items, the name of the
current item, and an index to pass to GetNextGroup to fetch the next
item.", "");
PyObject* GetNextGroup(long index) {
bool cont;
wxString value;
@@ -160,10 +160,10 @@ public:
DocAStr(GetFirstEntry,
"GetFirstEntry() -> (more, value, index)",
"Allows enumerating the entries in the current group in a config\n"
"object. Returns a tuple containing a flag indicating there are\n"
"more items, the name of the current item, and an index to pass to\n"
"GetNextGroup to fetch the next item.");
"Allows enumerating the entries in the current group in a config
object. Returns a tuple containing a flag indicating there are more
items, the name of the current item, and an index to pass to
GetNextGroup to fetch the next item.", "");
PyObject* GetFirstEntry() {
bool cont;
long index = 0;
@@ -176,10 +176,10 @@ public:
DocAStr(GetNextEntry,
"GetNextEntry(long index) -> (more, value, index)",
"Allows enumerating the entries in the current group in a config\n"
"object. Returns a tuple containing a flag indicating there are\n"
"more items, the name of the current item, and an index to pass to\n"
"GetNextGroup to fetch the next item.");
"Allows enumerating the entries in the current group in a config
object. Returns a tuple containing a flag indicating there are more
items, the name of the current item, and an index to pass to
GetNextGroup to fetch the next item.", "");
PyObject* GetNextEntry(long index) {
bool cont;
wxString value;
@@ -193,46 +193,46 @@ public:
DocDeclStr(
virtual size_t , GetNumberOfEntries(bool recursive = False) const,
"Get the number of entries in the current group, with or\n"
"without its subgroups.");
"Get the number of entries in the current group, with or without its
subgroups.", "");
DocDeclStr(
virtual size_t , GetNumberOfGroups(bool recursive = False) const,
"Get the number of subgroups in the current group, with or\n"
"without its subgroups.");
"Get the number of subgroups in the current group, with or without its
subgroups.", "");
DocDeclStr(
virtual bool , HasGroup(const wxString& name) const,
"Returns True if the group by this name exists");
"Returns True if the group by this name exists", "");
DocDeclStr(
virtual bool , HasEntry(const wxString& name) const,
"Returns True if the entry by this name exists");
"Returns True if the entry by this name exists", "");
DocDeclStr(
bool , Exists(const wxString& name) const,
"Returns True if either a group or an entry with a given name exists");
"Returns True if either a group or an entry with a given name exists", "");
// get the entry type
DocDeclStr(
virtual EntryType , GetEntryType(const wxString& name) const,
"Get the type of the entry. Returns one of the wx.Config.Type_XXX values.");
"Get the type of the entry. Returns one of the wx.Config.Type_XXX values.", "");
DocDeclStr(
wxString , Read(const wxString& key, const wxString& defaultVal = wxPyEmptyString),
"Returns the value of key if it exists, defaultVal otherwise.");
"Returns the value of key if it exists, defaultVal otherwise.", "");
%extend {
DocStr(ReadInt,
"Returns the value of key if it exists, defaultVal otherwise.");
"Returns the value of key if it exists, defaultVal otherwise.", "");
long ReadInt(const wxString& key, long defaultVal = 0) {
long rv;
self->Read(key, &rv, defaultVal);
@@ -240,7 +240,7 @@ public:
}
DocStr(ReadFloat,
"Returns the value of key if it exists, defaultVal otherwise.");
"Returns the value of key if it exists, defaultVal otherwise.", "");
double ReadFloat(const wxString& key, double defaultVal = 0.0) {
double rv;
self->Read(key, &rv, defaultVal);
@@ -248,7 +248,7 @@ public:
}
DocStr(ReadBool,
"Returns the value of key if it exists, defaultVal otherwise.");
"Returns the value of key if it exists, defaultVal otherwise.", "");
bool ReadBool(const wxString& key, bool defaultVal = False) {
bool rv;
self->Read(key, &rv, defaultVal);
@@ -260,40 +260,40 @@ public:
// write the value (return True on success)
DocDeclStr(
bool , Write(const wxString& key, const wxString& value),
"write the value (return True on success)");
"write the value (return True on success)", "");
DocDeclStrName(
bool, Write(const wxString& key, long value),
"write the value (return True on success)",
"write the value (return True on success)", "",
WriteInt);
DocDeclStrName(
bool, Write(const wxString& key, double value),
"write the value (return True on success)",
"write the value (return True on success)", "",
WriteFloat);
DocDeclStrName(
bool, Write(const wxString& key, bool value),
"write the value (return True on success)",
"write the value (return True on success)", "",
WriteBool);
DocDeclStr(
virtual bool , Flush(bool currentOnly = False),
"permanently writes all changes");
"permanently writes all changes", "");
DocDeclStr(
virtual bool , RenameEntry(const wxString& oldName,
const wxString& newName),
"Rename an entry. Returns False on failure (probably because the new\n"
"name is already taken by an existing entry)");
"Rename an entry. Returns False on failure (probably because the new
name is already taken by an existing entry)", "");
DocDeclStr(
virtual bool , RenameGroup(const wxString& oldName,
const wxString& newName),
"Rename aa group. Returns False on failure (probably because the new\n"
"name is already taken by an existing entry)");
"Rename a group. Returns False on failure (probably because the new
name is already taken by an existing entry)", "");
// deletes the specified entry and the group it belongs to if
@@ -301,71 +301,72 @@ public:
DocDeclStr(
virtual bool , DeleteEntry(const wxString& key,
bool deleteGroupIfEmpty = True),
"Deletes the specified entry and the group it belongs to if\n"
"it was the last key in it and the second parameter is True");
"Deletes the specified entry and the group it belongs to if it was the
last key in it and the second parameter is True", "");
DocDeclStr(
virtual bool , DeleteGroup(const wxString& key),
"Delete the group (with all subgroups)");
"Delete the group (with all subgroups)", "");
DocDeclStr(
virtual bool , DeleteAll(),
"Delete the whole underlying object (disk file, registry key, ...)\n"
"primarly intended for use by deinstallation routine.");
"Delete the whole underlying object (disk file, registry key, ...)
primarly intended for use by deinstallation routine.", "");
DocDeclStr(
void , SetExpandEnvVars(bool doIt = True),
"We can automatically expand environment variables in the config entries\n"
"(this option is on by default, you can turn it on/off at any time)");
"We can automatically expand environment variables in the config
entries this option is on by default, you can turn it on/off at any
time)", "");
DocDeclStr(
bool , IsExpandingEnvVars() const,
"Are we currently expanding environment variables?");
"Are we currently expanding environment variables?", "");
DocDeclStr(
void , SetRecordDefaults(bool doIt = True),
"Set whether the config objec should record default values.");
"Set whether the config objec should record default values.", "");
DocDeclStr(
bool , IsRecordingDefaults() const,
"Are we currently recording default values?");
"Are we currently recording default values?", "");
DocDeclStr(
wxString , ExpandEnvVars(const wxString& str) const,
"Expand any environment variables in str and return the result");
"Expand any environment variables in str and return the result", "");
DocDeclStr(
wxString , GetAppName() const,
"");
"", "");
DocDeclStr(
wxString , GetVendorName() const,
"");
"", "");
DocDeclStr(
void , SetAppName(const wxString& appName),
"");
"", "");
DocDeclStr(
void , SetVendorName(const wxString& vendorName),
"");
"", "");
DocDeclStr(
void , SetStyle(long style),
"");
"", "");
DocDeclStr(
long , GetStyle() const,
"");
"", "");
};
@@ -374,7 +375,7 @@ public:
DocStr(wxConfig,
"This ConfigBase-derived class will use the registry on Windows,
and will be a wx.FileConfig on other platforms.");
and will be a wx.FileConfig on other platforms.", "");
class wxConfig : public wxConfigBase {
public:
@@ -384,7 +385,7 @@ public:
const wxString& localFilename = wxPyEmptyString,
const wxString& globalFilename = wxPyEmptyString,
long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE),
"");
"", "");
~wxConfig();
};
@@ -393,7 +394,7 @@ public:
DocStr(wxFileConfig,
"This config class will use a file for storage on all platforms.");
"This config class will use a file for storage on all platforms.", "");
class wxFileConfig : public wxConfigBase {
public:
@@ -403,7 +404,7 @@ public:
const wxString& localFilename = wxPyEmptyString,
const wxString& globalFilename = wxPyEmptyString,
long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE),
"");
"", "");
~wxFileConfig();
};
@@ -412,23 +413,23 @@ public:
//---------------------------------------------------------------------------
DocStr(wxConfigPathChanger,
"A handy little class which changes current path to the path of
given entry and restores it in the destructoir: so if you declare
a local variable of this type, you work in the entry directory
and the path is automatically restored when the function returns.");
"A handy little class which changes current path to the path of given
entry and restores it in the destructoir: so if you declare a local
variable of this type, you work in the entry directory and the path is
automatically restored when the function returns.", "");
class wxConfigPathChanger
{
public:
DocCtorStr(
wxConfigPathChanger(const wxConfigBase *config, const wxString& entry),
"");
"", "");
~wxConfigPathChanger();
DocDeclStr(
const wxString& , Name() const,
"Get the key name");
"Get the key name", "");
};
@@ -438,10 +439,10 @@ public:
DocDeclStr(
wxString , wxExpandEnvVars(const wxString &sz),
"Replace environment variables ($SOMETHING) with their values. The\n"
"format is $VARNAME or ${VARNAME} where VARNAME contains\n"
"alphanumeric characters and '_' only. '$' must be escaped ('\$')\n"
"in order to be taken literally.");
"Replace environment variables ($SOMETHING) with their values. The
format is $VARNAME or ${VARNAME} where VARNAME contains alphanumeric
characters and '_' only. '$' must be escaped ('\$') in order to be
taken literally.", "");

View File

@@ -43,34 +43,39 @@ enum wxRelationship
DocStr(wxIndividualLayoutConstraint,
"Objects of this class are stored in the wx.LayoutConstraint class as one of
eight possible constraints that a window can be involved in. You will never
need to create an instance of wx.IndividualLayoutConstraint, rather you should
use create a wx.LayoutContstraints instance and use the individual contstraints
that it contains.
"Objects of this class are stored in the `wx.LayoutConstraints` class as
one of eight possible constraints that a window can be involved in.
You will never need to create an instance of
wx.IndividualLayoutConstraint, rather you should create a
`wx.LayoutConstraints` instance and use the individual contstraints
that it contains.", "
Constraints are initially set to have the relationship wx.Unconstrained, which
means that their values should be calculated by looking at known constraints.
Constraints are initially set to have the relationship
wx.Unconstrained, which means that their values should be calculated
by looking at known constraints.
The Edge specifies the type of edge or dimension of a window.
Edges
------
================== ==============================================
wx.Left The left edge.
wx.Top The top edge.
wx.Right The right edge.
wx.Bottom The bottom edge.
wx.CentreX The x-coordinate of the centre of the window.
wx.CentreY The y-coordinate of the centre of the window.
================== ==============================================
The Relationship specifies the relationship that this edge or dimension has
with another specified edge or dimension. Normally, the user doesn't use these
directly because functions such as Below and RightOf are a convenience for
using the more general Set function.
The Relationship specifies the relationship that this edge or
dimension has with another specified edge or dimension. Normally, the
user doesn't use these directly because functions such as Below and
RightOf are a convenience for using the more general Set function.
Relationships
-------------
================== ==============================================
wx.Unconstrained The edge or dimension is unconstrained
(the default for edges.)
wx.AsIs The edge or dimension is to be taken from the current
@@ -84,10 +89,12 @@ using the more general Set function.
wx.PercentOf The edge or dimension should be a percentage of another
edge or dimension.
wx.Absolute The edge or dimension should be a given absolute value.
================== ==============================================
:see: `wx.LayoutConstraints`, `wx.Window.SetConstraints`
");
// wxIndividualLayoutConstraint: a constraint on window position
class wxIndividualLayoutConstraint : public wxObject
{
public:
@@ -97,123 +104,141 @@ public:
DocDeclStr(
void , Set(wxRelationship rel, wxWindow *otherW, wxEdge otherE,
int val = 0, int marg = wxLAYOUT_DEFAULT_MARGIN),
"");
"Sets the properties of the constraint. Normally called by one of the
convenience functions such as Above, RightOf, SameAs.", "");
DocDeclStr(
void , LeftOf(wxWindow *sibling, int marg = 0),
"Sibling relationship");
"Constrains this edge to be to the left of the given window, with an
optional margin. Implicitly, this is relative to the left edge of the
other window.", "");
DocDeclStr(
void , RightOf(wxWindow *sibling, int marg = 0),
"Sibling relationship");
"Constrains this edge to be to the right of the given window, with an
optional margin. Implicitly, this is relative to the right edge of the
other window.", "");
DocDeclStr(
void , Above(wxWindow *sibling, int marg = 0),
"Sibling relationship");
"Constrains this edge to be above the given window, with an optional
margin. Implicitly, this is relative to the top edge of the other
window.", "");
DocDeclStr(
void , Below(wxWindow *sibling, int marg = 0),
"Sibling relationship");
"Constrains this edge to be below the given window, with an optional
margin. Implicitly, this is relative to the bottom edge of the other
window.", "");
DocDeclStr(
void , SameAs(wxWindow *otherW, wxEdge edge, int marg = 0),
"'Same edge' alignment");
"Constrains this edge or dimension to be to the same as the edge of the
given window, with an optional margin.", "");
DocDeclStr(
void , PercentOf(wxWindow *otherW, wxEdge wh, int per),
"The edge is a percentage of the other window's edge");
"Constrains this edge or dimension to be to a percentage of the given
window, with an optional margin.", "");
DocDeclStr(
void , Absolute(int val),
"Edge has absolute value");
"Constrains this edge or dimension to be the given absolute value.", "");
DocDeclStr(
void , Unconstrained(),
"Dimension is unconstrained");
"Sets this edge or dimension to be unconstrained, that is, dependent on
other edges and dimensions from which this value can be deduced.", "");
DocDeclStr(
void , AsIs(),
"Dimension is 'as is' (use current size settings)");
"Sets this edge or constraint to be whatever the window's value is at
the moment. If either of the width and height constraints are *as is*,
the window will not be resized, but moved instead. This is important
when considering panel items which are intended to have a default
size, such as a button, which may take its size from the size of the
button label.", "");
DocDeclStr(
wxWindow *, GetOtherWindow(),
"");
"", "");
DocDeclStr(
wxEdge , GetMyEdge() const,
"");
"", "");
DocDeclStr(
void , SetEdge(wxEdge which),
"");
"", "");
DocDeclStr(
void , SetValue(int v),
"");
"", "");
DocDeclStr(
int , GetMargin(),
"");
"", "");
DocDeclStr(
void , SetMargin(int m),
"");
"", "");
DocDeclStr(
int , GetValue() const,
"");
"", "");
DocDeclStr(
int , GetPercent() const,
"");
"", "");
DocDeclStr(
int , GetOtherEdge() const,
"");
"", "");
DocDeclStr(
bool , GetDone() const,
"");
"", "");
DocDeclStr(
void , SetDone(bool d),
"");
"", "");
DocDeclStr(
wxRelationship , GetRelationship(),
"");
"", "");
DocDeclStr(
void , SetRelationship(wxRelationship r),
"");
"", "");
DocDeclStr(
bool , ResetIfWin(wxWindow *otherW),
"Reset constraint if it mentions otherWin");
"Reset constraint if it mentions otherWin", "");
DocDeclStr(
bool , SatisfyConstraint(wxLayoutConstraints *constraints, wxWindow *win),
"Try to satisfy constraint");
"Try to satisfy constraint", "");
DocDeclStr(
int , GetEdge(wxEdge which, wxWindow *thisWin, wxWindow *other) const,
"Get the value of this edge or dimension, or if this\n"
"is not determinable, -1.");
"is not determinable, -1.", "");
};
DocStr(wxLayoutConstraints,
"Note: constraints are now deprecated and you should use sizers instead.
"**Note:** constraints are now deprecated and you should use sizers
instead.
Objects of this class can be associated with a window to define its layout
constraints, with respect to siblings or its parent.
Objects of this class can be associated with a window to define its
layout constraints, with respect to siblings or its parent.
The class consists of the following eight constraints of class
wx.IndividualLayoutConstraint, some or all of which should be accessed
@@ -228,15 +253,18 @@ directly to set the appropriate constraints.
* centreX: represents the horizontal centre point of the window
* centreY: represents the vertical centre point of the window
Most constraints are initially set to have the relationship wxUnconstrained,
which means that their values should be calculated by looking at known
constraints. The exceptions are width and height, which are set to wxAsIs to
ensure that if the user does not specify a constraint, the existing width and
height will be used, to be compatible with panel items which often have take a
default size. If the constraint is wxAsIs, the dimension will not be changed.
");
Most constraints are initially set to have the relationship
wxUnconstrained, which means that their values should be calculated by
looking at known constraints. The exceptions are width and height,
which are set to wxAsIs to ensure that if the user does not specify a
constraint, the existing width and height will be used, to be
compatible with panel items which often have take a default size. If
the constraint is ``wx.AsIs``, the dimension will not be changed.
:see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
", "");
// wxLayoutConstraints: the complete set of constraints for a window
class wxLayoutConstraints : public wxObject
{
public:
@@ -260,7 +288,7 @@ public:
DocCtorStr(
wxLayoutConstraints(),
"");
"", "");
DocDeclA(
bool, SatisfyConstraints(wxWindow *win, int *OUTPUT),

View File

@@ -24,8 +24,8 @@ MAKE_CONST_WXSTRING(ControlNameStr);
DocStr(wxControl,
"This is the base class for a control or 'widget'.
A control is generally a small window which processes user input and/or
displays one or more item of data.");
A control is generally a small window which processes user input
and/or displays one or more item of data.", "");
class wxControl : public wxWindow
{
@@ -41,12 +41,12 @@ public:
long style=0,
const wxValidator& validator=wxDefaultValidator,
const wxString& name=wxPyControlNameStr),
"Create a Control. Normally you should only call this from a\n"
"subclass' __init__ as a plain old wx.Control is not very useful.");
"Create a Control. Normally you should only call this from a subclass'
__init__ as a plain old wx.Control is not very useful.", "");
DocCtorStrName(
wxControl(),
"Precreate a Control control for 2-phase creation",
"Precreate a Control control for 2-phase creation", "",
PreControl);
DocDeclStr(
@@ -57,21 +57,23 @@ public:
long style=0,
const wxValidator& validator=wxDefaultValidator,
const wxString& name=wxPyControlNameStr),
"Do the 2nd phase and create the GUI control.");
"Do the 2nd phase and create the GUI control.", "");
DocDeclStr(
void , Command(wxCommandEvent& event),
"Simulates the effect of the user issuing a command to the\n"
"item. See wx.CommandEvent.");
"Simulates the effect of the user issuing a command to the item.
:see: `wx.CommandEvent`
", "");
DocDeclStr(
wxString , GetLabel(),
"Return a control's text.");
"Return a control's text.", "");
DocDeclStr(
void , SetLabel(const wxString& label),
"Sets the item's text.");
"Sets the item's text.", "");
static wxVisualAttributes
@@ -85,18 +87,18 @@ public:
DocStr(wxItemContainer,
"wx.ItemContainer defines an interface which is implemented by all
controls which have string subitems, each of which may be
selected, such as wx.ListBox, wx.CheckListBox, wx.Choice and
wx.ComboBox (which implements an extended interface deriving from
this one)
controls which have string subitems, each of which may be selected,
such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well as
`wx.ComboBox` which implements an extended interface deriving from
this one.
It defines the methods for accessing the control's items and
although each of the derived classes implements them differently,
they still all conform to the same interface.
It defines the methods for accessing the control's items and although
each of the derived classes implements them differently, they still
all conform to the same interface.
The items in a wx.ItemContainer have (non empty) string labels
and, optionally, client data associated with them.
");
The items in a wx.ItemContainer have (non empty) string labels and,
optionally, client data associated with them.
", "");
class wxItemContainer
{
@@ -106,10 +108,10 @@ public:
%extend {
DocStr(Append,
"Adds the item to the control, associating the given data with the\n"
"item if not None. The return value is the index of the newly\n"
"added item which may be different from the last one if the\n"
"control is sorted (e.g. has wx.LB_SORT or wx.CB_SORT style).");
"Adds the item to the control, associating the given data with the item
if not None. The return value is the index of the newly added item
which may be different from the last one if the control is sorted (e.g.
has wx.LB_SORT or wx.CB_SORT style).", "");
int Append(const wxString& item, PyObject* clientData=NULL) {
if (clientData) {
wxPyClientData* data = new wxPyClientData(clientData);
@@ -121,16 +123,16 @@ public:
DocDeclStrName(
void , Append(const wxArrayString& strings),
"Apend several items at once to the control. Notice that calling\n"
"this method may be much faster than appending the items one by\n"
"one if you need to add a lot of items.",
"Apend several items at once to the control. Notice that calling this
method may be much faster than appending the items one by one if you
need to add a lot of items.", "",
AppendItems);
%extend {
DocStr(Insert,
"Insert an item into the control before the item at the pos index,\n"
"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.", "");
int Insert(const wxString& item, int pos, PyObject* clientData=NULL) {
if (clientData) {
wxPyClientData* data = new wxPyClientData(clientData);
@@ -143,65 +145,67 @@ public:
DocDeclStr(
virtual void , Clear(),
"Removes all items from the control.");
"Removes all items from the control.", "");
DocDeclStr(
virtual void , Delete(int n),
"Deletes the item at the zero-based index 'n' from the control.\n"
"Note that it is an error (signalled by a PyAssertionError\n"
"exception if enabled) to remove an item with the index negative\n"
"or greater or equal than the number of items in the control.");
"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
enabled) to remove an item with the index negative or greater or equal
than the number of items in the control.", "");
DocDeclStr(
virtual int , GetCount() const,
"Returns the number of items in the control.");
"Returns the number of items in the control.", "");
DocDeclStr(
bool , IsEmpty() const,
"Returns True if the control is empty or False if it has some items.");
"Returns True if the control is empty or False if it has some items.", "");
DocDeclStr(
virtual wxString , GetString(int n) const,
"Returns the label of the item with the given index.");
"Returns the label of the item with the given index.", "");
DocDeclStr(
wxArrayString , GetStrings() const,
"");
"", "");
DocDeclStr(
virtual void , SetString(int n, const wxString& s),
"Sets the label for the given item.");
"Sets the label for the given item.", "");
DocDeclStr(
virtual int , FindString(const wxString& s) const,
"Finds an item whose label matches the given string. Returns the\n"
"zero-based position of the item, or wx.NOT_FOUND if the string\n"
"was not found.");
"Finds an item whose label matches the given string. Returns the
zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
found.", "");
DocDeclStr(
virtual void , Select(int n),
"Sets the item at index 'n' to be the selected item.");
"Sets the item at index 'n' to be the selected item.", "");
%pythoncode { SetSelection = Select }
DocDeclStr(
virtual int , GetSelection() const,
"Returns the index of the selected item or wx.NOT_FOUND if no item is selected.");
"Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
is selected.", "");
DocDeclStr(
wxString , GetStringSelection() const,
"Returns the label of the selected item or an empty string if no item is selected.");
"Returns the label of the selected item or an empty string if no item
is selected.", "");
%extend {
DocStr(GetClientData,
"Returns the client data associated with the given item, (if any.)");
"Returns the client data associated with the given item, (if any.)", "");
PyObject* GetClientData(int n) {
wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
if (data) {
@@ -214,7 +218,7 @@ public:
}
DocStr(SetClientData,
"Associate the given client data with the item at position n.");
"Associate the given client data with the item at position n.", "");
void SetClientData(int n, PyObject* clientData) {
wxPyClientData* data = new wxPyClientData(clientData);
self->SetClientObject(n, data);
@@ -228,9 +232,9 @@ public:
%newgroup;
DocStr(wxControlWithItems,
"wx.ControlWithItems combines the wx.ItemContainer class with the
wx.Control class, and is used for the base class of various
controls that have items.");
"wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
wx.Control class, and is used for the base class of various controls
that have items.", "");
class wxControlWithItems : public wxControl, public wxItemContainer
{

View File

@@ -38,28 +38,32 @@ EVT_DETAILED_HELP_RANGE = wx.PyEventBinder( wxEVT_DETAILED_HELP, 2)
//----------------------------------------------------------------------
DocStr(wxHelpEvent,
"A help event is sent when the user has requested
context-sensitive help. This can either be caused by the
application requesting context-sensitive help mode via
wx.ContextHelp, or (on MS Windows) by the system generating a
WM_HELP message when the user pressed F1 or clicked on the query
button in a dialog caption.
"A help event is sent when the user has requested context-sensitive
help. This can either be caused by the application requesting
context-sensitive help mode via wx.ContextHelp, or (on MS Windows) by
the system generating a WM_HELP message when the user pressed F1 or
clicked on the query button in a dialog caption.
A help event is sent to the window that the user clicked on, and
is propagated up the window hierarchy until the event is
processed or there are no more event handlers. The application
should call event.GetId to check the identity of the clicked-on
window, and then either show some suitable help or call
event.Skip if the identifier is unrecognised. Calling Skip is
important because it allows wxWindows to generate further events
for ancestors of the clicked-on window. Otherwise it would be
impossible to show help for container windows, since processing
would stop after the first window found.
A help event is sent to the window that the user clicked on, and is
propagated up the window hierarchy until the event is processed or
there are no more event handlers. The application should call
event.GetId to check the identity of the clicked-on window, and then
either show some suitable help or call event.Skip if the identifier is
unrecognised. Calling Skip is important because it allows wxWindows to
generate further events for ancestors of the clicked-on
window. Otherwise it would be impossible to show help for container
windows, since processing would stop after the first window found.",
"
Events
-------
============== =========================================
EVT_HELP Sent when the user has requested context-
sensitive help.
EVT_HELP_RANGE Allows to catch EVT_HELP for a range of IDs
============== =========================================
:see: `wx.ContextHelp`, `wx.ContextHelpButton`
");
@@ -70,36 +74,36 @@ public:
wxHelpEvent(wxEventType type = wxEVT_NULL,
wxWindowID winid = 0,
const wxPoint& pt = wxDefaultPosition),
"");
"", "");
DocDeclStr(
const wxPoint , GetPosition() const,
"Returns the left-click position of the mouse, in screen\n"
"coordinates. This allows the application to position the help\n"
"appropriately.");
"Returns the left-click position of the mouse, in screen
coordinates. This allows the application to position the help
appropriately.", "");
DocDeclStr(
void , SetPosition(const wxPoint& pos),
"Sets the left-click position of the mouse, in screen coordinates.");
"Sets the left-click position of the mouse, in screen coordinates.", "");
DocDeclStr(
const wxString& , GetLink() const,
"Get an optional link to further help");
"Get an optional link to further help", "");
DocDeclStr(
void , SetLink(const wxString& link),
"Set an optional link to further help");
"Set an optional link to further help", "");
DocDeclStr(
const wxString& , GetTarget() const,
"Get an optional target to display help in. E.g. a window specification");
"Get an optional target to display help in. E.g. a window specification", "");
DocDeclStr(
void , SetTarget(const wxString& target),
"Set an optional target to display help in. E.g. a window specification");
"Set an optional target to display help in. E.g. a window specification", "");
};
@@ -107,52 +111,53 @@ public:
DocStr(wxContextHelp,
"This class changes the cursor to a query and puts the application
into a 'context-sensitive help mode'. When the user left-clicks
on a window within the specified window, a EVT_HELP event is sent
to that control, and the application may respond to it by popping
up some help.
"This class changes the cursor to a query and puts the application into
a 'context-sensitive help mode'. When the user left-clicks on a window
within the specified window, a ``EVT_HELP`` event is sent to that
control, and the application may respond to it by popping up some
help.
There are a couple of ways to invoke this behaviour implicitly:
* Use the wx.DIALOG_EX_CONTEXTHELP extended style for a
dialog (Windows only). This will put a question mark in the
titlebar, and Windows will put the application into
context-sensitive help mode automatically, with further
programming.
* Use the wx.DIALOG_EX_CONTEXTHELP extended style for a dialog
(Windows only). This will put a question mark in the titlebar,
and Windows will put the application into context-sensitive help
mode automatically, with further programming.
* Create a wx.ContextHelpButton, whose predefined behaviour
is to create a context help object. Normally you will write
your application so that this button is only added to a
dialog for non-Windows platforms (use
wx.DIALOG_EX_CONTEXTHELP on Windows).
");
* Create a `wx.ContextHelpButton`, whose predefined behaviour is
to create a context help object. Normally you will write your
application so that this button is only added to a dialog for
non-Windows platforms (use ``wx.DIALOG_EX_CONTEXTHELP`` on
Windows).
:see: `wx.ContextHelpButton`
", "");
class wxContextHelp : public wxObject {
public:
DocCtorStr(
wxContextHelp(wxWindow* window = NULL, bool doNow = True),
"Constructs a context help object, calling BeginContextHelp if\n"
"doNow is true (the default).\n"
"\n"
"If window is None, the top window is used.");
"Constructs a context help object, calling BeginContextHelp if doNow is
true (the default).
If window is None, the top window is used.", "");
~wxContextHelp();
DocDeclStr(
bool , BeginContextHelp(wxWindow* window = NULL),
"Puts the application into context-sensitive help mode. window is\n"
"the window which will be used to catch events; if NULL, the top\n"
"window will be used.\n"
"\n"
"Returns true if the application was successfully put into\n"
"context-sensitive help mode. This function only returns when the\n"
"event loop has finished.");
"Puts the application into context-sensitive help mode. window is the
window which will be used to catch events; if NULL, the top window
will be used.
Returns true if the application was successfully put into
context-sensitive help mode. This function only returns when the event
loop has finished.", "");
DocDeclStr(
bool , EndContextHelp(),
"Ends context-sensitive help mode. Not normally called by the\n"
"application.");
"Ends context-sensitive help mode. Not normally called by the
application.", "");
};
@@ -160,17 +165,18 @@ public:
//----------------------------------------------------------------------
DocStr(wxContextHelpButton,
"Instances of this class may be used to add a question mark button
that when pressed, puts the application into context-help
mode. It does this by creating a wx.ContextHelp object which
itself generates a EVT_HELP event when the user clicks on a
window.
"Instances of this class may be used to add a question mark button that
when pressed, puts the application into context-help mode. It does
this by creating a wx.ContextHelp object which itself generates a
``EVT_HELP`` event when the user clicks on a window.
On Windows, you may add a question-mark icon to a dialog by use
of the wx.DIALOG_EX_CONTEXTHELP extra style, but on other
platforms you will have to add a button explicitly, usually next
to OK, Cancel or similar buttons.
");
On Windows, you may add a question-mark icon to a dialog by use of the
``wx.DIALOG_EX_CONTEXTHELP`` extra style, but on other platforms you
will have to add a button explicitly, usually next to OK, Cancel or
similar buttons.
:see: `wx.ContextHelp`, `wx.ContextHelpButton`
", "");
class wxContextHelpButton : public wxBitmapButton {
public:
@@ -181,7 +187,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxBU_AUTODRAW),
"Constructor, creating and showing a context help button.");
"Constructor, creating and showing a context help button.", "");
};
@@ -193,54 +199,51 @@ implementing context-sensitive help to show the help text for the
given window.
The current help provider must be explicitly set by the
application using wx.HelpProvider.Set().");
application using wx.HelpProvider.Set().", "");
class wxHelpProvider
{
public:
DocDeclStr(
static wxHelpProvider *, Set(wxHelpProvider *helpProvider),
"Sset the current, application-wide help provider. Returns the\n"
"previous one. Unlike some other classes, the help provider is\n"
"not created on demand. This must be explicitly done by the\n"
"application.");
"Sset the current, application-wide help provider. Returns the previous
one. Unlike some other classes, the help provider is not created on
demand. This must be explicitly done by the application.", "");
DocDeclStr(
static wxHelpProvider *, Get(),
"Return the current application-wide help provider.");
"Return the current application-wide help provider.", "");
DocDeclStr(
wxString , GetHelp(const wxWindow *window),
"Gets the help string for this window. Its interpretation is\n"
"dependent on the help provider except that empty string always\n"
"means that no help is associated with the window.");
"Gets the help string for this window. Its interpretation is dependent
on the help provider except that empty string always means that no
help is associated with the window.", "");
DocDeclStr(
bool , ShowHelp(wxWindow *window),
"Shows help for the given window. Uses GetHelp internally if\n"
"applicable.\n"
"\n"
"Returns true if it was done, or false if no help was available\n"
"for this window.");
"Shows help for the given window. Uses GetHelp internally if
applicable. Returns True if it was done, or False if no help was
available for this window.", "");
DocDeclStr(
void , AddHelp(wxWindow *window, const wxString& text),
"Associates the text with the given window.");
"Associates the text with the given window.", "");
DocDeclStrName(
void , AddHelp(wxWindowID id, const wxString& text),
"This version associates the given text with all windows with this\n"
"id. May be used to set the same help string for all Cancel\n"
"buttons in the application, for example.",
"This version associates the given text with all windows with this
id. May be used to set the same help string for all Cancel buttons in
the application, for example.", "",
AddHelpById);
DocDeclStr(
void , RemoveHelp(wxWindow* window),
"Removes the association between the window pointer and the help\n"
"text. This is called by the wx.Window destructor. Without this,\n"
"the table of help strings will fill up and when window pointers\n"
"are reused, the wrong help string will be found.");
"Removes the association between the window pointer and the help
text. This is called by the wx.Window destructor. Without this, the
table of help strings will fill up and when window pointers are
reused, the wrong help string will be found.", "");
%extend { void Destroy() { delete self; } }
@@ -250,9 +253,9 @@ public:
//----------------------------------------------------------------------
DocStr(wxSimpleHelpProvider,
"wx.SimpleHelpProvider is an implementation of wx.HelpProvider
which supports only plain text help strings, and shows the string
associated with the control (if any) in a tooltip.");
"wx.SimpleHelpProvider is an implementation of `wx.HelpProvider` which
supports only plain text help strings, and shows the string associated
with the control (if any) in a tooltip.", "");
class wxSimpleHelpProvider : public wxHelpProvider
{

View File

@@ -17,21 +17,19 @@
DocStr(wxCursor,
"A cursor is a small bitmap usually used for denoting where the
mouse pointer is, with a picture that might indicate the
interpretation of a mouse click.
"A cursor is a small bitmap usually used for denoting where the mouse
pointer is, with a picture that might indicate the interpretation of a
mouse click.
A single cursor object may be used in many windows (any subwindow
type). The wxWindows convention is to set the cursor for a
window, as in X, rather than to set it globally as in MS Windows,
although a global wx.SetCursor function is also available for use
on MS Windows.");
type). The wxWindows convention is to set the cursor for a window, as
in X, rather than to set it globally as in MS Windows, although a
global `wx.SetCursor` function is also available for use on MS Windows.
","
RefDoc(wxCursor::wxCursor(int id),
"
Stock Cursor IDs
-----------------
======================== ======================================
wx.CURSOR_ARROW A standard arrow cursor.
wx.CURSOR_RIGHT_ARROW A standard arrow cursor pointing to the right.
wx.CURSOR_BLANK Transparent cursor.
@@ -59,6 +57,7 @@ RefDoc(wxCursor::wxCursor(int id),
wx.CURSOR_WAIT A wait cursor.
wx.CURSOR_WATCH A watch cursor.
wx.CURSOR_ARROWWAIT A cursor with both an arrow and an hourglass, (windows.)
======================== ======================================
");
@@ -66,16 +65,14 @@ class wxCursor : public wxGDIObject
{
public:
RefDoc(wxCursor, ""); // turn it off for the ctors
%extend {
DocStr(wxCursor,
"Construct a Cursor from a file. Specify the type of file using\n"
"wx.BITAMP_TYPE* constants, and specify the hotspot if not using a\n"
".cur file.\n"
"\n"
"This cursor is not available on wxGTK, use wx.StockCursor,\n"
"wx.CursorFromImage, or wx.CursorFromBits instead.");
"Construct a Cursor from a file. Specify the type of file using
wx.BITAMP_TYPE* constants, and specify the hotspot if not using a cur
file.
This constructor is not available on wxGTK, use ``wx.StockCursor``,
``wx.CursorFromImage``, or ``wx.CursorFromBits`` instead.", "");
wxCursor(const wxString* cursorName, long type, int hotSpotX=0, int hotSpotY=0) {
%#ifdef __WXGTK__
wxCHECK_MSG(False, NULL,
@@ -90,24 +87,26 @@ public:
DocCtorStrName(
wxCursor(int id),
"Create a cursor using one of the stock cursors. Note that not\n"
"all cursors are available on all platforms.",
"Create a cursor using one of the stock cursors. Note that not all
cursors are available on all platforms.", "",
StockCursor);
DocCtorStrName(
wxCursor(const wxImage& image),
"Constructs a cursor from a wxImage. The cursor is monochrome,\n"
"colors with the RGB elements all greater than 127 will be\n"
"foreground, colors less than this background. The mask (if any)\n"
"will be used as transparent.\n"
"\n"
"In MSW the foreground will be white and the background black. The\n"
"cursor is resized to 32x32 In GTK, the two most frequent colors\n"
"will be used for foreground and background. The cursor will be\n"
"displayed at the size of the image. On MacOS the cursor is\n"
"resized to 16x16 and currently only shown as black/white (mask\n"
"respected).",
"Constructs a cursor from a wxImage. The cursor is monochrome, colors
with the RGB elements all greater than 127 will be foreground, colors
less than this background. The mask (if any) will be used as
transparent.",
"
In MSW the foreground will be white and the background
black. The cursor is resized to 32x32.
In GTK, the two most frequent colors will be used for foreground and
background. The cursor will be displayed at the size of the image.
On MacOS the cursor is resized to 16x16 and currently only shown as
black/white (mask respected).",
CursorFromImage);
@@ -132,11 +131,11 @@ public:
#ifdef __WXMSW__
DocDeclStr(
long , GetHandle(),
"Get the MS Windows handle for the cursor");
"Get the MS Windows handle for the cursor", "");
%extend {
DocStr(SetHandle,
"Set the MS Windows handle to use for the cursor");
"Set the MS Windows handle to use for the cursor", "");
void SetHandle(long handle) { self->SetHandle((WXHANDLE)handle); }
}
@@ -144,7 +143,7 @@ public:
DocDeclStr(
bool , Ok(),
"");
"", "");
%pythoncode { def __nonzero__(self): return self.Ok() }
@@ -152,31 +151,31 @@ public:
#ifdef __WXMSW__
DocDeclStr(
int , GetWidth(),
"");
"", "");
DocDeclStr(
int , GetHeight(),
"");
"", "");
DocDeclStr(
int , GetDepth(),
"");
"", "");
DocDeclStr(
void , SetWidth(int w),
"");
"", "");
DocDeclStr(
void , SetHeight(int h),
"");
"", "");
DocDeclStr(
void , SetDepth(int d),
"");
"", "");
DocDeclStr(
void , SetSize(const wxSize& size),
"");
"", "");
#endif

View File

@@ -50,45 +50,47 @@ enum wxDataFormatId
DocStr(wxDataFormat,
"A wx.DataFormat is an encapsulation of a platform-specific format
handle which is used by the system for the clipboard and drag and
drop operations. The applications are usually only interested in,
for 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.
handle which is used by the system for the clipboard and drag and drop
operations. The applications are usually only interested in, for
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.)
On the system level, a data format is usually just a number
(CLIPFORMAT under Windows or Atom under X11, for example).");
The standard format IDs are:
// 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
================ =====================================
// 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
Aside 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.
// Aside 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.
// ");
");
class wxDataFormat {
public:
DocCtorStr(
wxDataFormat( wxDataFormatId type ),
"Constructs a data format object for one of the standard data\n"
"formats or an empty data object (use SetType or SetId later in\n"
"this case)");
"Constructs a data format object for one of the standard data formats
or an empty data object (use SetType or SetId later in this case)", "");
DocCtorStrName(
wxDataFormat(const wxString& format),
"Constructs a data format object for a custom format identified by its name.",
"Constructs a data format object for a custom format identified by its
name.", "",
CustomDataFormat);
~wxDataFormat();
@@ -104,20 +106,22 @@ public:
DocDeclStr(
void , SetType(wxDataFormatId format),
"Sets the format to the given value, which should be one of wx.DF_XXX constants.");
"Sets the format to the given value, which should be one of wx.DF_XXX
constants.", "");
DocDeclStr(
wxDataFormatId , GetType() const,
"Returns the platform-specific number identifying the format.");
"Returns the platform-specific number identifying the format.", "");
DocDeclStr(
wxString , GetId() const,
"Returns the name of a custom format (this function will fail for a standard format).");
"Returns the name of a custom format (this function will fail for a
standard format).", "");
DocDeclStr(
void , SetId(const wxString& format),
"Sets the format to be the custom format identified by the given name.");
"Sets the format to be the custom format identified by the given name.", "");
};

View File

@@ -366,7 +366,7 @@ public:
DocDeclAStr(
static void, GetAmPmStrings(wxString *OUTPUT, wxString *OUTPUT),
"GetAmPmStrings() -> (am, pm)",
"Get the AM and PM strings in the current locale (may be empty)");
"Get the AM and PM strings in the current locale (may be empty)", "");
// return True if the given country uses DST for this year
static bool IsDSTApplicable(int year = Inv_Year,

View File

@@ -302,15 +302,16 @@ public:
DocDeclAStr(
void, GetTextExtent(const wxString& string, wxCoord *OUTPUT, wxCoord *OUTPUT),
"GetTextExtent(wxString string) -> (width, height)",
"Get the width and height of the text using the current font.\n"
"Only works for single line strings.");
"Get the width and height of the text using the current font. Only
works for single line strings.", "");
DocDeclAStrName(
void, GetTextExtent(const wxString& string,
wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord* OUTPUT,
wxFont* font = NULL),
"GetFullTextExtent(wxString string, Font font=None) ->\n (width, height, descent, externalLeading)",
"Get the width, height, decent and leading of the text using the current or specified font.\n"
"Only works for single line strings.",
"Get the width, height, decent and leading of the text using the
current or specified font. Only works for single line strings.", "",
GetFullTextExtent);
@@ -320,8 +321,9 @@ public:
wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT,
wxFont *font = NULL),
"GetMultiLineTextExtent(wxString string, Font font=None) ->\n (width, height, descent, externalLeading)",
"Get the width, height, decent and leading of the text using the current or specified font.\n"
"Works for single as well as multi-line strings.");
"Get the width, height, decent and leading of the text using the
current or specified font. Works for single as well as multi-line
strings.", "");
%extend {
@@ -336,7 +338,7 @@ public:
// size and resolution
// -------------------
DocStr(GetSize, "Get the DC size in device units.");
DocStr(GetSize, "Get the DC size in device units.", "");
wxSize GetSize();
DocDeclAName(
void, GetSize( int *OUTPUT, int *OUTPUT ),
@@ -344,7 +346,7 @@ public:
GetSizeTuple);
DocStr(GetSizeMM, "Get the DC size in milimeters.");
DocStr(GetSizeMM, "Get the DC size in milimeters.", "");
wxSize GetSizeMM() const;
DocDeclAName(
void, GetSizeMM( int *OUTPUT, int *OUTPUT ) const,

View File

@@ -83,43 +83,73 @@ typedef unsigned char byte;
// Macros for the docstring and autodoc features of SWIG.
//----------------------------------------------------------------------
// Macros for the docstring and autodoc features of SWIG. These will
// help make the code look more readable, and pretty, as well as help
// reduce typing in some cases.
// Set the docsring for the given full or partial declaration
%define DocStr(decl, docstr)
%feature("docstring") decl docstr;
//%feature("refdoc") decl "";
#ifdef _DO_FULL_DOCS
%define DocStr(decl, docstr, details)
%feature("docstring") decl docstr details;
%enddef
#else
%define DocStr(decl, docstr, details)
%feature("docstring") decl docstr;
%enddef
#endif
// Set the autodoc string for a full or partial declaration
%define DocA(decl, astr)
%feature("autodoc") decl astr;
%enddef
// Set both the autodoc and docstring for a full or partial declaration
%define DocAStr(decl, astr, docstr)
#ifdef _DO_FULL_DOCS
%define DocAStr(decl, astr, docstr, details)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr details
%enddef
#else
%define DocAStr(decl, astr, docstr, details)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr
%enddef
// Set the detailed reference docs for full or partial declaration
#define DocRef(decl, str) %feature("docref") decl str
#endif
// Set the docstring for a decl and then define the decl too. Must use the
// full declaration of the item.
%define DocDeclStr(type, decl, docstr)
#ifdef _DO_FULL_DOCS
%define DocDeclStr(type, decl, docstr, details)
%feature("docstring") decl docstr details;
type decl
%enddef
#else
%define DocDeclStr(type, decl, docstr, details)
%feature("docstring") decl docstr;
type decl
%enddef
#endif
// As above, but also give the decl a new %name
%define DocDeclStrName(type, decl, docstr, newname)
#ifdef _DO_FULL_DOCS
%define DocDeclStrName(type, decl, docstr, details, newname)
%feature("docstring") decl docstr details;
%name(newname) type decl
%enddef
#else
%define DocDeclStrName(type, decl, docstr, details, newname)
%feature("docstring") decl docstr;
%name(newname) type decl
%enddef
#endif
// Set the autodoc string for a decl and then define the decl too. Must use the
@@ -139,72 +169,117 @@ typedef unsigned char byte;
// Set the autodoc and the docstring for a decl and then define the decl too.
// Must use the full declaration of the item.
%define DocDeclAStr(type, decl, astr, docstr)
#ifdef _DO_FULL_DOCS
%define DocDeclAStr(type, decl, astr, details, docstr)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr details;
type decl
%enddef
#else
%define DocDeclAStr(type, decl, astr, details, docstr)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr;
type decl
%enddef
#endif
// As above, but also give the decl a new %name
%define DocDeclAStrName(type, decl, astr, docstr, newname)
#ifdef _DO_FULL_DOCS
%define DocDeclAStrName(type, decl, astr, docstr, details, newname)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr details;
%name(newname) type decl
%enddef
#else
%define DocDeclAStrName(type, decl, astr, docstr, details, newname)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr;
%name(newname) type decl
%enddef
#endif
// Set the docstring for a constructor decl and then define the decl too.
// Must use the full declaration of the item.
%define DocCtorStr(decl, docstr)
#ifdef _DO_FULL_DOCS
%define DocCtorStr(decl, docstr, details)
%feature("docstring") decl docstr details;
decl
%enddef
#else
%define DocCtorStr(decl, docstr, details)
%feature("docstring") decl docstr;
decl
%enddef
#endif
// As above, but also give the decl a new %name
%define DocCtorStrName(decl, docstr, newname)
#ifdef _DO_FULL_DOCS
%define DocCtorStrName(decl, docstr, details, newname)
%feature("docstring") decl docstr details;
%name(newname) decl
%enddef
#else
%define DocCtorStrName(decl, docstr, details, newname)
%feature("docstring") decl docstr;
%name(newname) decl
%enddef
#endif
// Set the autodoc string for a decl and then define the decl too. Must use the
// full declaration of the item.
// Set the autodoc string for a constructor decl and then define the decl too.
// Must use the full declaration of the item.
%define DocCtorA(decl, astr)
%feature("autodoc") decl astr;
decl
%enddef
// As above, but also give the decl a new %name
%define DocCtorAname(decl, astr, newname)
%define DocCtorAName(decl, astr, newname)
%feature("autodoc") decl astr;
%name(newname) decl
%enddef
// Set the autodoc and the docstring for a decl and then define the decl too.
// Must use the full declaration of the item.
%define DocCtorAStr(decl, astr, docstr)
// Set the autodoc and the docstring for a constructor decl and then define
// the decl too. Must use the full declaration of the item.
#ifdef _DO_FULL_DOCS
%define DocCtorAStr(decl, astr, docstr, details)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr details;
decl
%enddef
#else
%define DocCtorAStr(decl, astr, docstr, details)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr;
decl
%enddef
#endif
// As above, but also give the decl a new %name
%define DocCtorAStrName(decl, astr, docstr, newname)
#ifdef _DO_FULL_DOCS
%define DocCtorAStrName(decl, astr, docstr, details, newname)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr details;
%name(newname) decl
%enddef
#else
%define DocCtorAStrName(decl, astr, docstr, details, newname)
%feature("autodoc") decl astr;
%feature("docstring") decl docstr;
%name(newname) decl
%enddef
#endif
// A placeholder for the detailed reference docs.
%define RefDoc(decl, docstr)
%feature("refdoc") decl docstr;
%enddef
%define %newgroup
%pythoncode {

View File

@@ -118,9 +118,11 @@ public:
DocDeclAStr(
virtual wxTreeItemId, FindChild(wxTreeItemId parentId, const wxString& path, bool& OUTPUT),
"FindChild(wxTreeItemId parentId, wxString path) -> (item, done)",
"Find the child that matches the first part of 'path'. E.g. if a child path is\n"
"\"/usr\" and 'path' is \"/usr/include\" then the child for /usr is returned.\n"
"If the path string has been used (we're at the leaf), done is set to True\n");
"Find the child that matches the first part of 'path'. E.g. if a child
path is \"/usr\" and 'path' is \"/usr/include\" then the child for
/usr is returned. If the path string has been used (we're at the
leaf), done is set to True.
", "");
// Resize the components of the control

View File

@@ -25,7 +25,7 @@
DocStr(wxVideoMode,
"A simple struct containing video mode parameters for a display");
"A simple struct containing video mode parameters for a display", "");
struct wxVideoMode
{
@@ -34,29 +34,28 @@ struct wxVideoMode
DocDeclStr(
bool , Matches(const wxVideoMode& other) const,
"Returns true if this mode matches the other one in the sense that
all non zero fields of the other mode have the same value in this
one (except for refresh which is allowed to have a greater value)");
"Returns true if this mode matches the other one in the sense that all
non zero fields of the other mode have the same value in this
one (except for refresh which is allowed to have a greater value)", "");
DocDeclStr(
int , GetWidth() const,
"Returns the screen width in pixels (e.g. 640*480), 0 means
unspecified");
"Returns the screen width in pixels (e.g. 640*480), 0 means unspecified", "");
DocDeclStr(
int , GetHeight() const,
"Returns the screen width in pixels (e.g. 640*480), 0 means
unspecified");
unspecified", "");
DocDeclStr(
int , GetDepth() const,
"Returns the screen's bits per pixel (e.g. 32), 1 is monochrome
and 0 means unspecified/known");
"Returns the screen's bits per pixel (e.g. 32), 1 is monochrome and 0
means unspecified/known", "");
DocDeclStr(
bool , IsOk() const,
"returns true if the object has been initialized");
"returns true if the object has been initialized", "");
@@ -86,7 +85,7 @@ const wxVideoMode wxDefaultVideoMode;
//---------------------------------------------------------------------------
DocStr(wxDisplay,
"Represents a display/monitor attached to the system");
"Represents a display/monitor attached to the system", "");
class wxDisplay
@@ -95,26 +94,26 @@ public:
//
DocCtorStr(
wxDisplay(size_t index = 0),
"Set up a Display instance with the specified display. The
displays are numbered from 0 to GetCount() - 1, 0 is always the
primary display and the only one which is always supported");
"Set up a Display instance with the specified display. The displays
are numbered from 0 to GetCount() - 1, 0 is always the primary display
and the only one which is always supported", "");
virtual ~wxDisplay();
DocDeclStr(
static size_t , GetCount(),
"Return the number of available displays.");
"Return the number of available displays.", "");
DocDeclStr(
static int , GetFromPoint(const wxPoint& pt),
"Find the display where the given point lies, return wx.NOT_FOUND
if it doesn't belong to any display");
"Find the display where the given point lies, return wx.NOT_FOUND if it
doesn't belong to any display", "");
DocStr(GetFromWindow,
"Find the display where the given window lies, return wx.NOT_FOUND
if it is not shown at all.");
"Find the display where the given window lies, return wx.NOT_FOUND if
it is not shown at all.", "");
#ifdef __WXMSW__
static int GetFromWindow(wxWindow *window);
#else
@@ -126,39 +125,38 @@ if it is not shown at all.");
DocDeclStr(
virtual bool , IsOk() const,
"Return true if the object was initialized successfully");
"Return true if the object was initialized successfully", "");
%pythoncode { def __nonzero__(self): return self.IsOk() }
DocDeclStr(
virtual wxRect , GetGeometry() const,
"Returns the bounding rectangle of the display whose index was
passed to the constructor.");
"Returns the bounding rectangle of the display whose index was passed
to the constructor.", "");
DocDeclStr(
virtual wxString , GetName() const,
"Returns the display's name. A name is not available on all platforms.");
"Returns the display's name. A name is not available on all platforms.", "");
DocDeclStr(
bool , IsPrimary() const,
"Returns true if the display is the primary display. The primary
display is the one whose index is 0.");
display is the one whose index is 0.", "");
%extend {
DocAStr(GetModes,
"GetModes(VideoMode mode=DefaultVideoMode) -> [videoMode...]",
"Enumerate all video modes supported by this display matching the
given one (in the sense of VideoMode.Match()).
"Enumerate all video modes supported by this display matching the given
one (in the sense of VideoMode.Match()).
As any mode matches the default value of the argument and there
is always at least one video mode supported by display, the
returned array is only empty for the default value of the
argument if this function is not supported at all on this
platform.");
As any mode matches the default value of the argument and there is
always at least one video mode supported by display, the returned
array is only empty for the default value of the argument if this
function is not supported at all on this platform.", "");
PyObject* GetModes(const wxVideoMode& mode = wxDefaultVideoMode) {
PyObject* pyList = NULL;
@@ -178,17 +176,17 @@ platform.");
DocDeclStr(
virtual wxVideoMode , GetCurrentMode() const,
"Get the current video mode.");
"Get the current video mode.", "");
DocDeclStr(
virtual bool , ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode),
"Change current mode, return true if succeeded, false otherwise");
"Change current mode, return true if succeeded, false otherwise", "");
DocDeclStr(
void , ResetMode(),
"Restore the default video mode (just a more readable synonym)");
"Restore the default video mode (just a more readable synonym)", "");
};

View File

@@ -597,7 +597,8 @@ public:
DocStr(GetPosition, // sets the docstring for both
"Returns the position of the mouse in window coordinates when the event happened.");
"Returns the position of the mouse in window coordinates when the event
happened.", "");
wxPoint GetPosition();
DocDeclAName(
@@ -712,7 +713,7 @@ public:
DocStr(GetPosition, // sets the docstring for both
"Find the position of the event.");
"Find the position of the event.", "");
wxPoint GetPosition();
DocDeclAName(

View File

@@ -97,7 +97,7 @@ public:
}
}
%pythoncode {
asTuple = Get
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.GBPosition'+str(self.Get())
def __len__(self): return len(self.Get())
@@ -154,7 +154,7 @@ public:
}
}
%pythoncode {
asTuple = Get
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.GBSpan'+str(self.Get())
def __len__(self): return len(self.Get())

View File

@@ -112,10 +112,10 @@ enum wxStockCursor
%newgroup
DocStr( wxSize,
"wx.Size is a useful data structure used to represent the size of something.
It simply contians integer width and height proprtites. In most places in
wxPython where a wx.Size is expected a (width,height) tuple can be used
instead.");
"wx.Size is a useful data structure used to represent the size of
something. It simply contians integer width and height proprtites.
In most places in wxPython where a wx.Size is expected a
(width,height) tuple can be used instead.", "");
class wxSize
{
@@ -126,7 +126,7 @@ public:
DocCtorStr(
wxSize(int w=0, int h=0),
"Creates a size object.");
"Creates a size object.", "");
~wxSize();
@@ -138,33 +138,33 @@ public:
DocDeclStr(
bool, operator==(const wxSize& sz),
"Test for equality of wx.Size objects.");
"Test for equality of wx.Size objects.", "");
DocDeclStr(
bool, operator!=(const wxSize& sz),
"Test for inequality.");
"Test for inequality.", "");
DocDeclStr(
wxSize, operator+(const wxSize& sz),
"Add sz's proprties to this and return the result.");
"Add sz's proprties to this and return the result.", "");
DocDeclStr(
wxSize, operator-(const wxSize& sz),
"Subtract sz's properties from this and return the result.");
"Subtract sz's properties from this and return the result.", "");
DocDeclStr(
void, IncTo(const wxSize& sz),
"Increments this object so that both of its dimensions are not less\n"
"than the corresponding dimensions of the size.");
"Increments this object so that both of its dimensions are not less
than the corresponding dimensions of the size.", "");
DocDeclStr(
void, DecTo(const wxSize& sz),
"Decrements this object so that both of its dimensions are not greater\n"
"than the corresponding dimensions of the size.");
"Decrements this object so that both of its dimensions are not greater
than the corresponding dimensions of the size.", "");
DocDeclStr(
void, Set(int w, int h),
"Set both width and height.");
"Set both width and height.", "");
void SetWidth(int w);
void SetHeight(int h);
@@ -174,14 +174,13 @@ public:
DocDeclStr(
bool , IsFullySpecified() const,
"Returns True if both components of the size are non-default values.");
"Returns True if both components of the size are non-default values.", "");
DocDeclStr(
void , SetDefaults(const wxSize& size),
"Combine this size with the other one replacing the default
components of this object (i.e. equal to -1) with those of the
other.");
"Combine this size with the other one replacing the default components
of this object (i.e. equal to -1) with those of the other.", "");
//int GetX() const;
@@ -190,7 +189,7 @@ other.");
%extend {
DocAStr(Get,
"Get() -> (width,height)",
"Returns the width and height properties as a tuple.");
"Returns the width and height properties as a tuple.", "");
PyObject* Get() {
bool blocked = wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
@@ -201,7 +200,7 @@ other.");
}
}
%pythoncode {
asTuple = Get
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.Size'+str(self.Get())
def __len__(self): return len(self.Get())
@@ -221,9 +220,9 @@ other.");
%newgroup
DocStr( wxRealPoint,
"A data structure for representing a point or position with floating point x
and y properties. In wxPython most places that expect a wx.RealPoint can also
accept a (x,y) tuple.");
"A data structure for representing a point or position with floating
point x and y properties. In wxPython most places that expect a
wx.RealPoint can also accept a (x,y) tuple.", "");
class wxRealPoint
{
public:
@@ -232,30 +231,30 @@ public:
DocCtorStr(
wxRealPoint(double x=0.0, double y=0.0),
"Create a wx.RealPoint object");
"Create a wx.RealPoint object", "");
~wxRealPoint();
DocDeclStr(
bool, operator==(const wxRealPoint& pt),
"Test for equality of wx.RealPoint objects.");
"Test for equality of wx.RealPoint objects.", "");
DocDeclStr(
bool, operator!=(const wxRealPoint& pt),
"Test for inequality of wx.RealPoint objects.");
"Test for inequality of wx.RealPoint objects.", "");
DocDeclStr(
wxRealPoint, operator+(const wxRealPoint& pt),
"Add pt's proprties to this and return the result.");
"Add pt's proprties to this and return the result.", "");
DocDeclStr(
wxRealPoint, operator-(const wxRealPoint& pt),
"Subtract pt's proprties from this and return the result");
"Subtract pt's proprties from this and return the result", "");
%extend {
DocStr(Set, "Set both the x and y properties");
DocStr(Set, "Set both the x and y properties", "");
void Set(double x, double y) {
self->x = x;
self->y = y;
@@ -263,7 +262,7 @@ public:
DocAStr(Get,
"Get() -> (x,y)",
"Return the x and y properties as a tuple. ");
"Return the x and y properties as a tuple. ", "");
PyObject* Get() {
bool blocked = wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
@@ -275,7 +274,7 @@ public:
}
%pythoncode {
asTuple = Get
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.RealPoint'+str(self.Get())
def __len__(self): return len(self.Get())
@@ -296,9 +295,9 @@ public:
DocStr(wxPoint,
"A data structure for representing a point or position with integer x and y
properties. Most places in wxPython that expect a wx.Point can also accept a
(x,y) tuple.");
"A data structure for representing a point or position with integer x
and y properties. Most places in wxPython that expect a wx.Point can
also accept a (x,y) tuple.", "");
class wxPoint
{
@@ -307,18 +306,18 @@ public:
DocCtorStr(
wxPoint(int x=0, int y=0),
"Create a wx.Point object");
"Create a wx.Point object", "");
~wxPoint();
DocDeclStr(
bool, operator==(const wxPoint& pt),
"Test for equality of wx.Point objects.");
"Test for equality of wx.Point objects.", "");
DocDeclStr(
bool, operator!=(const wxPoint& pt),
"Test for inequality of wx.Point objects.");
"Test for inequality of wx.Point objects.", "");
@@ -329,46 +328,46 @@ public:
DocDeclStr(
wxPoint, operator+(const wxPoint& pt),
"Add pt's proprties to this and return the result.");
"Add pt's proprties to this and return the result.", "");
DocDeclStr(
wxPoint, operator-(const wxPoint& pt),
"Subtract pt's proprties from this and return the result");
"Subtract pt's proprties from this and return the result", "");
DocDeclStr(
wxPoint&, operator+=(const wxPoint& pt),
"Add pt to this object.");
"Add pt to this object.", "");
DocDeclStr(
wxPoint&, operator-=(const wxPoint& pt),
"Subtract pt from this object.");
"Subtract pt from this object.", "");
// DocDeclStr(
// wxPoint, operator+(const wxSize& sz),
// "Add sz to this Point and return the result.");
// "Add sz to this Point and return the result.", "");
// DocDeclStr(
// wxPoint, operator-(const wxSize& sz),
// "Subtract sz from this Point and return the result");
// "Subtract sz from this Point and return the result", "");
// DocDeclStr(
// wxPoint&, operator+=(const wxSize& sz),
// "Add sz to this object.");
// "Add sz to this object.", "");
// DocDeclStr(
// wxPoint&, operator-=(const wxSize& sz),
// "Subtract sz from this object.");
// "Subtract sz from this object.", "");
%extend {
DocStr(Set, "Set both the x and y properties");
DocStr(Set, "Set both the x and y properties", "");
void Set(long x, long y) {
self->x = x;
self->y = y;
@@ -376,7 +375,7 @@ public:
DocAStr(Get,
"Get() -> (x,y)",
"Return the x and y properties as a tuple. ");
"Return the x and y properties as a tuple. ", "");
PyObject* Get() {
bool blocked = wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
@@ -388,7 +387,7 @@ public:
}
%pythoncode {
asTuple = Get
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.Point'+str(self.Get())
def __len__(self): return len(self.Get())
@@ -408,25 +407,25 @@ public:
DocStr(wxRect,
"A class for representing and manipulating rectangles. It has x, y, width and
height properties. In wxPython most palces that expect a wx.Rect can also
accept a (x,y,width,height) tuple.");
"A class for representing and manipulating rectangles. It has x, y,
width and height properties. In wxPython most palces that expect a
wx.Rect can also accept a (x,y,width,height) tuple.", "");
class wxRect
{
public:
DocCtorStr(
wxRect(int x=0, int y=0, int width=0, int height=0),
"Create a new Rect object.");
"Create a new Rect object.", "");
DocCtorStrName(
wxRect(const wxPoint& topLeft, const wxPoint& bottomRight),
"Create a new Rect object from Points representing two corners.",
"Create a new Rect object from Points representing two corners.", "",
RectPP);
DocCtorStrName(
wxRect(const wxPoint& pos, const wxSize& size),
"Create a new Rect from a position and size.",
"Create a new Rect from a position and size.", "",
RectPS);
~wxRect();
@@ -480,61 +479,62 @@ public:
DocDeclStr(
wxRect&, Inflate(wxCoord dx, wxCoord dy),
"Increase the rectangle size by dx in x direction and dy in y direction. Both\n"
"(or one of) parameters may be negative to decrease the rectangle size.");
"Increase the rectangle size by dx in x direction and dy in y
direction. Both or one of) parameters may be negative to decrease the
rectangle size.", "");
DocDeclStr(
wxRect&, Deflate(wxCoord dx, wxCoord dy),
"Decrease the rectangle size by dx in x direction and dy in y direction. Both\n"
"(or one of) parameters may be negative to increase the rectngle size. This\n"
"method is the opposite of Inflate.");
"Decrease the rectangle size by dx in x direction and dy in y
direction. Both or one of) parameters may be negative to increase the
rectngle size. This method is the opposite of Inflate.", "");
DocDeclStrName(
void, Offset(wxCoord dx, wxCoord dy),
"Moves the rectangle by the specified offset. If dx is positive, the rectangle\n"
"is moved to the right, if dy is positive, it is moved to the bottom, otherwise\n"
"it is moved to the left or top respectively.",
"Moves the rectangle by the specified offset. If dx is positive, the
rectangle is moved to the right, if dy is positive, it is moved to the
bottom, otherwise it is moved to the left or top respectively.", "",
OffsetXY);
DocDeclStr(
void, Offset(const wxPoint& pt),
"Same as OffsetXY but uses dx,dy from Point");
"Same as OffsetXY but uses dx,dy from Point", "");
DocDeclStr(
wxRect&, Intersect(const wxRect& rect),
"Return the intersectsion of this rectangle and rect.");
"Return the intersectsion of this rectangle and rect.", "");
DocDeclStr(
wxRect, operator+(const wxRect& rect) const,
"Add the properties of rect to this rectangle and return the result.");
"Add the properties of rect to this rectangle and return the result.", "");
DocDeclStr(
wxRect&, operator+=(const wxRect& rect),
"Add the properties of rect to this rectangle, updating this rectangle.");
"Add the properties of rect to this rectangle, updating this rectangle.", "");
DocDeclStr(
bool, operator==(const wxRect& rect) const,
"Test for equality.");
"Test for equality.", "");
DocDeclStr(
bool, operator!=(const wxRect& rect) const,
"Test for inequality.");
"Test for inequality.", "");
DocStr( Inside, "Return True if the point is (not strcitly) inside the rect.");
DocStr( Inside, "Return True if the point is (not strcitly) inside the rect.", "");
%name(InsideXY)bool Inside(int x, int y) const;
bool Inside(const wxPoint& pt) const;
DocDeclStr(
bool, Intersects(const wxRect& rect) const,
"Returns True if the rectangles have a non empty intersection.");
"Returns True if the rectangles have a non empty intersection.", "");
int x, y, width, height;
%extend {
DocStr(Set, "Set all rectangle properties.");
DocStr(Set, "Set all rectangle properties.", "");
void Set(int x=0, int y=0, int width=0, int height=0) {
self->x = x;
self->y = y;
@@ -544,7 +544,7 @@ public:
DocAStr(Get,
"Get() -> (x,y,width,height)",
"Return the rectangle properties as a tuple.");
"Return the rectangle properties as a tuple.", "");
PyObject* Get() {
bool blocked = wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(4);
@@ -558,7 +558,7 @@ public:
}
%pythoncode {
asTuple = Get
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.Rect'+str(self.Get())
def __len__(self): return len(self.Get())
@@ -578,7 +578,7 @@ public:
DocAStr(wxIntersectRect,
"IntersectRect(Rect r1, Rect r2) -> Rect",
"Calculate and return the intersection of r1 and r2.");
"Calculate and return the intersection of r1 and r2.", "");
%inline %{
PyObject* wxIntersectRect(wxRect* r1, wxRect* r2) {
wxRegion reg1(*r1);
@@ -606,12 +606,13 @@ DocAStr(wxIntersectRect,
DocStr(wxPoint2D,
"wx.Point2Ds represent a point or a vector in a 2d coordinate system with floating point values.");
"wx.Point2Ds represent a point or a vector in a 2d coordinate system
with floating point values.", "");
class wxPoint2D
{
public:
DocStr(wxPoint2D, "Create a w.Point2D object.");
DocStr(wxPoint2D, "Create a w.Point2D object.", "");
wxPoint2D( double x=0.0 , double y=0.0 );
%name(Point2DCopy) wxPoint2D( const wxPoint2D &pt );
%name(Point2DFromPoint) wxPoint2D( const wxPoint &pt );
@@ -619,12 +620,12 @@ public:
DocDeclAStr(
void, GetFloor( int *OUTPUT , int *OUTPUT ) const,
"GetFloor() -> (x,y)",
"Convert to integer");
"Convert to integer", "");
DocDeclAStr(
void, GetRounded( int *OUTPUT , int *OUTPUT ) const,
"GetRounded() -> (x,y)",
"Convert to integer");
"Convert to integer", "");
double GetVectorLength() const;
double GetVectorAngle() const ;
@@ -648,7 +649,7 @@ public:
DocDeclStr(
wxPoint2D, operator-(),
"the reflection of this point");
"the reflection of this point", "");
wxPoint2D& operator+=(const wxPoint2D& pt);
wxPoint2D& operator-=(const wxPoint2D& pt);
@@ -658,11 +659,11 @@ public:
DocDeclStr(
bool, operator==(const wxPoint2D& pt) const,
"Test for equality");
"Test for equality", "");
DocDeclStr(
bool, operator!=(const wxPoint2D& pt) const,
"Test for inequality");
"Test for inequality", "");
%name(x)double m_x;
%name(y)double m_y;
@@ -675,7 +676,7 @@ public:
DocAStr(Get,
"Get() -> (x,y)",
"Return x and y properties as a tuple.");
"Return x and y properties as a tuple.", "");
PyObject* Get() {
bool blocked = wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(2);
@@ -687,7 +688,7 @@ public:
}
%pythoncode {
asTuple = Get
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
def __str__(self): return str(self.Get())
def __repr__(self): return 'wx.Point2D'+str(self.Get())
def __len__(self): return len(self.Get())

View File

@@ -52,7 +52,7 @@ class wxImageHistogram /* : public wxImageHistogramBase */
public:
wxImageHistogram();
DocStr(MakeKey, "Get the key in the histogram for the given RGB values");
DocStr(MakeKey, "Get the key in the histogram for the given RGB values", "");
static unsigned long MakeKey(unsigned char r,
unsigned char g,
unsigned char b);
@@ -65,9 +65,9 @@ public:
unsigned char startG = 0,
unsigned char startB = 0 ) const,
"FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)",
"Find first colour that is not used in the image and has higher RGB values than\n"
"startR, startG, startB. Returns a tuple consisting of a success flag and rgb\n"
"values.");
"Find first colour that is not used in the image and has higher RGB
values than startR, startG, startB. Returns a tuple consisting of a
success flag and rgb values.", "");
};
@@ -129,9 +129,9 @@ public:
bool, FindFirstUnusedColour( byte *OUTPUT, byte *OUTPUT, byte *OUTPUT,
byte startR = 0, byte startG = 0, byte startB = 0 ) const,
"FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)",
"Find first colour that is not used in the image and has higher RGB values than\n"
"startR, startG, startB. Returns a tuple consisting of a success flag and rgb\n"
"values.");
"Find first colour that is not used in the image and has higher RGB
values than startR, startG, startB. Returns a tuple consisting of a
success flag and rgb values.", "");
// Set image's mask to the area of 'mask' that has <mr,mg,mb> colour

View File

@@ -639,8 +639,8 @@ public:
DocDeclAStr(
long, HitTest(const wxPoint& point, int& OUTPUT),
"HitTest(Point point) -> (item, where)",
"Determines which item (if any) is at the specified point,\n"
"giving details in the second return value (see wxLIST_HITTEST_... flags.)");
"Determines which item (if any) is at the specified point, giving
details in the second return value (see wxLIST_HITTEST_... flags.)", "");
// Inserts an item, returning the index of the new item if successful,
// -1 otherwise.

View File

@@ -196,7 +196,8 @@ public:
DocDeclAStr(
virtual int, HitTest(const wxPoint& pt, long* OUTPUT) const,
"HitTest(Point pt) -> (tab, where)",
"Returns the tab which is hit, and flags indicating where using wx.NB_HITTEST_ flags.");
"Returns the tab which is hit, and flags indicating where using
wx.NB_HITTEST flags.", "");
// implement some base class functions
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;

View File

@@ -18,20 +18,20 @@
DocStr(wxObject,
"The base class for most wx objects, although in wxPython not
much functionality is needed nor exposed.");
much functionality is needed nor exposed.", "");
class wxObject {
public:
%extend {
DocStr(GetClassName,
"Returns the class name of the C++ class using wxRTTI.");
"Returns the class name of the C++ class using wxRTTI.", "");
wxString GetClassName() {
return self->GetClassInfo()->GetClassName();
}
DocStr(Destroy,
"Deletes the C++ object this Python object is a proxy for.");
"Deletes the C++ object this Python object is a proxy for.", "");
void Destroy() {
delete self;
}

View File

@@ -98,7 +98,7 @@ public:
DocDeclAStr(
virtual void, GetScrollPixelsPerUnit(int *OUTPUT, int *OUTPUT) const,
"GetScrollPixelsPerUnit() -> (xUnit, yUnit)",
"Get the size of one logical unit in physical units.");
"Get the size of one logical unit in physical units.", "");
// Enable/disable Windows scrolling in either direction. If True, wxWindows
// scrolls the canvas and only a bit of the canvas is invalidated; no
@@ -111,7 +111,7 @@ public:
DocDeclAStr(
virtual void, GetViewStart(int *OUTPUT, int *OUTPUT) const,
"GetViewStart() -> (x,y)",
"Get the view start");
"Get the view start", "");
// Set the scale factor, used in PrepareDC
void SetScale(double xs, double ys);
@@ -122,14 +122,14 @@ public:
%nokwargs CalcScrolledPosition;
%nokwargs CalcUnscrolledPosition;
DocStr(CalcScrolledPosition, "Translate between scrolled and unscrolled coordinates.");
DocStr(CalcScrolledPosition, "Translate between scrolled and unscrolled coordinates.", "");
wxPoint CalcScrolledPosition(const wxPoint& pt) const;
DocDeclA(
void, CalcScrolledPosition(int x, int y, int *OUTPUT, int *OUTPUT) const,
"CalcScrolledPosition(int x, int y) -> (sx, sy)");
DocStr(CalcUnscrolledPosition, "Translate between scrolled and unscrolled coordinates.");
DocStr(CalcUnscrolledPosition, "Translate between scrolled and unscrolled coordinates.", "");
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const;
DocDeclA(
void, CalcUnscrolledPosition(int x, int y, int *OUTPUT, int *OUTPUT) const,

View File

@@ -49,13 +49,13 @@ enum
//---------------------------------------------------------------------------
DocStr(wxSplitterWindow,
"wx.SplitterWindow manages up to two subwindows or panes,
with an optional vertical or horizontal split which can be
used with the mouse or programmatically.
");
"wx.SplitterWindow manages up to two subwindows or panes, with an
optional vertical or horizontal split which can be used with the mouse
or programmatically.", "
RefDoc(wxSplitterWindow, "
Styles
-------
==================== ======================================
wx.SP_3D Draws a 3D effect border and sash.
wx.SP_3DSASH Draws a 3D effect sash.
wx.SP_3DBORDER Synonym for wxSP_BORDER.
@@ -70,11 +70,12 @@ RefDoc(wxSplitterWindow, "
the minimum pane size other than zero.
wx.SP_LIVE_UPDATE Don't draw XOR line but resize the
child windows immediately.
==================== ======================================
Events
EVT_SPLITTER_SASH_POS_CHANGING
The sash position is in the
------
============================== =======================================
EVT_SPLITTER_SASH_POS_CHANGING The sash position is in the
process of being changed. May be
used to modify the position of
the tracking bar to properly
@@ -97,12 +98,12 @@ RefDoc(wxSplitterWindow, "
(unless the minimum pane size has
been set to a value greater than
zero.)
============================== =======================================
");
// wxSplitterWindow maintains one or two panes, with an optional vertical or
// horizontal split which can be used with the mouse or programmatically.
class wxSplitterWindow: public wxWindow
{
public:
@@ -111,19 +112,17 @@ public:
%pythonAppend wxSplitterWindow "self._setOORInfo(self)"
%pythonAppend wxSplitterWindow() ""
RefDoc(wxSplitterWindow, ""); // turn it off for the ctors
DocCtorStr(
wxSplitterWindow(wxWindow* parent, wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style=wxSP_3D,
const wxString& name = wxPySplitterNameStr),
"Constructor. Creates and shows a SplitterWindow.");
"Constructor. Creates and shows a SplitterWindow.", "");
DocCtorStrName(
wxSplitterWindow(),
"Precreate a SplitterWindow for 2-phase creation.",
"Precreate a SplitterWindow for 2-phase creation.", "",
PreSplitterWindow);
@@ -133,37 +132,37 @@ public:
const wxSize& size = wxDefaultSize,
long style=wxSP_3D,
const wxString& name = wxPySplitterNameStr),
"Create the GUI part of the SplitterWindow for the 2-phase create.");
"Create the GUI part of the SplitterWindow for the 2-phase create.", "");
DocDeclStr(
wxWindow *, GetWindow1() const,
"Gets the only or left/top pane.");
"Gets the only or left/top pane.", "");
DocDeclStr(
wxWindow *, GetWindow2() const,
"Gets the right/bottom pane.");
"Gets the right/bottom pane.", "");
DocDeclStr(
void , SetSplitMode(int mode),
"Sets the split mode. The mode can be wx.SPLIT_VERTICAL or
wx.SPLIT_HORIZONTAL. This only sets the internal variable;
does not update the display.");
wx.SPLIT_HORIZONTAL. This only sets the internal variable; does not
update the display.", "");
DocDeclStr(
wxSplitMode , GetSplitMode() const,
"Gets the split mode");
"Gets the split mode", "");
DocDeclStr(
void , Initialize(wxWindow *window),
"Initializes the splitter window to have one pane. This
should be called if you wish to initially view only a single
pane in the splitter window.");
"Initializes the splitter window to have one pane. This should be
called if you wish to initially view only a single pane in the
splitter window.", "");
// Associates the given window with window 2, drawing the appropriate sash
@@ -177,159 +176,155 @@ pane in the splitter window.");
virtual bool , SplitVertically(wxWindow *window1,
wxWindow *window2,
int sashPosition = 0),
"Initializes the left and right panes of the splitter window.
"Initializes the left and right panes of the splitter window.",
"
:param window1: The left pane.
:param window2: The right pane.
:param sashPosition: The initial position of the sash. If this
value is positive, it specifies the size of the left
pane. If it is negative, it is absolute value gives
the size of the right pane. Finally, specify 0
(default) to choose the default position (half of
the total window width).
window1 The left pane.
window2 The right pane.
sashPosition The initial position of the sash. If this
value is positive, it specifies the size
of the left pane. If it is negative, it is
absolute value gives the size of the right
pane. Finally, specify 0 (default) to
choose the default position (half of the
total window width).
Returns True if successful, False otherwise (the window was already
split).
Returns True if successful, False otherwise (the window was
already split).
SplitVertically should be called if you wish to initially
view two panes. It can also be called at any subsequent
time, but the application should check that the window is
not currently split using IsSplit.");
SplitVertically should be called if you wish to initially view two
panes. It can also be called at any subsequent time, but the
application should check that the window is not currently split using
IsSplit.
");
DocDeclStr(
virtual bool , SplitHorizontally(wxWindow *window1,
wxWindow *window2,
int sashPosition = 0),
"Initializes the top and bottom panes of the splitter window.
window1 The top pane.
window2 The bottom pane.
sashPosition The initial position of the sash. If this
value is positive, it specifies the size
of the upper pane. If it is negative, it
is absolute value gives the size of the
lower pane. Finally, specify 0 (default)
to choose the default position (half of
"Initializes the top and bottom panes of the splitter window.",
"
:param window1: The top pane.
:param window2: The bottom pane.
:param sashPosition: The initial position of the sash. If this
value is positive, it specifies the size of the
upper pane. If it is negative, it is absolute value
gives the size of the lower pane. Finally, specify 0
(default) to choose the default position (half of
the total window height).
Returns True if successful, False otherwise (the window was
already split).
Returns True if successful, False otherwise (the window was already
split).
SplitHorizontally should be called if you wish to initially
view two panes. It can also be called at any subsequent
time, but the application should check that the window is
not currently split using IsSplit.");
SplitHorizontally should be called if you wish to initially view two
panes. It can also be called at any subsequent time, but the
application should check that the window is not currently split using
IsSplit.
");
DocDeclStr(
bool , Unsplit(wxWindow *toRemove = NULL),
"Unsplits the window. Pass the pane to remove, or None to
remove the right or bottom pane. Returns True if
successful, False otherwise (the window was not split).
"Unsplits the window. Pass the pane to remove, or None to remove the
right or bottom pane. Returns True if successful, False otherwise (the
window was not split).
This function will not actually delete the pane being
removed; it sends EVT_SPLITTER_UNSPLIT which can be handled
for the desired behaviour. By default, the pane being
removed is only hidden.");
removed is only hidden.", "");
DocDeclStr(
bool , ReplaceWindow(wxWindow *winOld, wxWindow *winNew),
"This function replaces one of the windows managed by the
SplitterWindow with another one. It is in general better to
use it instead of calling Unsplit() and then resplitting the
window back because it will provoke much less flicker. It is
valid to call this function whether the splitter has two
windows or only one.
SplitterWindow with another one. It is in general better to use it
instead of calling Unsplit() and then resplitting the window back
because it will provoke much less flicker. It is valid to call this
function whether the splitter has two windows or only one.
Both parameters should be non-None and winOld must specify
one of the windows managed by the splitter. If the
parameters are incorrect or the window couldn't be replaced,
False is returned. Otherwise the function will return True,
but please notice that it will not Destroy the replaced
window and you may wish to do it yourself.");
Both parameters should be non-None and winOld must specify one of the
windows managed by the splitter. If the parameters are incorrect or
the window couldn't be replaced, False is returned. Otherwise the
function will return True, but please notice that it will not Destroy
the replaced window and you may wish to do it yourself.", "");
DocDeclStr(
void , UpdateSize(),
"Causes any pending sizing of the sash and child panes to
take place immediately.
"Causes any pending sizing of the sash and child panes to take place
immediately.
Such resizing normally takes place in idle time, in order to
wait for layout to be completed. However, this can cause
unacceptable flicker as the panes are resized after the
window has been shown. To work around this, you can perform
window layout (for example by sending a size event to the
parent window), and then call this function, before showing
the top-level window.");
Such resizing normally takes place in idle time, in order to wait for
layout to be completed. However, this can cause unacceptable flicker
as the panes are resized after the window has been shown. To work
around this, you can perform window layout (for example by sending a
size event to the parent window), and then call this function, before
showing the top-level window.", "");
DocDeclStr(
bool , IsSplit() const,
"Is the window split?");
"Is the window split?", "");
DocDeclStr(
void , SetSashSize(int width),
"Sets the sash size");
"Sets the sash size", "");
DocDeclStr(
void , SetBorderSize(int width),
"Sets the border size");
"Sets the border size", "");
DocDeclStr(
int , GetSashSize() const,
"Gets the sash size");
"Gets the sash size", "");
DocDeclStr(
int , GetBorderSize() const,
"Gets the border size");
"Gets the border size", "");
DocDeclStr(
void , SetSashPosition(int position, bool redraw = True),
"Sets the sash position, in pixels. If redraw is Ttrue then
the panes are resized and the sash and border are redrawn.");
"Sets the sash position, in pixels. If redraw is Ttrue then the panes
are resized and the sash and border are redrawn.", "");
DocDeclStr(
int , GetSashPosition() const,
"Returns the surrent sash position.");
"Returns the surrent sash position.", "");
DocDeclStr(
void , SetMinimumPaneSize(int min),
"Sets the minimum pane size in pixels.
The default minimum pane size is zero, which means that
either pane can be reduced to zero by dragging the sash,
thus removing one of the panes. To prevent this behaviour (and
veto out-of-range sash dragging), set a minimum size,
for example 20 pixels. If the wx.SP_PERMIT_UNSPLIT style is
used when a splitter window is created, the window may be
unsplit even if minimum size is non-zero.");
The default minimum pane size is zero, which means that either pane
can be reduced to zero by dragging the sash, thus removing one of the
panes. To prevent this behaviour (and veto out-of-range sash
dragging), set a minimum size, for example 20 pixels. If the
wx.SP_PERMIT_UNSPLIT style is used when a splitter window is created,
the window may be unsplit even if minimum size is non-zero.", "");
DocDeclStr(
int , GetMinimumPaneSize() const,
"Gets the minimum pane size in pixels.");
"Gets the minimum pane size in pixels.", "");
DocDeclStr(
virtual bool , SashHitTest(int x, int y, int tolerance = 5),
"Tests for x, y over the sash");
"Tests for x, y over the sash", "");
DocDeclStr(
virtual void , SizeWindows(),
"Resizes subwindows");
"Resizes subwindows", "");
void SetNeedUpdating(bool needUpdating);
@@ -342,7 +337,7 @@ unsplit even if minimum size is non-zero.");
DocStr(wxSplitterEvent,
"This class represents the events generated by a splitter control.");
"This class represents the events generated by a splitter control.", "");
class wxSplitterEvent : public wxNotifyEvent
{
@@ -353,37 +348,34 @@ public:
DocDeclStr(
void , SetSashPosition(int pos),
"This funciton is only meaningful during
EVT_SPLITTER_SASH_POS_CHANGING and
EVT_SPLITTER_SASH_POS_CHANGED events. In the case of
_CHANGED events, sets the the new sash position. In the case
of _CHANGING events, sets the new tracking bar position so
visual feedback during dragging will represent that change
that will actually take place. Set to -1 from the event
handler code to prevent repositioning.");
"This funciton is only meaningful during EVT_SPLITTER_SASH_POS_CHANGING
and EVT_SPLITTER_SASH_POS_CHANGED events. In the case of _CHANGED
events, sets the the new sash position. In the case of _CHANGING
events, sets the new tracking bar position so visual feedback during
dragging will represent that change that will actually take place. Set
to -1 from the event handler code to prevent repositioning.", "");
DocDeclStr(
int , GetSashPosition() const,
"Returns the new sash position while in
EVT_SPLITTER_SASH_POS_CHANGING and
EVT_SPLITTER_SASH_POS_CHANGED events.");
"Returns the new sash position while in EVT_SPLITTER_SASH_POS_CHANGING
and EVT_SPLITTER_SASH_POS_CHANGED events.", "");
DocDeclStr(
wxWindow *, GetWindowBeingRemoved() const,
"Returns a pointer to the window being removed when a
splitter window is unsplit.");
"Returns a pointer to the window being removed when a splitter window
is unsplit.", "");
DocDeclStr(
int , GetX() const,
"Returns the x coordinate of the double-click point in a
EVT_SPLITTER_DCLICK event.");
EVT_SPLITTER_DCLICK event.", "");
DocDeclStr(
int , GetY() const,
"Returns the y coordinate of the double-click point in a
EVT_SPLITTER_DCLICK event.");
EVT_SPLITTER_DCLICK event.", "");
};

View File

@@ -204,7 +204,7 @@ public:
DocDeclAStr(
virtual void, GetSelection(long* OUTPUT, long* OUTPUT) const,
"GetSelection() -> (from, to)",
"If the return values from and to are the same, there is no selection.");
"If the return values from and to are the same, there is no selection.", "");
virtual wxString GetStringSelection() const;
@@ -258,9 +258,8 @@ public:
virtual wxTextCtrlHitTestResult, HitTest(const wxPoint& pt,
long* OUTPUT, long* OUTPUT) const,
"HitTest(Point pt) -> (result, row, col)",
"Find the character at position given in pixels.\n"
"NB: pt is in device coords (not adjusted for the client area\n"
"origin nor scrolling)");
"Find the character at position given in pixels. NB: pt is in device
coords but is not adjusted for the client area origin nor scrolling", "");
// Clipboard operations

View File

@@ -685,10 +685,10 @@ public:
DocDeclAStr(
wxTreeItemId, HitTest(const wxPoint& point, int& OUTPUT),
"HitTest(Point point) -> (item, where)",
"Determine which item (if any) belongs the given point. The\n"
"coordinates specified are relative to the client area of tree ctrl\n"
"and the where return value is set to a bitmask of wxTREE_HITTEST_xxx\n"
"constants.\n");
"Determine which item (if any) belongs the given point. The coordinates
specified are relative to the client area of tree ctrl and the where return
value is set to a bitmask of wxTREE_HITTEST_xxx constants.
", "");
%extend {

File diff suppressed because it is too large Load Diff

View File

@@ -63,13 +63,13 @@ enum wxCalendarDateBorder
DocStr(wxCalendarDateAttr,
"A set of customization attributes for a calendar date, which can be
used to control the look of the Calendar object.");
used to control the look of the Calendar object.", "");
class wxCalendarDateAttr
{
public:
DocStr(wxCalendarDateAttr,
"Create a CalendarDateAttr.");
"Create a CalendarDateAttr.", "");
wxCalendarDateAttr(const wxColour& colText = wxNullColour,
const wxColour& colBack = wxNullColour,
const wxColour& colBorder = wxNullColour,
@@ -165,7 +165,7 @@ recognized as one by wx.DateTime) by using the SetHoliday method.
As the attributes are specified for each day, they may change when the
month is changed, so you will often want to update them in an
EVT_CALENDAR_MONTH event handler.
EVT_CALENDAR_MONTH event handler.", "
Window Styles
-------------
@@ -212,8 +212,6 @@ public:
%pythonAppend wxCalendarCtrl "self._setOORInfo(self)"
%pythonAppend wxCalendarCtrl() ""
RefDoc(wxCalendarCtrl, ""); // turn it off for the ctors
DocCtorStr(
wxCalendarCtrl(wxWindow *parent,
wxWindowID id=-1,
@@ -222,11 +220,11 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxCAL_SHOW_HOLIDAYS | wxWANTS_CHARS,
const wxString& name = wxPyCalendarNameStr),
"Create and show a calendar control.");
"Create and show a calendar control.", "");
DocCtorStrName(
wxCalendarCtrl(),
"Precreate a CalendarCtrl for 2-phase creation.",
"Precreate a CalendarCtrl for 2-phase creation.", "",
PreCalendarCtrl);
DocDeclStr(
@@ -238,40 +236,40 @@ public:
long style = wxCAL_SHOW_HOLIDAYS | wxWANTS_CHARS,
const wxString& name = wxPyCalendarNameStr),
"Acutally create the GUI portion of the CalendarCtrl for 2-phase
creation.");
creation.", "");
DocDeclStr(
void, SetDate(const wxDateTime& date),
"Sets the current date.");
"Sets the current date.", "");
DocDeclStr(
const wxDateTime&, GetDate() const,
"Gets the currently selected date.");
"Gets the currently selected date.", "");
DocDeclStr(
bool, SetLowerDateLimit(const wxDateTime& date = wxDefaultDateTime),
"set the range in which selection can occur");
"set the range in which selection can occur", "");
DocDeclStr(
bool, SetUpperDateLimit(const wxDateTime& date = wxDefaultDateTime),
"set the range in which selection can occur");
"set the range in which selection can occur", "");
DocDeclStr(
const wxDateTime&, GetLowerDateLimit() const,
"get the range in which selection can occur");
"get the range in which selection can occur", "");
DocDeclStr(
const wxDateTime&, GetUpperDateLimit() const,
"get the range in which selection can occur");
"get the range in which selection can occur", "");
DocDeclStr(
bool, SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
const wxDateTime& upperdate = wxDefaultDateTime),
"set the range in which selection can occur");
"set the range in which selection can occur", "");
@@ -280,87 +278,87 @@ creation.");
void, EnableYearChange(bool enable = True),
"This function should be used instead of changing CAL_NO_YEAR_CHANGE
style bit directly. It allows or disallows the user to change the year
interactively.");
interactively.", "");
DocDeclStr(
void, EnableMonthChange(bool enable = True),
"This function should be used instead of changing CAL_NO_MONTH_CHANGE
style bit. It allows or disallows the user to change the month
interactively. Note that if the month can not be changed, the year can
not be changed either.");
not be changed either.", "");
DocDeclStr(
void, EnableHolidayDisplay(bool display = True),
"This function should be used instead of changing CAL_SHOW_HOLIDAYS
style bit directly. It enables or disables the special highlighting of
the holidays.");
the holidays.", "");
DocDeclStr(
void, SetHeaderColours(const wxColour& colFg, const wxColour& colBg),
"Header colours are used for painting the weekdays at the top.");
"Header colours are used for painting the weekdays at the top.", "");
DocDeclStr(
wxColour, GetHeaderColourFg() const,
"Header colours are used for painting the weekdays at the top.");
"Header colours are used for painting the weekdays at the top.", "");
DocDeclStr(
wxColour, GetHeaderColourBg() const,
"Header colours are used for painting the weekdays at the top.");
"Header colours are used for painting the weekdays at the top.", "");
DocDeclStr(
void, SetHighlightColours(const wxColour& colFg, const wxColour& colBg),
"Highlight colour is used for the currently selected date.");
"Highlight colour is used for the currently selected date.", "");
DocDeclStr(
wxColour, GetHighlightColourFg() const,
"Highlight colour is used for the currently selected date.");
"Highlight colour is used for the currently selected date.", "");
DocDeclStr(
wxColour, GetHighlightColourBg() const,
"Highlight colour is used for the currently selected date.");
"Highlight colour is used for the currently selected date.", "");
DocDeclStr(
void, SetHolidayColours(const wxColour& colFg, const wxColour& colBg),
"Holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is
used).");
used).", "");
DocDeclStr(
wxColour, GetHolidayColourFg() const,
"Holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is
used).");
used).", "");
DocDeclStr(
wxColour, GetHolidayColourBg() const,
"Holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is
used).");
used).", "");
DocDeclStr(
wxCalendarDateAttr*, GetAttr(size_t day) const,
"Returns the attribute for the given date (should be in the range
1...31). The returned value may be None");
1...31). The returned value may be None", "");
DocDeclStr(
void, SetAttr(size_t day, wxCalendarDateAttr *attr),
"Associates the attribute with the specified date (in the range
1...31). If the attribute passed is None, the items attribute is
cleared.");
cleared.", "");
DocDeclStr(
void, SetHoliday(size_t day),
"Marks the specified day as being a holiday in the current month.");
"Marks the specified day as being a holiday in the current month.", "");
DocDeclStr(
void, ResetAttr(size_t day),
"Clears any attributes associated with the given day (in the range
1...31).");
1...31).", "");
@@ -368,8 +366,9 @@ cleared.");
"HitTest(Point pos) -> (result, date, weekday)",
"Returns 3-tuple with information about the given position on the
calendar control. The first value of the tuple is a result code and
determines the validity of the remaining two values. The result codes
are:
determines the validity of the remaining two values.",
"
The result codes are:
=================== ============================================
CAL_HITTEST_NOWHERE hit outside of anything
@@ -394,11 +393,11 @@ are:
DocDeclStr(
wxControl*, GetMonthControl() const,
"Get the currently shown control for month.");
"Get the currently shown control for month.", "");
DocDeclStr(
wxControl*, GetYearControl() const,
"Get the currently shown control for year.");
"Get the currently shown control for year.", "");
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);

View File

@@ -1505,7 +1505,7 @@ public:
bool operator!=( const wxGridCellCoords& other ) const;
%extend {
PyObject* asTuple() {
PyObject* Get() {
PyObject* tup = PyTuple_New(2);
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->GetRow()));
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->GetCol()));
@@ -1513,9 +1513,10 @@ public:
}
}
%pythoncode {
def __str__(self): return str(self.asTuple())
def __repr__(self): return 'wxGridCellCoords'+str(self.asTuple())
def __len__(self): return len(self.asTuple())
asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
def __str__(self): return str(self.Get())
def __repr__(self): return 'wxGridCellCoords'+str(self.Get())
def __len__(self): return len(self.Get())
def __getitem__(self, index): return self.asTuple()[index]
def __setitem__(self, index, val):
if index == 0: self.SetRow(val)

View File

@@ -858,7 +858,7 @@ public:
DocDeclStr(
void, SetTitle(const wxString& title),
"");
"", "");
// Sets space between text and window borders.
void SetBorders(int b);