1 #include <../../nrnconf.h>
7 #include <InterViews/layout.h>
8 #include <IV-look/kit.h>
39 char* str_action =
NULL;
56 char* str_action =
NULL;
113 select_is_pycallback_ =
false;
114 accept_is_pycallback_ =
false;
127 psec_[scnt_++] =
sec;
141 psec_[scnt_++] =
sec;
144 for (
i = 0;
i < scnt_; ++
i) {
194 OcBrowser::select(-1);
226 OcBrowser::select(
i);
241 state(
i)->set(TelltaleState::is_enabled,
false);
242 OcBrowser::select(old);
253 b[0] = wk.palette_button(
"Parameters",
NULL);
254 b[1] = wk.palette_button(
"States",
NULL);
255 b[2] = wk.palette_button(
"Assigned",
NULL);
256 PolyGlyph* vb = lk.vbox(b[0], b[1], b[2]);
257 for (
i = 0;
i < 3; ++
i) {
258 tts_[
i] = b[
i]->state();
261 tts_[0]->set(TelltaleState::is_chosen,
true);
262 body(wk.inset_frame(lk.margin(vb, 5)));
267 for (
i = 0;
i < 3; ++
i) {
282 return tts_[
i]->test(TelltaleState::is_chosen);
298 b->state()->set(TelltaleState::is_chosen,
true);
300 tts_[
i] = b->state();
302 body(lk.hbox(lk.vcenter(wk.inset_frame(lk.margin(lk.natural_span(vsb, 200, 100), 5)), 1.0),
304 wk.vscroll_bar(vsb)));
340 class SectionBrowserImpl {
342 SectionBrowserImpl();
343 ~SectionBrowserImpl();
350 class BrowserAccept:
public Action {
353 virtual ~BrowserAccept();
362 BrowserAccept::~BrowserAccept() {}
367 SectionBrowserImpl::SectionBrowserImpl() {
380 psec_[scnt_++] =
sec;
388 SectionBrowserImpl::~SectionBrowserImpl() {
389 for (
int i = 0;
i < scnt_; ++
i) {
401 sbi_ =
new SectionBrowserImpl;
402 for (
int i = 0;
i < sbi_->scnt_; ++
i) {
403 append_item(
secname(sbi_->psec_[
i]));
415 printf(
"accepted %d\n",
int(selected()));
419 if (
sbi_->mvt_->parameter_select()) {
422 if (
sbi_->mvt_->state_select()) {
425 if (
sbi_->mvt_->assigned_select()) {
430 printf(
"This section was deleted\n");
435 if (
sbi_->psec_[
int(
i)]->prop) {
436 FileBrowser::select(
i);
438 FileBrowser::select(-1);
449 lk.vbox(sb->
sbi_->mvt_, lk.vspace(5), sb->
sbi_->ms_)));
454 class PBrowserAccept:
public Action {
457 virtual ~PBrowserAccept();
466 PBrowserAccept::~PBrowserAccept() {}
478 PPBImpl::PPBImpl(
OcList* ocl) {
482 PPBImpl::~PPBImpl() {
488 ppbi_ =
new PPBImpl(ocl);
490 for (
i = 0;
i <
cnt; ++
i) {
516 remove_selectable(
i);
523 ppbi_->ocl_->append(ob);
530 FileBrowser::select(
i);
536 printf(
"PointProcessBrowser::accept\n");
const char * secname(Section *sec)
void nrn_pushsec(Section *sec)
Section * chk_access(void)
int execute(bool notify=true)
bool is_selected(int type)
virtual Glyph * standard_glyph()
virtual void append_item(const char *)
virtual void select_and_adjust(GlyphIndex)
virtual void set_select_action(const char *, Object *)
virtual void select(GlyphIndex)
virtual void set_accept_action(const char *, Object *)
virtual void select_section(Section *)
virtual ~OcSectionBrowser()
Object * accept_pycallback_
Object * select_pycallback_
bool select_is_pycallback_
OcSectionBrowser(Object *)
bool accept_is_pycallback_
virtual ~PointProcessBrowser()
virtual void add_pp(Object *)
PointProcessBrowser(OcList *)
virtual void append_pp(Object *)
virtual void select(GlyphIndex)
static void make_point_process_browser(OcList *)
virtual void unref() const
static void make_section_browser()
virtual void select(GlyphIndex)
virtual ~SectionBrowser()
SectionBrowserImpl * sbi_
int hoc_is_object_arg(int narg)
char * hoc_object_name(Object *ob)
#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)
#define ITERATE(itm, lst)
void section_ref(Section *)
void section_unref(Section *)
void class2oc(const char *, void *(*cons)(Object *), void(*destruct)(void *), Member_func *, int(*checkpoint)(void **), Member_ret_obj_func *, Member_ret_str_func *)
static void * sb_cons(Object *)
double(* nrnpy_object_to_double_)(Object *)
static void sb_destruct(void *v)
void SectionBrowser_reg()
static Member_func sb_members[]
static double sb_accept_action(void *v)
static double sb_select_action(void *v)
void(* nrnpy_call_python_with_section)(Object *, Section *)
static double sb_select(void *v)
void section_menu(double, int, MechSelector *=NULL)