mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-10 12:22:43 +08:00
Lots of little bug fixes, API updates, etc.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -108,7 +108,7 @@ public:
|
||||
|
||||
%addtofunc wxPyArtProvider "self._setCallbackInfo(self, ArtProvider)"
|
||||
wxPyArtProvider();
|
||||
~wxPyArtProvider();
|
||||
// ~wxPyArtProvider();
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ public:
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
void SetSelection(int n);
|
||||
%name(SetMark) virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
||||
|
||||
+2
-2
@@ -513,13 +513,13 @@ public:
|
||||
raise ValueError('textlist and coords must have same length')
|
||||
if foregrounds is None:
|
||||
foregrounds = []
|
||||
elif isinstance(foregrounds, wxColour):
|
||||
elif isinstance(foregrounds, wx.Colour):
|
||||
foregrounds = [foregrounds]
|
||||
elif len(foregrounds) != len(coords):
|
||||
raise ValueError('foregrounds and coords must have same length')
|
||||
if backgrounds is None:
|
||||
backgrounds = []
|
||||
elif isinstance(backgrounds, wxColour):
|
||||
elif isinstance(backgrounds, wx.Colour):
|
||||
backgrounds = [backgrounds]
|
||||
elif len(backgrounds) != len(coords):
|
||||
raise ValueError('backgrounds and coords must have same length')
|
||||
|
||||
+3
-1
@@ -121,7 +121,9 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyDropTarget, wxDropTarget, OnDrop);
|
||||
%name(DropTarget) class wxPyDropTarget // : public wxDropTarget
|
||||
{
|
||||
public:
|
||||
%addtofunc wxPyDropTarget "if args: args[1].thisown = 0; self._setCallbackInfo(self, DropTarget)"
|
||||
%addtofunc wxPyDropTarget
|
||||
"if args: args[0].thisown = 0;
|
||||
self._setCallbackInfo(self, DropTarget)"
|
||||
|
||||
wxPyDropTarget(wxDataObject *dataObject = NULL);
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
@@ -376,7 +376,7 @@ public:
|
||||
class wxPreviewCanvas: public wxScrolledWindow
|
||||
{
|
||||
public:
|
||||
%addtofunc wxPreviewCanvas "self._self._setOORInfo(self)"
|
||||
%addtofunc wxPreviewCanvas "self._setOORInfo(self)"
|
||||
|
||||
wxPreviewCanvas(wxPrintPreview *preview,
|
||||
wxWindow *parent,
|
||||
@@ -389,7 +389,7 @@ public:
|
||||
|
||||
class wxPreviewFrame : public wxFrame {
|
||||
public:
|
||||
%addtofunc wxPreviewFrame "self._self._setOORInfo(self)"
|
||||
%addtofunc wxPreviewFrame "self._setOORInfo(self)"
|
||||
|
||||
wxPreviewFrame(wxPrintPreview* preview, wxFrame* parent, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
@@ -429,7 +429,7 @@ enum {
|
||||
class wxPreviewControlBar: public wxPanel
|
||||
{
|
||||
public:
|
||||
%addtofunc wxPreviewControlBar "self._self._setOORInfo(self)"
|
||||
%addtofunc wxPreviewControlBar "self._setOORInfo(self)"
|
||||
|
||||
wxPreviewControlBar(wxPrintPreview *preview,
|
||||
long buttons,
|
||||
|
||||
@@ -35,11 +35,10 @@ public:
|
||||
|
||||
%extend {
|
||||
wxTipWindow(wxWindow *parent,
|
||||
const wxString* text,
|
||||
const wxString& text,
|
||||
wxCoord maxLength = 100,
|
||||
wxRect* rectBound = NULL) {
|
||||
wxString tmp = *text;
|
||||
return new wxTipWindow(parent, tmp, maxLength, NULL, rectBound);
|
||||
return new wxTipWindow(parent, text, maxLength, NULL, rectBound);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -762,13 +762,13 @@ def DLG_PNT(win, point_or_x, y=None):
|
||||
if y is None:
|
||||
return win.ConvertDialogPointToPixels(point_or_x)
|
||||
else:
|
||||
return win.ConvertDialogPointToPixels(wxPoint(point_or_x, y))
|
||||
return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
|
||||
|
||||
def DLG_SZE(win, size_width, height=None):
|
||||
if height is None:
|
||||
return win.ConvertDialogSizeToPixels(size_width)
|
||||
else:
|
||||
return win.ConvertDialogSizeToPixels(wxSize(size_width, height))
|
||||
return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ PyObject* wxPyDrawTextList(wxDC& dc, PyObject* textList, PyObject* pyPoints, PyO
|
||||
else {
|
||||
obj = PySequence_GetItem(foregroundList, i);
|
||||
}
|
||||
if (! wxPyConvertSwigPtr(obj, (void **) &color, wxT("wxColour_p"))) {
|
||||
if (! wxPyConvertSwigPtr(obj, (void **) &color, wxT("wxColour"))) {
|
||||
if (!isFastForeground)
|
||||
Py_DECREF(obj);
|
||||
goto err2;
|
||||
|
||||
@@ -334,6 +334,10 @@ class ComboBox(core.Control,core.ItemContainer):
|
||||
"""Replace(long from, long to, wxString value)"""
|
||||
return _controls.ComboBox_Replace(*args, **kwargs)
|
||||
|
||||
def SetSelection(*args, **kwargs):
|
||||
"""SetSelection(int n)"""
|
||||
return _controls.ComboBox_SetSelection(*args, **kwargs)
|
||||
|
||||
def SetMark(*args, **kwargs):
|
||||
"""SetMark(long from, long to)"""
|
||||
return _controls.ComboBox_SetMark(*args, **kwargs)
|
||||
|
||||
@@ -2855,6 +2855,31 @@ static PyObject *_wrap_ComboBox_Replace(PyObject *self, PyObject *args, PyObject
|
||||
}
|
||||
|
||||
|
||||
static PyObject *_wrap_ComboBox_SetSelection(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj;
|
||||
wxComboBox *arg1 = (wxComboBox *) 0 ;
|
||||
int arg2 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
char *kwnames[] = {
|
||||
(char *) "self",(char *) "n", NULL
|
||||
};
|
||||
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"Oi:ComboBox_SetSelection",kwnames,&obj0,&arg2)) goto fail;
|
||||
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxComboBox,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
(arg1)->SetSelection(arg2);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) SWIG_fail;
|
||||
}
|
||||
Py_INCREF(Py_None); resultobj = Py_None;
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static PyObject *_wrap_ComboBox_SetMark(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj;
|
||||
wxComboBox *arg1 = (wxComboBox *) 0 ;
|
||||
@@ -25790,6 +25815,7 @@ static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"ComboBox_GetInsertionPoint", (PyCFunction) _wrap_ComboBox_GetInsertionPoint, METH_VARARGS | METH_KEYWORDS },
|
||||
{ (char *)"ComboBox_GetLastPosition", (PyCFunction) _wrap_ComboBox_GetLastPosition, METH_VARARGS | METH_KEYWORDS },
|
||||
{ (char *)"ComboBox_Replace", (PyCFunction) _wrap_ComboBox_Replace, METH_VARARGS | METH_KEYWORDS },
|
||||
{ (char *)"ComboBox_SetSelection", (PyCFunction) _wrap_ComboBox_SetSelection, METH_VARARGS | METH_KEYWORDS },
|
||||
{ (char *)"ComboBox_SetMark", (PyCFunction) _wrap_ComboBox_SetMark, METH_VARARGS | METH_KEYWORDS },
|
||||
{ (char *)"ComboBox_SetEditable", (PyCFunction) _wrap_ComboBox_SetEditable, METH_VARARGS | METH_KEYWORDS },
|
||||
{ (char *)"ComboBox_SetInsertionPointEnd", (PyCFunction) _wrap_ComboBox_SetInsertionPointEnd, METH_VARARGS | METH_KEYWORDS },
|
||||
|
||||
@@ -5827,13 +5827,13 @@ def DLG_PNT(win, point_or_x, y=None):
|
||||
if y is None:
|
||||
return win.ConvertDialogPointToPixels(point_or_x)
|
||||
else:
|
||||
return win.ConvertDialogPointToPixels(wxPoint(point_or_x, y))
|
||||
return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
|
||||
|
||||
def DLG_SZE(win, size_width, height=None):
|
||||
if height is None:
|
||||
return win.ConvertDialogSizeToPixels(size_width)
|
||||
else:
|
||||
return win.ConvertDialogSizeToPixels(wxSize(size_width, height))
|
||||
return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
|
||||
|
||||
|
||||
def FindWindowById(*args, **kwargs):
|
||||
|
||||
@@ -2584,13 +2584,13 @@ Get the DC size in milimeters."""
|
||||
raise ValueError('textlist and coords must have same length')
|
||||
if foregrounds is None:
|
||||
foregrounds = []
|
||||
elif isinstance(foregrounds, wxColour):
|
||||
elif isinstance(foregrounds, wx.Colour):
|
||||
foregrounds = [foregrounds]
|
||||
elif len(foregrounds) != len(coords):
|
||||
raise ValueError('foregrounds and coords must have same length')
|
||||
if backgrounds is None:
|
||||
backgrounds = []
|
||||
elif isinstance(backgrounds, wxColour):
|
||||
elif isinstance(backgrounds, wx.Colour):
|
||||
backgrounds = [backgrounds]
|
||||
elif len(backgrounds) != len(coords):
|
||||
raise ValueError('backgrounds and coords must have same length')
|
||||
|
||||
@@ -372,15 +372,17 @@ public:
|
||||
|
||||
// First, make a new instance of the tag handler
|
||||
wxPyBeginBlockThreads();
|
||||
PyObject* arg = Py_BuildValue("()");
|
||||
PyObject* obj = PyInstance_New(m_tagHandlerClass, arg, NULL);
|
||||
PyObject* arg = PyTuple_New(0);
|
||||
PyObject* obj = PyObject_CallObject(m_tagHandlerClass, arg);
|
||||
Py_DECREF(arg);
|
||||
wxPyEndBlockThreads();
|
||||
|
||||
|
||||
// now figure out where it's C++ object is...
|
||||
wxPyHtmlWinTagHandler* thPtr;
|
||||
if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler")))
|
||||
if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler"))) {
|
||||
wxPyEndBlockThreads();
|
||||
return;
|
||||
}
|
||||
wxPyEndBlockThreads();
|
||||
|
||||
// add it,
|
||||
parser->AddTagHandler(thPtr);
|
||||
|
||||
@@ -2302,12 +2302,6 @@ class ArtProvider(object):
|
||||
del newobj.thisown
|
||||
self._setCallbackInfo(self, ArtProvider)
|
||||
|
||||
def __del__(self, destroy=_misc.delete_ArtProvider):
|
||||
"""__del__()"""
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
|
||||
def _setCallbackInfo(*args, **kwargs):
|
||||
"""_setCallbackInfo(PyObject self, PyObject _class)"""
|
||||
return _misc.ArtProvider__setCallbackInfo(*args, **kwargs)
|
||||
@@ -4372,7 +4366,8 @@ class DropTarget(object):
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
del newobj.thisown
|
||||
if args: args[1].thisown = 0; self._setCallbackInfo(self, DropTarget)
|
||||
if args: args[0].thisown = 0;
|
||||
self._setCallbackInfo(self, DropTarget)
|
||||
|
||||
def _setCallbackInfo(*args, **kwargs):
|
||||
"""_setCallbackInfo(PyObject self, PyObject _class)"""
|
||||
|
||||
@@ -12840,30 +12840,6 @@ static PyObject *_wrap_new_ArtProvider(PyObject *self, PyObject *args, PyObject
|
||||
}
|
||||
|
||||
|
||||
static PyObject *_wrap_delete_ArtProvider(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj;
|
||||
wxPyArtProvider *arg1 = (wxPyArtProvider *) 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
char *kwnames[] = {
|
||||
(char *) "self", NULL
|
||||
};
|
||||
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:delete_ArtProvider",kwnames,&obj0)) goto fail;
|
||||
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPyArtProvider,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
delete arg1;
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) SWIG_fail;
|
||||
}
|
||||
Py_INCREF(Py_None); resultobj = Py_None;
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static PyObject *_wrap_ArtProvider__setCallbackInfo(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj;
|
||||
wxPyArtProvider *arg1 = (wxPyArtProvider *) 0 ;
|
||||
@@ -24689,7 +24665,6 @@ static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"delete_MimeTypesManager", (PyCFunction) _wrap_delete_MimeTypesManager, METH_VARARGS | METH_KEYWORDS },
|
||||
{ (char *)"MimeTypesManager_swigregister", MimeTypesManager_swigregister, METH_VARARGS },
|
||||
{ (char *)"new_ArtProvider", (PyCFunction) _wrap_new_ArtProvider, METH_VARARGS | METH_KEYWORDS },
|
||||
{ (char *)"delete_ArtProvider", (PyCFunction) _wrap_delete_ArtProvider, METH_VARARGS | METH_KEYWORDS },
|
||||
{ (char *)"ArtProvider__setCallbackInfo", (PyCFunction) _wrap_ArtProvider__setCallbackInfo, METH_VARARGS | METH_KEYWORDS },
|
||||
{ (char *)"ArtProvider_PushProvider", (PyCFunction) _wrap_ArtProvider_PushProvider, METH_VARARGS | METH_KEYWORDS },
|
||||
{ (char *)"ArtProvider_PopProvider", (PyCFunction) _wrap_ArtProvider_PopProvider, METH_VARARGS | METH_KEYWORDS },
|
||||
|
||||
@@ -3388,7 +3388,7 @@ class PreviewCanvas(ScrolledWindow):
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
del newobj.thisown
|
||||
self._self._setOORInfo(self)
|
||||
self._setOORInfo(self)
|
||||
|
||||
|
||||
class PreviewCanvasPtr(PreviewCanvas):
|
||||
@@ -3410,7 +3410,7 @@ class PreviewFrame(Frame):
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
del newobj.thisown
|
||||
self._self._setOORInfo(self)
|
||||
self._setOORInfo(self)
|
||||
|
||||
def Initialize(*args, **kwargs):
|
||||
"""Initialize()"""
|
||||
@@ -3464,7 +3464,7 @@ class PreviewControlBar(Panel):
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
del newobj.thisown
|
||||
self._self._setOORInfo(self)
|
||||
self._setOORInfo(self)
|
||||
|
||||
def GetZoomControl(*args, **kwargs):
|
||||
"""GetZoomControl() -> int"""
|
||||
|
||||
@@ -405,9 +405,8 @@ IMP_PYCALLBACK_BOOL_(wxPyPopupTransientWindow, wxPopupTransientWindow, CanDismis
|
||||
|
||||
#include <wx/tipwin.h>
|
||||
|
||||
wxTipWindow *new_wxTipWindow(wxWindow *parent,wxString const *text,int maxLength,wxRect *rectBound){
|
||||
wxString tmp = *text;
|
||||
return new wxTipWindow(parent, tmp, maxLength, NULL, rectBound);
|
||||
wxTipWindow *new_wxTipWindow(wxWindow *parent,wxString const &text,int maxLength,wxRect *rectBound){
|
||||
return new wxTipWindow(parent, text, maxLength, NULL, rectBound);
|
||||
}
|
||||
|
||||
#include <wx/tipwin.h>
|
||||
@@ -7862,10 +7861,11 @@ static PyObject * PopupTransientWindow_swigregister(PyObject *self, PyObject *ar
|
||||
static PyObject *_wrap_new_TipWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj;
|
||||
wxWindow *arg1 = (wxWindow *) 0 ;
|
||||
wxString *arg2 = (wxString *) 0 ;
|
||||
wxString *arg2 = 0 ;
|
||||
int arg3 = (int) 100 ;
|
||||
wxRect *arg4 = (wxRect *) NULL ;
|
||||
wxTipWindow *result;
|
||||
bool temp2 = False ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
PyObject * obj3 = 0 ;
|
||||
@@ -7875,20 +7875,32 @@ static PyObject *_wrap_new_TipWindow(PyObject *self, PyObject *args, PyObject *k
|
||||
|
||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|iO:new_TipWindow",kwnames,&obj0,&obj1,&arg3,&obj3)) goto fail;
|
||||
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
||||
if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxString,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
||||
{
|
||||
arg2 = wxString_in_helper(obj1);
|
||||
if (arg2 == NULL) SWIG_fail;
|
||||
temp2 = True;
|
||||
}
|
||||
if (obj3) {
|
||||
if ((SWIG_ConvertPtr(obj3,(void **) &arg4, SWIGTYPE_p_wxRect,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
||||
}
|
||||
{
|
||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||
result = (wxTipWindow *)new_wxTipWindow(arg1,(wxString const *)arg2,arg3,arg4);
|
||||
result = (wxTipWindow *)new_wxTipWindow(arg1,(wxString const &)*arg2,arg3,arg4);
|
||||
|
||||
wxPyEndAllowThreads(__tstate);
|
||||
if (PyErr_Occurred()) SWIG_fail;
|
||||
}
|
||||
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxTipWindow, 1);
|
||||
{
|
||||
if (temp2)
|
||||
delete arg2;
|
||||
}
|
||||
return resultobj;
|
||||
fail:
|
||||
{
|
||||
if (temp2)
|
||||
delete arg2;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user