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>
19 class SpecialPatch:
public Patch {
22 virtual ~SpecialPatch();
28 SpecialPatch::SpecialPatch(
Glyph* g)
30 SpecialPatch::~SpecialPatch() {}
31 void SpecialPatch::request(
Requisition& req)
const {
43 Patch::allocate(
c, aa, e);
45 Patch::allocate(
c, a, e);
67 CopyString* save_action_;
101 bool b = int(
chkarg(1, 0., 1.));
160 for (
i=0;
i < 4; ++
i) {
184 i = int(
chkarg(1, -1, b->count() - 1));
249 bi_ =
new OcDeckImpl;
251 bi_->deck_ =
new Deck(2);
256 lk.flexible(bi_->deck_
261 bi_->save_action_ =
NULL;
270 if (
bi_->save_action_) {
271 delete (
bi_->save_action_);
278 ((SpecialPatch*) body())->reallocate();
279 ((SpecialPatch*) body())->redraw();
285 bi_->ocglyph_list_->append(g);
286 bi_->deck_->append(g);
294 if (
bi_->deck_->card() == last) {
297 bi_->ocglyph_list_->remove(last);
298 bi_->deck_->remove(last);
302 if (
bi_->deck_->card() ==
i) {
305 bi_->ocglyph_list_->remove(
i);
306 bi_->deck_->remove(
i);
310 int last =
bi_->ocglyph_list_->count() - 1;
315 bi_->ocglyph_list_->insert(
i, g);
316 bi_->deck_->insert(
i, g);
317 last =
bi_->ocglyph_list_->count() - 1;
318 bi_->ocglyph_list_->remove(last);
319 bi_->deck_->remove(last);
323 bi_->save_action_ =
new CopyString(creat);
326 ++
bi_->oc_ref_->refcount;
332 if (
bi_->save_action_) {
334 o <<
buf << std::endl;
336 o <<
"{ocbox_ = new Deck()" << std::endl;
337 o <<
"ocbox_list_.prepend(ocbox_)" << std::endl;
338 o <<
"ocbox_.intercept(1)}" << std::endl;
339 long i,
cnt =
bi_->ocglyph_list_->count();
340 for (
i = 0;
i <
cnt; ++
i) {
343 o <<
"{ocbox_ = ocbox_list_.object(0)" << std::endl;
344 o <<
"ocbox_list_.remove(0)" << std::endl;
345 o <<
"ocbox_.intercept(0)" << std::endl;
349 "ocbox_.map(\"%s\", %g, %g, %g, %g)}",
355 o <<
buf << std::endl;
357 o <<
"ocbox_.map()}" << std::endl;
361 o <<
buf << std::endl;
Allotment & y_allotment()
virtual const char * name() const
virtual void flip_to(int)
virtual void save_action(const char *, Object *)
virtual void box_append(OcGlyph *)
virtual void save(std::ostream &)
virtual void move_last(int)
virtual void remove(long)
virtual void remove_last()
virtual PrintableWindow * make_window(Coord left=-1, Coord bottom=-1, Coord width=-1, Coord height=-1)
virtual PrintableWindow * window()
virtual bool has_window()
virtual void unref() const
void class2oc(const char *, ctor_f *cons, dtor_f *destruct, Member_func *, Member_ret_obj_func *, Member_ret_str_func *)
double chkarg(int, double low, double high)
char * hoc_object_pathname(Object *ob)
void hoc_dec_refcount(Object **pobj)
#define TRY_GUI_REDIRECT_ACTUAL_DOUBLE(name, obj)
#define TRY_GUI_REDIRECT_NO_RETURN(name, obj)
#define TRY_GUI_REDIRECT_OBJ(name, obj)
Object ** hoc_objgetarg(int)
int Sprintf(char(&buf)[N], const char *fmt, Args &&... args)
Redirect sprintf to snprintf if the buffer size can be deduced.
static Member_func members[]
static double move_last(void *v)
static void * cons(Object *)
static void destruct(void *v)
static double unmap(void *v)
static double map(void *v)
static double save(void *v)
static double remove(void *v)
static double intercept(void *v)
static double remove_last(void *v)
static double flip_to(void *v)