1 #include <../../nrnconf.h> 8 #include <InterViews/iv3text.h> 9 #include <InterViews/layout.h> 10 #include <InterViews/background.h> 11 #include <InterViews/event.h> 12 #include <IV-look/kit.h> 27 extern char** (*nrnpy_gui_helper3_str_)(
const char*
name,
Object* obj,
int handle_strptr);
30 class OcText :
public Text {
34 virtual void keystroke(
const Event& event);
37 class OcMLineEditor :
public OcGlyph {
39 OcMLineEditor(
unsigned row,
unsigned col,
const char*
buf =
NULL);
40 virtual ~OcMLineEditor();
46 static double map(
void*
v) {
50 OcMLineEditor*
e = (OcMLineEditor*)v;
74 OcMLineEditor*
e = (OcMLineEditor*)v;
77 e->txt_->readOnly(
int(
chkarg(1, 0, 1)));
79 return double(e->txt_->readOnly());
89 OcMLineEditor*
e = (OcMLineEditor*)v;
94 tb->Insert(0, s, strlen(s));
97 *p = (
char*)tb->Text();
98 return (
const char**)
p;
120 const char*
buf =
"";
127 row = unsigned(
chkarg(2, 1, 1000));
128 col = unsigned(
chkarg(3, 1, 1000));
130 OcMLineEditor*
e =
new OcMLineEditor(row, col, buf);
142 OcMLineEditor*
e = (OcMLineEditor*)v;
143 if (e->has_window()) {
144 e->window()->dismiss();
156 OcMLineEditor::OcMLineEditor(
unsigned row,
unsigned col,
const char*
buf) {
157 txt_ =
new OcText(
row, col,
new TextBuffer(buf,strlen(buf),1000));
162 WidgetKit::instance()->background()
166 OcMLineEditor::~OcMLineEditor() {
170 OcText::OcText(
unsigned rows,
unsigned cols,
TextBuffer*
buf) :
177 void OcText::keystroke(
const Event&
e){
182 int count = e.mapkey(buffer, 8);
#define TRY_GUI_REDIRECT_NO_RETURN(name, obj)
#define TRY_GUI_REDIRECT_ACTUAL_STR(name, obj)
static double readonly(void *v)
static const char ** v_text(void *v)
#define TRY_GUI_REDIRECT_ACTUAL_DOUBLE(name, obj)
virtual const char * name() const
static Member_func members[]
static double map(void *v)
void class2oc(const char *, void *(*cons)(Object *), void(*destruct)(void *), Member_func *, int(*checkpoint)(void **), Member_ret_obj_func *, Member_ret_str_func *)
static Member_ret_str_func retstr_members[]
static void destruct(void *v)
#define TRY_GUI_REDIRECT_OBJ(name, obj)
static void * cons(Object *)
char ** hoc_temp_charptr(void)
double(* nrnpy_object_to_double_)(Object *)
double chkarg(int, double low, double high)