self.tree = wxTreeCtrl(self, tID, wxDefaultPosition, wxDefaultSize,
wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS)# | wxTR_MULTIPLE)
- il = wxImageList(16, 16)
- idx1 = il.Add(wxBitmap('bitmaps/smiles.bmp', wxBITMAP_TYPE_BMP))
- idx2 = il.Add(wxBitmap('bitmaps/open.bmp', wxBITMAP_TYPE_BMP))
- idx3 = il.Add(wxBitmap('bitmaps/new.bmp', wxBITMAP_TYPE_BMP))
- idx4 = il.Add(wxBitmap('bitmaps/copy.bmp', wxBITMAP_TYPE_BMP))
- idx5 = il.Add(wxBitmap('bitmaps/paste.bmp', wxBITMAP_TYPE_BMP))
+ #il = wxImageList(16, 16)
+ #idx1 = il.Add(wxBitmap('bitmaps/smiles.bmp', wxBITMAP_TYPE_BMP))
+ #idx2 = il.Add(wxBitmap('bitmaps/open.bmp', wxBITMAP_TYPE_BMP))
+ #idx3 = il.Add(wxBitmap('bitmaps/new.bmp', wxBITMAP_TYPE_BMP))
+ #idx4 = il.Add(wxBitmap('bitmaps/copy.bmp', wxBITMAP_TYPE_BMP))
+ #idx5 = il.Add(wxBitmap('bitmaps/paste.bmp', wxBITMAP_TYPE_BMP))
- self.tree.SetImageList(il)
- self.il = il
+ #self.tree.SetImageList(il)
+ #self.il = il
self.root = self.tree.AddRoot("The Root Item")
- self.tree.SetItemImage(self.root, idx1)
+ #self.tree.SetItemImage(self.root, idx1)
for x in range(15):
child = self.tree.AppendItem(self.root, "Item %d" % x)
- self.tree.SetItemImage(child, idx2)
- self.tree.SetItemSelectedImage(child, idx3)
+ #self.tree.SetItemImage(child, idx2)
+ #self.tree.SetItemSelectedImage(child, idx3)
for y in range(5):
last = self.tree.AppendItem(child, "item %d-%s" % (x, chr(ord("a")+y)))
- self.tree.SetItemImage(last, idx4)
- self.tree.SetItemSelectedImage(last, idx5)
+ #self.tree.SetItemImage(last, idx4)
+ #self.tree.SetItemSelectedImage(last, idx5)
for z in range(5):
self.tree.AppendItem(last, "item %d-%s-%d" % (x, chr(ord("a")+y), z))
class wxBrush;
class wxButton;
class wxCalculateLayoutEvent;
+class wxCaret;
class wxCheckBox;
class wxCheckListBox;
class wxChoice;
self.frame = None
self.title = title
+
def SetParent(self, parent):
self.parent = parent
+
def OnCloseWindow(self, event):
if self.frame != None:
self.frame.Destroy()
self.frame = None
self.text = None
+
# this provides the file-like behaviour
def write(self, str):
if not self.frame:
EVT_CLOSE(self.frame, self.OnCloseWindow)
self.text.AppendText(str)
+
def close(self):
+ if self.frame != None:
+ self.frame.Destroy()
self.frame = None
self.text = None
def SetTopWindow(self, frame):
if self.stdioWin:
self.stdioWin.SetParent(frame)
- sys.stdout = self.stdioWin #sys.stderr =
+ sys.stderr = sys.stdout = self.stdioWin
wxPyApp.SetTopWindow(self, frame)
+
def MainLoop(self):
wxPyApp.MainLoop(self)
self.RestoreStdio()
+
def RedirectStdio(self, filename):
if filename:
sys.stdout = sys.stderr = open(filename, 'a')
else:
self.stdioWin = self.outputWindowClass() # wxPyOnDemandOutputWindow
+
def RestoreStdio(self):
sys.stdout, sys.stderr = self.saveStdio
if self.stdioWin != None:
wxWindow *GetWindow();
%name(MoveXY)void Move(int x, int y);
void Move(const wxPoint& pt);
+ %name(SetSizeWH) void SetSize(int width, int height);
+ void SetSize(const wxSize& size);
void Show(int show = TRUE);
void Hide();
void OnSetFocus();
return _resultobj;
}
+#define wxCaret_SetSizeWH(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetSize(_swigarg0,_swigarg1))
+static PyObject *_wrap_wxCaret_SetSizeWH(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxCaret * _arg0;
+ int _arg1;
+ int _arg2;
+ PyObject * _argo0 = 0;
+ char *_kwnames[] = { "self","width","height", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxCaret_SetSizeWH",_kwnames,&_argo0,&_arg1,&_arg2))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCaret_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCaret_SetSizeWH. Expected _wxCaret_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ wxCaret_SetSizeWH(_arg0,_arg1,_arg2);
+
+ wxPy_END_ALLOW_THREADS;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ return _resultobj;
+}
+
+#define wxCaret_SetSize(_swigobj,_swigarg0) (_swigobj->SetSize(_swigarg0))
+static PyObject *_wrap_wxCaret_SetSize(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxCaret * _arg0;
+ wxSize * _arg1;
+ PyObject * _argo0 = 0;
+ wxSize temp;
+ PyObject * _obj1 = 0;
+ char *_kwnames[] = { "self","size", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxCaret_SetSize",_kwnames,&_argo0,&_obj1))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCaret_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCaret_SetSize. Expected _wxCaret_p.");
+ return NULL;
+ }
+ }
+{
+ _arg1 = &temp;
+ if (! wxSize_helper(_obj1, &_arg1))
+ return NULL;
+}
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ wxCaret_SetSize(_arg0,*_arg1);
+
+ wxPy_END_ALLOW_THREADS;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ return _resultobj;
+}
+
#define wxCaret_Show(_swigobj,_swigarg0) (_swigobj->Show(_swigarg0))
static PyObject *_wrap_wxCaret_Show(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
{ "wxCaret_OnSetFocus", (PyCFunction) _wrap_wxCaret_OnSetFocus, METH_VARARGS | METH_KEYWORDS },
{ "wxCaret_Hide", (PyCFunction) _wrap_wxCaret_Hide, METH_VARARGS | METH_KEYWORDS },
{ "wxCaret_Show", (PyCFunction) _wrap_wxCaret_Show, METH_VARARGS | METH_KEYWORDS },
+ { "wxCaret_SetSize", (PyCFunction) _wrap_wxCaret_SetSize, METH_VARARGS | METH_KEYWORDS },
+ { "wxCaret_SetSizeWH", (PyCFunction) _wrap_wxCaret_SetSizeWH, METH_VARARGS | METH_KEYWORDS },
{ "wxCaret_Move", (PyCFunction) _wrap_wxCaret_Move, METH_VARARGS | METH_KEYWORDS },
{ "wxCaret_MoveXY", (PyCFunction) _wrap_wxCaret_MoveXY, METH_VARARGS | METH_KEYWORDS },
{ "wxCaret_GetWindow", (PyCFunction) _wrap_wxCaret_GetWindow, METH_VARARGS | METH_KEYWORDS },
def Move(self, *_args, **_kwargs):
val = apply(misc2c.wxCaret_Move,(self,) + _args, _kwargs)
return val
+ def SetSizeWH(self, *_args, **_kwargs):
+ val = apply(misc2c.wxCaret_SetSizeWH,(self,) + _args, _kwargs)
+ return val
+ def SetSize(self, *_args, **_kwargs):
+ val = apply(misc2c.wxCaret_SetSize,(self,) + _args, _kwargs)
+ return val
def Show(self, *_args, **_kwargs):
val = apply(misc2c.wxCaret_Show,(self,) + _args, _kwargs)
return val
win->SubclassWin(hWnd);
return win;
}
+
+ int wxWindow_NewControlId() {
+ return wxWindow::NewControlId();
+ }
+ int wxWindow_NextControlId(int id) {
+ return wxWindow::NextControlId(id);
+ }
+ int wxWindow_PrevControlId(int id) {
+ return wxWindow::PrevControlId(id);
+ }
#ifdef __cplusplus
extern "C" {
#endif
return _resultobj;
}
+static PyObject *_wrap_wxWindow_NewControlId(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ int _result;
+ char *_kwnames[] = { NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxWindow_NewControlId",_kwnames))
+ return NULL;
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ _result = (int )wxWindow_NewControlId();
+
+ wxPy_END_ALLOW_THREADS;
+} _resultobj = Py_BuildValue("i",_result);
+ return _resultobj;
+}
+
+static PyObject *_wrap_wxWindow_NextControlId(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ int _result;
+ int _arg0;
+ char *_kwnames[] = { "id", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxWindow_NextControlId",_kwnames,&_arg0))
+ return NULL;
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ _result = (int )wxWindow_NextControlId(_arg0);
+
+ wxPy_END_ALLOW_THREADS;
+} _resultobj = Py_BuildValue("i",_result);
+ return _resultobj;
+}
+
+static PyObject *_wrap_wxWindow_PrevControlId(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ int _result;
+ int _arg0;
+ char *_kwnames[] = { "id", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxWindow_PrevControlId",_kwnames,&_arg0))
+ return NULL;
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ _result = (int )wxWindow_PrevControlId(_arg0);
+
+ wxPy_END_ALLOW_THREADS;
+} _resultobj = Py_BuildValue("i",_result);
+ return _resultobj;
+}
+
#define wxEvtHandler_ProcessEvent(_swigobj,_swigarg0) (_swigobj->ProcessEvent(_swigarg0))
static PyObject *_wrap_wxEvtHandler_ProcessEvent(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
}
static void wxWindow_SetSize(wxWindow *self,const wxSize & size) {
- self->SetSize(size.x, size.y);
+ self->SetSize(size);
}
static PyObject *_wrap_wxWindow_SetSize(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
return _resultobj;
}
+#define wxWindow_SetCaret(_swigobj,_swigarg0) (_swigobj->SetCaret(_swigarg0))
+static PyObject *_wrap_wxWindow_SetCaret(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxWindow * _arg0;
+ wxCaret * _arg1;
+ PyObject * _argo0 = 0;
+ PyObject * _argo1 = 0;
+ char *_kwnames[] = { "self","caret", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_SetCaret",_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 wxWindow_SetCaret. Expected _wxWindow_p.");
+ return NULL;
+ }
+ }
+ if (_argo1) {
+ if (_argo1 == Py_None) { _arg1 = NULL; }
+ else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxCaret_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxWindow_SetCaret. Expected _wxCaret_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ wxWindow_SetCaret(_arg0,_arg1);
+
+ wxPy_END_ALLOW_THREADS;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ return _resultobj;
+}
+
+#define wxWindow_GetCaret(_swigobj) (_swigobj->GetCaret())
+static PyObject *_wrap_wxWindow_GetCaret(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxCaret * _result;
+ wxWindow * _arg0;
+ PyObject * _argo0 = 0;
+ char *_kwnames[] = { "self", NULL };
+ char _ptemp[128];
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_GetCaret",_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_GetCaret. Expected _wxWindow_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ _result = (wxCaret *)wxWindow_GetCaret(_arg0);
+
+ wxPy_END_ALLOW_THREADS;
+} if (_result) {
+ SWIG_MakePtr(_ptemp, (char *) _result,"_wxCaret_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;
{ "wxPanel_GetDefaultItem", (PyCFunction) _wrap_wxPanel_GetDefaultItem, METH_VARARGS | METH_KEYWORDS },
{ "wxPanel_InitDialog", (PyCFunction) _wrap_wxPanel_InitDialog, METH_VARARGS | METH_KEYWORDS },
{ "new_wxPanel", (PyCFunction) _wrap_new_wxPanel, METH_VARARGS | METH_KEYWORDS },
+ { "wxWindow_GetCaret", (PyCFunction) _wrap_wxWindow_GetCaret, METH_VARARGS | METH_KEYWORDS },
+ { "wxWindow_SetCaret", (PyCFunction) _wrap_wxWindow_SetCaret, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_GetBestSize", (PyCFunction) _wrap_wxWindow_GetBestSize, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_GetDropTarget", (PyCFunction) _wrap_wxWindow_GetDropTarget, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_SetDropTarget", (PyCFunction) _wrap_wxWindow_SetDropTarget, METH_VARARGS | METH_KEYWORDS },
{ "wxEvtHandler_SetEvtHandlerEnabled", (PyCFunction) _wrap_wxEvtHandler_SetEvtHandlerEnabled, METH_VARARGS | METH_KEYWORDS },
{ "wxEvtHandler_GetEvtHandlerEnabled", (PyCFunction) _wrap_wxEvtHandler_GetEvtHandlerEnabled, METH_VARARGS | METH_KEYWORDS },
{ "wxEvtHandler_ProcessEvent", (PyCFunction) _wrap_wxEvtHandler_ProcessEvent, 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 },
{ "wxWindow_FromHWND", (PyCFunction) _wrap_wxWindow_FromHWND, METH_VARARGS | METH_KEYWORDS },
{ "wxWindow_FindFocus", (PyCFunction) _wrap_wxWindow_FindFocus, METH_VARARGS | METH_KEYWORDS },
{ "wxValidator_SetBellOnError", (PyCFunction) _wrap_wxValidator_SetBellOnError, METH_VARARGS | METH_KEYWORDS },
val = apply(windowsc.wxWindow_GetBestSize,(self,) + _args, _kwargs)
if val: val = wxSizePtr(val) ; val.thisown = 1
return val
+ def SetCaret(self, *_args, **_kwargs):
+ val = apply(windowsc.wxWindow_SetCaret,(self,) + _args, _kwargs)
+ return val
+ def GetCaret(self, *_args, **_kwargs):
+ val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs)
+ if val: val = wxCaretPtr(val)
+ return val
def __repr__(self):
return "<C wxWindow instance at %s>" % (self.this,)
+ # replaces broken shadow method
+ def GetCaret(self, *_args, **_kwargs):
+ from misc2 import wxCaretPtr
+ val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs)
+ if val: val = wxCaretPtr(val)
+ return val
+
class wxWindow(wxWindowPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windowsc.new_wxWindow,_args,_kwargs)
if val: val = wxWindowPtr(val)
return val
+wxWindow_NewControlId = windowsc.wxWindow_NewControlId
+
+wxWindow_NextControlId = windowsc.wxWindow_NextControlId
+
+wxWindow_PrevControlId = windowsc.wxWindow_PrevControlId
+
#-------------- VARIABLE WRAPPERS ------------------
%pragma(python) addtomethod = "SetDropTarget:_args[0].thisown = 0"
wxSize GetBestSize();
+
+ void SetCaret(wxCaret *caret);
+ wxCaret *GetCaret();
+ %pragma(python) addtoclass = "# replaces broken shadow method
+ def GetCaret(self, *_args, **_kwargs):
+ from misc2 import wxCaretPtr
+ val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs)
+ if val: val = wxCaretPtr(val)
+ return val
+"
};
//%clear int* x, int* y;
%}
#endif
+%inline %{
+ int wxWindow_NewControlId() {
+ return wxWindow::NewControlId();
+ }
+ int wxWindow_NextControlId(int id) {
+ return wxWindow::NextControlId(id);
+ }
+ int wxWindow_PrevControlId(int id) {
+ return wxWindow::PrevControlId(id);
+ }
+%}
//---------------------------------------------------------------------------