Пример #1
0
int move_panel(PANEL *pan, int starty, int startx)
{
    WINDOW *win;
    int maxy, maxx;

    if (!pan)
        return ERR;

    if (_panel_is_linked(pan))
        _override(pan, 0);

    win = pan->win;

    if (mvwin(win, starty, startx) == ERR)
        return ERR;

    getbegyx(win, pan->wstarty, pan->wstartx);
    getmaxyx(win, maxy, maxx);
    pan->wendy = pan->wstarty + maxy;
    pan->wendx = pan->wstartx + maxx;

    if (_panel_is_linked(pan))
        _calculate_obscure();

    return OK;
}
Пример #2
0
//------------------------------------------------------------------------------
int replace_panel( PANEL* pan, WINDOW* win )
{
	__QCS_FCONTEXT( "replace_panel" );

    int maxy, maxx;

    if( !pan )
	{
        return ERR;
	}

    if( _panel_is_linked( pan ) )
	{
        _override( pan, 0 );
	}

    pan->win = win;
    getbegyx( win, pan->wstarty, pan->wstartx );
    getmaxyx( win, maxy, maxx );
    pan->wendy = pan->wstarty + maxy;
    pan->wendx = pan->wstartx + maxx;

    if( _panel_is_linked( pan ) )
	{
		_calculate_obscure();
	}

    return 0;
}
Пример #3
0
// link panel into stack at bottom
//------------------------------------------------------------------------------
static void _panel_link_bottom( PANEL* pan )
{
	__QCS_FCONTEXT( "_panel_link_bottom" );

#ifdef PANEL_DEBUG
    dStack( "<lb%d>", 1, pan );
    if( _panel_is_linked( pan ) )
	{
        return;
	}
#endif
    pan->above = (PANEL*)0;
    pan->below = (PANEL*)0;

    if( _bottom_panel )
    {
        _bottom_panel->below = pan;
        pan->above = _bottom_panel;
    }

    _bottom_panel = pan;

    if( !_top_panel )
	{
        _top_panel = pan;
	}

    _calculate_obscure();
    dStack( "<lb%d>", 9, pan );
}
Пример #4
0
//------------------------------------------------------------------------------
static void _panel_unlink( PANEL* pan )
{
	__QCS_FCONTEXT( "_panel_unlink" );

    PANEL* prev;
    PANEL* next;

#ifdef PANEL_DEBUG
    dStack( "<u%d>", 1, pan );
    if( !_panel_is_linked( pan ) )
	{
        return;
	}
#endif
    _override( pan, 0 );
    _free_obscure( pan );

    prev = pan->below;
    next = pan->above;

    // if non-zero, we will not update the list head

    if( prev )
    {
        prev->above = next;
        if( next )
		{
            next->below = prev;
		}
    }
    else if( next )
	{
        next->below = prev;
	}

    if( pan == _bottom_panel )
	{
        _bottom_panel = next;
	}

    if( pan == _top_panel )
	{
        _top_panel = prev;
	}

    _calculate_obscure();

    pan->above = (PANEL*)0;
    pan->below = (PANEL*)0;
    dStack( "<u%d>", 9, pan );
}
Пример #5
0
int replace_panel(PANEL *pan, WINDOW *win)
{
    int maxy, maxx;

    if (!pan)
        return ERR;

    if (_panel_is_linked(pan))
        _override(pan, 0);

    pan->win = win;
    getbegyx(win, pan->wstarty, pan->wstartx);
    getmaxyx(win, maxy, maxx);
    pan->wendy = pan->wstarty + maxy;
    pan->wendx = pan->wstartx + maxx;

    if (_panel_is_linked(pan))
        _calculate_obscure();

    return OK;
}
Пример #6
0
static void _panel_link_top(PANEL *pan)
{
#ifdef PANEL_DEBUG
    dStack("<lt%d>", 1, pan);
    if (_panel_is_linked(pan))
        return;
#endif
    pan->above = (PANEL *)0;
    pan->below = (PANEL *)0;

    if (_top_panel)
    {
        _top_panel->above = pan;
        pan->below = _top_panel;
    }

    _top_panel = pan;

    if (!_bottom_panel)
        _bottom_panel = pan;

    _calculate_obscure();
    dStack("<lt%d>", 9, pan);
}
Пример #7
0
//------------------------------------------------------------------------------
int move_panel( PANEL* pan, int starty, int startx )
{
	__QCS_FCONTEXT( "move_panel" );

    WINDOW* win;
    int maxy, maxx;

    if( !pan )
	{
        return ERR;
	}

    if( _panel_is_linked( pan ) )
	{
        _override( pan, 0 );
	}

    win = pan->win;

    if( mvwin( win, starty, startx ) == ERR )
	{
        return ERR;
	}

    getbegyx( win, pan->wstarty, pan->wstartx );
    getmaxyx( win, maxy, maxx );
    pan->wendy = pan->wstarty + maxy;
    pan->wendx = pan->wstartx + maxx;

    if( _panel_is_linked( pan ) )
	{
        _calculate_obscure();
	}

    return 0;
}