mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-21 21:47:55 +08:00
Added wxBufferedDC, changes for wxMenu and wxMenuItem, and other
little fixes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14675 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
+12
-7
@@ -738,8 +738,9 @@ enum wxBitmapType
|
||||
// Standard cursors
|
||||
enum wxStockCursor
|
||||
{
|
||||
wxCURSOR_NONE, // should be 0
|
||||
wxCURSOR_NONE,
|
||||
wxCURSOR_ARROW,
|
||||
wxCURSOR_RIGHT_ARROW,
|
||||
wxCURSOR_BULLSEYE,
|
||||
wxCURSOR_CHAR,
|
||||
wxCURSOR_CROSS,
|
||||
@@ -765,12 +766,6 @@ enum wxStockCursor
|
||||
wxCURSOR_WATCH,
|
||||
wxCURSOR_BLANK,
|
||||
wxCURSOR_DEFAULT,
|
||||
// // Not yet implemented for Windows
|
||||
// wxCURSOR_CROSS_REVERSE,
|
||||
// wxCURSOR_DOUBLE_ARROW,
|
||||
// wxCURSOR_BASED_ARROW_UP,
|
||||
// wxCURSOR_BASED_ARROW_DOWN,
|
||||
|
||||
wxCURSOR_ARROWWAIT,
|
||||
wxCURSOR_MAX
|
||||
};
|
||||
@@ -857,6 +852,16 @@ typedef enum {
|
||||
|
||||
|
||||
|
||||
// menu and toolbar item kinds
|
||||
enum wxItemKind
|
||||
{
|
||||
wxItem_Separator = -1,
|
||||
wxItem_Normal,
|
||||
wxItem_Check,
|
||||
wxItem_Radio,
|
||||
wxItem_Max
|
||||
};
|
||||
|
||||
enum wxHitTest
|
||||
{
|
||||
wxHT_NOWHERE,
|
||||
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
return wxFileSystemHandler::GetRightLocation(location);
|
||||
}
|
||||
|
||||
wxString GetMimeTypeFromExt(const wxString& location){
|
||||
wxString GetMimeTypeFromExt(const wxString& location) {
|
||||
return wxFileSystemHandler::GetMimeTypeFromExt(location);
|
||||
}
|
||||
|
||||
@@ -194,15 +194,11 @@ void __wxMemoryFSHandler_AddFile_wxBitmap(const wxString& filename,
|
||||
wxMemoryFSHandler::AddFile(filename, bitmap, type);
|
||||
}
|
||||
|
||||
// void __wxMemoryFSHandler_AddFile_wxString(const wxString& filename,
|
||||
// const wxString& textdata) {
|
||||
// wxMemoryFSHandler::AddFile(filename, textdata);
|
||||
// }
|
||||
|
||||
void __wxMemoryFSHandler_AddFile_Data(const wxString& filename,
|
||||
PyObject* data) {
|
||||
|
||||
wxMemoryFSHandler::AddFile(filename,
|
||||
// TODO: Verify data type
|
||||
(void*)PyString_AsString(data),
|
||||
(size_t)PyString_Size(data));
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <wx/fontenc.h>
|
||||
#include <wx/fontmap.h>
|
||||
#include <wx/fontutil.h>
|
||||
#include <wx/dcbuffer.h>
|
||||
%}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -1139,6 +1140,26 @@ public:
|
||||
%}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxBufferedDC : public wxMemoryDC {
|
||||
public:
|
||||
// Construct a wxBufferedDC using a user supplied buffer.
|
||||
wxBufferedDC( wxDC *dc, const wxBitmap &buffer );
|
||||
|
||||
// Construct a wxBufferedDC with an internal buffer of 'area'
|
||||
// (where area is usually something like the size of the window
|
||||
// being buffered)
|
||||
%name(wxBufferedDCInternalBuffer)wxBufferedDC( wxDC *dc, const wxSize &area );
|
||||
};
|
||||
|
||||
|
||||
class wxBufferedPaintDC : public wxBufferedDC
|
||||
{
|
||||
public:
|
||||
wxBufferedPaintDC( wxWindow *window, const wxBitmap &buffer = wxNullBitmap );
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxScreenDC : public wxDC {
|
||||
|
||||
@@ -1888,7 +1888,6 @@ bool wxColour_helper(PyObject* source, wxColour** obj) {
|
||||
if (spec.GetChar(0) == '#' && spec.Length() == 7) { // It's #RRGGBB
|
||||
long red, green, blue;
|
||||
red = green = blue = 0;
|
||||
|
||||
spec.Mid(1,2).ToLong(&red, 16);
|
||||
spec.Mid(3,2).ToLong(&green, 16);
|
||||
spec.Mid(5,2).ToLong(&blue, 16);
|
||||
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
return wxFileSystemHandler::GetRightLocation(location);
|
||||
}
|
||||
|
||||
wxString GetMimeTypeFromExt(const wxString& location){
|
||||
wxString GetMimeTypeFromExt(const wxString& location) {
|
||||
return wxFileSystemHandler::GetMimeTypeFromExt(location);
|
||||
}
|
||||
|
||||
@@ -141,15 +141,11 @@ void __wxMemoryFSHandler_AddFile_wxBitmap(const wxString& filename,
|
||||
wxMemoryFSHandler::AddFile(filename, bitmap, type);
|
||||
}
|
||||
|
||||
// void __wxMemoryFSHandler_AddFile_wxString(const wxString& filename,
|
||||
// const wxString& textdata) {
|
||||
// wxMemoryFSHandler::AddFile(filename, textdata);
|
||||
// }
|
||||
|
||||
void __wxMemoryFSHandler_AddFile_Data(const wxString& filename,
|
||||
PyObject* data) {
|
||||
|
||||
wxMemoryFSHandler::AddFile(filename,
|
||||
// TODO: Verify data type
|
||||
(void*)PyString_AsString(data),
|
||||
(size_t)PyString_Size(data));
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ extern PyObject *SWIG_newvarlink(void);
|
||||
#include <wx/fontenc.h>
|
||||
#include <wx/fontmap.h>
|
||||
#include <wx/fontutil.h>
|
||||
#include <wx/dcbuffer.h>
|
||||
|
||||
|
||||
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
|
||||
@@ -10426,6 +10427,193 @@ static PyObject *_wrap_wxMemoryDC_SelectObject(PyObject *self, PyObject *args, P
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static void *SwigwxBufferedDCTowxMemoryDC(void *ptr) {
|
||||
wxBufferedDC *src;
|
||||
wxMemoryDC *dest;
|
||||
src = (wxBufferedDC *) ptr;
|
||||
dest = (wxMemoryDC *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxBufferedDCTowxDC(void *ptr) {
|
||||
wxBufferedDC *src;
|
||||
wxDC *dest;
|
||||
src = (wxBufferedDC *) ptr;
|
||||
dest = (wxDC *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxBufferedDCTowxObject(void *ptr) {
|
||||
wxBufferedDC *src;
|
||||
wxObject *dest;
|
||||
src = (wxBufferedDC *) ptr;
|
||||
dest = (wxObject *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
#define new_wxBufferedDC(_swigarg0,_swigarg1) (new wxBufferedDC(_swigarg0,_swigarg1))
|
||||
static PyObject *_wrap_new_wxBufferedDC(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxBufferedDC * _result;
|
||||
wxDC * _arg0;
|
||||
wxBitmap * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _argo1 = 0;
|
||||
char *_kwnames[] = { "dc","buffer", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:new_wxBufferedDC",_kwnames,&_argo0,&_argo1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDC_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxBufferedDC. Expected _wxDC_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_argo1) {
|
||||
if (_argo1 == Py_None) { _arg1 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxBitmap_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxBufferedDC. Expected _wxBitmap_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxBufferedDC *)new_wxBufferedDC(_arg0,*_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxBufferedDC_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
#define new_wxBufferedDCInternalBuffer(_swigarg0,_swigarg1) (new wxBufferedDC(_swigarg0,_swigarg1))
|
||||
static PyObject *_wrap_new_wxBufferedDCInternalBuffer(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxBufferedDC * _result;
|
||||
wxDC * _arg0;
|
||||
wxSize * _arg1;
|
||||
PyObject * _argo0 = 0;
|
||||
wxSize temp;
|
||||
PyObject * _obj1 = 0;
|
||||
char *_kwnames[] = { "dc","area", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:new_wxBufferedDCInternalBuffer",_kwnames,&_argo0,&_obj1))
|
||||
return NULL;
|
||||
if (_argo0) {
|
||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDC_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxBufferedDCInternalBuffer. Expected _wxDC_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
_arg1 = &temp;
|
||||
if (! wxSize_helper(_obj1, &_arg1))
|
||||
return NULL;
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxBufferedDC *)new_wxBufferedDCInternalBuffer(_arg0,*_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxBufferedDC_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static void *SwigwxBufferedPaintDCTowxBufferedDC(void *ptr) {
|
||||
wxBufferedPaintDC *src;
|
||||
wxBufferedDC *dest;
|
||||
src = (wxBufferedPaintDC *) ptr;
|
||||
dest = (wxBufferedDC *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxBufferedPaintDCTowxMemoryDC(void *ptr) {
|
||||
wxBufferedPaintDC *src;
|
||||
wxMemoryDC *dest;
|
||||
src = (wxBufferedPaintDC *) ptr;
|
||||
dest = (wxMemoryDC *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxBufferedPaintDCTowxDC(void *ptr) {
|
||||
wxBufferedPaintDC *src;
|
||||
wxDC *dest;
|
||||
src = (wxBufferedPaintDC *) ptr;
|
||||
dest = (wxDC *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxBufferedPaintDCTowxObject(void *ptr) {
|
||||
wxBufferedPaintDC *src;
|
||||
wxObject *dest;
|
||||
src = (wxBufferedPaintDC *) ptr;
|
||||
dest = (wxObject *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
#define new_wxBufferedPaintDC(_swigarg0,_swigarg1) (new wxBufferedPaintDC(_swigarg0,_swigarg1))
|
||||
static PyObject *_wrap_new_wxBufferedPaintDC(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
wxBufferedPaintDC * _result;
|
||||
wxWindow * _arg0;
|
||||
wxBitmap * _arg1 = (wxBitmap *) &wxNullBitmap;
|
||||
PyObject * _argo0 = 0;
|
||||
PyObject * _argo1 = 0;
|
||||
char *_kwnames[] = { "window","buffer", NULL };
|
||||
char _ptemp[128];
|
||||
|
||||
self = self;
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:new_wxBufferedPaintDC",_kwnames,&_argo0,&_argo1))
|
||||
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 new_wxBufferedPaintDC. Expected _wxWindow_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (_argo1) {
|
||||
if (_argo1 == Py_None) { _arg1 = NULL; }
|
||||
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxBitmap_p")) {
|
||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxBufferedPaintDC. Expected _wxBitmap_p.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
_result = (wxBufferedPaintDC *)new_wxBufferedPaintDC(_arg0,*_arg1);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) return NULL;
|
||||
} if (_result) {
|
||||
SWIG_MakePtr(_ptemp, (char *) _result,"_wxBufferedPaintDC_p");
|
||||
_resultobj = Py_BuildValue("s",_ptemp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
_resultobj = Py_None;
|
||||
}
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static void *SwigwxScreenDCTowxDC(void *ptr) {
|
||||
wxScreenDC *src;
|
||||
wxDC *dest;
|
||||
@@ -12896,6 +13084,9 @@ static PyMethodDef gdicMethods[] = {
|
||||
{ "wxScreenDC_StartDrawingOnTop", (PyCFunction) _wrap_wxScreenDC_StartDrawingOnTop, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxScreenDC_StartDrawingOnTopWin", (PyCFunction) _wrap_wxScreenDC_StartDrawingOnTopWin, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxScreenDC", (PyCFunction) _wrap_new_wxScreenDC, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxBufferedPaintDC", (PyCFunction) _wrap_new_wxBufferedPaintDC, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxBufferedDCInternalBuffer", (PyCFunction) _wrap_new_wxBufferedDCInternalBuffer, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxBufferedDC", (PyCFunction) _wrap_new_wxBufferedDC, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxMemoryDC_SelectObject", (PyCFunction) _wrap_wxMemoryDC_SelectObject, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "new_wxMemoryDC", (PyCFunction) _wrap_new_wxMemoryDC, METH_VARARGS | METH_KEYWORDS },
|
||||
{ "wxDC__DrawLineList", (PyCFunction) _wrap_wxDC__DrawLineList, METH_VARARGS | METH_KEYWORDS },
|
||||
@@ -13207,6 +13398,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_wxDC","_wxPaintDC",SwigwxPaintDCTowxDC},
|
||||
{ "_wxDC","_wxClientDC",SwigwxClientDCTowxDC},
|
||||
{ "_wxDC","_wxScreenDC",SwigwxScreenDCTowxDC},
|
||||
{ "_wxDC","_wxBufferedPaintDC",SwigwxBufferedPaintDCTowxDC},
|
||||
{ "_wxDC","_wxBufferedDC",SwigwxBufferedDCTowxDC},
|
||||
{ "_wxDC","_wxMemoryDC",SwigwxMemoryDCTowxDC},
|
||||
{ "_size_t","_wxCoord",0},
|
||||
{ "_size_t","_wxPrintQuality",0},
|
||||
@@ -13224,6 +13417,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_uint","_wxWindowID",0},
|
||||
{ "_wxChar","_char",0},
|
||||
{ "_char","_wxChar",0},
|
||||
{ "_wxBufferedDC","_wxBufferedPaintDC",SwigwxBufferedPaintDCTowxBufferedDC},
|
||||
{ "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
|
||||
{ "_EBool","_wxCoord",0},
|
||||
{ "_EBool","_wxPrintQuality",0},
|
||||
@@ -13252,6 +13446,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_wxObject","_wxPaintDC",SwigwxPaintDCTowxObject},
|
||||
{ "_wxObject","_wxClientDC",SwigwxClientDCTowxObject},
|
||||
{ "_wxObject","_wxScreenDC",SwigwxScreenDCTowxObject},
|
||||
{ "_wxObject","_wxBufferedPaintDC",SwigwxBufferedPaintDCTowxObject},
|
||||
{ "_wxObject","_wxBufferedDC",SwigwxBufferedDCTowxObject},
|
||||
{ "_wxObject","_wxMemoryDC",SwigwxMemoryDCTowxObject},
|
||||
{ "_wxObject","_wxDC",SwigwxDCTowxObject},
|
||||
{ "_wxObject","_wxBrushList",SwigwxBrushListTowxObject},
|
||||
@@ -13270,6 +13466,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_wxObject","_wxGDIObject",SwigwxGDIObjectTowxObject},
|
||||
{ "_signed_short","_WXTYPE",0},
|
||||
{ "_signed_short","_short",0},
|
||||
{ "_wxMemoryDC","_wxBufferedPaintDC",SwigwxBufferedPaintDCTowxMemoryDC},
|
||||
{ "_wxMemoryDC","_wxBufferedDC",SwigwxBufferedDCTowxMemoryDC},
|
||||
{ "_unsigned_char","_byte",0},
|
||||
{ "_unsigned_int","_wxCoord",0},
|
||||
{ "_unsigned_int","_wxPrintQuality",0},
|
||||
|
||||
@@ -1047,6 +1047,39 @@ class wxMemoryDC(wxMemoryDCPtr):
|
||||
|
||||
|
||||
|
||||
class wxBufferedDCPtr(wxMemoryDCPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def __repr__(self):
|
||||
return "<C wxBufferedDC instance at %s>" % (self.this,)
|
||||
class wxBufferedDC(wxBufferedDCPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = apply(gdic.new_wxBufferedDC,_args,_kwargs)
|
||||
self.thisown = 1
|
||||
|
||||
|
||||
|
||||
def wxBufferedDCInternalBuffer(*_args,**_kwargs):
|
||||
val = wxBufferedDCPtr(apply(gdic.new_wxBufferedDCInternalBuffer,_args,_kwargs))
|
||||
val.thisown = 1
|
||||
return val
|
||||
|
||||
|
||||
class wxBufferedPaintDCPtr(wxBufferedDCPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def __repr__(self):
|
||||
return "<C wxBufferedPaintDC instance at %s>" % (self.this,)
|
||||
class wxBufferedPaintDC(wxBufferedPaintDCPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = apply(gdic.new_wxBufferedPaintDC,_args,_kwargs)
|
||||
self.thisown = 1
|
||||
|
||||
|
||||
|
||||
|
||||
class wxScreenDCPtr(wxDCPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
|
||||
+814
-58
File diff suppressed because it is too large
Load Diff
@@ -695,11 +695,19 @@ class wxScrolledWindowPtr(wxPanelPtr):
|
||||
def GetViewStart(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxScrolledWindow_GetViewStart,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CalcScrolledPosition(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxScrolledWindow_CalcScrolledPosition,(self,) + _args, _kwargs)
|
||||
def CalcScrolledPosition1(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxScrolledWindow_CalcScrolledPosition1,(self,) + _args, _kwargs)
|
||||
if val: val = wxPointPtr(val) ; val.thisown = 1
|
||||
return val
|
||||
def CalcUnscrolledPosition(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxScrolledWindow_CalcUnscrolledPosition,(self,) + _args, _kwargs)
|
||||
def CalcScrolledPosition2(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxScrolledWindow_CalcScrolledPosition2,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def CalcUnscrolledPosition1(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxScrolledWindow_CalcUnscrolledPosition1,(self,) + _args, _kwargs)
|
||||
if val: val = wxPointPtr(val) ; val.thisown = 1
|
||||
return val
|
||||
def CalcUnscrolledPosition2(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxScrolledWindow_CalcUnscrolledPosition2,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetScale(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxScrolledWindow_SetScale,(self,) + _args, _kwargs)
|
||||
@@ -719,6 +727,23 @@ class wxScrolledWindowPtr(wxPanelPtr):
|
||||
def __repr__(self):
|
||||
return "<C wxScrolledWindow instance at %s>" % (self.this,)
|
||||
ViewStart = GetViewStart
|
||||
|
||||
def CalcScrolledPosition(self, *args):
|
||||
if len(args) == 1:
|
||||
return apply(self.CalcScrolledPosition1, args)
|
||||
elif len(args) == 2:
|
||||
return apply(self.CalcScrolledPosition2, args)
|
||||
else:
|
||||
raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed'
|
||||
|
||||
def CalcUnscrolledPosition(self, *args):
|
||||
if len(args) == 1:
|
||||
return apply(self.CalcUnscrolledPosition1, args)
|
||||
elif len(args) == 2:
|
||||
return apply(self.CalcUnscrolledPosition2, args)
|
||||
else:
|
||||
raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed'
|
||||
|
||||
class wxScrolledWindow(wxScrolledWindowPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = apply(windowsc.new_wxScrolledWindow,_args,_kwargs)
|
||||
@@ -747,9 +772,51 @@ class wxMenuPtr(wxEvtHandlerPtr):
|
||||
def AppendItem(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_AppendItem,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def AppendCheckItem(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_AppendCheckItem,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def AppendRadioItem(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_AppendRadioItem,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def AppendSeparator(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_AppendSeparator,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Insert(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_Insert,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def InsertSeparator(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_InsertSeparator,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def InsertCheckItem(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_InsertCheckItem,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def InsertRadioItem(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_InsertRadioItem,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def InsertMenu(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_InsertMenu,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def InsertItem(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_InsertItem,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Prepend(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_Prepend,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def PrependSeparator(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_PrependSeparator,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def PrependCheckItem(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_PrependCheckItem,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def PrependRadioItem(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_PrependRadioItem,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def PrependMenu(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_PrependMenu,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def PrependItem(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_PrependItem,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Break(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_Break,(self,) + _args, _kwargs)
|
||||
return val
|
||||
@@ -798,9 +865,6 @@ class wxMenuPtr(wxEvtHandlerPtr):
|
||||
def DeleteItem(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_DeleteItem,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Insert(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_Insert,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Remove(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenu_Remove,(self,) + _args, _kwargs)
|
||||
return val
|
||||
@@ -957,6 +1021,9 @@ class wxMenuItemPtr(wxObjectPtr):
|
||||
def GetText(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenuItem_GetText,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetKind(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenuItem_GetKind,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetCheckable(self, *_args, **_kwargs):
|
||||
val = apply(windowsc.wxMenuItem_SetCheckable,(self,) + _args, _kwargs)
|
||||
return val
|
||||
|
||||
@@ -2393,6 +2393,7 @@ SWIGEXPORT(void) initwxc() {
|
||||
PyDict_SetItemString(d,"wxBITMAP_TYPE_ANY", PyInt_FromLong((long) wxBITMAP_TYPE_ANY));
|
||||
PyDict_SetItemString(d,"wxCURSOR_NONE", PyInt_FromLong((long) wxCURSOR_NONE));
|
||||
PyDict_SetItemString(d,"wxCURSOR_ARROW", PyInt_FromLong((long) wxCURSOR_ARROW));
|
||||
PyDict_SetItemString(d,"wxCURSOR_RIGHT_ARROW", PyInt_FromLong((long) wxCURSOR_RIGHT_ARROW));
|
||||
PyDict_SetItemString(d,"wxCURSOR_BULLSEYE", PyInt_FromLong((long) wxCURSOR_BULLSEYE));
|
||||
PyDict_SetItemString(d,"wxCURSOR_CHAR", PyInt_FromLong((long) wxCURSOR_CHAR));
|
||||
PyDict_SetItemString(d,"wxCURSOR_CROSS", PyInt_FromLong((long) wxCURSOR_CROSS));
|
||||
@@ -2490,6 +2491,11 @@ SWIGEXPORT(void) initwxc() {
|
||||
PyDict_SetItemString(d,"wxDUPLEX_SIMPLEX", PyInt_FromLong((long) wxDUPLEX_SIMPLEX));
|
||||
PyDict_SetItemString(d,"wxDUPLEX_HORIZONTAL", PyInt_FromLong((long) wxDUPLEX_HORIZONTAL));
|
||||
PyDict_SetItemString(d,"wxDUPLEX_VERTICAL", PyInt_FromLong((long) wxDUPLEX_VERTICAL));
|
||||
PyDict_SetItemString(d,"wxItem_Separator", PyInt_FromLong((long) wxItem_Separator));
|
||||
PyDict_SetItemString(d,"wxItem_Normal", PyInt_FromLong((long) wxItem_Normal));
|
||||
PyDict_SetItemString(d,"wxItem_Check", PyInt_FromLong((long) wxItem_Check));
|
||||
PyDict_SetItemString(d,"wxItem_Radio", PyInt_FromLong((long) wxItem_Radio));
|
||||
PyDict_SetItemString(d,"wxItem_Max", PyInt_FromLong((long) wxItem_Max));
|
||||
PyDict_SetItemString(d,"wxHT_NOWHERE", PyInt_FromLong((long) wxHT_NOWHERE));
|
||||
PyDict_SetItemString(d,"wxHT_SCROLLBAR_FIRST", PyInt_FromLong((long) wxHT_SCROLLBAR_FIRST));
|
||||
PyDict_SetItemString(d,"wxHT_SCROLLBAR_ARROW_LINE_1", PyInt_FromLong((long) wxHT_SCROLLBAR_ARROW_LINE_1));
|
||||
|
||||
@@ -654,6 +654,7 @@ wxBITMAP_TYPE_MACCURSOR_RESOURCE = wxc.wxBITMAP_TYPE_MACCURSOR_RESOURCE
|
||||
wxBITMAP_TYPE_ANY = wxc.wxBITMAP_TYPE_ANY
|
||||
wxCURSOR_NONE = wxc.wxCURSOR_NONE
|
||||
wxCURSOR_ARROW = wxc.wxCURSOR_ARROW
|
||||
wxCURSOR_RIGHT_ARROW = wxc.wxCURSOR_RIGHT_ARROW
|
||||
wxCURSOR_BULLSEYE = wxc.wxCURSOR_BULLSEYE
|
||||
wxCURSOR_CHAR = wxc.wxCURSOR_CHAR
|
||||
wxCURSOR_CROSS = wxc.wxCURSOR_CROSS
|
||||
@@ -751,6 +752,11 @@ wxPAPER_A3_EXTRA_TRANSVERSE = wxc.wxPAPER_A3_EXTRA_TRANSVERSE
|
||||
wxDUPLEX_SIMPLEX = wxc.wxDUPLEX_SIMPLEX
|
||||
wxDUPLEX_HORIZONTAL = wxc.wxDUPLEX_HORIZONTAL
|
||||
wxDUPLEX_VERTICAL = wxc.wxDUPLEX_VERTICAL
|
||||
wxItem_Separator = wxc.wxItem_Separator
|
||||
wxItem_Normal = wxc.wxItem_Normal
|
||||
wxItem_Check = wxc.wxItem_Check
|
||||
wxItem_Radio = wxc.wxItem_Radio
|
||||
wxItem_Max = wxc.wxItem_Max
|
||||
wxHT_NOWHERE = wxc.wxHT_NOWHERE
|
||||
wxHT_SCROLLBAR_FIRST = wxc.wxHT_SCROLLBAR_FIRST
|
||||
wxHT_SCROLLBAR_ARROW_LINE_1 = wxc.wxHT_SCROLLBAR_ARROW_LINE_1
|
||||
|
||||
+80
-7
@@ -531,8 +531,29 @@ public:
|
||||
void GetViewStart(int* OUTPUT, int* OUTPUT);
|
||||
%pragma(python) addtoclass = "ViewStart = GetViewStart"
|
||||
|
||||
void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
|
||||
void CalcUnscrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
|
||||
%name(CalcScrolledPosition1)wxPoint CalcScrolledPosition(const wxPoint& pt);
|
||||
%name(CalcScrolledPosition2)void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
|
||||
|
||||
%name(CalcUnscrolledPosition1)wxPoint CalcUnscrolledPosition(const wxPoint& pt);
|
||||
%name(CalcUnscrolledPosition2)void CalcUnscrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
|
||||
|
||||
%pragma(python) addtoclass = "
|
||||
def CalcScrolledPosition(self, *args):
|
||||
if len(args) == 1:
|
||||
return apply(self.CalcScrolledPosition1, args)
|
||||
elif len(args) == 2:
|
||||
return apply(self.CalcScrolledPosition2, args)
|
||||
else:
|
||||
raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed'
|
||||
|
||||
def CalcUnscrolledPosition(self, *args):
|
||||
if len(args) == 1:
|
||||
return apply(self.CalcUnscrolledPosition1, args)
|
||||
elif len(args) == 2:
|
||||
return apply(self.CalcUnscrolledPosition2, args)
|
||||
else:
|
||||
raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed'
|
||||
"
|
||||
|
||||
void SetScale(double xs, double ys);
|
||||
double GetScaleX();
|
||||
@@ -554,12 +575,59 @@ public:
|
||||
|
||||
void Append(int id, const wxString& item,
|
||||
const wxString& helpString = wxEmptyString,
|
||||
int checkable = FALSE);
|
||||
wxItemKind kind = wxItem_Normal);
|
||||
%name(AppendMenu)void Append(int id, const wxString& item, wxMenu *subMenu,
|
||||
const wxString& helpString = wxEmptyString);
|
||||
const wxString& helpString = wxEmptyString);
|
||||
%name(AppendItem)void Append(const wxMenuItem* item);
|
||||
|
||||
void AppendCheckItem(int id,
|
||||
const wxString& text,
|
||||
const wxString& help = wxEmptyString);
|
||||
void AppendRadioItem(int id,
|
||||
const wxString& text,
|
||||
const wxString& help = wxEmptyString);
|
||||
void AppendSeparator();
|
||||
|
||||
|
||||
void Insert(size_t pos,
|
||||
int id,
|
||||
const wxString& text,
|
||||
const wxString& help = wxEmptyString,
|
||||
wxItemKind kind = wxItem_Normal);
|
||||
void InsertSeparator(size_t pos);
|
||||
void InsertCheckItem(size_t pos,
|
||||
int id,
|
||||
const wxString& text,
|
||||
const wxString& help = wxEmptyString);
|
||||
void InsertRadioItem(size_t pos,
|
||||
int id,
|
||||
const wxString& text,
|
||||
const wxString& help = wxEmptyString);
|
||||
%name(InsertMenu)void Insert(size_t pos,
|
||||
int id,
|
||||
const wxString& text,
|
||||
wxMenu *submenu,
|
||||
const wxString& help = wxEmptyString);
|
||||
%name(InsertItem)bool Insert(size_t pos, wxMenuItem *item);
|
||||
|
||||
|
||||
void Prepend(int id,
|
||||
const wxString& text,
|
||||
const wxString& help = wxEmptyString,
|
||||
wxItemKind kind = wxItem_Normal);
|
||||
void PrependSeparator();
|
||||
void PrependCheckItem(int id,
|
||||
const wxString& text,
|
||||
const wxString& help = wxEmptyString);
|
||||
void PrependRadioItem(int id,
|
||||
const wxString& text,
|
||||
const wxString& help = wxEmptyString);
|
||||
%name(PrependMenu)void Prepend(int id,
|
||||
const wxString& text,
|
||||
wxMenu *submenu,
|
||||
const wxString& help = wxEmptyString);
|
||||
%name(PrependItem)void Prepend(wxMenuItem *item);
|
||||
|
||||
|
||||
void Break();
|
||||
void Check(int id, bool flag);
|
||||
bool IsChecked(int id);
|
||||
@@ -581,10 +649,12 @@ public:
|
||||
|
||||
bool Delete(int id);
|
||||
%name(DeleteItem)bool Delete(wxMenuItem *item);
|
||||
bool Insert(size_t pos, wxMenuItem *item);
|
||||
wxMenuItem *Remove(int id);
|
||||
%name(RemoveItem) wxMenuItem *Remove(wxMenuItem *item);
|
||||
|
||||
|
||||
|
||||
|
||||
%addmethods {
|
||||
void Destroy() { delete self; }
|
||||
}
|
||||
@@ -656,7 +726,8 @@ public:
|
||||
wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_SEPARATOR,
|
||||
const wxString& text = wxEmptyString,
|
||||
const wxString& help = wxEmptyString,
|
||||
bool isCheckable = FALSE, wxMenu* subMenu = NULL);
|
||||
wxItemKind kind = wxItem_Normal,
|
||||
wxMenu* subMenu = NULL);
|
||||
|
||||
|
||||
wxMenu *GetMenu();
|
||||
@@ -666,6 +737,7 @@ public:
|
||||
void SetText(const wxString& str);
|
||||
wxString GetLabel();
|
||||
const wxString& GetText();
|
||||
wxItemKind GetKind();
|
||||
void SetCheckable(bool checkable);
|
||||
bool IsCheckable();
|
||||
bool IsSubMenu();
|
||||
@@ -682,6 +754,7 @@ public:
|
||||
void SetAccel(wxAcceleratorEntry *accel);
|
||||
|
||||
static wxString GetLabelFromText(const wxString& text);
|
||||
// static wxAcceleratorEntry *GetAccelFromString(const wxString& label);
|
||||
|
||||
// wxOwnerDrawn methods
|
||||
#ifdef __WXMSW__
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
%module wx
|
||||
|
||||
|
||||
%{
|
||||
#include "helpers.h"
|
||||
%}
|
||||
|
||||
Reference in New Issue
Block a user