Пример #1
0
/*--------------------------------------------------------------------------*/
static void backSpace(void)
{
	int X = 0, Y = 0;
	reallocLineBuffer();

	TermGetPosition(&X, &Y);
	if ( (X - 1) < 0 )
	{
		X = getXConsoleScreenSize();
		Y = Y - 1;
		TermSetPosition(X, Y);
	}
	else TerminalPutc(VK_BACK);
}
Пример #2
0
/*--------------------------------------------------------------------------*/
int scilinesdefault(void)
{
#ifndef _MSC_VER

    char tc_buf[1024];       /* holds termcap buffer */
    if (tgetent(tc_buf, getenv("TERM")) == 1)
    {
        setConsoleLines(tgetnum("li")); /* retrieve from the term info the number
										of lines */
        setConsoleWidth(tgetnum("co")); /* And the number of columns */
    }
    else
    {
        /* Haven't been able to detect the terminal */
        setConsoleLines(DEFAULT_NUMBERS_LINES);
        setConsoleWidth(DEFAULT_NUMBERS_COLUMNS);
    }

#else
    if ( (getScilabMode() != SCILAB_STD) && (getScilabMode() != SCILAB_API) )
    {
        /* -NW or -NWNI mode */
        int X = getXConsoleScreenSize();
        int Y = getYConsoleScreenSize();

        if (X < DEFAULT_NUMBERS_COLUMNS)
        {
            X = DEFAULT_NUMBERS_COLUMNS;
        }
        if (Y < DEFAULT_NUMBERS_LINES)
        {
            Y = DEFAULT_NUMBERS_LINES;
        }
        setConsoleWidth(X);
        setConsoleLines(Y);
    }
    else
    {
        setConsoleLines(DEFAULT_NUMBERS_LINES);
        setConsoleWidth(DEFAULT_NUMBERS_COLUMNS);
    }
#endif
    return 0;
}