1 #include <../../nrnconf.h> 4 #include <InterViews/window.h> 23 init(cmd, hoc_thisobject);
32 if (strcmp(pobj->ctemplate->sym->name,
"PythonObject") != 0) {
74 obj_->ctemplate->sym->name
83 const char*
ccc =
"PythonObject";
109 err = (*nrnpy_hoccommand_exec)(
po_);
128 int err = (*nrnpy_hoccommand_exec_strret)(
po_,
buf, size);
172 #if HAVE_IV // to end of file 174 HocCommandAction::HocCommandAction(
HocCommand* hc) {
178 HocCommandAction::~HocCommandAction() {
delete hc_;}
188 HocCommandTool::~HocCommandTool() {
192 bool HocCommandTool::event(
Event&
e) {
197 if (e.type() != Event::down && e.type() != Event::up && e.window()->canvas()->any_damage()) {
201 if (e.type() == Event::down) {
206 e.window()->grab_pointer();
209 kd = e.control_is_down() + e.shift_is_down()*2 + e.meta_is_down()*4;
213 t.transform(e.pointer_x(), e.pointer_y(), x, y);
215 if (e.type() == Event::up) {
218 e.window()->ungrab_pointer();
221 if (hc_->pyobject()) {
222 (*nrnpy_cmdtool)(hc_->pyobject(), e.type(), x, y, kd);
226 sprintf(buf,
"%s(%d, %g, %g, %d)", hc_->name(), e.type(), x, y, kd);
227 hc_->execute(buf,
true);
229 if (e.type() == Event::up) {
const Transformer & s2o() const
Symbol * hoc_lookup(const char *)
char * hoc_object_name(Object *ob)
static void help(const char *)
void nrn_notify_when_void_freed(void *p, Observer *ob)
int(* nrnpy_hoccommand_exec_strret)(Object *, char *, int)
sprintf(buf," if (secondorder) {\ " int _i;\" " for(_i=0;_i< %d;++_i) {\" " _p[_slist%d[_i]]+=dt *_p[_dlist%d[_i]];\" " }}\", numeqn, listnum, listnum)
const char * string() const
int execute(bool notify=true)
void hoc_obj_unref(Object *obj)
void hoc_execerror(const char *, const char *)
int(* nrnpy_hoccommand_exec)(Object *)
void(* nrnpy_cmdtool)(Object *, int type, double x, double y, int kd)
virtual void unref() const
void hoc_obj_ref(Object *obj)
int exec_strret(char *buf, int size, bool notify=true)
int hoc_obj_run(const char *, Object *)
double func_call(int narg, int *perr=NULL)
void init(const char *, Object *)
Symbol * hoc_table_lookup(const char *, Symlist *)
void nrn_notify_pointer_disconnect(Observer *ob)
void hoc_audit_command(const char *buf)
double hoc_call_objfunc(Symbol *s, int narg, Object *ob)
double(* nrnpy_func_call)(Object *, int, int *)
static XYView * current_pick_view()
virtual void update(Observable *)