Commit d57b35fa authored by allens's avatar allens
Browse files

added support for testChanged

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@27789 18c085ea-50e0-402c-830e-de6fd14e8384
parent 4d91f2f7
...@@ -86,6 +86,14 @@ sim_ui_handle(const char *name, char *args) ...@@ -86,6 +86,14 @@ sim_ui_handle(const char *name, char *args)
++handled; ++handled;
} }
if(strcmp(signalName, "textChanged(char *)") == 0 &&
ui->slot_textChanged != NULL)
{
char *text = value;
(*ui->slot_textChanged)(text, ui->slot_textChanged_data);
++handled;
}
if(strcmp(signalName, "stateChanged(int)") == 0 && if(strcmp(signalName, "stateChanged(int)") == 0 &&
ui->slot_stateChanged != NULL) ui->slot_stateChanged != NULL)
{ {
......
...@@ -12,6 +12,9 @@ typedef struct ...@@ -12,6 +12,9 @@ typedef struct
void (*slot_valueChanged)(int, void*); void (*slot_valueChanged)(int, void*);
void *slot_valueChanged_data; void *slot_valueChanged_data;
void (*slot_textChanged)(char*, void*);
void *slot_textChanged_data;
void (*slot_stateChanged)(int, void *); void (*slot_stateChanged)(int, void *);
void *slot_stateChanged_data; void *slot_stateChanged_data;
......
...@@ -4160,6 +4160,22 @@ VisItUI_valueChanged(const char *name, void (*cb)(int,void*), void *cbdata) ...@@ -4160,6 +4160,22 @@ VisItUI_valueChanged(const char *name, void (*cb)(int,void*), void *cbdata)
return retval; return retval;
} }
int
VisItUI_textChanged(const char *name, void (*cb)(char*,void*), void *cbdata)
{
int retval = VISIT_ERROR;
sim_ui_element *e = NULL;
LIBSIM_API_ENTER(VisItUI_textChanged);
if((e = sim_ui_get(name)) != NULL)
{
e->slot_textChanged = cb;
e->slot_textChanged_data = cbdata;
retval = VISIT_OKAY;
}
LIBSIM_API_LEAVE(VisItUI_textChanged);
return retval;
}
int int
VisItUI_setValueI(const char *name, int value, int enabled) VisItUI_setValueI(const char *name, int value, int enabled)
{ {
......
...@@ -1327,6 +1327,7 @@ int VisItSetWriteVariable(int (*cb)(const char *, const char *, int, visit_handl ...@@ -1327,6 +1327,7 @@ int VisItSetWriteVariable(int (*cb)(const char *, const char *, int, visit_handl
int VisItUI_clicked(const char *name, void (*cb)(void*), void *cbdata2); int VisItUI_clicked(const char *name, void (*cb)(void*), void *cbdata2);
int VisItUI_stateChanged(const char *name, void (*cb)(int,void*), void *cbdata2); int VisItUI_stateChanged(const char *name, void (*cb)(int,void*), void *cbdata2);
int VisItUI_valueChanged(const char *name, void (*cb)(int,void*), void *cbdata2); int VisItUI_valueChanged(const char *name, void (*cb)(int,void*), void *cbdata2);
int VisItUI_textChanged(const char *name, void (*cb)(char *,void*), void *cbdata2);
int VisItUI_setValueI(const char *name, int value, int enabled); int VisItUI_setValueI(const char *name, int value, int enabled);
int VisItUI_setValueS(const char *name, const char *value, int enabled); int VisItUI_setValueS(const char *name, const char *value, int enabled);
......
...@@ -363,6 +363,10 @@ def VisItUI_valueChanged(name, cb, cbdata2): ...@@ -363,6 +363,10 @@ def VisItUI_valueChanged(name, cb, cbdata2):
return _simV2.VisItUI_valueChanged(name, cb, cbdata2) return _simV2.VisItUI_valueChanged(name, cb, cbdata2)
VisItUI_valueChanged = _simV2.VisItUI_valueChanged VisItUI_valueChanged = _simV2.VisItUI_valueChanged
def VisItUI_textChanged(name, cb, cbdata2):
return _simV2.VisItUI_textChanged(name, cb, cbdata2)
VisItUI_textChanged = _simV2.VisItUI_textChanged
def VisItUI_setValueI(name, value, enabled): def VisItUI_setValueI(name, value, enabled):
return _simV2.VisItUI_setValueI(name, value, enabled) return _simV2.VisItUI_setValueI(name, value, enabled)
VisItUI_setValueI = _simV2.VisItUI_setValueI VisItUI_setValueI = _simV2.VisItUI_setValueI
......
...@@ -663,6 +663,36 @@ void pylibsim_invoke_v_F_i_pv(int arg0, void *cbdata) ...@@ -663,6 +663,36 @@ void pylibsim_invoke_v_F_i_pv(int arg0, void *cbdata)
} }
} }
/******************************************************************************
* used by: UI_textChanged
******************************************************************************/
void pylibsim_invoke_v_F_pc_pv(char *arg0, void *cbdata)
{
/* a callback and its data */
simV2_CallbackData *cbpair = static_cast<simV2_CallbackData*>(cbdata);
simV2_PyObject &callback = cbpair->first;
simV2_PyObject &data = cbpair->second;
if (callback)
{
PyObject *tuple = PyTuple_New(1);
PyTuple_SET_ITEM(tuple, 0, PyString_FromString(arg0));
Py_INCREF(data); // SET_ITEM steals a ref
PyTuple_SET_ITEM(tuple, 1, data);
PyObject *ret = PyObject_Call(callback, tuple, NULL);
Py_DECREF(tuple);
if(ret != NULL)
{
Py_DECREF(ret);
}
}
}
namespace pylibsim { namespace pylibsim {
#if defined(SIMV2_USE_NUMPY) #if defined(SIMV2_USE_NUMPY)
......
...@@ -79,6 +79,7 @@ int pylibsim_invoke_i_F_pcc_pv(const char*,void*); ...@@ -79,6 +79,7 @@ int pylibsim_invoke_i_F_pcc_pv(const char*,void*);
int pylibsim_invoke_i_F_pcc_i_i_h_h_pv(const char*,int,int,visit_handle,visit_handle,void*); int pylibsim_invoke_i_F_pcc_i_i_h_h_pv(const char*,int,int,visit_handle,visit_handle,void*);
int pylibsim_invoke_i_F_pcc_pcc_i_h_h_pv(const char *, const char *, int, visit_handle, visit_handle, void *); int pylibsim_invoke_i_F_pcc_pcc_i_h_h_pv(const char *, const char *, int, visit_handle, visit_handle, void *);
void pylibsim_invoke_v_F_i_pv(int,void*); void pylibsim_invoke_v_F_i_pv(int,void*);
void pylibsim_invoke_v_F_pc_pv(char*,void*);
void pylibsim_invoke_v_F_pv(void *); void pylibsim_invoke_v_F_pv(void *);
// for passing data // for passing data
......
...@@ -5841,6 +5841,46 @@ fail: ...@@ -5841,6 +5841,46 @@ fail:
} }
SWIGINTERN PyObject *_wrap_VisItUI_textChanged(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
void (*arg2)(char *,void *) = (void (*)(char *,void *)) 0 ;
void *arg3 = (void *) 0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
simV2_PyObject callback2 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
int result;
if (!PyArg_ParseTuple(args,(char *)"OOO:VisItUI_textChanged",&obj0,&obj1,&obj2)) SWIG_fail;
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VisItUI_textChanged" "', argument " "1"" of type '" "char const *""'");
}
arg1 = reinterpret_cast< char * >(buf1);
{
if (assignCallback(callback2, obj1)) {
return NULL;
}
arg2 = pylibsim_invoke_v_F_pc_pv;
}
{
simV2_CallbackData *package = newCallbackData(callback2, obj2);
arg3 = static_cast<void*>(package);
}
result = (int)VisItUI_textChanged((char const *)arg1,arg2,arg3);
resultobj = SWIG_From_int(static_cast< int >(result));
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
return resultobj;
fail:
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
return NULL;
}
SWIGINTERN PyObject *_wrap_VisItUI_setValueI(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { SWIGINTERN PyObject *_wrap_VisItUI_setValueI(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0; PyObject *resultobj = 0;
char *arg1 = (char *) 0 ; char *arg1 = (char *) 0 ;
...@@ -13377,6 +13417,7 @@ static PyMethodDef SwigMethods[] = { ...@@ -13377,6 +13417,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"VisItUI_clicked", _wrap_VisItUI_clicked, METH_VARARGS, NULL}, { (char *)"VisItUI_clicked", _wrap_VisItUI_clicked, METH_VARARGS, NULL},
{ (char *)"VisItUI_stateChanged", _wrap_VisItUI_stateChanged, METH_VARARGS, NULL}, { (char *)"VisItUI_stateChanged", _wrap_VisItUI_stateChanged, METH_VARARGS, NULL},
{ (char *)"VisItUI_valueChanged", _wrap_VisItUI_valueChanged, METH_VARARGS, NULL}, { (char *)"VisItUI_valueChanged", _wrap_VisItUI_valueChanged, METH_VARARGS, NULL},
{ (char *)"VisItUI_textChanged", _wrap_VisItUI_textChanged, METH_VARARGS, NULL},
{ (char *)"VisItUI_setValueI", _wrap_VisItUI_setValueI, METH_VARARGS, NULL}, { (char *)"VisItUI_setValueI", _wrap_VisItUI_setValueI, METH_VARARGS, NULL},
{ (char *)"VisItUI_setValueS", _wrap_VisItUI_setValueS, METH_VARARGS, NULL}, { (char *)"VisItUI_setValueS", _wrap_VisItUI_setValueS, METH_VARARGS, NULL},
{ (char *)"VISIT_INVALID_HANDLE_swigconstant", VISIT_INVALID_HANDLE_swigconstant, METH_VARARGS, NULL}, { (char *)"VISIT_INVALID_HANDLE_swigconstant", VISIT_INVALID_HANDLE_swigconstant, METH_VARARGS, NULL},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment