1 #include <../../nrnconf.h> 5 #include <InterViews/deck.h> 6 #include <InterViews/patch.h> 7 #include <InterViews/layout.h> 8 #include <InterViews/background.h> 9 #include <IV-look/kit.h> 23 class SpecialPatch :
public Patch {
26 virtual ~SpecialPatch();
33 SpecialPatch::~SpecialPatch() {}
46 Patch::allocate(c, aa, e);
48 Patch::allocate(c, a, e);
93 if (b->has_window()) {
106 ((
OcDeck*)v)->intercept(b);
121 w = b->make_window(
float(*
getarg(2)),
float(*
getarg(3)),
124 w = b->make_window();
143 if (b->has_window()) {
161 for (i=0; i < 4; ++
i) {
168 b->save_action(
gargstr(1), o[0]);
198 ((
OcDeck*)v)->remove_last();
206 static double remove(
void*
v) {
211 b->remove((
int)
chkarg(1,0,b->count()-1));
251 bi_ =
new OcDeckImpl;
278 if (
bi_->save_action_) {
279 delete(
bi_->save_action_);
286 ((SpecialPatch*)body())->reallocate();
287 ((SpecialPatch*)body())->redraw();
293 bi_->ocglyph_list_->append(g);
294 bi_->deck_->append(g);
302 if (
bi_->deck_->card() == last) {
305 bi_->ocglyph_list_->remove(last);
306 bi_->deck_->remove(last);
310 if (
bi_->deck_->card() ==
i) {
313 bi_->ocglyph_list_->remove(i);
314 bi_->deck_->remove(i);
318 int last =
bi_->ocglyph_list_->count() - 1;
323 bi_->ocglyph_list_->insert(i, g);
324 bi_->deck_->insert(i, g);
325 last =
bi_->ocglyph_list_->count() - 1;
326 bi_->ocglyph_list_->remove(last);
327 bi_->deck_->remove(last);
334 ++
bi_->oc_ref_->refcount;
340 if (
bi_->save_action_) {
341 sprintf(buf,
"{ocbox_ = %s",
bi_->save_action_->string());
344 o <<
"{ocbox_ = new Deck()" << endl;
345 o <<
"ocbox_list_.prepend(ocbox_)" << endl;
346 o <<
"ocbox_.intercept(1)}" << endl;
347 long i,
cnt =
bi_->ocglyph_list_->count();
348 for (i=0; i <
cnt; ++
i) {
351 o <<
"{ocbox_ = ocbox_list_.object(0)" << endl;
352 o <<
"ocbox_list_.remove(0)" << endl;
353 o <<
"ocbox_.intercept(0)" << endl;
356 sprintf(buf,
"ocbox_.map(\"%s\", %g, %g, %g, %g)}",
358 window()->save_left(), window()->save_bottom(),
359 window()->width(), window()->height());
362 o <<
"ocbox_.map()}" << endl;
static double move_last(void *v)
static Member_func members[]
static double save(void *v)
#define TRY_GUI_REDIRECT_NO_RETURN(name, obj)
virtual void save_action(const char *, Object *)
static double flip_to(void *v)
static void destruct(void *v)
sprintf(buf," if (secondorder) {\ " int _i;\" " for(_i=0;_i< %d;++_i) {\" " _p[_slist%d[_i]]+=dt *_p[_dlist%d[_i]];\" " }}\", numeqn, listnum, listnum)
virtual void move_last(int)
#define TRY_GUI_REDIRECT_ACTUAL_DOUBLE(name, obj)
virtual const char * name() const
virtual void remove_last()
static double unmap(void *v)
virtual void flip_to(int)
virtual PrintableWindow * window()
virtual void box_append(OcGlyph *)
void class2oc(const char *, void *(*cons)(Object *), void(*destruct)(void *), Member_func *, int(*checkpoint)(void **), Member_ret_obj_func *, Member_ret_str_func *)
virtual void save(ostream &)
static double remove_last(void *v)
void hoc_dec_refcount(Object **pobj)
virtual void unref() const
double(* nrnpy_object_to_double_)(Object *)
static void * cons(Object *)
static double intercept(void *v)
#define TRY_GUI_REDIRECT_OBJ(name, obj)
char * hoc_object_pathname(Object *ob)
static double map(void *v)
Allotment & y_allotment()
Object ** hoc_objgetarg(int)
double chkarg(int, double low, double high)