Various small fixes and tweaks
Added wxIntersectRect helper function git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
b47c832e55
commit
eb7159455d
@ -63,6 +63,14 @@ Added wxPython.lib.filebrowsebutton also from Mike Fletcher.
|
|||||||
Renamed wxTreeCtrl.GetParent to GetItemParent to avoid a name clash
|
Renamed wxTreeCtrl.GetParent to GetItemParent to avoid a name clash
|
||||||
with wxWindow.GetParent.
|
with wxWindow.GetParent.
|
||||||
|
|
||||||
|
Added wxIntersectRect to computer the intersection of two wxRect's.
|
||||||
|
It is used like this:
|
||||||
|
|
||||||
|
intersect = wxIntersectRect(rect1, rect2)
|
||||||
|
|
||||||
|
If r1 and r2 don't intersect then None is returned, otherwise the
|
||||||
|
rectangle representing the intersection is returned.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
What's new in 2.1.11
|
What's new in 2.1.11
|
||||||
|
@ -152,6 +152,9 @@ def EVT_IDLE(win, func):
|
|||||||
def EVT_UPDATE_UI(win, id, func):
|
def EVT_UPDATE_UI(win, id, func):
|
||||||
win.Connect(id, -1, wxEVT_UPDATE_UI, func)
|
win.Connect(id, -1, wxEVT_UPDATE_UI, func)
|
||||||
|
|
||||||
|
def EVT_UPDATE_UI_RANGE(win, id, id2, func):
|
||||||
|
win.Connect(id, id2, wxEVT_UPDATE_UI, func)
|
||||||
|
|
||||||
|
|
||||||
# Mouse Events
|
# Mouse Events
|
||||||
def EVT_LEFT_DOWN(win, func):
|
def EVT_LEFT_DOWN(win, func):
|
||||||
|
@ -388,7 +388,7 @@ public:
|
|||||||
|
|
||||||
wxTreeItemId GetRootItem();
|
wxTreeItemId GetRootItem();
|
||||||
wxTreeItemId GetSelection();
|
wxTreeItemId GetSelection();
|
||||||
wxTreeItemId GetParent(const wxTreeItemId& item);
|
%name(GetItemParent) wxTreeItemId GetParent(const wxTreeItemId& item);
|
||||||
//size_t GetSelections(wxArrayTreeItemIds& selection);
|
//size_t GetSelections(wxArrayTreeItemIds& selection);
|
||||||
%addmethods {
|
%addmethods {
|
||||||
PyObject* GetSelections() {
|
PyObject* GetSelections() {
|
||||||
|
@ -92,7 +92,7 @@ wxBitmap* wxNoRefBitmap(char* name, long flags);
|
|||||||
class wxMask {
|
class wxMask {
|
||||||
public:
|
public:
|
||||||
wxMask(const wxBitmap& bitmap);
|
wxMask(const wxBitmap& bitmap);
|
||||||
~wxMask();
|
//~wxMask();
|
||||||
};
|
};
|
||||||
|
|
||||||
%new wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour);
|
%new wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour);
|
||||||
|
@ -114,29 +114,35 @@ public:
|
|||||||
|
|
||||||
class wxRect {
|
class wxRect {
|
||||||
public:
|
public:
|
||||||
wxRect(long x=0, long y=0, long w=0, long h=0);
|
wxRect(int x=0, int y=0, int w=0, int h=0);
|
||||||
// TODO: do this one too... wxRect(const wxPoint& pos, const wxSize& size);
|
// TODO: do this one too... wxRect(const wxPoint& pos, const wxSize& size);
|
||||||
~wxRect();
|
~wxRect();
|
||||||
|
|
||||||
long GetX();
|
int GetX();
|
||||||
void SetX(long X);
|
void SetX(int X);
|
||||||
long GetY();
|
int GetY();
|
||||||
void SetY(long Y);
|
void SetY(int Y);
|
||||||
long GetWidth();
|
int GetWidth();
|
||||||
void SetWidth(long w);
|
void SetWidth(int w);
|
||||||
long GetHeight();
|
int GetHeight();
|
||||||
void SetHeight(long h);
|
void SetHeight(int h);
|
||||||
|
|
||||||
|
|
||||||
wxPoint GetPosition();
|
wxPoint GetPosition();
|
||||||
wxSize GetSize();
|
wxSize GetSize();
|
||||||
|
|
||||||
long GetLeft();
|
int GetLeft();
|
||||||
long GetTop();
|
int GetTop();
|
||||||
long GetBottom();
|
int GetBottom();
|
||||||
long GetRight();
|
int GetRight();
|
||||||
|
|
||||||
long x, y, width, height;
|
void SetLeft(int left);
|
||||||
|
void SetRight(int right);
|
||||||
|
void SetTop(int top);
|
||||||
|
void SetBottom(int bottom);
|
||||||
|
|
||||||
|
|
||||||
|
int x, y, width, height;
|
||||||
|
|
||||||
%addmethods {
|
%addmethods {
|
||||||
PyObject* asTuple() {
|
PyObject* asTuple() {
|
||||||
@ -153,6 +159,44 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// %inline %{
|
||||||
|
// bool wxIntersectRect(wxRect* dest, wxRect* r1, wxRect* r2) {
|
||||||
|
// wxRegion reg1(*r1);
|
||||||
|
// wxRegion reg2(*r2);
|
||||||
|
// bool success;
|
||||||
|
// *dest = wxRect(0,0,0,0);
|
||||||
|
// success = reg1.Intersect(reg2);
|
||||||
|
// if (success) {
|
||||||
|
// *dest = reg1.GetBox();
|
||||||
|
// return *dest != wxRect(0,0,0,0);
|
||||||
|
// }
|
||||||
|
// return FALSE;
|
||||||
|
// }
|
||||||
|
// %}
|
||||||
|
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
PyObject* wxIntersectRect(wxRect* r1, wxRect* r2) {
|
||||||
|
wxRegion reg1(*r1);
|
||||||
|
wxRegion reg2(*r2);
|
||||||
|
wxRect dest(0,0,0,0);
|
||||||
|
PyObject* obj;
|
||||||
|
|
||||||
|
reg1.Intersect(reg2);
|
||||||
|
dest = reg1.GetBox();
|
||||||
|
|
||||||
|
if (dest != wxRect(0,0,0,0)) {
|
||||||
|
bool doSave = wxPyRestoreThread();
|
||||||
|
wxRect* newRect = new wxRect(dest);
|
||||||
|
obj = wxPyConstructObject((void*)newRect, "wxRect");
|
||||||
|
PyObject_SetAttrString(obj, "thisown", PyInt_FromLong(1));
|
||||||
|
wxPySaveThread(doSave);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@ -166,7 +210,7 @@ void wxRegisterId(long id);
|
|||||||
void wxBell();
|
void wxBell();
|
||||||
void wxDisplaySize(int *OUTPUT, int *OUTPUT);
|
void wxDisplaySize(int *OUTPUT, int *OUTPUT);
|
||||||
void wxEndBusyCursor();
|
void wxEndBusyCursor();
|
||||||
long wxExecute(const wxString& command, bool sync = FALSE);
|
long wxExecute(const wxString& command, int sync = FALSE);
|
||||||
long wxGetElapsedTime(bool resetTimer = TRUE);
|
long wxGetElapsedTime(bool resetTimer = TRUE);
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
long wxGetFreeMemory();
|
long wxGetFreeMemory();
|
||||||
@ -272,13 +316,27 @@ public:
|
|||||||
wxRegionContain Contains(long x, long y);
|
wxRegionContain Contains(long x, long y);
|
||||||
%name(ContainsPoint)wxRegionContain Contains(const wxPoint& pt);
|
%name(ContainsPoint)wxRegionContain Contains(const wxPoint& pt);
|
||||||
%name(ContainsRect)wxRegionContain Contains(const wxRect& rect);
|
%name(ContainsRect)wxRegionContain Contains(const wxRect& rect);
|
||||||
|
%name(ContainsRectDim)wxRegionContain Contains(long x, long y, long w, long h);
|
||||||
|
|
||||||
wxRect GetBox();
|
wxRect GetBox();
|
||||||
bool Intersect(const wxRect& rect);
|
|
||||||
|
bool Intersect(long x, long y, long width, long height);
|
||||||
|
%name(IntersectRect)bool Intersect(const wxRect& rect);
|
||||||
|
%name(IntersectRegion)bool Intersect(const wxRegion& region);
|
||||||
|
|
||||||
bool IsEmpty();
|
bool IsEmpty();
|
||||||
bool Subtract(const wxRect& rect);
|
|
||||||
bool Union(const wxRect& rect);
|
bool Union(long x, long y, long width, long height);
|
||||||
bool Xor(const wxRect& rect);
|
%name(UnionRect)bool Union(const wxRect& rect);
|
||||||
|
%name(UnionRegion)bool Union(const wxRegion& region);
|
||||||
|
|
||||||
|
bool Subtract(long x, long y, long width, long height);
|
||||||
|
%name(SubtractRect)bool Subtract(const wxRect& rect);
|
||||||
|
%name(SubtractRegion)bool Subtract(const wxRegion& region);
|
||||||
|
|
||||||
|
bool Xor(long x, long y, long width, long height);
|
||||||
|
%name(XorRect)bool Xor(const wxRect& rect);
|
||||||
|
%name(XorRegion)bool Xor(const wxRegion& region);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -4429,8 +4429,8 @@ static PyObject *_wrap_wxTreeCtrl_GetSelection(PyObject *self, PyObject *args, P
|
|||||||
return _resultobj;
|
return _resultobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define wxTreeCtrl_GetParent(_swigobj,_swigarg0) (_swigobj->GetParent(_swigarg0))
|
#define wxTreeCtrl_GetItemParent(_swigobj,_swigarg0) (_swigobj->GetParent(_swigarg0))
|
||||||
static PyObject *_wrap_wxTreeCtrl_GetParent(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_wxTreeCtrl_GetItemParent(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
wxTreeItemId * _result;
|
wxTreeItemId * _result;
|
||||||
wxTreeCtrl * _arg0;
|
wxTreeCtrl * _arg0;
|
||||||
@ -4441,25 +4441,25 @@ static PyObject *_wrap_wxTreeCtrl_GetParent(PyObject *self, PyObject *args, PyOb
|
|||||||
char _ptemp[128];
|
char _ptemp[128];
|
||||||
|
|
||||||
self = self;
|
self = self;
|
||||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxTreeCtrl_GetParent",_kwnames,&_argo0,&_argo1))
|
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxTreeCtrl_GetItemParent",_kwnames,&_argo0,&_argo1))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (_argo0) {
|
if (_argo0) {
|
||||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTreeCtrl_p")) {
|
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTreeCtrl_p")) {
|
||||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTreeCtrl_GetParent. Expected _wxTreeCtrl_p.");
|
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTreeCtrl_GetItemParent. Expected _wxTreeCtrl_p.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_argo1) {
|
if (_argo1) {
|
||||||
if (_argo1 == Py_None) { _arg1 = NULL; }
|
if (_argo1 == Py_None) { _arg1 = NULL; }
|
||||||
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTreeItemId_p")) {
|
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTreeItemId_p")) {
|
||||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTreeCtrl_GetParent. Expected _wxTreeItemId_p.");
|
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTreeCtrl_GetItemParent. Expected _wxTreeItemId_p.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
wxPy_BEGIN_ALLOW_THREADS;
|
wxPy_BEGIN_ALLOW_THREADS;
|
||||||
_result = new wxTreeItemId (wxTreeCtrl_GetParent(_arg0,*_arg1));
|
_result = new wxTreeItemId (wxTreeCtrl_GetItemParent(_arg0,*_arg1));
|
||||||
|
|
||||||
wxPy_END_ALLOW_THREADS;
|
wxPy_END_ALLOW_THREADS;
|
||||||
} SWIG_MakePtr(_ptemp, (void *) _result,"_wxTreeItemId_p");
|
} SWIG_MakePtr(_ptemp, (void *) _result,"_wxTreeItemId_p");
|
||||||
@ -5898,7 +5898,7 @@ static PyMethodDef controls2cMethods[] = {
|
|||||||
{ "wxTreeCtrl_GetFirstChild", (PyCFunction) _wrap_wxTreeCtrl_GetFirstChild, METH_VARARGS | METH_KEYWORDS },
|
{ "wxTreeCtrl_GetFirstChild", (PyCFunction) _wrap_wxTreeCtrl_GetFirstChild, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxTreeCtrl_GetChildrenCount", (PyCFunction) _wrap_wxTreeCtrl_GetChildrenCount, METH_VARARGS | METH_KEYWORDS },
|
{ "wxTreeCtrl_GetChildrenCount", (PyCFunction) _wrap_wxTreeCtrl_GetChildrenCount, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxTreeCtrl_GetSelections", (PyCFunction) _wrap_wxTreeCtrl_GetSelections, METH_VARARGS | METH_KEYWORDS },
|
{ "wxTreeCtrl_GetSelections", (PyCFunction) _wrap_wxTreeCtrl_GetSelections, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxTreeCtrl_GetParent", (PyCFunction) _wrap_wxTreeCtrl_GetParent, METH_VARARGS | METH_KEYWORDS },
|
{ "wxTreeCtrl_GetItemParent", (PyCFunction) _wrap_wxTreeCtrl_GetItemParent, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxTreeCtrl_GetSelection", (PyCFunction) _wrap_wxTreeCtrl_GetSelection, METH_VARARGS | METH_KEYWORDS },
|
{ "wxTreeCtrl_GetSelection", (PyCFunction) _wrap_wxTreeCtrl_GetSelection, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxTreeCtrl_GetRootItem", (PyCFunction) _wrap_wxTreeCtrl_GetRootItem, METH_VARARGS | METH_KEYWORDS },
|
{ "wxTreeCtrl_GetRootItem", (PyCFunction) _wrap_wxTreeCtrl_GetRootItem, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxTreeCtrl_IsSelected", (PyCFunction) _wrap_wxTreeCtrl_IsSelected, METH_VARARGS | METH_KEYWORDS },
|
{ "wxTreeCtrl_IsSelected", (PyCFunction) _wrap_wxTreeCtrl_IsSelected, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
@ -476,8 +476,8 @@ class wxTreeCtrlPtr(wxControlPtr):
|
|||||||
val = apply(controls2c.wxTreeCtrl_GetSelection,(self,) + _args, _kwargs)
|
val = apply(controls2c.wxTreeCtrl_GetSelection,(self,) + _args, _kwargs)
|
||||||
if val: val = wxTreeItemIdPtr(val) ; val.thisown = 1
|
if val: val = wxTreeItemIdPtr(val) ; val.thisown = 1
|
||||||
return val
|
return val
|
||||||
def GetParent(self, *_args, **_kwargs):
|
def GetItemParent(self, *_args, **_kwargs):
|
||||||
val = apply(controls2c.wxTreeCtrl_GetParent,(self,) + _args, _kwargs)
|
val = apply(controls2c.wxTreeCtrl_GetItemParent,(self,) + _args, _kwargs)
|
||||||
if val: val = wxTreeItemIdPtr(val) ; val.thisown = 1
|
if val: val = wxTreeItemIdPtr(val) ; val.thisown = 1
|
||||||
return val
|
return val
|
||||||
def GetSelections(self, *_args, **_kwargs):
|
def GetSelections(self, *_args, **_kwargs):
|
||||||
|
@ -1637,33 +1637,6 @@ static PyObject *_wrap_new_wxMask(PyObject *self, PyObject *args, PyObject *kwar
|
|||||||
return _resultobj;
|
return _resultobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define delete_wxMask(_swigobj) (delete _swigobj)
|
|
||||||
static PyObject *_wrap_delete_wxMask(PyObject *self, PyObject *args, PyObject *kwargs) {
|
|
||||||
PyObject * _resultobj;
|
|
||||||
wxMask * _arg0;
|
|
||||||
PyObject * _argo0 = 0;
|
|
||||||
char *_kwnames[] = { "self", NULL };
|
|
||||||
|
|
||||||
self = self;
|
|
||||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxMask",_kwnames,&_argo0))
|
|
||||||
return NULL;
|
|
||||||
if (_argo0) {
|
|
||||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
|
||||||
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMask_p")) {
|
|
||||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxMask. Expected _wxMask_p.");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
|
||||||
wxPy_BEGIN_ALLOW_THREADS;
|
|
||||||
delete_wxMask(_arg0);
|
|
||||||
|
|
||||||
wxPy_END_ALLOW_THREADS;
|
|
||||||
} Py_INCREF(Py_None);
|
|
||||||
_resultobj = Py_None;
|
|
||||||
return _resultobj;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void *SwigwxIconTowxBitmap(void *ptr) {
|
static void *SwigwxIconTowxBitmap(void *ptr) {
|
||||||
wxIcon *src;
|
wxIcon *src;
|
||||||
wxBitmap *dest;
|
wxBitmap *dest;
|
||||||
@ -7291,7 +7264,6 @@ static PyMethodDef gdicMethods[] = {
|
|||||||
{ "wxIcon_GetDepth", (PyCFunction) _wrap_wxIcon_GetDepth, METH_VARARGS | METH_KEYWORDS },
|
{ "wxIcon_GetDepth", (PyCFunction) _wrap_wxIcon_GetDepth, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "delete_wxIcon", (PyCFunction) _wrap_delete_wxIcon, METH_VARARGS | METH_KEYWORDS },
|
{ "delete_wxIcon", (PyCFunction) _wrap_delete_wxIcon, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "new_wxIcon", (PyCFunction) _wrap_new_wxIcon, METH_VARARGS | METH_KEYWORDS },
|
{ "new_wxIcon", (PyCFunction) _wrap_new_wxIcon, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "delete_wxMask", (PyCFunction) _wrap_delete_wxMask, METH_VARARGS | METH_KEYWORDS },
|
|
||||||
{ "new_wxMask", (PyCFunction) _wrap_new_wxMask, METH_VARARGS | METH_KEYWORDS },
|
{ "new_wxMask", (PyCFunction) _wrap_new_wxMask, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxBitmap_SetWidth", (PyCFunction) _wrap_wxBitmap_SetWidth, METH_VARARGS | METH_KEYWORDS },
|
{ "wxBitmap_SetWidth", (PyCFunction) _wrap_wxBitmap_SetWidth, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxBitmap_SetPalette", (PyCFunction) _wrap_wxBitmap_SetPalette, METH_VARARGS | METH_KEYWORDS },
|
{ "wxBitmap_SetPalette", (PyCFunction) _wrap_wxBitmap_SetPalette, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
@ -67,9 +67,6 @@ class wxMaskPtr :
|
|||||||
def __init__(self,this):
|
def __init__(self,this):
|
||||||
self.this = this
|
self.this = this
|
||||||
self.thisown = 0
|
self.thisown = 0
|
||||||
def __del__(self,gdic=gdic):
|
|
||||||
if self.thisown == 1 :
|
|
||||||
gdic.delete_wxMask(self)
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<C wxMask instance at %s>" % (self.this,)
|
return "<C wxMask instance at %s>" % (self.this,)
|
||||||
class wxMask(wxMaskPtr):
|
class wxMask(wxMaskPtr):
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -196,6 +196,18 @@ class wxRectPtr :
|
|||||||
def GetRight(self, *_args, **_kwargs):
|
def GetRight(self, *_args, **_kwargs):
|
||||||
val = apply(miscc.wxRect_GetRight,(self,) + _args, _kwargs)
|
val = apply(miscc.wxRect_GetRight,(self,) + _args, _kwargs)
|
||||||
return val
|
return val
|
||||||
|
def SetLeft(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRect_SetLeft,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetRight(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRect_SetRight,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetTop(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRect_SetTop,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SetBottom(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRect_SetBottom,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
def asTuple(self, *_args, **_kwargs):
|
def asTuple(self, *_args, **_kwargs):
|
||||||
val = apply(miscc.wxRect_asTuple,(self,) + _args, _kwargs)
|
val = apply(miscc.wxRect_asTuple,(self,) + _args, _kwargs)
|
||||||
return val
|
return val
|
||||||
@ -384,6 +396,9 @@ class wxRegionPtr :
|
|||||||
def ContainsRect(self, *_args, **_kwargs):
|
def ContainsRect(self, *_args, **_kwargs):
|
||||||
val = apply(miscc.wxRegion_ContainsRect,(self,) + _args, _kwargs)
|
val = apply(miscc.wxRegion_ContainsRect,(self,) + _args, _kwargs)
|
||||||
return val
|
return val
|
||||||
|
def ContainsRectDim(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRegion_ContainsRectDim,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
def GetBox(self, *_args, **_kwargs):
|
def GetBox(self, *_args, **_kwargs):
|
||||||
val = apply(miscc.wxRegion_GetBox,(self,) + _args, _kwargs)
|
val = apply(miscc.wxRegion_GetBox,(self,) + _args, _kwargs)
|
||||||
if val: val = wxRectPtr(val) ; val.thisown = 1
|
if val: val = wxRectPtr(val) ; val.thisown = 1
|
||||||
@ -391,18 +406,42 @@ class wxRegionPtr :
|
|||||||
def Intersect(self, *_args, **_kwargs):
|
def Intersect(self, *_args, **_kwargs):
|
||||||
val = apply(miscc.wxRegion_Intersect,(self,) + _args, _kwargs)
|
val = apply(miscc.wxRegion_Intersect,(self,) + _args, _kwargs)
|
||||||
return val
|
return val
|
||||||
|
def IntersectRect(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRegion_IntersectRect,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def IntersectRegion(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRegion_IntersectRegion,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
def IsEmpty(self, *_args, **_kwargs):
|
def IsEmpty(self, *_args, **_kwargs):
|
||||||
val = apply(miscc.wxRegion_IsEmpty,(self,) + _args, _kwargs)
|
val = apply(miscc.wxRegion_IsEmpty,(self,) + _args, _kwargs)
|
||||||
return val
|
return val
|
||||||
def Subtract(self, *_args, **_kwargs):
|
|
||||||
val = apply(miscc.wxRegion_Subtract,(self,) + _args, _kwargs)
|
|
||||||
return val
|
|
||||||
def Union(self, *_args, **_kwargs):
|
def Union(self, *_args, **_kwargs):
|
||||||
val = apply(miscc.wxRegion_Union,(self,) + _args, _kwargs)
|
val = apply(miscc.wxRegion_Union,(self,) + _args, _kwargs)
|
||||||
return val
|
return val
|
||||||
|
def UnionRect(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRegion_UnionRect,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def UnionRegion(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRegion_UnionRegion,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def Subtract(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRegion_Subtract,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SubtractRect(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRegion_SubtractRect,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def SubtractRegion(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRegion_SubtractRegion,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
def Xor(self, *_args, **_kwargs):
|
def Xor(self, *_args, **_kwargs):
|
||||||
val = apply(miscc.wxRegion_Xor,(self,) + _args, _kwargs)
|
val = apply(miscc.wxRegion_Xor,(self,) + _args, _kwargs)
|
||||||
return val
|
return val
|
||||||
|
def XorRect(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRegion_XorRect,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
|
def XorRegion(self, *_args, **_kwargs):
|
||||||
|
val = apply(miscc.wxRegion_XorRegion,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<C wxRegion instance at %s>" % (self.this,)
|
return "<C wxRegion instance at %s>" % (self.this,)
|
||||||
class wxRegion(wxRegionPtr):
|
class wxRegion(wxRegionPtr):
|
||||||
@ -528,6 +567,8 @@ class wxBusyInfo(wxBusyInfoPtr):
|
|||||||
|
|
||||||
#-------------- FUNCTION WRAPPERS ------------------
|
#-------------- FUNCTION WRAPPERS ------------------
|
||||||
|
|
||||||
|
wxIntersectRect = miscc.wxIntersectRect
|
||||||
|
|
||||||
wxNewId = miscc.wxNewId
|
wxNewId = miscc.wxNewId
|
||||||
|
|
||||||
wxRegisterId = miscc.wxRegisterId
|
wxRegisterId = miscc.wxRegisterId
|
||||||
|
@ -3542,13 +3542,12 @@ static PyObject *_wrap_wxWindow_SetScrollbar(PyObject *self, PyObject *args, PyO
|
|||||||
int _arg2;
|
int _arg2;
|
||||||
int _arg3;
|
int _arg3;
|
||||||
int _arg4;
|
int _arg4;
|
||||||
bool _arg5 = (bool ) TRUE;
|
int _arg5 = (int ) TRUE;
|
||||||
PyObject * _argo0 = 0;
|
PyObject * _argo0 = 0;
|
||||||
int tempbool5 = (int) TRUE;
|
|
||||||
char *_kwnames[] = { "self","orientation","position","thumbSize","range","refresh", NULL };
|
char *_kwnames[] = { "self","orientation","position","thumbSize","range","refresh", NULL };
|
||||||
|
|
||||||
self = self;
|
self = self;
|
||||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiiii|i:wxWindow_SetScrollbar",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&tempbool5))
|
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiiii|i:wxWindow_SetScrollbar",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (_argo0) {
|
if (_argo0) {
|
||||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||||
@ -3557,7 +3556,6 @@ static PyObject *_wrap_wxWindow_SetScrollbar(PyObject *self, PyObject *args, PyO
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_arg5 = (bool ) tempbool5;
|
|
||||||
{
|
{
|
||||||
wxPy_BEGIN_ALLOW_THREADS;
|
wxPy_BEGIN_ALLOW_THREADS;
|
||||||
wxWindow_SetScrollbar(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5);
|
wxWindow_SetScrollbar(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5);
|
||||||
@ -5463,6 +5461,42 @@ static PyObject *_wrap_wxScrolledWindow_SetScrollbars(PyObject *self, PyObject *
|
|||||||
return _resultobj;
|
return _resultobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define wxScrolledWindow_SetTargetWindow(_swigobj,_swigarg0) (_swigobj->SetTargetWindow(_swigarg0))
|
||||||
|
static PyObject *_wrap_wxScrolledWindow_SetTargetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
|
PyObject * _resultobj;
|
||||||
|
wxScrolledWindow * _arg0;
|
||||||
|
wxWindow * _arg1;
|
||||||
|
PyObject * _argo0 = 0;
|
||||||
|
PyObject * _argo1 = 0;
|
||||||
|
char *_kwnames[] = { "self","window", NULL };
|
||||||
|
|
||||||
|
self = self;
|
||||||
|
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxScrolledWindow_SetTargetWindow",_kwnames,&_argo0,&_argo1))
|
||||||
|
return NULL;
|
||||||
|
if (_argo0) {
|
||||||
|
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||||
|
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) {
|
||||||
|
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_SetTargetWindow. Expected _wxScrolledWindow_p.");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_argo1) {
|
||||||
|
if (_argo1 == Py_None) { _arg1 = NULL; }
|
||||||
|
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindow_p")) {
|
||||||
|
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxScrolledWindow_SetTargetWindow. Expected _wxWindow_p.");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
wxPy_BEGIN_ALLOW_THREADS;
|
||||||
|
wxScrolledWindow_SetTargetWindow(_arg0,_arg1);
|
||||||
|
|
||||||
|
wxPy_END_ALLOW_THREADS;
|
||||||
|
} Py_INCREF(Py_None);
|
||||||
|
_resultobj = Py_None;
|
||||||
|
return _resultobj;
|
||||||
|
}
|
||||||
|
|
||||||
#define wxScrolledWindow_ViewStart(_swigobj,_swigarg0,_swigarg1) (_swigobj->ViewStart(_swigarg0,_swigarg1))
|
#define wxScrolledWindow_ViewStart(_swigobj,_swigarg0,_swigarg1) (_swigobj->ViewStart(_swigarg0,_swigarg1))
|
||||||
static PyObject *_wrap_wxScrolledWindow_ViewStart(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_wxScrolledWindow_ViewStart(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
@ -6494,9 +6528,7 @@ static PyObject *_wrap_wxMenu_RemoveItem(PyObject *self, PyObject *args, PyObjec
|
|||||||
return _resultobj;
|
return _resultobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wxMenu_Destroy(wxMenu *self) {
|
static void wxMenu_Destroy(wxMenu *self) { delete self; }
|
||||||
delete self;
|
|
||||||
}
|
|
||||||
static PyObject *_wrap_wxMenu_Destroy(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_wxMenu_Destroy(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
wxMenu * _arg0;
|
wxMenu * _arg0;
|
||||||
@ -8474,6 +8506,7 @@ static PyMethodDef windowscMethods[] = {
|
|||||||
{ "wxScrolledWindow_CalcUnscrolledPosition", (PyCFunction) _wrap_wxScrolledWindow_CalcUnscrolledPosition, METH_VARARGS | METH_KEYWORDS },
|
{ "wxScrolledWindow_CalcUnscrolledPosition", (PyCFunction) _wrap_wxScrolledWindow_CalcUnscrolledPosition, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxScrolledWindow_CalcScrolledPosition", (PyCFunction) _wrap_wxScrolledWindow_CalcScrolledPosition, METH_VARARGS | METH_KEYWORDS },
|
{ "wxScrolledWindow_CalcScrolledPosition", (PyCFunction) _wrap_wxScrolledWindow_CalcScrolledPosition, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxScrolledWindow_ViewStart", (PyCFunction) _wrap_wxScrolledWindow_ViewStart, METH_VARARGS | METH_KEYWORDS },
|
{ "wxScrolledWindow_ViewStart", (PyCFunction) _wrap_wxScrolledWindow_ViewStart, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
{ "wxScrolledWindow_SetTargetWindow", (PyCFunction) _wrap_wxScrolledWindow_SetTargetWindow, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxScrolledWindow_SetScrollbars", (PyCFunction) _wrap_wxScrolledWindow_SetScrollbars, METH_VARARGS | METH_KEYWORDS },
|
{ "wxScrolledWindow_SetScrollbars", (PyCFunction) _wrap_wxScrolledWindow_SetScrollbars, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxScrolledWindow_Scroll", (PyCFunction) _wrap_wxScrolledWindow_Scroll, METH_VARARGS | METH_KEYWORDS },
|
{ "wxScrolledWindow_Scroll", (PyCFunction) _wrap_wxScrolledWindow_Scroll, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxScrolledWindow_PrepareDC", (PyCFunction) _wrap_wxScrolledWindow_PrepareDC, METH_VARARGS | METH_KEYWORDS },
|
{ "wxScrolledWindow_PrepareDC", (PyCFunction) _wrap_wxScrolledWindow_PrepareDC, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
@ -589,6 +589,9 @@ class wxScrolledWindowPtr(wxPanelPtr):
|
|||||||
def SetScrollbars(self, *_args, **_kwargs):
|
def SetScrollbars(self, *_args, **_kwargs):
|
||||||
val = apply(windowsc.wxScrolledWindow_SetScrollbars,(self,) + _args, _kwargs)
|
val = apply(windowsc.wxScrolledWindow_SetScrollbars,(self,) + _args, _kwargs)
|
||||||
return val
|
return val
|
||||||
|
def SetTargetWindow(self, *_args, **_kwargs):
|
||||||
|
val = apply(windowsc.wxScrolledWindow_SetTargetWindow,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
def ViewStart(self, *_args, **_kwargs):
|
def ViewStart(self, *_args, **_kwargs):
|
||||||
val = apply(windowsc.wxScrolledWindow_ViewStart,(self,) + _args, _kwargs)
|
val = apply(windowsc.wxScrolledWindow_ViewStart,(self,) + _args, _kwargs)
|
||||||
return val
|
return val
|
||||||
|
@ -972,6 +972,9 @@ def EVT_IDLE(win, func):
|
|||||||
def EVT_UPDATE_UI(win, id, func):
|
def EVT_UPDATE_UI(win, id, func):
|
||||||
win.Connect(id, -1, wxEVT_UPDATE_UI, func)
|
win.Connect(id, -1, wxEVT_UPDATE_UI, func)
|
||||||
|
|
||||||
|
def EVT_UPDATE_UI_RANGE(win, id, id2, func):
|
||||||
|
win.Connect(id, id2, wxEVT_UPDATE_UI, func)
|
||||||
|
|
||||||
|
|
||||||
# Mouse Events
|
# Mouse Events
|
||||||
def EVT_LEFT_DOWN(win, func):
|
def EVT_LEFT_DOWN(win, func):
|
||||||
|
@ -265,7 +265,7 @@ public:
|
|||||||
void SetForegroundColour(const wxColour& colour);
|
void SetForegroundColour(const wxColour& colour);
|
||||||
void SetId(int id);
|
void SetId(int id);
|
||||||
void SetName(const wxString& name);
|
void SetName(const wxString& name);
|
||||||
void SetScrollbar(int orientation, int position, int thumbSize, int range, bool refresh = TRUE);
|
void SetScrollbar(int orientation, int position, int thumbSize, int range, int refresh = TRUE);
|
||||||
void SetScrollPos(int orientation, int pos, bool refresh = TRUE);
|
void SetScrollPos(int orientation, int pos, bool refresh = TRUE);
|
||||||
|
|
||||||
%name(SetDimensions) void SetSize(int x, int y, int width, int height, int sizeFlags=wxSIZE_AUTO);
|
%name(SetDimensions) void SetSize(int x, int y, int width, int height, int sizeFlags=wxSIZE_AUTO);
|
||||||
@ -433,6 +433,7 @@ public:
|
|||||||
void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
||||||
int noUnitsX, int noUnitsY,
|
int noUnitsX, int noUnitsY,
|
||||||
int xPos = 0, int yPos = 0);
|
int xPos = 0, int yPos = 0);
|
||||||
|
void SetTargetWindow(wxWindow* window);
|
||||||
void ViewStart(int* OUTPUT, int* OUTPUT);
|
void ViewStart(int* OUTPUT, int* OUTPUT);
|
||||||
|
|
||||||
void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
|
void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
|
||||||
@ -481,9 +482,7 @@ public:
|
|||||||
%name(RemoveItem) wxMenuItem *Remove(wxMenuItem *item);
|
%name(RemoveItem) wxMenuItem *Remove(wxMenuItem *item);
|
||||||
|
|
||||||
%addmethods {
|
%addmethods {
|
||||||
void Destroy() {
|
void Destroy() { delete self; }
|
||||||
delete self;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
%name(DestroyId)bool Destroy(int id);
|
%name(DestroyId)bool Destroy(int id);
|
||||||
%name(DestroyItem)bool Destroy(wxMenuItem *item);
|
%name(DestroyItem)bool Destroy(wxMenuItem *item);
|
||||||
|
@ -89,31 +89,3 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
#
|
|
||||||
# $Log$
|
|
||||||
# Revision 1.2 1998/12/15 20:44:36 RD
|
|
||||||
# Changed the import semantics from "from wxPython import *" to "from
|
|
||||||
# wxPython.wx import *" This is for people who are worried about
|
|
||||||
# namespace pollution, they can use "from wxPython import wx" and then
|
|
||||||
# prefix all the wxPython identifiers with "wx."
|
|
||||||
#
|
|
||||||
# Added wxTaskbarIcon for wxMSW.
|
|
||||||
#
|
|
||||||
# Made the events work for wxGrid.
|
|
||||||
#
|
|
||||||
# Added wxConfig.
|
|
||||||
#
|
|
||||||
# Added wxMiniFrame for wxGTK, (untested.)
|
|
||||||
#
|
|
||||||
# Changed many of the args and return values that were pointers to gdi
|
|
||||||
# objects to references to reflect changes in the wxWindows API.
|
|
||||||
#
|
|
||||||
# Other assorted fixes and additions.
|
|
||||||
#
|
|
||||||
# Revision 1.1 1998/11/25 08:47:12 RD
|
|
||||||
#
|
|
||||||
# Added wxPalette, wxRegion, wxRegionIterator, wxTaskbarIcon
|
|
||||||
# Added events for wxGrid
|
|
||||||
# Other various fixes and additions
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
Loading…
Reference in New Issue
Block a user