Added wxChildFocusEvent

Updated wxHtmlWindow

Added wxEditableListBox


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12739 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-11-28 09:47:53 +00:00
parent 96d24601af
commit 7b7ac0ab51
22 changed files with 538 additions and 47 deletions

View File

@@ -886,6 +886,7 @@ enum wxEventType {
wxEVT_COMMAND_TOOL_ENTER,
wxEVT_SET_FOCUS,
wxEVT_KILL_FOCUS,
wxEVT_CHILD_FOCUS,
wxEVT_MOUSEWHEEL,
/* Mouse event types */

View File

@@ -75,6 +75,9 @@ def EVT_SET_FOCUS(win, func):
def EVT_KILL_FOCUS(win, func):
win.Connect(-1, -1, wxEVT_KILL_FOCUS, func)
def EVT_CHILD_FOCUS(win, func):
win.Connect(-1, -1, wxEVT_CHILD_FOCUS, func)
def EVT_ACTIVATE(win, func):
win.Connect(-1, -1, wxEVT_ACTIVATE, func)

View File

@@ -269,6 +269,18 @@ public:
wxFocusEvent(WXTYPE eventType = 0, int id = 0);
};
//---------------------------------------------------------------------------
// wxChildFocusEvent notifies the parent that a child has got the focus: unlike
// wxFocusEvent it is propgated upwards the window chain
class wxChildFocusEvent : public wxCommandEvent
{
public:
wxChildFocusEvent(wxWindow *win = NULL);
wxWindow *GetWindow() const;
};
//---------------------------------------------------------------------------
class wxActivateEvent: public wxEvent{

View File

@@ -64,6 +64,8 @@ static void wxPyCoreAPI_IMPORT() {
#define wxPyMake_wxObject2(a,b) (wxPyCoreAPIPtr->p_wxPyMake_wxObject(a,b))
#define wxPyMake_wxSizer(a) (wxPyCoreAPIPtr->p_wxPyMake_wxSizer(a))
#define wxPyPtrTypeMap_Add(a, b) (wxPyCoreAPIPtr->p_wxPyPtrTypeMap_Add(a, b))
#define wxArrayString2PyList_helper(a) (wxPyCoreAPIPtr->p_wxArrayString2PyList_helper(a))
// This one is special. It's the first function called in SWIG generated

View File

@@ -152,7 +152,7 @@ bool _2int_seq_helper(PyObject* source, int* i1, int* i2);
bool _4int_seq_helper(PyObject* source, int* i1, int* i2, int* i3, int* i4);
PyObject* wxArrayString2PyList_helper(const wxArrayString& app);
PyObject* wxArrayString2PyList_helper(const wxArrayString& arr);
#define RETURN_NONE() { Py_INCREF(Py_None); return Py_None; }
@@ -288,7 +288,7 @@ struct wxPyCoreAPI {
PyObject* (*p_wxPyMake_wxObject)(wxObject* source, bool checkEvtHandler);
PyObject* (*p_wxPyMake_wxSizer)(wxSizer* source);
void (*p_wxPyPtrTypeMap_Add)(const char* commonName, const char* ptrName);
PyObject* (*p_wxArrayString2PyList_helper)(const wxArrayString& arr);
};
#ifdef wxPyUSE_EXPORT

View File

@@ -419,6 +419,7 @@ public:
long style = wxHW_SCROLLBAR_AUTO,
const wxString& name = "htmlWindow")
: wxHtmlWindow(parent, id, pos, size, style, name) {};
wxPyHtmlWindow() : wxHtmlWindow() {};
void OnLinkClicked(const wxHtmlLinkInfo& link);
void base_OnLinkClicked(const wxHtmlLinkInfo& link);
@@ -462,11 +463,19 @@ public:
wxSize& size = wxDefaultSize,
int flags=wxHW_SCROLLBAR_AUTO,
char* name = "htmlWindow");
%name(wxPreHtmlWindow)wxPyHtmlWindow();
bool Create(wxWindow *parent, int id = -1,
wxPoint& pos = wxDefaultPosition,
wxSize& size = wxDefaultSize,
int flags=wxHW_SCROLLBAR_AUTO,
char* name = "htmlWindow");
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxHtmlWindow)"
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
%pragma(python) addtomethod = "wxPreHtmlWindow:val._setOORInfo(val)"
bool SetPage(const wxString& source);
bool LoadPage(const wxString& location);

View File

@@ -4459,6 +4459,93 @@ static PyObject *_wrap_new_wxFocusEvent(PyObject *self, PyObject *args, PyObject
return _resultobj;
}
static void *SwigwxChildFocusEventTowxCommandEvent(void *ptr) {
wxChildFocusEvent *src;
wxCommandEvent *dest;
src = (wxChildFocusEvent *) ptr;
dest = (wxCommandEvent *) src;
return (void *) dest;
}
static void *SwigwxChildFocusEventTowxEvent(void *ptr) {
wxChildFocusEvent *src;
wxEvent *dest;
src = (wxChildFocusEvent *) ptr;
dest = (wxEvent *) src;
return (void *) dest;
}
static void *SwigwxChildFocusEventTowxObject(void *ptr) {
wxChildFocusEvent *src;
wxObject *dest;
src = (wxChildFocusEvent *) ptr;
dest = (wxObject *) src;
return (void *) dest;
}
#define new_wxChildFocusEvent(_swigarg0) (new wxChildFocusEvent(_swigarg0))
static PyObject *_wrap_new_wxChildFocusEvent(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxChildFocusEvent * _result;
wxWindow * _arg0 = (wxWindow *) NULL;
PyObject * _argo0 = 0;
char *_kwnames[] = { "win", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:new_wxChildFocusEvent",_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 new_wxChildFocusEvent. Expected _wxWindow_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxChildFocusEvent *)new_wxChildFocusEvent(_arg0);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxChildFocusEvent_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define wxChildFocusEvent_GetWindow(_swigobj) (_swigobj->GetWindow())
static PyObject *_wrap_wxChildFocusEvent_GetWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxWindow * _result;
wxChildFocusEvent * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxChildFocusEvent_GetWindow",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxChildFocusEvent_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxChildFocusEvent_GetWindow. Expected _wxChildFocusEvent_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxWindow *)wxChildFocusEvent_GetWindow(_arg0);
wxPy_END_ALLOW_THREADS;
if (PyErr_Occurred()) return NULL;
}{ _resultobj = wxPyMake_wxObject(_result); }
return _resultobj;
}
static void *SwigwxActivateEventTowxEvent(void *ptr) {
wxActivateEvent *src;
wxEvent *dest;
@@ -7059,6 +7146,8 @@ static PyMethodDef eventscMethods[] = {
{ "new_wxInitDialogEvent", (PyCFunction) _wrap_new_wxInitDialogEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxActivateEvent_GetActive", (PyCFunction) _wrap_wxActivateEvent_GetActive, METH_VARARGS | METH_KEYWORDS },
{ "new_wxActivateEvent", (PyCFunction) _wrap_new_wxActivateEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxChildFocusEvent_GetWindow", (PyCFunction) _wrap_wxChildFocusEvent_GetWindow, METH_VARARGS | METH_KEYWORDS },
{ "new_wxChildFocusEvent", (PyCFunction) _wrap_new_wxChildFocusEvent, METH_VARARGS | METH_KEYWORDS },
{ "new_wxFocusEvent", (PyCFunction) _wrap_new_wxFocusEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxEraseEvent_GetDC", (PyCFunction) _wrap_wxEraseEvent_GetDC, METH_VARARGS | METH_KEYWORDS },
{ "new_wxEraseEvent", (PyCFunction) _wrap_new_wxEraseEvent, METH_VARARGS | METH_KEYWORDS },
@@ -7229,6 +7318,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxEvent","_wxMenuEvent",SwigwxMenuEventTowxEvent},
{ "_wxEvent","_wxInitDialogEvent",SwigwxInitDialogEventTowxEvent},
{ "_wxEvent","_wxActivateEvent",SwigwxActivateEventTowxEvent},
{ "_wxEvent","_wxChildFocusEvent",SwigwxChildFocusEventTowxEvent},
{ "_wxEvent","_wxFocusEvent",SwigwxFocusEventTowxEvent},
{ "_wxEvent","_wxEraseEvent",SwigwxEraseEventTowxEvent},
{ "_wxEvent","_wxPaintEvent",SwigwxPaintEventTowxEvent},
@@ -7275,6 +7365,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxCommandEvent","_wxWindowDestroyEvent",SwigwxWindowDestroyEventTowxCommandEvent},
{ "_wxCommandEvent","_wxWindowCreateEvent",SwigwxWindowCreateEventTowxCommandEvent},
{ "_wxCommandEvent","_wxNotifyEvent",SwigwxNotifyEventTowxCommandEvent},
{ "_wxCommandEvent","_wxChildFocusEvent",SwigwxChildFocusEventTowxCommandEvent},
{ "_wxCommandEvent","_wxSpinEvent",SwigwxSpinEventTowxCommandEvent},
{ "_wxCommandEvent","_wxScrollEvent",SwigwxScrollEventTowxCommandEvent},
{ "_char","_wxChar",0},
@@ -7317,6 +7408,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxObject","_wxMenuEvent",SwigwxMenuEventTowxObject},
{ "_wxObject","_wxInitDialogEvent",SwigwxInitDialogEventTowxObject},
{ "_wxObject","_wxActivateEvent",SwigwxActivateEventTowxObject},
{ "_wxObject","_wxChildFocusEvent",SwigwxChildFocusEventTowxObject},
{ "_wxObject","_wxFocusEvent",SwigwxFocusEventTowxObject},
{ "_wxObject","_wxEraseEvent",SwigwxEraseEventTowxObject},
{ "_wxObject","_wxPaintEvent",SwigwxPaintEventTowxObject},

View File

@@ -574,6 +574,23 @@ class wxFocusEvent(wxFocusEventPtr):
class wxChildFocusEventPtr(wxCommandEventPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def GetWindow(self, *_args, **_kwargs):
val = apply(eventsc.wxChildFocusEvent_GetWindow,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxChildFocusEvent instance at %s>" % (self.this,)
class wxChildFocusEvent(wxChildFocusEventPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(eventsc.new_wxChildFocusEvent,_args,_kwargs)
self.thisown = 1
class wxActivateEventPtr(wxEventPtr):
def __init__(self,this):
self.this = this

View File

@@ -201,6 +201,7 @@ public:
long style = wxHW_SCROLLBAR_AUTO,
const wxString& name = "htmlWindow")
: wxHtmlWindow(parent, id, pos, size, style, name) {};
wxPyHtmlWindow() : wxHtmlWindow() {};
void OnLinkClicked(const wxHtmlLinkInfo& link);
void base_OnLinkClicked(const wxHtmlLinkInfo& link);
@@ -4076,6 +4077,88 @@ static PyObject *_wrap_new_wxHtmlWindow(PyObject *self, PyObject *args, PyObject
return _resultobj;
}
#define new_wxPreHtmlWindow() (new wxPyHtmlWindow())
static PyObject *_wrap_new_wxPreHtmlWindow(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPyHtmlWindow * _result;
char *_kwnames[] = { NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxPreHtmlWindow",_kwnames))
return NULL;
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (wxPyHtmlWindow *)new_wxPreHtmlWindow();
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyHtmlWindow_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define wxHtmlWindow_Create(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5) (_swigobj->Create(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5))
static PyObject *_wrap_wxHtmlWindow_Create(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxPyHtmlWindow * _arg0;
wxWindow * _arg1;
int _arg2 = (int ) -1;
wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg4 = (wxSize *) &wxDefaultSize;
int _arg5 = (int ) wxHW_SCROLLBAR_AUTO;
char * _arg6 = (char *) "htmlWindow";
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
wxPoint temp;
PyObject * _obj3 = 0;
wxSize temp0;
PyObject * _obj4 = 0;
char *_kwnames[] = { "self","parent","id","pos","size","flags","name", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOis:wxHtmlWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyHtmlWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlWindow_Create. Expected _wxPyHtmlWindow_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 wxHtmlWindow_Create. Expected _wxWindow_p.");
return NULL;
}
}
if (_obj3)
{
_arg3 = &temp;
if (! wxPoint_helper(_obj3, &_arg3))
return NULL;
}
if (_obj4)
{
_arg4 = &temp0;
if (! wxSize_helper(_obj4, &_arg4))
return NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxHtmlWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6);
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
#define wxHtmlWindow__setCallbackInfo(_swigobj,_swigarg0,_swigarg1) (_swigobj->_setCallbackInfo(_swigarg0,_swigarg1))
static PyObject *_wrap_wxHtmlWindow__setCallbackInfo(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -6266,6 +6349,8 @@ static PyMethodDef htmlcMethods[] = {
{ "wxHtmlWindow_LoadPage", (PyCFunction) _wrap_wxHtmlWindow_LoadPage, METH_VARARGS | METH_KEYWORDS },
{ "wxHtmlWindow_SetPage", (PyCFunction) _wrap_wxHtmlWindow_SetPage, METH_VARARGS | METH_KEYWORDS },
{ "wxHtmlWindow__setCallbackInfo", (PyCFunction) _wrap_wxHtmlWindow__setCallbackInfo, METH_VARARGS | METH_KEYWORDS },
{ "wxHtmlWindow_Create", (PyCFunction) _wrap_wxHtmlWindow_Create, METH_VARARGS | METH_KEYWORDS },
{ "new_wxPreHtmlWindow", (PyCFunction) _wrap_new_wxPreHtmlWindow, METH_VARARGS | METH_KEYWORDS },
{ "new_wxHtmlWindow", (PyCFunction) _wrap_new_wxHtmlWindow, METH_VARARGS | METH_KEYWORDS },
{ "new_wxHtmlWidgetCell", (PyCFunction) _wrap_new_wxHtmlWidgetCell, METH_VARARGS | METH_KEYWORDS },
{ "new_wxHtmlFontCell", (PyCFunction) _wrap_new_wxHtmlFontCell, METH_VARARGS | METH_KEYWORDS },

View File

@@ -511,6 +511,9 @@ class wxHtmlWindowPtr(wxScrolledWindowPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def Create(self, *_args, **_kwargs):
val = apply(htmlc.wxHtmlWindow_Create,(self,) + _args, _kwargs)
return val
def _setCallbackInfo(self, *_args, **_kwargs):
val = apply(htmlc.wxHtmlWindow__setCallbackInfo,(self,) + _args, _kwargs)
return val
@@ -602,6 +605,12 @@ class wxHtmlWindow(wxHtmlWindowPtr):
def wxPreHtmlWindow(*_args,**_kwargs):
val = wxHtmlWindowPtr(apply(htmlc.new_wxPreHtmlWindow,_args,_kwargs))
val.thisown = 1
val._setOORInfo(val)
return val
class wxHtmlDCRendererPtr(wxObjectPtr):
def __init__(self,this):

View File

@@ -4595,13 +4595,13 @@ static PyObject *_wrap_wxWindow_Show(PyObject *self, PyObject *args, PyObject *k
PyObject * _resultobj;
bool _result;
wxWindow * _arg0;
bool _arg1;
bool _arg1 = (bool ) TRUE;
PyObject * _argo0 = 0;
int tempbool1;
int tempbool1 = (int) TRUE;
char *_kwnames[] = { "self","show", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxWindow_Show",_kwnames,&_argo0,&tempbool1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxWindow_Show",_kwnames,&_argo0,&tempbool1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }

View File

@@ -609,6 +609,7 @@ class wxPanel(wxPanelPtr):
def wxPrePanel(*_args,**_kwargs):
val = wxPanelPtr(apply(windowsc.new_wxPrePanel,_args,_kwargs))
val.thisown = 1
val._setOORInfo(val)
return val

View File

@@ -674,6 +674,7 @@ static wxPyCoreAPI API = {
wxPyMake_wxObject,
wxPyMake_wxSizer,
wxPyPtrTypeMap_Add,
wxArrayString2PyList_helper
};
@@ -2507,6 +2508,7 @@ SWIGEXPORT(void) initwxc() {
PyDict_SetItemString(d,"wxEVT_COMMAND_TOOL_ENTER", PyInt_FromLong((long) wxEVT_COMMAND_TOOL_ENTER));
PyDict_SetItemString(d,"wxEVT_SET_FOCUS", PyInt_FromLong((long) wxEVT_SET_FOCUS));
PyDict_SetItemString(d,"wxEVT_KILL_FOCUS", PyInt_FromLong((long) wxEVT_KILL_FOCUS));
PyDict_SetItemString(d,"wxEVT_CHILD_FOCUS", PyInt_FromLong((long) wxEVT_CHILD_FOCUS));
PyDict_SetItemString(d,"wxEVT_MOUSEWHEEL", PyInt_FromLong((long) wxEVT_MOUSEWHEEL));
PyDict_SetItemString(d,"wxEVT_LEFT_DOWN", PyInt_FromLong((long) wxEVT_LEFT_DOWN));
PyDict_SetItemString(d,"wxEVT_LEFT_UP", PyInt_FromLong((long) wxEVT_LEFT_UP));

View File

@@ -771,6 +771,7 @@ wxEVT_COMMAND_TOOL_RCLICKED = wxc.wxEVT_COMMAND_TOOL_RCLICKED
wxEVT_COMMAND_TOOL_ENTER = wxc.wxEVT_COMMAND_TOOL_ENTER
wxEVT_SET_FOCUS = wxc.wxEVT_SET_FOCUS
wxEVT_KILL_FOCUS = wxc.wxEVT_KILL_FOCUS
wxEVT_CHILD_FOCUS = wxc.wxEVT_CHILD_FOCUS
wxEVT_MOUSEWHEEL = wxc.wxEVT_MOUSEWHEEL
wxEVT_LEFT_DOWN = wxc.wxEVT_LEFT_DOWN
wxEVT_LEFT_UP = wxc.wxEVT_LEFT_UP
@@ -947,6 +948,9 @@ def EVT_SET_FOCUS(win, func):
def EVT_KILL_FOCUS(win, func):
win.Connect(-1, -1, wxEVT_KILL_FOCUS, func)
def EVT_CHILD_FOCUS(win, func):
win.Connect(-1, -1, wxEVT_CHILD_FOCUS, func)
def EVT_ACTIVATE(win, func):
win.Connect(-1, -1, wxEVT_ACTIVATE, func)

View File

@@ -336,7 +336,7 @@ public:
void SetEventHandler(wxEvtHandler* handler);
void SetExtraStyle(long exStyle);
void SetTitle(const wxString& title);
bool Show(bool show);
bool Show(bool show=TRUE);
bool TransferDataFromWindow();
bool TransferDataToWindow();
bool Validate();
@@ -452,7 +452,7 @@ public:
const char* name = "panel");
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
%pragma(python) addtomethod = "XXX:val._setOORInfo(self)"
%pragma(python) addtomethod = "wxPrePanel:val._setOORInfo(val)"
void InitDialog();
wxButton* GetDefaultItem();

View File

@@ -192,6 +192,7 @@ static wxPyCoreAPI API = {
wxPyMake_wxObject,
wxPyMake_wxSizer,
wxPyPtrTypeMap_Add,
wxArrayString2PyList_helper
};