Exemple #1
0
void
refresh_screen()
{
#ifdef SIGWINCH
    if(should_resize) {
        resize_abook();
        return;
    }
#endif
    clear();

    refresh_statusline();
    headerline(gettext(MAIN_HELPLINE));
    list_headerline();

    refresh_list();
}
Exemple #2
0
void
display_help(int help)
{
    int i;
    char **tbl;
    WINDOW *helpw;

    switch(help) {
    case HELP_MAIN:
        tbl = mainhelp;
        break;
    case HELP_EDITOR:
        tbl = editorhelp;
        break;
    default:
        return;
    }

    helpw = newwin(LINES - 5, COLS - 6, 2, 3);
    erase();
    headerline(_("help"));

    for(i = 0; tbl[i] != NULL; i++) {
        waddstr(helpw, gettext(tbl[i]));
        if( (!((i + 1) % (LINES - 8))) ||
                (tbl[i + 1] == NULL) ) {
            refresh();
            wrefresh(helpw);
            refresh_statusline();
            if(statusline_msg(_("Press any key to continue..."))
                    == 'q')
                break;
            wclear(helpw);
        }
    }

    clear_statusline();
    delwin(helpw);
}
Exemple #3
0
void printdataline( void )
{
    int i, k;
    static int linect = 50;

    if ( iper != 0 )   goto w330;
    if ( ipr < 1 )   goto w380;
    linect++;
    if ( linect < 48 && ipr3 == 0 )   goto w340;
    if ( ipr3 == 0 && nsear > 1 )   fprintf (ioout,"\f" );
    headerline ( );
    linect = 0;
    goto w340;
w330 :
    k = (nsear / iper) * iper;
    if ( k != nsear && k != (nsear-1) )  goto w340;
    if ( nsear == 0 ) headerline ( );
    if ( nsear < 2 )  goto w340;
    if ( k == (nsear-1) ) headerline ( );
    ipr = iprhld;
    ipr3 = iprhd3;
w340 :
    grnorm = 0.0;
    if ( nsuper == 0 )   goto w360;
    for ( i=1; i<=nsuper; i++ )
	if ( fabs(gradf[i]) > grnorm )   grnorm = fabs(gradf[i]);
w360 :
    if ( nsuper > maxrm )  cond = 0.0;
    if ( degen == 1 )    step = 0.0;
    if ( maxim == 1 && ninf == 0 )   g[nobj] = -g[nobj];
    if ( degen == 1 )
	fprintf (ioout,
	"%3d %12.6g    %3d     %3d     %3d  %10.4g  %8.3g %8.3g     T \n",
	nsear, g[nobj], nb, nsuper, ninf, grnorm, cond, step );
    else
	fprintf (ioout,
	"%3d %12.6g    %3d     %3d     %3d  %10.4g  %8.3g %8.3g\n",
	nsear, g[nobj], nb, nsuper, ninf, grnorm, cond, step );
    if ( ipr < 3 )   goto w370;
    for ( i=1; i<=mp1; i++ )
		{
		fprintf (ioout,"G[%3d] = %-14.7g ", i, g[i] );
		if (i % 3 == 0) fprintf (ioout,"\n");
		}
    fprintf ( ioout, "\n");
    for ( i=1; i<=n; i++ )
		{
		fprintf (ioout,"X[%3d] = %-14.7g ", i, x[i] );
		if (i % 3 == 0) fprintf (ioout,"\n");
		}
    fprintf ( ioout, "\n");
w370 :
    if ( maxim == 1 && ninf == 0 )   g[nobj] = -g[nobj];
    if ( iper == 0 )   goto w380;
    if ( k != (nsear-1 ) )  goto w380;
    if ( nsear != 1 ) headerline ( );
    ipr = 1;
    ipr3 = 0;
w380 :
    return ;
}