Ejemplo n.º 1
0
static int lc_bottom_panel(lua_State *L)
{
    PANEL *ap = panel_above(NULL);

    /* get associated userdata variable */
    lua_pushlightuserdata(L, ap);
    lua_rawget(L, UPINDEX);
    return 1;
}
Ejemplo n.º 2
0
static int lcp_panel_above(lua_State *L)
{
    PANEL *p = lcp_check(L, 1);
    PANEL *ap = panel_above(p);

    /* get associated userdata variable */
    lua_pushlightuserdata(L, ap);
    lua_rawget(L, UPINDEX);
    return 1;
}
Ejemplo n.º 3
0
// Get the panel above PAN
SCM
gucu_panel_above (SCM pan)
{
  if (_scm_is_panel (pan))
    {
      PANEL *c_pan = _scm_to_panel (pan);
      PANEL *c_pan2 = panel_above (c_pan);
      return _scm_from_panel (c_pan2);
    }
  else if (pan == SCM_BOOL_F)
    {
      PANEL *c_pan2 = panel_above (0);
      return _scm_from_panel (c_pan2);
    }
  else
    scm_wrong_type_arg ("panel-above", SCM_ARG1, pan);

  /* Never reached */
  return SCM_BOOL_F;
}
Ejemplo n.º 4
0
static void
show_panels(PANEL * px[MAX_PANELS + 1])
{
    static const char *help[] =
    {
	"",
	"Commands are letter/digit pairs.  Digits are the panel number.",
	"",
	"  b - put the panel on the bottom of the stack",
	"  c - create the panel",
	"  d - delete the panel",
	"  h - hide the panel",
	"  m - move the panel (M for continuous move)",
	"  r - resize the panel",
	"  s - show the panel",
	"  b - put the panel on the top of the stack"
    };

    struct {
	bool valid;
	bool hidden;
	PANEL *above;
	PANEL *below;
    } table[MAX_PANELS + 1];

    WINDOW *win;
    PANEL *pan;
    int j;

    memset(table, 0, sizeof(table));
    for (j = 1; j <= MAX_PANELS; ++j) {
	table[j].valid = (px[j] != 0);
	if (table[j].valid) {
	    table[j].hidden = panel_hidden(px[j]);
	    table[j].above = panel_above(px[j]);
	    table[j].below = panel_below(px[j]);
	}
    }

    if ((win = newwin(LINES - 1, COLS, 0, 0)) != 0) {
	keypad(win, TRUE);
	if ((pan = new_panel(win)) != 0) {
	    werase(win);
	    MvWPrintw(win, 0, 0, "Panels:\n");
	    for (j = 1; j <= MAX_PANELS; ++j) {
		if (table[j].valid) {
		    wprintw(win, " %d:", j);
		    if (table[j].hidden) {
			waddstr(win, " hidden");
		    } else {
			if (table[j].above) {
			    wprintw(win, " above %d",
				    which_panel(px, table[j].above));
			}
			if (table[j].below) {
			    wprintw(win, "%s below %d",
				    table[j].above ? "," : "",
				    which_panel(px, table[j].below));
			}
		    }
		    waddch(win, '\n');
		}
	    }
	    for (j = 0; j < (int) SIZEOF(help); ++j) {
		if (wprintw(win, "%s\n", help[j]) == ERR)
		    break;
	    }
	    wgetch(win);
	    del_panel(pan);
	    pflush();
	}
	delwin(win);
    }
}
Ejemplo n.º 5
0
inline void panel_stack_bottom(PANEL **panel) {
	*panel = panel_above(NULL);
}
Ejemplo n.º 6
0
static VALUE rbncurs_c_panel_above(VALUE rb_panel)
{ return wrap_panel(panel_above(get_panel(rb_panel))); }