Added wxPython support of new HTML Printing classes.

Fixed thread problem
Other miscellaneous fixes, minor additions, etc.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4265 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
1999-10-29 22:25:04 +00:00
parent dc2f8a65c0
commit 2abc0a0f9b
32 changed files with 789 additions and 244 deletions
+4 -2
View File
@@ -63,6 +63,8 @@ an EVT_SIZE handler that calls Layout().
Fixed deadlock problem that happened when using threads.
Added new HTML printing classes.
@@ -120,7 +122,7 @@ wxGTK. Added them back in since the methods exist now.
Wrapped the wxHtmlHelpController and related classes.
Wrapped the C++ versions of wxSizer and firends. The Python-only
Wrapped the C++ versions of wxSizer and friends. The Python-only
versions are still in the library, but depreciated. (You will get a
warning message if you try to use them, but the warning can be
disabled.) The usage of the C++ versions is slightly different, and
@@ -196,7 +198,7 @@ in the wxWindows docs...
Some new 3rd party contributions in wxPython.lib. PyShell, in
shell.py is an interesting implementaion of an interactive Python
shell in wxWindows. floatbar.py has a class derived from wxTooBar
shell in wxWindows. floatbar.py has a class derived from wxToolBar
that can sense mouse drags and then reparent itself into another
frame. Moving the new frame close to where it came from puts the tool
bar back into the original parent. (Unfortunately there is currently
+3
View File
@@ -194,6 +194,9 @@ class wxPythonDemo(wxFrame):
self.tree.EnsureVisible(selectedDemo)
self.WriteText('window handle: %s\n' % self.GetHandle())
#---------------------------------------------
def WriteText(self, text):
self.log.WriteText(text)
+5
View File
@@ -278,6 +278,7 @@ enum {
wxSB_HORIZONTAL,
wxSB_VERTICAL,
wxST_SIZEGRIP,
wxST_NO_AUTORESIZE,
wxBU_AUTODRAW,
wxBU_NOAUTODRAW,
wxTR_HAS_BUTTONS,
@@ -428,6 +429,7 @@ enum {
wxSAVE,
wxHIDE_READONLY,
wxOVERWRITE_PROMPT,
wxFILE_MUST_EXIST,
wxACCEL_ALT,
wxACCEL_CTRL,
@@ -905,6 +907,9 @@ enum wxEventType {
wxEVT_COMMAND_TREE_SEL_CHANGED,
wxEVT_COMMAND_TREE_SEL_CHANGING,
wxEVT_COMMAND_TREE_KEY_DOWN,
wxEVT_COMMAND_TREE_ITEM_ACTIVATED,
wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK,
wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK,
/* List control event types */
wxEVT_COMMAND_LIST_BEGIN_DRAG,
+9
View File
@@ -472,6 +472,15 @@ def EVT_TREE_KEY_DOWN(win, id, func):
def EVT_TREE_DELETE_ITEM(win, id, func):
win.Connect(id, -1, wxEVT_COMMAND_TREE_DELETE_ITEM, func)
def EVT_TREE_ITEM_ACTIVATED(win, id, func):
win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_ACTIVATED, func)
def EVT_TREE_ITEM_RIGHT_CLICK(win, id, func):
win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, func)
def EVT_TREE_ITEM_MIDDLE_CLICK(win, id, func):
win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, func)
# wxSpinButton
def EVT_SPIN_UP(win, id, func):
+1 -1
View File
@@ -298,7 +298,7 @@ HELPEREXPORT bool wxPyRestoreThread() {
// occurs, so I put in this code as a guard condition since there are
// many possibilites for nested events and callbacks in wxPython. If
// The current thread is our thread, then we can assume that we
// already have the lock.
// already have the lock. (I hope!)
//
#ifdef WXP_WITH_THREAD
_wxPyNestCount += 1;
+10
View File
@@ -16,6 +16,7 @@
#include "helpers.h"
#include <wx/resource.h>
#include <wx/tooltip.h>
#include <wx/busyinfo.h>
%}
//----------------------------------------------------------------------
@@ -328,6 +329,15 @@ public:
};
//---------------------------------------------------------------------------
class wxBusyInfo {
public:
wxBusyInfo(const wxString& message);
~wxBusyInfo();
};
//---------------------------------------------------------------------------
+12
View File
@@ -328,6 +328,18 @@ public:
const wxString& encoding);
};
#endif
//----------------------------------------------------------------------
class wxBusyCursor {
public:
wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR);
~wxBusyCursor();
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
//----------------------------------------------------------------------
+2
View File
@@ -2906,6 +2906,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxFont","_wxFont",0},
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -3016,6 +3017,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
+2
View File
@@ -7258,6 +7258,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxFont","_wxFont",0},
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -7423,6 +7424,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
+2
View File
@@ -6110,6 +6110,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxFont","_wxFont",0},
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -6212,6 +6213,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxCommandEvent","_class_wxTreeEvent",SwigwxTreeEventTowxCommandEvent},
{ "_class_wxCommandEvent","_wxTreeEvent",SwigwxTreeEventTowxCommandEvent},
{ "_class_wxCommandEvent","_class_wxListEvent",SwigwxListEventTowxCommandEvent},
+2
View File
@@ -5334,6 +5334,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_unsigned_short","_WXTYPE",0},
{ "_unsigned_short","_short",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxMouseEvent","_class_wxMouseEvent",0},
@@ -5390,6 +5391,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxRegion","_class_wxRegion",0},
{ "_class_wxShowEvent","_wxShowEvent",0},
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxCommandEvent","_class_wxPyCommandEvent",SwigwxPyCommandEventTowxCommandEvent},
{ "_class_wxCommandEvent","_wxPyCommandEvent",SwigwxPyCommandEventTowxCommandEvent},
{ "_class_wxCommandEvent","_class_wxNotifyEvent",SwigwxNotifyEventTowxCommandEvent},
+2
View File
@@ -1126,6 +1126,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxFont","_wxFont",0},
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -1219,6 +1220,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
+2
View File
@@ -7399,6 +7399,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_unsigned_short","_WXTYPE",0},
{ "_unsigned_short","_short",0},
{ "_class_wxFont","_wxFont",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_wxClientDC","_class_wxClientDC",0},
{ "_class_wxPoint","_wxPoint",0},
{ "_wxRealPoint","_class_wxRealPoint",0},
@@ -7446,6 +7447,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxScreenDC","_wxScreenDC",0},
{ "_wxPalette","_class_wxPalette",0},
{ "_wxRegion","_class_wxRegion",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSize","_wxSize",0},
{ "_class_wxBitmap","_class_wxCursor",SwigwxCursorTowxBitmap},
+2
View File
@@ -1802,6 +1802,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_unsigned_short","_WXTYPE",0},
{ "_unsigned_short","_short",0},
{ "_class_wxFont","_wxFont",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_wxClientDC","_class_wxClientDC",0},
{ "_class_wxPoint","_wxPoint",0},
{ "_wxRealPoint","_class_wxRealPoint",0},
@@ -1865,6 +1866,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxPalette","_class_wxPalette",0},
{ "_wxRegion","_class_wxRegion",0},
{ "_class_wxPCXHandler","_wxPCXHandler",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSize","_wxSize",0},
{ "_class_wxBitmap","_wxBitmap",0},
+2
View File
@@ -882,6 +882,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxFont","_wxFont",0},
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -978,6 +979,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
+70
View File
@@ -56,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void);
#include "helpers.h"
#include <wx/resource.h>
#include <wx/tooltip.h>
#include <wx/busyinfo.h>
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
@@ -3807,7 +3808,74 @@ static PyObject *_wrap_delete_wxAcceleratorTable(PyObject *self, PyObject *args,
return _resultobj;
}
#define new_wxBusyInfo(_swigarg0) (new wxBusyInfo(_swigarg0))
static PyObject *_wrap_new_wxBusyInfo(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxBusyInfo * _result;
wxString * _arg0;
PyObject * _obj0 = 0;
char *_kwnames[] = { "message", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxBusyInfo",_kwnames,&_obj0))
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 = (wxBusyInfo *)new_wxBusyInfo(*_arg0);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxBusyInfo_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
{
if (_obj0)
delete _arg0;
}
return _resultobj;
}
#define delete_wxBusyInfo(_swigobj) (delete _swigobj)
static PyObject *_wrap_delete_wxBusyInfo(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxBusyInfo * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxBusyInfo",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBusyInfo_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxBusyInfo. Expected _wxBusyInfo_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
delete_wxBusyInfo(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
static PyMethodDef misccMethods[] = {
{ "delete_wxBusyInfo", (PyCFunction) _wrap_delete_wxBusyInfo, METH_VARARGS | METH_KEYWORDS },
{ "new_wxBusyInfo", (PyCFunction) _wrap_new_wxBusyInfo, METH_VARARGS | METH_KEYWORDS },
{ "delete_wxAcceleratorTable", (PyCFunction) _wrap_delete_wxAcceleratorTable, METH_VARARGS | METH_KEYWORDS },
{ "new_wxAcceleratorTable", (PyCFunction) _wrap_new_wxAcceleratorTable, METH_VARARGS | METH_KEYWORDS },
{ "wxAcceleratorEntry_GetCommand", (PyCFunction) _wrap_wxAcceleratorEntry_GetCommand, METH_VARARGS | METH_KEYWORDS },
@@ -4002,6 +4070,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_WXTYPE","_unsigned_short",0},
{ "_unsigned_short","_WXTYPE",0},
{ "_unsigned_short","_short",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxPoint","_wxPoint",0},
{ "_wxRealPoint","_class_wxRealPoint",0},
{ "_signed_short","_WXTYPE",0},
@@ -4034,6 +4103,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxRegionIterator","_class_wxRegionIterator",0},
{ "_class_wxLayoutConstraints","_wxLayoutConstraints",0},
{ "_wxRegion","_class_wxRegion",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxSize","_wxSize",0},
{0,0,0}};
+17
View File
@@ -504,6 +504,23 @@ class wxAcceleratorTable(wxAcceleratorTablePtr):
class wxBusyInfoPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,miscc=miscc):
if self.thisown == 1 :
miscc.delete_wxBusyInfo(self)
def __repr__(self):
return "<C wxBusyInfo instance at %s>" % (self.this,)
class wxBusyInfo(wxBusyInfoPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(miscc.new_wxBusyInfo,_args,_kwargs)
self.thisown = 1
#-------------- FUNCTION WRAPPERS ------------------
+67
View File
@@ -1714,7 +1714,70 @@ static PyObject *_wrap_wxCaret_OnKillFocus(PyObject *self, PyObject *args, PyObj
return _resultobj;
}
#define new_wxBusyCursor(_swigarg0) (new wxBusyCursor(_swigarg0))
static PyObject *_wrap_new_wxBusyCursor(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxBusyCursor * _result;
wxCursor * _arg0 = (wxCursor *) wxHOURGLASS_CURSOR;
PyObject * _argo0 = 0;
char *_kwnames[] = { "cursor", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:new_wxBusyCursor",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCursor_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxBusyCursor. Expected _wxCursor_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxBusyCursor *)new_wxBusyCursor(_arg0);
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxBusyCursor_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define delete_wxBusyCursor(_swigobj) (delete _swigobj)
static PyObject *_wrap_delete_wxBusyCursor(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxBusyCursor * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxBusyCursor",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBusyCursor_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxBusyCursor. Expected _wxBusyCursor_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
delete_wxBusyCursor(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
static PyMethodDef misc2cMethods[] = {
{ "delete_wxBusyCursor", (PyCFunction) _wrap_delete_wxBusyCursor, METH_VARARGS | METH_KEYWORDS },
{ "new_wxBusyCursor", (PyCFunction) _wrap_new_wxBusyCursor, METH_VARARGS | METH_KEYWORDS },
{ "wxCaret_OnKillFocus", (PyCFunction) _wrap_wxCaret_OnKillFocus, METH_VARARGS | METH_KEYWORDS },
{ "wxCaret_OnSetFocus", (PyCFunction) _wrap_wxCaret_OnSetFocus, METH_VARARGS | METH_KEYWORDS },
{ "wxCaret_Hide", (PyCFunction) _wrap_wxCaret_Hide, METH_VARARGS | METH_KEYWORDS },
@@ -1809,6 +1872,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxToolTip","_wxToolTip",0},
{ "_wxColour","_class_wxColour",0},
{ "_class_wxDialog","_wxDialog",0},
{ "_wxBusyCursor","_class_wxBusyCursor",0},
{ "_wxCaret","_class_wxCaret",0},
{ "_wxBrush","_class_wxBrush",0},
{ "_uint","_wxPrintQuality",0},
@@ -1824,6 +1888,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxWindowDC","_class_wxWindowDC",0},
{ "_class_wxIndividualLayoutConstraint","_wxIndividualLayoutConstraint",0},
{ "_class_wxValidator","_wxValidator",0},
{ "_class_wxBusyCursor","_wxBusyCursor",0},
{ "_EBool","_wxPrintQuality",0},
{ "_EBool","_signed_int",0},
{ "_EBool","_int",0},
@@ -1855,6 +1920,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxWindow","_wxWindow",0},
{ "_class_wxFont","_wxFont",0},
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_wxClientDC","_class_wxClientDC",0},
{ "_class_wxPoint","_wxPoint",0},
{ "_wxRealPoint","_class_wxRealPoint",0},
@@ -1906,6 +1972,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxScreenDC","_wxScreenDC",0},
{ "_wxPalette","_class_wxPalette",0},
{ "_wxRegion","_class_wxRegion",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSize","_wxSize",0},
{ "_class_wxBitmap","_wxBitmap",0},
+17
View File
@@ -89,6 +89,23 @@ class wxCaret(wxCaretPtr):
class wxBusyCursorPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,misc2c=misc2c):
if self.thisown == 1 :
misc2c.delete_wxBusyCursor(self)
def __repr__(self):
return "<C wxBusyCursor instance at %s>" % (self.this,)
class wxBusyCursor(wxBusyCursorPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(misc2c.new_wxBusyCursor,_args,_kwargs)
self.thisown = 1
#-------------- FUNCTION WRAPPERS ------------------
+38 -47
View File
@@ -57,6 +57,8 @@ extern PyObject *SWIG_newvarlink(void);
#include <wx/print.h>
#include <wx/printdlg.h>
#include "printfw.h"
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
@@ -106,66 +108,53 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
static char* wxStringErrorMsg = "string type is required for parameter";
class wxPyPrintout : public wxPrintout {
public:
wxPyPrintout(const wxString& title) : wxPrintout(title) {}
DEC_PYCALLBACK_BOOL_INTINT(OnBeginDocument);
DEC_PYCALLBACK__(OnEndDocument);
DEC_PYCALLBACK__(OnBeginPrinting);
DEC_PYCALLBACK__(OnEndPrinting);
DEC_PYCALLBACK__(OnPreparePrinting);
DEC_PYCALLBACK_BOOL_INT_pure(OnPrintPage);
DEC_PYCALLBACK_BOOL_INT(HasPage);
// Since this one would be tough and ugly to do with the Macros...
void GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
bool hadErr = false;
// Since this one would be tough and ugly to do with the Macros...
void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
bool hadErr = false;
bool doSave = wxPyRestoreThread();
if (m_myInst.findCallback("GetPageInfo")) {
PyObject* result = m_myInst.callCallbackObj(Py_BuildValue("()"));
if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
PyObject* val;
bool doSave = wxPyRestoreThread();
if (m_myInst.findCallback("GetPageInfo")) {
PyObject* result = m_myInst.callCallbackObj(Py_BuildValue("()"));
if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
PyObject* val;
val = PyTuple_GetItem(result, 0);
if (PyInt_Check(val)) *minPage = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 0);
if (PyInt_Check(val)) *minPage = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 1);
if (PyInt_Check(val)) *maxPage = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 1);
if (PyInt_Check(val)) *maxPage = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 2);
if (PyInt_Check(val)) *pageFrom = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 2);
if (PyInt_Check(val)) *pageFrom = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 3);
if (PyInt_Check(val)) *pageTo = PyInt_AsLong(val);
else hadErr = true;
}
else
hadErr = true;
if (hadErr) {
PyErr_SetString(PyExc_TypeError, "GetPageInfo should return a tuple of 4 integers.");
PyErr_Print();
}
Py_DECREF(result);
val = PyTuple_GetItem(result, 3);
if (PyInt_Check(val)) *pageTo = PyInt_AsLong(val);
else hadErr = true;
}
else
wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
hadErr = true;
wxPySaveThread(doSave);
if (hadErr) {
PyErr_SetString(PyExc_TypeError, "GetPageInfo should return a tuple of 4 integers.");
PyErr_Print();
}
Py_DECREF(result);
}
void base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
else
wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
}
PYPRIVATE;
};
wxPySaveThread(doSave);
}
void wxPyPrintout::base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
}
IMP_PYCALLBACK_BOOL_INTINT(wxPyPrintout, wxPrintout, OnBeginDocument);
IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnEndDocument);
@@ -4546,6 +4535,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxFont","_wxFont",0},
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -4650,6 +4640,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
+2
View File
@@ -1567,6 +1567,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxFont","_wxFont",0},
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -1666,6 +1667,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
+2
View File
@@ -2715,6 +2715,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxFont","_wxFont",0},
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -2808,6 +2809,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
File diff suppressed because it is too large Load Diff
+34 -11
View File
@@ -195,6 +195,9 @@ class wxWindowPtr(wxEvtHandlerPtr):
val = apply(windowsc.wxWindow_GetGrandParent,(self,) + _args, _kwargs)
if val: val = wxWindowPtr(val)
return val
def GetHandle(self, *_args, **_kwargs):
val = apply(windowsc.wxWindow_GetHandle,(self,) + _args, _kwargs)
return val
def GetId(self, *_args, **_kwargs):
val = apply(windowsc.wxWindow_GetId,(self,) + _args, _kwargs)
return val
@@ -675,14 +678,14 @@ class wxMenuBarPtr(wxEvtHandlerPtr):
def Check(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuBar_Check,(self,) + _args, _kwargs)
return val
def Checked(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuBar_Checked,(self,) + _args, _kwargs)
return val
def Enable(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuBar_Enable,(self,) + _args, _kwargs)
return val
def Enabled(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuBar_Enabled,(self,) + _args, _kwargs)
def IsChecked(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuBar_IsChecked,(self,) + _args, _kwargs)
return val
def IsEnabled(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuBar_IsEnabled,(self,) + _args, _kwargs)
return val
def FindMenuItem(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuBar_FindMenuItem,(self,) + _args, _kwargs)
@@ -722,6 +725,14 @@ class wxMenuBarPtr(wxEvtHandlerPtr):
def Refresh(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuBar_Refresh,(self,) + _args, _kwargs)
return val
def Replace(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuBar_Replace,(self,) + _args, _kwargs)
if val: val = wxMenuPtr(val)
return val
def Remove(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuBar_Remove,(self,) + _args, _kwargs)
if val: val = wxMenuPtr(val)
return val
def __repr__(self):
return "<C wxMenuBar instance at %s>" % (self.this,)
class wxMenuBar(wxMenuBarPtr):
@@ -748,19 +759,19 @@ class wxMenuItemPtr :
def IsCheckable(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_IsCheckable,(self,) + _args, _kwargs)
return val
def IsSubMenu(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_IsSubMenu,(self,) + _args, _kwargs)
return val
def GetId(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_GetId,(self,) + _args, _kwargs)
return val
def SetId(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_SetId,(self,) + _args, _kwargs)
return val
def GetSubMenu(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_GetSubMenu,(self,) + _args, _kwargs)
if val: val = wxMenuPtr(val)
return val
def SetName(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_SetName,(self,) + _args, _kwargs)
return val
def GetName(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_GetName,(self,) + _args, _kwargs)
return val
def GetHelp(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_GetHelp,(self,) + _args, _kwargs)
return val
@@ -804,12 +815,24 @@ class wxMenuItemPtr :
def SetMarginWidth(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_SetMarginWidth,(self,) + _args, _kwargs)
return val
def SetText(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_SetText,(self,) + _args, _kwargs)
return val
def GetText(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_GetText,(self,) + _args, _kwargs)
return val
def SetTextColour(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_SetTextColour,(self,) + _args, _kwargs)
return val
def DeleteSubMenu(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_DeleteSubMenu,(self,) + _args, _kwargs)
return val
def SetCheckable(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_SetCheckable,(self,) + _args, _kwargs)
return val
def SetSubMenu(self, *_args, **_kwargs):
val = apply(windowsc.wxMenuItem_SetSubMenu,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxMenuItem instance at %s>" % (self.this,)
class wxMenuItem(wxMenuItemPtr):
+2
View File
@@ -5563,6 +5563,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxFont","_wxFont",0},
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -5658,6 +5659,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxGridEvent","_wxGridEvent",0},
{ "_class_wxCommandEvent","_class_wxSplitterEvent",SwigwxSplitterEventTowxCommandEvent},
{ "_class_wxCommandEvent","_wxSplitterEvent",SwigwxSplitterEventTowxCommandEvent},
+2
View File
@@ -1925,6 +1925,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxSashEvent","_class_wxSashEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -2024,6 +2025,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxGridEvent","_wxGridEvent",0},
{ "_class_wxCommandEvent","_class_wxSashEvent",SwigwxSashEventTowxCommandEvent},
{ "_class_wxCommandEvent","_wxSashEvent",SwigwxSashEventTowxCommandEvent},
+9
View File
@@ -1766,6 +1766,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxPNGHandler","_wxPNGHandler",0},
{ "_wxColour","_class_wxColour",0},
{ "_class_wxDialog","_wxDialog",0},
{ "_wxBusyCursor","_class_wxBusyCursor",0},
{ "_wxPageSetupDialog","_class_wxPageSetupDialog",0},
{ "_class_wxPrinter","_wxPrinter",0},
{ "_wxIdleEvent","_class_wxIdleEvent",0},
@@ -1820,6 +1821,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxTextEntryDialog","_class_wxTextEntryDialog",0},
{ "_class_wxIconizeEvent","_wxIconizeEvent",0},
{ "_class_wxStaticBitmap","_wxStaticBitmap",0},
{ "_class_wxBusyCursor","_wxBusyCursor",0},
{ "_wxMDIChildFrame","_class_wxMDIChildFrame",0},
{ "_wxListItem","_class_wxListItem",0},
{ "_class_wxToolBar","_wxToolBar",0},
@@ -1890,6 +1892,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxPyValidator","_wxPyValidator",0},
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxSashEvent","_class_wxSashEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -2012,6 +2015,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxActivateEvent","_class_wxActivateEvent",0},
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxGridEvent","_wxGridEvent",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
@@ -2165,6 +2169,7 @@ SWIGEXPORT(void) initwxc() {
PyDict_SetItemString(d,"wxSB_HORIZONTAL", PyInt_FromLong((long) wxSB_HORIZONTAL));
PyDict_SetItemString(d,"wxSB_VERTICAL", PyInt_FromLong((long) wxSB_VERTICAL));
PyDict_SetItemString(d,"wxST_SIZEGRIP", PyInt_FromLong((long) wxST_SIZEGRIP));
PyDict_SetItemString(d,"wxST_NO_AUTORESIZE", PyInt_FromLong((long) wxST_NO_AUTORESIZE));
PyDict_SetItemString(d,"wxBU_AUTODRAW", PyInt_FromLong((long) wxBU_AUTODRAW));
PyDict_SetItemString(d,"wxBU_NOAUTODRAW", PyInt_FromLong((long) wxBU_NOAUTODRAW));
PyDict_SetItemString(d,"wxTR_HAS_BUTTONS", PyInt_FromLong((long) wxTR_HAS_BUTTONS));
@@ -2309,6 +2314,7 @@ SWIGEXPORT(void) initwxc() {
PyDict_SetItemString(d,"wxSAVE", PyInt_FromLong((long) wxSAVE));
PyDict_SetItemString(d,"wxHIDE_READONLY", PyInt_FromLong((long) wxHIDE_READONLY));
PyDict_SetItemString(d,"wxOVERWRITE_PROMPT", PyInt_FromLong((long) wxOVERWRITE_PROMPT));
PyDict_SetItemString(d,"wxFILE_MUST_EXIST", PyInt_FromLong((long) wxFILE_MUST_EXIST));
PyDict_SetItemString(d,"wxACCEL_ALT", PyInt_FromLong((long) wxACCEL_ALT));
PyDict_SetItemString(d,"wxACCEL_CTRL", PyInt_FromLong((long) wxACCEL_CTRL));
PyDict_SetItemString(d,"wxACCEL_SHIFT", PyInt_FromLong((long) wxACCEL_SHIFT));
@@ -2695,6 +2701,9 @@ SWIGEXPORT(void) initwxc() {
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_SEL_CHANGED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_SEL_CHANGED));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_SEL_CHANGING", PyInt_FromLong((long) wxEVT_COMMAND_TREE_SEL_CHANGING));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_KEY_DOWN", PyInt_FromLong((long) wxEVT_COMMAND_TREE_KEY_DOWN));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_ACTIVATED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_ACTIVATED));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK));
PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK));
PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_DRAG));
PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_RDRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_RDRAG));
PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT));
+14
View File
@@ -264,6 +264,7 @@ wxSL_SELRANGE = wxc.wxSL_SELRANGE
wxSB_HORIZONTAL = wxc.wxSB_HORIZONTAL
wxSB_VERTICAL = wxc.wxSB_VERTICAL
wxST_SIZEGRIP = wxc.wxST_SIZEGRIP
wxST_NO_AUTORESIZE = wxc.wxST_NO_AUTORESIZE
wxBU_AUTODRAW = wxc.wxBU_AUTODRAW
wxBU_NOAUTODRAW = wxc.wxBU_NOAUTODRAW
wxTR_HAS_BUTTONS = wxc.wxTR_HAS_BUTTONS
@@ -408,6 +409,7 @@ wxOPEN = wxc.wxOPEN
wxSAVE = wxc.wxSAVE
wxHIDE_READONLY = wxc.wxHIDE_READONLY
wxOVERWRITE_PROMPT = wxc.wxOVERWRITE_PROMPT
wxFILE_MUST_EXIST = wxc.wxFILE_MUST_EXIST
wxACCEL_ALT = wxc.wxACCEL_ALT
wxACCEL_CTRL = wxc.wxACCEL_CTRL
wxACCEL_SHIFT = wxc.wxACCEL_SHIFT
@@ -794,6 +796,9 @@ wxEVT_COMMAND_TREE_ITEM_COLLAPSING = wxc.wxEVT_COMMAND_TREE_ITEM_COLLAPSING
wxEVT_COMMAND_TREE_SEL_CHANGED = wxc.wxEVT_COMMAND_TREE_SEL_CHANGED
wxEVT_COMMAND_TREE_SEL_CHANGING = wxc.wxEVT_COMMAND_TREE_SEL_CHANGING
wxEVT_COMMAND_TREE_KEY_DOWN = wxc.wxEVT_COMMAND_TREE_KEY_DOWN
wxEVT_COMMAND_TREE_ITEM_ACTIVATED = wxc.wxEVT_COMMAND_TREE_ITEM_ACTIVATED
wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK = wxc.wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK
wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK = wxc.wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK
wxEVT_COMMAND_LIST_BEGIN_DRAG = wxc.wxEVT_COMMAND_LIST_BEGIN_DRAG
wxEVT_COMMAND_LIST_BEGIN_RDRAG = wxc.wxEVT_COMMAND_LIST_BEGIN_RDRAG
wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT = wxc.wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT
@@ -1301,6 +1306,15 @@ def EVT_TREE_KEY_DOWN(win, id, func):
def EVT_TREE_DELETE_ITEM(win, id, func):
win.Connect(id, -1, wxEVT_COMMAND_TREE_DELETE_ITEM, func)
def EVT_TREE_ITEM_ACTIVATED(win, id, func):
win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_ACTIVATED, func)
def EVT_TREE_ITEM_RIGHT_CLICK(win, id, func):
win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, func)
def EVT_TREE_ITEM_MIDDLE_CLICK(win, id, func):
win.Connect(id, -1, wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, func)
# wxSpinButton
def EVT_SPIN_UP(win, id, func):
+33
View File
@@ -0,0 +1,33 @@
/////////////////////////////////////////////////////////////////////////////
// Name: printfw.h
// Purpose: Exposing the class definition of wxPyPrintout so it can be
// used by wxHtmlPrintout. Must be included after helpers.h
//
// Author: Robin Dunn
//
// Created: 29-Oct-1999
// RCS-ID: $Id$
// Copyright: (c) 1999 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
class wxPyPrintout : public wxPrintout {
public:
wxPyPrintout(const wxString& title) : wxPrintout(title) {}
DEC_PYCALLBACK_BOOL_INTINT(OnBeginDocument);
DEC_PYCALLBACK__(OnEndDocument);
DEC_PYCALLBACK__(OnBeginPrinting);
DEC_PYCALLBACK__(OnEndPrinting);
DEC_PYCALLBACK__(OnPreparePrinting);
DEC_PYCALLBACK_BOOL_INT_pure(OnPrintPage);
DEC_PYCALLBACK_BOOL_INT(HasPage);
// Since this one would be tough and ugly to do with the Macros...
void GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo);
void base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo);
PYPRIVATE;
};
+36 -47
View File
@@ -16,6 +16,8 @@
#include "helpers.h"
#include <wx/print.h>
#include <wx/printdlg.h>
#include "printfw.h"
%}
//----------------------------------------------------------------------
@@ -198,66 +200,53 @@ public:
//----------------------------------------------------------------------
// Custom wxPrintout class that knows how to call python
%{
class wxPyPrintout : public wxPrintout {
public:
wxPyPrintout(const wxString& title) : wxPrintout(title) {}
DEC_PYCALLBACK_BOOL_INTINT(OnBeginDocument);
DEC_PYCALLBACK__(OnEndDocument);
DEC_PYCALLBACK__(OnBeginPrinting);
DEC_PYCALLBACK__(OnEndPrinting);
DEC_PYCALLBACK__(OnPreparePrinting);
DEC_PYCALLBACK_BOOL_INT_pure(OnPrintPage);
DEC_PYCALLBACK_BOOL_INT(HasPage);
// Since this one would be tough and ugly to do with the Macros...
void GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
bool hadErr = false;
// Since this one would be tough and ugly to do with the Macros...
void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
bool hadErr = false;
bool doSave = wxPyRestoreThread();
if (m_myInst.findCallback("GetPageInfo")) {
PyObject* result = m_myInst.callCallbackObj(Py_BuildValue("()"));
if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
PyObject* val;
bool doSave = wxPyRestoreThread();
if (m_myInst.findCallback("GetPageInfo")) {
PyObject* result = m_myInst.callCallbackObj(Py_BuildValue("()"));
if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
PyObject* val;
val = PyTuple_GetItem(result, 0);
if (PyInt_Check(val)) *minPage = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 0);
if (PyInt_Check(val)) *minPage = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 1);
if (PyInt_Check(val)) *maxPage = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 1);
if (PyInt_Check(val)) *maxPage = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 2);
if (PyInt_Check(val)) *pageFrom = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 2);
if (PyInt_Check(val)) *pageFrom = PyInt_AsLong(val);
else hadErr = true;
val = PyTuple_GetItem(result, 3);
if (PyInt_Check(val)) *pageTo = PyInt_AsLong(val);
else hadErr = true;
}
else
hadErr = true;
if (hadErr) {
PyErr_SetString(PyExc_TypeError, "GetPageInfo should return a tuple of 4 integers.");
PyErr_Print();
}
Py_DECREF(result);
val = PyTuple_GetItem(result, 3);
if (PyInt_Check(val)) *pageTo = PyInt_AsLong(val);
else hadErr = true;
}
else
wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
hadErr = true;
wxPySaveThread(doSave);
if (hadErr) {
PyErr_SetString(PyExc_TypeError, "GetPageInfo should return a tuple of 4 integers.");
PyErr_Print();
}
Py_DECREF(result);
}
void base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
else
wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
}
PYPRIVATE;
};
wxPySaveThread(doSave);
}
void wxPyPrintout::base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
}
IMP_PYCALLBACK_BOOL_INTINT(wxPyPrintout, wxPrintout, OnBeginDocument);
IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnEndDocument);
+24 -11
View File
@@ -190,7 +190,6 @@ public:
}
}
int GetCharHeight();
int GetCharWidth();
%name(GetClientSizeTuple) void GetClientSize(int *OUTPUT, int *OUTPUT);
@@ -201,6 +200,11 @@ public:
wxFont& GetFont();
wxColour GetForegroundColour();
wxWindow * GetGrandParent();
%addmethods {
long GetHandle() {
return (long)self->GetHandle();
}
}
int GetId();
wxString GetLabel();
void SetLabel(const wxString& label);
@@ -490,9 +494,11 @@ public:
void Append(wxMenu *menu, const wxString& title);
void Check(int id, bool flag);
bool Checked(int id);
// bool Checked(int id);
void Enable(int id, bool enable);
bool Enabled(int id);
// bool Enabled(int id);
bool IsChecked(int id);
bool IsEnabled(int id);
int FindMenuItem(const wxString& menuString, const wxString& itemString);
wxMenuItem * FindItemForId(int id);
void SetLabel(int id, const wxString& label);
@@ -505,6 +511,9 @@ public:
int GetMenuCount();
wxMenu* GetMenu(int i);
void Refresh();
wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
wxMenu *Remove(size_t pos);
};
@@ -512,29 +521,29 @@ public:
class wxMenuItem {
public:
#ifndef __WXGTK__
//#ifndef __WXGTK__
wxMenuItem(wxMenu* parentMenu=NULL, int id=ID_SEPARATOR,
const wxString& text = wxPyEmptyStr,
const wxString& helpString = wxPyEmptyStr,
bool checkable = FALSE, wxMenu* subMenu = NULL);
#else
wxMenuItem();
#endif
//#else
// wxMenuItem();
//#endif
bool IsSeparator();
bool IsEnabled();
bool IsChecked();
bool IsCheckable();
bool IsSubMenu();
int GetId();
void SetId(int id);
wxMenu* GetSubMenu();
void SetName(const wxString& strName);
wxString GetName();
wxString GetHelp();
void SetHelp(const wxString& strHelp);
void Enable(bool bDoEnable = TRUE);
void Check(bool bDoCheck = TRUE);
#ifdef __WXMSW__
//#ifdef __WXMSW__
wxColour& GetBackgroundColour();
wxBitmap GetBitmap(bool checked = TRUE);
wxFont& GetFont();
@@ -544,9 +553,13 @@ public:
void SetBitmaps(const wxBitmap& checked, const wxBitmap& unchecked = wxNullBitmap);
void SetFont(const wxFont& font);
void SetMarginWidth(int width);
void SetText(const wxString& str);
const wxString& GetText();
void SetTextColour(const wxColour& colour);
void DeleteSubMenu();
#endif
void SetCheckable(bool checkable);
void SetSubMenu(wxMenu *menu);
//#endif
};
//---------------------------------------------------------------------------
+4 -16
View File
@@ -181,19 +181,7 @@ public:
//---------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
//
// $Log$
// Revision 1.2 1999/04/30 03:29:19 RD
// wxPython 2.0b9, first phase (win32)
// Added gobs of stuff, see wxPython/README.txt for details
//
// Revision 1.1 1999/01/30 07:30:16 RD
//
// Added wxSashWindow, wxSashEvent, wxLayoutAlgorithm, etc.
//
// Various cleanup, tweaks, minor additions, etc. to maintain
// compatibility with the current wxWindows.
//
//
//
//---------------------------------------------------------------------------