Added wxTipProfider and friends
Tweaked wxGrid a bit. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2,6 +2,20 @@ CHANGES.txt for wxPython
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
New in 2.1.??
|
||||
-------------
|
||||
|
||||
Added an attribute named labelDelta to the generic buttons that
|
||||
specifies how far to offset the label when the button is in the
|
||||
depressed state.
|
||||
|
||||
Added wxTipProvider and friends. See the demo for an example.
|
||||
|
||||
wxGrid can now change the cell highlight colour.
|
||||
|
||||
|
||||
|
||||
|
||||
New in 2.1.15
|
||||
-------------
|
||||
|
||||
|
@@ -36,8 +36,7 @@ Windows 95 users may also need the WinSock 2.0 and OpenGL libraries.
|
||||
These can be found at these sites:
|
||||
|
||||
|
||||
http://www.microsoft.com/windows95/downloads/contents/wuadmintools/s_wunetwo
|
||||
rkingtools/w95sockets2/default.asp
|
||||
http://www.microsoft.com/windows95/downloads/contents/wuadmintools/s_wunetworkingtools/w95sockets2/default.asp
|
||||
|
||||
http://www.opengl.org/Downloads/Downloads.html
|
||||
|
||||
|
@@ -392,12 +392,27 @@ class MyApp(wxApp):
|
||||
wxYield()
|
||||
return true
|
||||
|
||||
|
||||
def AfterSplash(self):
|
||||
self.splash.Close(true)
|
||||
frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)")
|
||||
frame.Show(true)
|
||||
self.SetTopWindow(frame)
|
||||
return true
|
||||
self.ShowTip(frame)
|
||||
|
||||
|
||||
def ShowTip(self, frame):
|
||||
try:
|
||||
showTipText = open("data/showTips").read()
|
||||
showTip, index = eval(showTipText)
|
||||
except IOError:
|
||||
showTip, index = (1, 0)
|
||||
if showTip:
|
||||
tp = wxCreateFileTipProvider("data/tips.txt", index)
|
||||
showTip = wxShowTip(frame, tp)
|
||||
index = tp.GetCurrentTip()
|
||||
open("data/showTips", "w").write(str( (showTip, index) ))
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
@@ -418,33 +433,76 @@ def main():
|
||||
overview = """<html><body>
|
||||
<h2>Python</h2>
|
||||
|
||||
Python is an interpreted, interactive, object-oriented programming language often compared to Tcl, Perl, Scheme, or Java.
|
||||
<p>
|
||||
Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing. There are interfaces to many system calls and libraries, and new built-in modules are easily written in C or C++. Python is also usable as an extension language for applications that need a programmable interface.
|
||||
<p>
|
||||
Python is an interpreted, interactive, object-oriented programming
|
||||
language often compared to Tcl, Perl, Scheme, or Java.
|
||||
|
||||
<p> Python combines remarkable power with very clear syntax. It has
|
||||
modules, classes, exceptions, very high level dynamic data types, and
|
||||
dynamic typing. There are interfaces to many system calls and
|
||||
libraries, and new built-in modules are easily written in C or
|
||||
C++. Python is also usable as an extension language for applications
|
||||
that need a programmable interface. <p>
|
||||
|
||||
<h2>wxWindows</h2>
|
||||
|
||||
wxWindows is a free C++ framework designed to make cross-platform programming child's play. Well, almost. wxWindows 2 supports Windows 3.1/95/98/NT, Unix with GTK/Motif/Lesstif, with a Mac version underway. Other ports are under consideration.
|
||||
<p>
|
||||
wxWindows is a set of libraries that allows C++ applications to compile and run on several different types of computers, with minimal source code changes. There is one library per supported GUI (such as Motif, or Windows). As well as providing a common API (Application Programming Interface) for GUI functionality, it provides functionality for accessing some commonly-used operating system facilities, such as copying or deleting files. wxWindows is a 'framework' in the sense that it provides a lot of built-in functionality, which the application can use or replace as required, thus saving a great deal of coding effort. Basic data structures such as strings, linked lists and hash tables are also supported.
|
||||
wxWindows is a free C++ framework designed to make cross-platform
|
||||
programming child's play. Well, almost. wxWindows 2 supports Windows
|
||||
3.1/95/98/NT, Unix with GTK/Motif/Lesstif, with a Mac version
|
||||
underway. Other ports are under consideration. <p>
|
||||
|
||||
wxWindows is a set of libraries that allows C++ applications to
|
||||
compile and run on several different types of computers, with minimal
|
||||
source code changes. There is one library per supported GUI (such as
|
||||
Motif, or Windows). As well as providing a common API (Application
|
||||
Programming Interface) for GUI functionality, it provides
|
||||
functionality for accessing some commonly-used operating system
|
||||
facilities, such as copying or deleting files. wxWindows is a
|
||||
'framework' in the sense that it provides a lot of built-in
|
||||
functionality, which the application can use or replace as required,
|
||||
thus saving a great deal of coding effort. Basic data structures such
|
||||
as strings, linked lists and hash tables are also supported.
|
||||
|
||||
<p>
|
||||
<h2>wxPython</h2>
|
||||
|
||||
wxPython is a Python extension module that encapsulates the wxWindows GUI classes. Currently it is only available for the Win32 and GTK ports of wxWindows, but as soon as the other ports are brought up to the same level as Win32 and GTK, it should be fairly trivial to enable wxPython to be used with the new GUI.
|
||||
wxPython is a Python extension module that encapsulates the wxWindows
|
||||
GUI classes. Currently it is only available for the Win32 and GTK
|
||||
ports of wxWindows, but as soon as the other ports are brought up to
|
||||
the same level as Win32 and GTK, it should be fairly trivial to
|
||||
enable wxPython to be used with the new GUI.
|
||||
|
||||
<p>
|
||||
The wxPython extension module attempts to mirror the class heiarchy of wxWindows as closely as possible. This means that there is a wxFrame class in wxPython that looks, smells, tastes and acts almost the same as the wxFrame class in the C++ version. Unfortunately, because of differences in the languages, wxPython doesn't match wxWindows exactly, but the differences should be easy to absorb because they are natural to Python. For example, some methods that return multiple values via argument pointers in C++ will return a tuple of values in Python.
|
||||
|
||||
The wxPython extension module attempts to mirror the class heiarchy
|
||||
of wxWindows as closely as possible. This means that there is a
|
||||
wxFrame class in wxPython that looks, smells, tastes and acts almost
|
||||
the same as the wxFrame class in the C++ version. Unfortunately,
|
||||
because of differences in the languages, wxPython doesn't match
|
||||
wxWindows exactly, but the differences should be easy to absorb
|
||||
because they are natural to Python. For example, some methods that
|
||||
return multiple values via argument pointers in C++ will return a
|
||||
tuple of values in Python.
|
||||
|
||||
<p>
|
||||
There is still much to be done for wxPython, many classes still need to be mirrored. Also, wxWindows is still somewhat of a moving target so it is a bit of an effort just keeping wxPython up to date. On the other hand, there are enough of the core classes completed that useful applications can be written.
|
||||
|
||||
There is still much to be done for wxPython, many classes still need
|
||||
to be mirrored. Also, wxWindows is still somewhat of a moving target
|
||||
so it is a bit of an effort just keeping wxPython up to date. On the
|
||||
other hand, there are enough of the core classes completed that
|
||||
useful applications can be written.
|
||||
|
||||
<p>
|
||||
wxPython is close enough to the C++ version that the majority of the wxPython documentation is actually just notes attached to the C++ documents that describe the places where wxPython is different. There is also a series of sample programs included, and a series of documentation pages that assist the programmer in getting started with wxPython.
|
||||
|
||||
wxPython is close enough to the C++ version that the majority of
|
||||
the wxPython documentation is actually just notes attached to the C++
|
||||
documents that describe the places where wxPython is different. There
|
||||
is also a series of sample programs included, and a series of
|
||||
documentation pages that assist the programmer in getting started
|
||||
with wxPython.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
7
utils/wxPython/demo/data/tips.txt
Normal file
7
utils/wxPython/demo/data/tips.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Each of the leaf items in the tree is a separate demo. Click and learn!
|
||||
Use the source Luke!
|
||||
Many of the demos have some helpful overview text associated with them. Simply click on the first tab in the notebook control after selecting the demo. You can switch back and forth to the demo page as often as you like.
|
||||
You can also view the source code for each demo by clicking on the second notebook tab.
|
||||
wxPython now has a company providing commercial support, consulting and training. Go to http://wxpros.com for details.
|
||||
You shouldn't pee on an electric fence!
|
||||
Be sure to subscribe to the mail list. Go to http://wxwindows.org/mailman/listinfo/wxpython-users today!
|
@@ -53,6 +53,8 @@ class wxGenButtonEvent(wxPyCommandEvent):
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
class wxGenButton(wxControl):
|
||||
labelDelta = 1
|
||||
|
||||
def __init__(self, parent, ID, label,
|
||||
pos = wxDefaultPosition, size = wxDefaultSize,
|
||||
style = 0, validator = wxDefaultValidator,
|
||||
@@ -202,7 +204,7 @@ class wxGenButton(wxControl):
|
||||
label = self.GetLabel()
|
||||
tw, th = dc.GetTextExtent(label)
|
||||
if not self.up:
|
||||
dw = dy = 1
|
||||
dw = dy = self.labelDelta
|
||||
dc.DrawText(label, (width-tw)/2+dw, (height-th)/2+dy)
|
||||
|
||||
|
||||
@@ -362,7 +364,7 @@ class wxGenBitmapButton(wxGenButton):
|
||||
bmp = self.bmpSelected
|
||||
bw,bh = bmp.GetWidth(), bmp.GetHeight()
|
||||
if not self.up:
|
||||
dw = dy = 1
|
||||
dw = dy = self.labelDelta
|
||||
hasMask = bmp.GetMask() != None
|
||||
dc.DrawBitmap(bmp, (width-bw)/2+dw, (height-bh)/2+dy, hasMask)
|
||||
|
||||
|
@@ -563,33 +563,33 @@ def EVT_TASKBAR_RIGHT_DCLICK(win, func):
|
||||
win.Connect(-1, -1, wxEVT_TASKBAR_RIGHT_DCLICK, func)
|
||||
|
||||
|
||||
# wxGrid
|
||||
def EVT_GRID_SELECT_CELL(win, fn):
|
||||
win.Connect(-1, -1, wxEVT_GRID_SELECT_CELL, fn)
|
||||
## # wxGrid *** THE OLD ONE ***
|
||||
## def EVT_GRID_SELECT_CELL(win, fn):
|
||||
## win.Connect(-1, -1, wxEVT_GRID_SELECT_CELL, fn)
|
||||
|
||||
def EVT_GRID_CREATE_CELL(win, fn):
|
||||
win.Connect(-1, -1, wxEVT_GRID_CREATE_CELL, fn)
|
||||
## def EVT_GRID_CREATE_CELL(win, fn):
|
||||
## win.Connect(-1, -1, wxEVT_GRID_CREATE_CELL, fn)
|
||||
|
||||
def EVT_GRID_CHANGE_LABELS(win, fn):
|
||||
win.Connect(-1, -1, wxEVT_GRID_CHANGE_LABELS, fn)
|
||||
## def EVT_GRID_CHANGE_LABELS(win, fn):
|
||||
## win.Connect(-1, -1, wxEVT_GRID_CHANGE_LABELS, fn)
|
||||
|
||||
def EVT_GRID_CHANGE_SEL_LABEL(win, fn):
|
||||
win.Connect(-1, -1, wxEVT_GRID_CHANGE_SEL_LABEL, fn)
|
||||
## def EVT_GRID_CHANGE_SEL_LABEL(win, fn):
|
||||
## win.Connect(-1, -1, wxEVT_GRID_CHANGE_SEL_LABEL, fn)
|
||||
|
||||
def EVT_GRID_CELL_CHANGE(win, fn):
|
||||
win.Connect(-1, -1, wxEVT_GRID_CELL_CHANGE, fn)
|
||||
## def EVT_GRID_CELL_CHANGE(win, fn):
|
||||
## win.Connect(-1, -1, wxEVT_GRID_CELL_CHANGE, fn)
|
||||
|
||||
def EVT_GRID_CELL_LCLICK(win, fn):
|
||||
win.Connect(-1, -1, wxEVT_GRID_CELL_LCLICK, fn)
|
||||
## def EVT_GRID_CELL_LCLICK(win, fn):
|
||||
## win.Connect(-1, -1, wxEVT_GRID_CELL_LCLICK, fn)
|
||||
|
||||
def EVT_GRID_CELL_RCLICK(win, fn):
|
||||
win.Connect(-1, -1, wxEVT_GRID_CELL_RCLICK, fn)
|
||||
## def EVT_GRID_CELL_RCLICK(win, fn):
|
||||
## win.Connect(-1, -1, wxEVT_GRID_CELL_RCLICK, fn)
|
||||
|
||||
def EVT_GRID_LABEL_LCLICK(win, fn):
|
||||
win.Connect(-1, -1, wxEVT_GRID_LABEL_LCLICK, fn)
|
||||
## def EVT_GRID_LABEL_LCLICK(win, fn):
|
||||
## win.Connect(-1, -1, wxEVT_GRID_LABEL_LCLICK, fn)
|
||||
|
||||
def EVT_GRID_LABEL_RCLICK(win, fn):
|
||||
win.Connect(-1, -1, wxEVT_GRID_LABEL_RCLICK, fn)
|
||||
## def EVT_GRID_LABEL_RCLICK(win, fn):
|
||||
## win.Connect(-1, -1, wxEVT_GRID_LABEL_RCLICK, fn)
|
||||
|
||||
|
||||
# wxSashWindow
|
||||
@@ -837,6 +837,20 @@ class wxPySimpleApp(wxApp):
|
||||
return true
|
||||
|
||||
|
||||
class wxPyWidgetTester(wxApp):
|
||||
def __init__(self, size = (250, 100)):
|
||||
self.size = size
|
||||
wxApp.__init__(self, 0)
|
||||
|
||||
def OnInit(self):
|
||||
self.frame = wxFrame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
|
||||
self.SetTopWindow(self.frame)
|
||||
return true
|
||||
|
||||
def SetWidget(self, widgetClass, *args):
|
||||
w = apply(widgetClass, (self.frame,) + args)
|
||||
self.frame.Show(true)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# DO NOT hold any other references to this object. This is how we know when
|
||||
# to cleanup system resources that wxWin is holding. When this module is
|
||||
|
@@ -1435,6 +1435,7 @@ public:
|
||||
wxString GetRowLabelValue( int row );
|
||||
wxString GetColLabelValue( int col );
|
||||
wxColour GetGridLineColour();
|
||||
wxColour GetCellHighlightColour();
|
||||
|
||||
void SetRowLabelSize( int width );
|
||||
void SetColLabelSize( int height );
|
||||
@@ -1446,6 +1447,7 @@ public:
|
||||
void SetRowLabelValue( int row, const wxString& );
|
||||
void SetColLabelValue( int col, const wxString& );
|
||||
void SetGridLineColour( const wxColour& );
|
||||
void SetCellHighlightColour( const wxColour& );
|
||||
|
||||
void EnableDragRowSize( bool enable = TRUE );
|
||||
void DisableDragRowSize();
|
||||
|
@@ -110,6 +110,12 @@ int WXDLLEXPORT wxEntryInitGui();
|
||||
void WXDLLEXPORT wxEntryCleanup();
|
||||
|
||||
|
||||
#ifdef WXP_WITH_THREAD
|
||||
PyThreadState* wxPyEventThreadState = NULL;
|
||||
#endif
|
||||
static char* __nullArgv[1] = { 0 };
|
||||
|
||||
|
||||
// This is where we pick up the first part of the wxEntry functionality...
|
||||
// The rest is in __wxStart and __wxCleanup. This function is called when
|
||||
// wxcmodule is imported. (Before there is a wxApp object.)
|
||||
@@ -117,6 +123,7 @@ void __wxPreStart()
|
||||
{
|
||||
#ifdef WXP_WITH_THREAD
|
||||
PyEval_InitThreads();
|
||||
wxPyEventThreadState = PyThreadState_Get();
|
||||
#endif
|
||||
|
||||
// Bail out if there is already windows created. This means that the
|
||||
@@ -139,13 +146,6 @@ void __wxPreStart()
|
||||
|
||||
|
||||
|
||||
#ifdef WXP_WITH_THREAD
|
||||
PyThreadState* wxPyEventThreadState = NULL;
|
||||
#endif
|
||||
static char* __nullArgv[1] = { 0 };
|
||||
|
||||
|
||||
|
||||
// Start the user application, user App's OnInit method is a parameter here
|
||||
PyObject* __wxStart(PyObject* /* self */, PyObject* args)
|
||||
{
|
||||
@@ -154,10 +154,6 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args)
|
||||
PyObject* result;
|
||||
long bResult;
|
||||
|
||||
#ifdef WXP_WITH_THREAD
|
||||
wxPyEventThreadState = PyThreadState_Get();
|
||||
#endif
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O", &onInitFunc))
|
||||
return NULL;
|
||||
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include <wx/tooltip.h>
|
||||
#include <wx/caret.h>
|
||||
#include <wx/fontenum.h>
|
||||
#include <wx/tipdlg.h>
|
||||
%}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -356,6 +357,49 @@ void wxPostEvent(wxEvtHandler *dest, wxEvent& event);
|
||||
void wxWakeUpIdle();
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
class wxTipProvider
|
||||
{
|
||||
public:
|
||||
// wxTipProvider(size_t currentTip); **** Abstract base class
|
||||
~wxTipProvider();
|
||||
|
||||
virtual wxString GetTip() = 0;
|
||||
size_t GetCurrentTip();
|
||||
|
||||
};
|
||||
|
||||
|
||||
// The C++ version of wxPyTipProvider
|
||||
%{
|
||||
class wxPyTipProvider : public wxTipProvider {
|
||||
public:
|
||||
wxPyTipProvider(size_t currentTip)
|
||||
: wxTipProvider(currentTip) {}
|
||||
|
||||
DEC_PYCALLBACK_STRING__pure(GetTip);
|
||||
|
||||
PYPRIVATE;
|
||||
};
|
||||
|
||||
IMP_PYCALLBACK_STRING__pure( wxPyTipProvider, wxTipProvider, GetTip);
|
||||
|
||||
%}
|
||||
|
||||
|
||||
// Now let SWIG know about it
|
||||
class wxPyTipProvider : public wxTipProvider {
|
||||
public:
|
||||
wxPyTipProvider(size_t currentTip);
|
||||
};
|
||||
|
||||
|
||||
|
||||
bool wxShowTip(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup = TRUE);
|
||||
%new wxTipProvider * wxCreateFileTipProvider(const wxString& filename, size_t currentTip);
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@@ -8511,6 +8511,35 @@ static PyObject *_wrap_wxGrid_GetGridLineColour(PyObject *self, PyObject *args,
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGrid_GetCellHighlightColour(_swigobj) (_swigobj->GetCellHighlightColour())
|
||||
static PyObject *_wrap_wxGrid_GetCellHighlightColour(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxColour * _result;
|
||||
wxGrid * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGrid_GetCellHighlightColour",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGrid_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGrid_GetCellHighlightColour. Expected _wxGrid_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
_result = new wxColour (wxGrid_GetCellHighlightColour(_arg0));
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} SWIG_MakePtr(_ptemp, (void *) _result,"_wxColour_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGrid_SetRowLabelSize(_swigobj,_swigarg0) (_swigobj->SetRowLabelSize(_swigarg0))
|
||||
static PyObject *_wrap_wxGrid_SetRowLabelSize(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
@@ -8848,6 +8877,41 @@ static PyObject *_wrap_wxGrid_SetGridLineColour(PyObject *self, PyObject *args,
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGrid_SetCellHighlightColour(_swigobj,_swigarg0) (_swigobj->SetCellHighlightColour(_swigarg0))
|
||||
static PyObject *_wrap_wxGrid_SetCellHighlightColour(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxGrid * _arg0;
|
||||
wxColour * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
wxColour temp;
|
||||
PyObject * _obj1 = 0;
|
||||
char *_kwnames[] = { "self","arg2", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_SetCellHighlightColour",_kwnames,&_argo0,&_obj1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGrid_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGrid_SetCellHighlightColour. Expected _wxGrid_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
_arg1 = &temp;
|
||||
if (! wxColour_helper(_obj1, &_arg1))
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
wxGrid_SetCellHighlightColour(_arg0,*_arg1);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxGrid_EnableDragRowSize(_swigobj,_swigarg0) (_swigobj->EnableDragRowSize(_swigarg0))
|
||||
static PyObject *_wrap_wxGrid_EnableDragRowSize(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
@@ -12464,6 +12528,7 @@ static PyMethodDef gridcMethods[] = {
|
||||
{ "wxGrid_CanDragRowSize", (PyCFunction) _wrap_wxGrid_CanDragRowSize, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_DisableDragRowSize", (PyCFunction) _wrap_wxGrid_DisableDragRowSize, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_EnableDragRowSize", (PyCFunction) _wrap_wxGrid_EnableDragRowSize, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_SetCellHighlightColour", (PyCFunction) _wrap_wxGrid_SetCellHighlightColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_SetGridLineColour", (PyCFunction) _wrap_wxGrid_SetGridLineColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_SetColLabelValue", (PyCFunction) _wrap_wxGrid_SetColLabelValue, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_SetRowLabelValue", (PyCFunction) _wrap_wxGrid_SetRowLabelValue, METH_VARARGS | METH_KEYWORDS },
|
||||
@@ -12474,6 +12539,7 @@ static PyMethodDef gridcMethods[] = {
|
||||
{ "wxGrid_SetLabelBackgroundColour", (PyCFunction) _wrap_wxGrid_SetLabelBackgroundColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_SetColLabelSize", (PyCFunction) _wrap_wxGrid_SetColLabelSize, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_SetRowLabelSize", (PyCFunction) _wrap_wxGrid_SetRowLabelSize, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_GetCellHighlightColour", (PyCFunction) _wrap_wxGrid_GetCellHighlightColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_GetGridLineColour", (PyCFunction) _wrap_wxGrid_GetGridLineColour, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_GetColLabelValue", (PyCFunction) _wrap_wxGrid_GetColLabelValue, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxGrid_GetRowLabelValue", (PyCFunction) _wrap_wxGrid_GetRowLabelValue, METH_VARARGS | METH_KEYWORDS },
|
||||
|
@@ -1018,6 +1018,10 @@ class wxGridPtr(wxScrolledWindowPtr):
|
||||
val = apply(gridc.wxGrid_GetGridLineColour,(self,) + _args, _kwargs)
|
||||
if val: val = wxColourPtr(val) ; val.thisown = 1
|
||||
return val
|
||||
def GetCellHighlightColour(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_GetCellHighlightColour,(self,) + _args, _kwargs)
|
||||
if val: val = wxColourPtr(val) ; val.thisown = 1
|
||||
return val
|
||||
def SetRowLabelSize(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_SetRowLabelSize,(self,) + _args, _kwargs)
|
||||
return val
|
||||
@@ -1048,6 +1052,9 @@ class wxGridPtr(wxScrolledWindowPtr):
|
||||
def SetGridLineColour(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_SetGridLineColour,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetCellHighlightColour(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_SetCellHighlightColour,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def EnableDragRowSize(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_EnableDragRowSize,(self,) + _args, _kwargs)
|
||||
return val
|
||||
|
@@ -58,6 +58,7 @@ extern PyObject *SWIG_newvarlink(void);
|
||||
#include <wx/tooltip.h>
|
||||
#include <wx/caret.h>
|
||||
#include <wx/fontenum.h>
|
||||
#include <wx/tipdlg.h>
|
||||
|
||||
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
|
||||
PyObject* o2;
|
||||
@@ -151,6 +152,19 @@ public:
|
||||
IMP_PYCALLBACK_BOOL_STRING(wxPyFontEnumerator, wxFontEnumerator, OnFacename);
|
||||
IMP_PYCALLBACK_BOOL_STRINGSTRING(wxPyFontEnumerator, wxFontEnumerator, OnFontEncoding);
|
||||
|
||||
|
||||
class wxPyTipProvider : public wxTipProvider {
|
||||
public:
|
||||
wxPyTipProvider(size_t currentTip)
|
||||
: wxTipProvider(currentTip) {}
|
||||
|
||||
DEC_PYCALLBACK_STRING__pure(GetTip);
|
||||
|
||||
PYPRIVATE;
|
||||
};
|
||||
|
||||
IMP_PYCALLBACK_STRING__pure( wxPyTipProvider, wxTipProvider, GetTip);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -1153,6 +1167,82 @@ static PyObject *_wrap_wxWakeUpIdle(PyObject *self, PyObject *args, PyObject *kw
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyObject *_wrap_wxShowTip(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
bool _result;
|
||||
wxWindow * _arg0;
|
||||
wxTipProvider * _arg1;
|
||||
bool _arg2 = (bool ) TRUE;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _argo1 = 0;
|
||||
int tempbool2 = (int) TRUE;
|
||||
char *_kwnames[] = { "parent","tipProvider","showAtStartup", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxShowTip",_kwnames,&_argo0,&_argo1,&tempbool2))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxShowTip. Expected _wxWindow_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_argo1) {
|
||||
if (_argo1 == Py_None) { _arg1 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTipProvider_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxShowTip. Expected _wxTipProvider_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
_arg2 = (bool ) tempbool2;
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
_result = (bool )wxShowTip(_arg0,_arg1,_arg2);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} _resultobj = Py_BuildValue("i",_result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyObject *_wrap_wxCreateFileTipProvider(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxTipProvider * _result;
|
||||
wxString * _arg0;
|
||||
size_t _arg1;
|
||||
PyObject * _obj0 = 0;
|
||||
char *_kwnames[] = { "filename","currentTip", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxCreateFileTipProvider",_kwnames,&_obj0,&_arg1))
|
||||
return NULL;
|
||||
{
|
||||
if (!PyString_Check(_obj0)) {
|
||||
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
|
||||
return NULL;
|
||||
}
|
||||
_arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0));
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
_result = (wxTipProvider *)wxCreateFileTipProvider(*_arg0,_arg1);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxTipProvider_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
{
|
||||
if (_obj0)
|
||||
delete _arg0;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define new_wxToolTip(_swigarg0) (new wxToolTip(_swigarg0))
|
||||
static PyObject *_wrap_new_wxToolTip(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
@@ -2068,7 +2158,131 @@ static PyObject *_wrap_delete_wxBusyCursor(PyObject *self, PyObject *args, PyObj
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define delete_wxTipProvider(_swigobj) (delete _swigobj)
|
||||
static PyObject *_wrap_delete_wxTipProvider(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxTipProvider * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxTipProvider",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTipProvider_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxTipProvider. Expected _wxTipProvider_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
delete_wxTipProvider(_arg0);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxTipProvider_GetTip(_swigobj) (_swigobj->GetTip())
|
||||
static PyObject *_wrap_wxTipProvider_GetTip(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxString * _result;
|
||||
wxTipProvider * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTipProvider_GetTip",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTipProvider_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTipProvider_GetTip. Expected _wxTipProvider_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
_result = new wxString (wxTipProvider_GetTip(_arg0));
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
}{
|
||||
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
|
||||
}
|
||||
{
|
||||
delete _result;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define wxTipProvider_GetCurrentTip(_swigobj) (_swigobj->GetCurrentTip())
|
||||
static PyObject *_wrap_wxTipProvider_GetCurrentTip(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
size_t _result;
|
||||
wxTipProvider * _arg0;
|
||||
PyObject * _argo0 = 0;
|
||||
char *_kwnames[] = { "self", NULL };
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTipProvider_GetCurrentTip",_kwnames,&_argo0))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTipProvider_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTipProvider_GetCurrentTip. Expected _wxTipProvider_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
_result = (size_t )wxTipProvider_GetCurrentTip(_arg0);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} _resultobj = Py_BuildValue("i",_result);
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static void *SwigwxPyTipProviderTowxTipProvider(void *ptr) {
|
||||
wxPyTipProvider *src;
|
||||
wxTipProvider *dest;
|
||||
src = (wxPyTipProvider *) ptr;
|
||||
dest = (wxTipProvider *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
#define new_wxPyTipProvider(_swigarg0) (new wxPyTipProvider(_swigarg0))
|
||||
static PyObject *_wrap_new_wxPyTipProvider(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxPyTipProvider * _result;
|
||||
size_t _arg0;
|
||||
char *_kwnames[] = { "currentTip", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:new_wxPyTipProvider",_kwnames,&_arg0))
|
||||
return NULL;
|
||||
{
|
||||
wxPy_BEGIN_ALLOW_THREADS;
|
||||
_result = (wxPyTipProvider *)new_wxPyTipProvider(_arg0);
|
||||
|
||||
wxPy_END_ALLOW_THREADS;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyTipProvider_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static PyMethodDef misc2cMethods[] = {
|
||||
{ "new_wxPyTipProvider", (PyCFunction) _wrap_new_wxPyTipProvider, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxTipProvider_GetCurrentTip", (PyCFunction) _wrap_wxTipProvider_GetCurrentTip, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxTipProvider_GetTip", (PyCFunction) _wrap_wxTipProvider_GetTip, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "delete_wxTipProvider", (PyCFunction) _wrap_delete_wxTipProvider, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "delete_wxBusyCursor", (PyCFunction) _wrap_delete_wxBusyCursor, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxBusyCursor", (PyCFunction) _wrap_new_wxBusyCursor, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxFontEnumerator_GetFacenames", (PyCFunction) _wrap_wxFontEnumerator_GetFacenames, METH_VARARGS | METH_KEYWORDS },
|
||||
@@ -2097,6 +2311,8 @@ static PyMethodDef misc2cMethods[] = {
|
||||
{ "wxToolTip_GetTip", (PyCFunction) _wrap_wxToolTip_GetTip, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxToolTip_SetTip", (PyCFunction) _wrap_wxToolTip_SetTip, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxToolTip", (PyCFunction) _wrap_new_wxToolTip, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxCreateFileTipProvider", (PyCFunction) _wrap_wxCreateFileTipProvider, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxShowTip", (PyCFunction) _wrap_wxShowTip, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxWakeUpIdle", (PyCFunction) _wrap_wxWakeUpIdle, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxPostEvent", (PyCFunction) _wrap_wxPostEvent, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxCaret_SetBlinkTime", (PyCFunction) _wrap_wxCaret_SetBlinkTime, METH_VARARGS | METH_KEYWORDS },
|
||||
@@ -2276,6 +2492,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_class_wxDropTarget","_wxDropTarget",0},
|
||||
{ "_class_wxCaret","_wxCaret",0},
|
||||
{ "_class_wxBrush","_wxBrush",0},
|
||||
{ "_wxTipProvider","_class_wxPyTipProvider",SwigwxPyTipProviderTowxTipProvider},
|
||||
{ "_wxTipProvider","_wxPyTipProvider",SwigwxPyTipProviderTowxTipProvider},
|
||||
{ "_wxTipProvider","_class_wxTipProvider",0},
|
||||
{ "_unsigned_short","_WXTYPE",0},
|
||||
{ "_unsigned_short","_short",0},
|
||||
{ "_class_wxWindow","_wxWindow",0},
|
||||
@@ -2323,6 +2542,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_class_wxScrollEvent","_wxScrollEvent",0},
|
||||
{ "_wxJoystickEvent","_class_wxJoystickEvent",0},
|
||||
{ "_class_wxImageList","_wxImageList",0},
|
||||
{ "_wxPyTipProvider","_class_wxPyTipProvider",0},
|
||||
{ "_class_wxPaletteChangedEvent","_wxPaletteChangedEvent",0},
|
||||
{ "_wxWindowID","_wxCoord",0},
|
||||
{ "_wxWindowID","_wxPrintQuality",0},
|
||||
@@ -2373,8 +2593,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_wxEraseEvent","_class_wxEraseEvent",0},
|
||||
{ "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
|
||||
{ "_class_wxJoystickEvent","_wxJoystickEvent",0},
|
||||
{ "_class_wxTipProvider","_class_wxPyTipProvider",SwigwxPyTipProviderTowxTipProvider},
|
||||
{ "_class_wxTipProvider","_wxPyTipProvider",SwigwxPyTipProviderTowxTipProvider},
|
||||
{ "_class_wxTipProvider","_wxTipProvider",0},
|
||||
{ "_wxRegion","_class_wxRegion",0},
|
||||
{ "_class_wxShowEvent","_wxShowEvent",0},
|
||||
{ "_class_wxPyTipProvider","_wxPyTipProvider",0},
|
||||
{ "_wxPyDropTarget","_class_wxPyDropTarget",0},
|
||||
{ "_wxActivateEvent","_class_wxActivateEvent",0},
|
||||
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
||||
|
@@ -143,6 +143,42 @@ class wxBusyCursor(wxBusyCursorPtr):
|
||||
|
||||
|
||||
|
||||
class wxTipProviderPtr :
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def __del__(self,misc2c=misc2c):
|
||||
if self.thisown == 1 :
|
||||
misc2c.delete_wxTipProvider(self)
|
||||
def GetTip(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxTipProvider_GetTip,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetCurrentTip(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxTipProvider_GetCurrentTip,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def __repr__(self):
|
||||
return "<C wxTipProvider instance at %s>" % (self.this,)
|
||||
class wxTipProvider(wxTipProviderPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
|
||||
|
||||
|
||||
|
||||
class wxPyTipProviderPtr(wxTipProviderPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def __repr__(self):
|
||||
return "<C wxPyTipProvider instance at %s>" % (self.this,)
|
||||
class wxPyTipProvider(wxPyTipProviderPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = apply(misc2c.new_wxPyTipProvider,_args,_kwargs)
|
||||
self.thisown = 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------- FUNCTION WRAPPERS ------------------
|
||||
@@ -233,6 +269,13 @@ wxPostEvent = misc2c.wxPostEvent
|
||||
|
||||
wxWakeUpIdle = misc2c.wxWakeUpIdle
|
||||
|
||||
wxShowTip = misc2c.wxShowTip
|
||||
|
||||
def wxCreateFileTipProvider(*_args, **_kwargs):
|
||||
val = apply(misc2c.wxCreateFileTipProvider,_args,_kwargs)
|
||||
if val: val = wxTipProviderPtr(val); val.thisown = 1
|
||||
return val
|
||||
|
||||
|
||||
|
||||
#-------------- VARIABLE WRAPPERS ------------------
|
||||
|
Reference in New Issue
Block a user