Refactored Python shadows to use wxControlWithItems where appropriate.

Implememted SetClientData for wxControlWithItems.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2001-10-03 03:32:37 +00:00
parent a068364f32
commit 900d98862d
12 changed files with 817 additions and 1071 deletions

View File

@ -67,13 +67,15 @@ class TestListBox(wxPanel):
EVT_LISTBOX_DCLICK(self, 60, self.EvtListBoxDClick)
EVT_RIGHT_UP(self.lb1, self.EvtRightButton)
self.lb1.SetSelection(3)
self.lb1.Append("with data", "This one has data");
self.lb1.SetClientData(2, "This one has data");
wxStaticText(self, -1, "Select many:", wxPoint(200, 50), wxSize(65, 18))
self.lb2 = wxListBox(self, 70, wxPoint(280, 50), wxSize(80, 120),
sampleList, wxLB_EXTENDED)
EVT_LISTBOX(self, 70, self.EvtMultiListBox)
EVT_LISTBOX_DCLICK(self, 70, self.EvtListBoxDClick)
EVT_RIGHT_UP(self.lb2, self.EvtRightButton)
self.lb2.SetSelection(0)
@ -89,6 +91,11 @@ class TestListBox(wxPanel):
def EvtListBox(self, event):
self.log.WriteText('EvtListBox: %s\n' % event.GetString())
lb = event.GetEventObject()
data = lb.GetClientData(lb.GetSelection())
if data is not None:
self.log.WriteText('\tdata: %s\n' % data)
def EvtListBoxDClick(self, event):
self.log.WriteText('EvtListBoxDClick: %s\n' % self.lb1.GetSelection())
@ -99,6 +106,12 @@ class TestListBox(wxPanel):
def EvtRightButton(self, event):
self.log.WriteText('EvtRightButton: %s\n' % event.GetPosition())
if event.GetEventObject().GetId() == 70:
selections = list(self.lb2.GetSelections())
selections.reverse()
for index in selections:
self.lb2.Delete(index)
#---------------------------------------------------------------------------

View File

@ -83,6 +83,57 @@ public:
//----------------------------------------------------------------------
class wxControlWithItems : public wxControl {
public:
// void Clear(); ambiguous, redefine below...
void Delete(int n);
int GetCount();
%pragma(python) addtoclass = "Number = GetCount"
wxString GetString(int n);
void SetString(int n, const wxString& s);
int FindString(const wxString& s);
void Select(int n);
int GetSelection();
wxString GetStringSelection() const;
// void Append(const wxString& item);
// void Append(const wxString& item, char* clientData);
// char* GetClientData(const int n);
// void SetClientData(const int n, char* data);
%addmethods {
void Append(const wxString& item, PyObject* clientData=NULL) {
if (clientData) {
wxPyClientData* data = new wxPyClientData(clientData);
self->Append(item, data);
} else
self->Append(item);
}
PyObject* GetClientData(int n) {
wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
if (data) {
Py_INCREF(data->m_obj);
return data->m_obj;
} else {
Py_INCREF(Py_None);
return Py_None;
}
}
void SetClientData(int n, PyObject* clientData) {
wxPyClientData* data = new wxPyClientData(clientData);
self->SetClientObject(n, data);
}
}
};
//----------------------------------------------------------------------
class wxButton : public wxControl {
public:
wxButton(wxWindow* parent, wxWindowID id, const wxString& label,
@ -171,7 +222,7 @@ public:
//----------------------------------------------------------------------
class wxChoice : public wxControl {
class wxChoice : public wxControlWithItems {
public:
wxChoice(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
@ -190,26 +241,17 @@ public:
const wxValidator& validator = wxDefaultValidator,
char* name = "choice");
void Append(const wxString& item);
void Clear();
void Delete(int n);
int FindString(const wxString& string);
int GetColumns();
int GetSelection();
wxString GetString(const int n);
wxString GetStringSelection();
int GetCount();
void SetColumns(const int n = 1);
void SetSelection(const int n);
void SetStringSelection(const wxString& string);
void SetString(int n, const wxString& s);
%pragma(python) addtoclass = "
Number = GetCount
Select = SetSelection
"
};
//----------------------------------------------------------------------
@ -234,25 +276,14 @@ public:
char* name = "comboBox");
void Append(const wxString& item);
// TODO: void Append(const wxString& item, char* clientData);
void Clear();
void Copy();
void Cut();
void Delete(int n);
// NotMember??: void Deselect(int n);
int FindString(const wxString& string);
// TODO: char* GetClientData(const int n);
long GetInsertionPoint();
long GetLastPosition();
int GetSelection();
wxString GetString(int n);
wxString GetStringSelection();
wxString GetValue();
void Paste();
void Replace(long from, long to, const wxString& text);
void Remove(long from, long to);
// TODO: void SetClientData(const int n, char* data);
void SetInsertionPoint(long pos);
void SetInsertionPointEnd();
void SetSelection(int n);
@ -354,7 +385,7 @@ public:
//----------------------------------------------------------------------
class wxListBox : public wxControl {
class wxListBox : public wxControlWithItems {
public:
wxListBox(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
@ -373,15 +404,8 @@ public:
const wxValidator& validator = wxDefaultValidator,
char* name = "listBox");
void Append(const wxString& item);
// TODO: void Append(const wxString& item, char* clientData);
void Clear();
void Delete(int n);
void Deselect(int n);
int FindString(const wxString& string);
// TODO: char* GetClientData(const int n);
int GetSelection();
// int GetSelections(int **selections);
%addmethods {
@ -396,16 +420,12 @@ public:
}
}
void InsertItems(int LCOUNT, wxString* choices, int pos);
wxString GetString(int n);
wxString GetStringSelection();
int GetCount();
%pragma(python) addtoclass = "Number = GetCount"
bool IsSelected(const int n);
bool Selected(const int n);
void Set(int LCOUNT, wxString* choices);
// TODO: void SetClientData(const int n, char* data);
void SetFirstItem(int n);
%name(SetFirstItemStr)void SetFirstItem(const wxString& string);
void SetSelection(int n, bool select = TRUE);

View File

@ -89,6 +89,18 @@ public:
void SetExtraLong(long extraLong);
void SetInt(int i);
%addmethods {
PyObject* GetClientData() {
wxPyClientData* data = (wxPyClientData*)self->GetClientObject();
if (data) {
Py_INCREF(data->m_obj);
return data->m_obj;
} else {
Py_INCREF(Py_None);
return Py_None;
}
}
}
};

View File

@ -351,6 +351,29 @@ public:
class wxPyClientData : public wxClientData {
public:
wxPyClientData(PyObject* obj) {
m_obj = obj;
Py_INCREF(m_obj);
}
~wxPyClientData() {
#ifdef wxPyUSE_EXPORT
wxPyTState* state = wxPyCoreAPIPtr->p_wxPyBeginBlockThreads();
Py_DECREF(m_obj);
wxPyCoreAPIPtr->p_wxPyEndBlockThreads(state);
#else
wxPyTState* state = wxPyBeginBlockThreads();
Py_DECREF(m_obj);
wxPyEndBlockThreads(state);
#endif
}
PyObject* m_obj;
};
//---------------------------------------------------------------------------
// These macros are used to implement the virtual methods that should
// redirect to a Python method if one exists. The names designate the

File diff suppressed because it is too large Load Diff

View File

@ -42,6 +42,53 @@ def wxPreControl(*_args,**_kwargs):
return val
class wxControlWithItemsPtr(wxControlPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def Delete(self, *_args, **_kwargs):
val = apply(controlsc.wxControlWithItems_Delete,(self,) + _args, _kwargs)
return val
def GetCount(self, *_args, **_kwargs):
val = apply(controlsc.wxControlWithItems_GetCount,(self,) + _args, _kwargs)
return val
def GetString(self, *_args, **_kwargs):
val = apply(controlsc.wxControlWithItems_GetString,(self,) + _args, _kwargs)
return val
def SetString(self, *_args, **_kwargs):
val = apply(controlsc.wxControlWithItems_SetString,(self,) + _args, _kwargs)
return val
def FindString(self, *_args, **_kwargs):
val = apply(controlsc.wxControlWithItems_FindString,(self,) + _args, _kwargs)
return val
def Select(self, *_args, **_kwargs):
val = apply(controlsc.wxControlWithItems_Select,(self,) + _args, _kwargs)
return val
def GetSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxControlWithItems_GetSelection,(self,) + _args, _kwargs)
return val
def GetStringSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxControlWithItems_GetStringSelection,(self,) + _args, _kwargs)
return val
def Append(self, *_args, **_kwargs):
val = apply(controlsc.wxControlWithItems_Append,(self,) + _args, _kwargs)
return val
def GetClientData(self, *_args, **_kwargs):
val = apply(controlsc.wxControlWithItems_GetClientData,(self,) + _args, _kwargs)
return val
def SetClientData(self, *_args, **_kwargs):
val = apply(controlsc.wxControlWithItems_SetClientData,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxControlWithItems instance at %s>" % (self.this,)
Number = GetCount
class wxControlWithItems(wxControlWithItemsPtr):
def __init__(self,this):
self.this = this
class wxButtonPtr(wxControlPtr):
def __init__(self,this):
self.this = this
@ -166,40 +213,19 @@ def wxPreCheckBox(*_args,**_kwargs):
return val
class wxChoicePtr(wxControlPtr):
class wxChoicePtr(wxControlWithItemsPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def Create(self, *_args, **_kwargs):
val = apply(controlsc.wxChoice_Create,(self,) + _args, _kwargs)
return val
def Append(self, *_args, **_kwargs):
val = apply(controlsc.wxChoice_Append,(self,) + _args, _kwargs)
return val
def Clear(self, *_args, **_kwargs):
val = apply(controlsc.wxChoice_Clear,(self,) + _args, _kwargs)
return val
def Delete(self, *_args, **_kwargs):
val = apply(controlsc.wxChoice_Delete,(self,) + _args, _kwargs)
return val
def FindString(self, *_args, **_kwargs):
val = apply(controlsc.wxChoice_FindString,(self,) + _args, _kwargs)
return val
def GetColumns(self, *_args, **_kwargs):
val = apply(controlsc.wxChoice_GetColumns,(self,) + _args, _kwargs)
return val
def GetSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxChoice_GetSelection,(self,) + _args, _kwargs)
return val
def GetString(self, *_args, **_kwargs):
val = apply(controlsc.wxChoice_GetString,(self,) + _args, _kwargs)
return val
def GetStringSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxChoice_GetStringSelection,(self,) + _args, _kwargs)
return val
def GetCount(self, *_args, **_kwargs):
val = apply(controlsc.wxChoice_GetCount,(self,) + _args, _kwargs)
return val
def SetColumns(self, *_args, **_kwargs):
val = apply(controlsc.wxChoice_SetColumns,(self,) + _args, _kwargs)
return val
@ -215,7 +241,6 @@ class wxChoicePtr(wxControlPtr):
def __repr__(self):
return "<C wxChoice instance at %s>" % (self.this,)
Number = GetCount
Select = SetSelection
class wxChoice(wxChoicePtr):
@ -238,39 +263,18 @@ class wxComboBoxPtr(wxChoicePtr):
def Create(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_Create,(self,) + _args, _kwargs)
return val
def Append(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_Append,(self,) + _args, _kwargs)
return val
def Clear(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_Clear,(self,) + _args, _kwargs)
return val
def Copy(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_Copy,(self,) + _args, _kwargs)
return val
def Cut(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_Cut,(self,) + _args, _kwargs)
return val
def Delete(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_Delete,(self,) + _args, _kwargs)
return val
def FindString(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_FindString,(self,) + _args, _kwargs)
return val
def GetInsertionPoint(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_GetInsertionPoint,(self,) + _args, _kwargs)
return val
def GetLastPosition(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_GetLastPosition,(self,) + _args, _kwargs)
return val
def GetSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_GetSelection,(self,) + _args, _kwargs)
return val
def GetString(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_GetString,(self,) + _args, _kwargs)
return val
def GetStringSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_GetStringSelection,(self,) + _args, _kwargs)
return val
def GetValue(self, *_args, **_kwargs):
val = apply(controlsc.wxComboBox_GetValue,(self,) + _args, _kwargs)
return val
@ -434,46 +438,25 @@ def wxPreStaticText(*_args,**_kwargs):
return val
class wxListBoxPtr(wxControlPtr):
class wxListBoxPtr(wxControlWithItemsPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def Create(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_Create,(self,) + _args, _kwargs)
return val
def Append(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_Append,(self,) + _args, _kwargs)
return val
def Clear(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_Clear,(self,) + _args, _kwargs)
return val
def Delete(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_Delete,(self,) + _args, _kwargs)
return val
def Deselect(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_Deselect,(self,) + _args, _kwargs)
return val
def FindString(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_FindString,(self,) + _args, _kwargs)
return val
def GetSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_GetSelection,(self,) + _args, _kwargs)
return val
def GetSelections(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_GetSelections,(self,) + _args, _kwargs)
return val
def InsertItems(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_InsertItems,(self,) + _args, _kwargs)
return val
def GetString(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_GetString,(self,) + _args, _kwargs)
return val
def GetStringSelection(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_GetStringSelection,(self,) + _args, _kwargs)
return val
def GetCount(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_GetCount,(self,) + _args, _kwargs)
return val
def IsSelected(self, *_args, **_kwargs):
val = apply(controlsc.wxListBox_IsSelected,(self,) + _args, _kwargs)
return val
@ -500,7 +483,6 @@ class wxListBoxPtr(wxControlPtr):
return val
def __repr__(self):
return "<C wxListBox instance at %s>" % (self.this,)
Number = GetCount
class wxListBox(wxListBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxListBox,_args,_kwargs)

View File

@ -1098,6 +1098,45 @@ static PyObject *_wrap_wxCommandEvent_SetInt(PyObject *self, PyObject *args, PyO
return _resultobj;
}
static PyObject * wxCommandEvent_GetClientData(wxCommandEvent *self) {
wxPyClientData* data = (wxPyClientData*)self->GetClientObject();
if (data) {
Py_INCREF(data->m_obj);
return data->m_obj;
} else {
Py_INCREF(Py_None);
return Py_None;
}
}
static PyObject *_wrap_wxCommandEvent_GetClientData(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
PyObject * _result;
wxCommandEvent * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCommandEvent_GetClientData",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCommandEvent_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_GetClientData. Expected _wxCommandEvent_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (PyObject *)wxCommandEvent_GetClientData(_arg0);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
}{
_resultobj = _result;
}
return _resultobj;
}
static void *SwigwxScrollEventTowxCommandEvent(void *ptr) {
wxScrollEvent *src;
wxCommandEvent *dest;
@ -7119,6 +7158,7 @@ static PyMethodDef eventscMethods[] = {
{ "wxScrollEvent_GetPosition", (PyCFunction) _wrap_wxScrollEvent_GetPosition, METH_VARARGS | METH_KEYWORDS },
{ "wxScrollEvent_GetOrientation", (PyCFunction) _wrap_wxScrollEvent_GetOrientation, METH_VARARGS | METH_KEYWORDS },
{ "new_wxScrollEvent", (PyCFunction) _wrap_new_wxScrollEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxCommandEvent_GetClientData", (PyCFunction) _wrap_wxCommandEvent_GetClientData, METH_VARARGS | METH_KEYWORDS },
{ "wxCommandEvent_SetInt", (PyCFunction) _wrap_wxCommandEvent_SetInt, METH_VARARGS | METH_KEYWORDS },
{ "wxCommandEvent_SetExtraLong", (PyCFunction) _wrap_wxCommandEvent_SetExtraLong, METH_VARARGS | METH_KEYWORDS },
{ "wxCommandEvent_SetString", (PyCFunction) _wrap_wxCommandEvent_SetString, METH_VARARGS | METH_KEYWORDS },

View File

@ -135,6 +135,9 @@ class wxCommandEventPtr(wxEventPtr):
def SetInt(self, *_args, **_kwargs):
val = apply(eventsc.wxCommandEvent_SetInt,(self,) + _args, _kwargs)
return val
def GetClientData(self, *_args, **_kwargs):
val = apply(eventsc.wxCommandEvent_GetClientData,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxCommandEvent instance at %s>" % (self.this,)
class wxCommandEvent(wxCommandEventPtr):

View File

@ -525,6 +525,66 @@ static PyObject *_wrap_wxTopLevelWindow_SetIcon(PyObject *self, PyObject *args,
return _resultobj;
}
#define wxTopLevelWindow_ShowFullScreen(_swigobj,_swigarg0,_swigarg1) (_swigobj->ShowFullScreen(_swigarg0,_swigarg1))
static PyObject *_wrap_wxTopLevelWindow_ShowFullScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxTopLevelWindow * _arg0;
bool _arg1;
long _arg2 = (long ) (wxFULLSCREEN_ALL);
PyObject * _argo0 = 0;
int tempbool1;
char *_kwnames[] = { "self","show","style", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|l:wxTopLevelWindow_ShowFullScreen",_kwnames,&_argo0,&tempbool1,&_arg2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTopLevelWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTopLevelWindow_ShowFullScreen. Expected _wxTopLevelWindow_p.");
return NULL;
}
}
_arg1 = (bool ) tempbool1;
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxTopLevelWindow_ShowFullScreen(_arg0,_arg1,_arg2);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxTopLevelWindow_IsFullScreen(_swigobj) (_swigobj->IsFullScreen())
static PyObject *_wrap_wxTopLevelWindow_IsFullScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxTopLevelWindow * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTopLevelWindow_IsFullScreen",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTopLevelWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTopLevelWindow_IsFullScreen. Expected _wxTopLevelWindow_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxTopLevelWindow_IsFullScreen(_arg0);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxTopLevelWindow_SetTitle(_swigobj,_swigarg0) (_swigobj->SetTitle(_swigarg0))
static PyObject *_wrap_wxTopLevelWindow_SetTitle(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@ -1278,162 +1338,6 @@ static PyObject *_wrap_wxFrame_SetToolBar(PyObject *self, PyObject *args, PyObje
return _resultobj;
}
#define wxFrame_ShowFullScreen(_swigobj,_swigarg0,_swigarg1) (_swigobj->ShowFullScreen(_swigarg0,_swigarg1))
static PyObject *_wrap_wxFrame_ShowFullScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxFrame * _arg0;
bool _arg1;
long _arg2 = (long ) (wxFULLSCREEN_ALL);
PyObject * _argo0 = 0;
int tempbool1;
char *_kwnames[] = { "self","show","style", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|l:wxFrame_ShowFullScreen",_kwnames,&_argo0,&tempbool1,&_arg2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFrame_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFrame_ShowFullScreen. Expected _wxFrame_p.");
return NULL;
}
}
_arg1 = (bool ) tempbool1;
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxFrame_ShowFullScreen(_arg0,_arg1,_arg2);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxFrame_IsFullScreen(_swigobj) (_swigobj->IsFullScreen())
static PyObject *_wrap_wxFrame_IsFullScreen(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxFrame * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFrame_IsFullScreen",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFrame_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFrame_IsFullScreen. Expected _wxFrame_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxFrame_IsFullScreen(_arg0);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxFrame_Raise(_swigobj) (_swigobj->Raise())
static PyObject *_wrap_wxFrame_Raise(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxFrame * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFrame_Raise",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFrame_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFrame_Raise. Expected _wxFrame_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxFrame_Raise(_arg0);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxFrame_SetAcceleratorTable(_swigobj,_swigarg0) (_swigobj->SetAcceleratorTable(_swigarg0))
static PyObject *_wrap_wxFrame_SetAcceleratorTable(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxFrame * _arg0;
wxAcceleratorTable * _arg1;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","accel", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxFrame_SetAcceleratorTable",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFrame_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFrame_SetAcceleratorTable. Expected _wxFrame_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxAcceleratorTable_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxFrame_SetAcceleratorTable. Expected _wxAcceleratorTable_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxFrame_SetAcceleratorTable(_arg0,*_arg1);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxFrame_MakeModal(_swigobj,_swigarg0) (_swigobj->MakeModal(_swigarg0))
static PyObject *_wrap_wxFrame_MakeModal(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxFrame * _arg0;
bool _arg1 = (bool ) TRUE;
PyObject * _argo0 = 0;
int tempbool1 = (int) TRUE;
char *_kwnames[] = { "self","modal", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxFrame_MakeModal",_kwnames,&_argo0,&tempbool1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFrame_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFrame_MakeModal. Expected _wxFrame_p.");
return NULL;
}
}
_arg1 = (bool ) tempbool1;
{
wxPy_BEGIN_ALLOW_THREADS;
wxFrame_MakeModal(_arg0,_arg1);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
static void *SwigwxDialogTowxTopLevelWindow(void *ptr) {
wxDialog *src;
wxTopLevelWindow *dest;
@ -2282,11 +2186,6 @@ static PyMethodDef framescMethods[] = {
{ "wxDialog_Create", (PyCFunction) _wrap_wxDialog_Create, METH_VARARGS | METH_KEYWORDS },
{ "new_wxPreDialog", (PyCFunction) _wrap_new_wxPreDialog, METH_VARARGS | METH_KEYWORDS },
{ "new_wxDialog", (PyCFunction) _wrap_new_wxDialog, METH_VARARGS | METH_KEYWORDS },
{ "wxFrame_MakeModal", (PyCFunction) _wrap_wxFrame_MakeModal, METH_VARARGS | METH_KEYWORDS },
{ "wxFrame_SetAcceleratorTable", (PyCFunction) _wrap_wxFrame_SetAcceleratorTable, METH_VARARGS | METH_KEYWORDS },
{ "wxFrame_Raise", (PyCFunction) _wrap_wxFrame_Raise, METH_VARARGS | METH_KEYWORDS },
{ "wxFrame_IsFullScreen", (PyCFunction) _wrap_wxFrame_IsFullScreen, METH_VARARGS | METH_KEYWORDS },
{ "wxFrame_ShowFullScreen", (PyCFunction) _wrap_wxFrame_ShowFullScreen, METH_VARARGS | METH_KEYWORDS },
{ "wxFrame_SetToolBar", (PyCFunction) _wrap_wxFrame_SetToolBar, METH_VARARGS | METH_KEYWORDS },
{ "wxFrame_GetToolBar", (PyCFunction) _wrap_wxFrame_GetToolBar, METH_VARARGS | METH_KEYWORDS },
{ "wxFrame_CreateToolBar", (PyCFunction) _wrap_wxFrame_CreateToolBar, METH_VARARGS | METH_KEYWORDS },
@ -2305,6 +2204,8 @@ static PyMethodDef framescMethods[] = {
{ "new_wxFrame", (PyCFunction) _wrap_new_wxFrame, METH_VARARGS | METH_KEYWORDS },
{ "wxTopLevelWindow_GetTitle", (PyCFunction) _wrap_wxTopLevelWindow_GetTitle, METH_VARARGS | METH_KEYWORDS },
{ "wxTopLevelWindow_SetTitle", (PyCFunction) _wrap_wxTopLevelWindow_SetTitle, METH_VARARGS | METH_KEYWORDS },
{ "wxTopLevelWindow_IsFullScreen", (PyCFunction) _wrap_wxTopLevelWindow_IsFullScreen, METH_VARARGS | METH_KEYWORDS },
{ "wxTopLevelWindow_ShowFullScreen", (PyCFunction) _wrap_wxTopLevelWindow_ShowFullScreen, METH_VARARGS | METH_KEYWORDS },
{ "wxTopLevelWindow_SetIcon", (PyCFunction) _wrap_wxTopLevelWindow_SetIcon, METH_VARARGS | METH_KEYWORDS },
{ "wxTopLevelWindow_GetIcon", (PyCFunction) _wrap_wxTopLevelWindow_GetIcon, METH_VARARGS | METH_KEYWORDS },
{ "wxTopLevelWindow_IsIconized", (PyCFunction) _wrap_wxTopLevelWindow_IsIconized, METH_VARARGS | METH_KEYWORDS },

View File

@ -44,6 +44,12 @@ class wxTopLevelWindowPtr(wxWindowPtr):
def SetIcon(self, *_args, **_kwargs):
val = apply(framesc.wxTopLevelWindow_SetIcon,(self,) + _args, _kwargs)
return val
def ShowFullScreen(self, *_args, **_kwargs):
val = apply(framesc.wxTopLevelWindow_ShowFullScreen,(self,) + _args, _kwargs)
return val
def IsFullScreen(self, *_args, **_kwargs):
val = apply(framesc.wxTopLevelWindow_IsFullScreen,(self,) + _args, _kwargs)
return val
def SetTitle(self, *_args, **_kwargs):
val = apply(framesc.wxTopLevelWindow_SetTitle,(self,) + _args, _kwargs)
return val
@ -112,21 +118,6 @@ class wxFramePtr(wxTopLevelWindowPtr):
def SetToolBar(self, *_args, **_kwargs):
val = apply(framesc.wxFrame_SetToolBar,(self,) + _args, _kwargs)
return val
def ShowFullScreen(self, *_args, **_kwargs):
val = apply(framesc.wxFrame_ShowFullScreen,(self,) + _args, _kwargs)
return val
def IsFullScreen(self, *_args, **_kwargs):
val = apply(framesc.wxFrame_IsFullScreen,(self,) + _args, _kwargs)
return val
def Raise(self, *_args, **_kwargs):
val = apply(framesc.wxFrame_Raise,(self,) + _args, _kwargs)
return val
def SetAcceleratorTable(self, *_args, **_kwargs):
val = apply(framesc.wxFrame_SetAcceleratorTable,(self,) + _args, _kwargs)
return val
def MakeModal(self, *_args, **_kwargs):
val = apply(framesc.wxFrame_MakeModal,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxFrame instance at %s>" % (self.this,)
class wxFrame(wxFramePtr):

View File

@ -3119,13 +3119,13 @@ static PyObject *_wrap_wxWindow_Lower(PyObject *self, PyObject *args, PyObject *
static PyObject *_wrap_wxWindow_MakeModal(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxWindow * _arg0;
bool _arg1;
bool _arg1 = (bool ) TRUE;
PyObject * _argo0 = 0;
int tempbool1;
int tempbool1 = (int) TRUE;
char *_kwnames[] = { "self","flag", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxWindow_MakeModal",_kwnames,&_argo0,&tempbool1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxWindow_MakeModal",_kwnames,&_argo0,&tempbool1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@ -5715,6 +5715,41 @@ static PyObject *_wrap_wxWindow_PrevControlId(PyObject *self, PyObject *args, Py
return _resultobj;
}
#define wxWindow_GetAcceleratorTable(_swigobj) (_swigobj->GetAcceleratorTable())
static PyObject *_wrap_wxWindow_GetAcceleratorTable(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxAcceleratorTable * _result;
wxWindow * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_GetAcceleratorTable",_kwnames,&_argo0))
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 wxWindow_GetAcceleratorTable. Expected _wxWindow_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxAcceleratorTable *)wxWindow_GetAcceleratorTable(_arg0);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxAcceleratorTable_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
static void *SwigwxPanelTowxWindow(void *ptr) {
wxPanel *src;
wxWindow *dest;
@ -10502,6 +10537,7 @@ static PyMethodDef windowscMethods[] = {
{ "wxPanel_Create", (PyCFunction) _wrap_wxPanel_Create, METH_VARARGS | METH_KEYWORDS },
{ "new_wxPrePanel", (PyCFunction) _wrap_new_wxPrePanel, METH_VARARGS | METH_KEYWORDS },
{ "new_wxPanel", (PyCFunction) _wrap_new_wxPanel, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_GetAcceleratorTable", (PyCFunction) _wrap_wxWindow_GetAcceleratorTable, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_PrevControlId", (PyCFunction) _wrap_wxWindow_PrevControlId, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_NextControlId", (PyCFunction) _wrap_wxWindow_NextControlId, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_NewControlId", (PyCFunction) _wrap_wxWindow_NewControlId, METH_VARARGS | METH_KEYWORDS },

View File

@ -547,6 +547,10 @@ class wxWindowPtr(wxEvtHandlerPtr):
def PageDown(self, *_args, **_kwargs):
val = apply(windowsc.wxWindow_PageDown,(self,) + _args, _kwargs)
return val
def GetAcceleratorTable(self, *_args, **_kwargs):
val = apply(windowsc.wxWindow_GetAcceleratorTable,(self,) + _args, _kwargs)
if val: val = wxAcceleratorTablePtr(val)
return val
def __repr__(self):
return "<C wxWindow instance at %s>" % (self.this,)
# replaces broken shadow method