Beispiel #1
0
Datei: layout.c Projekt: m32/mc
void
set_hintbar (const char *str)
{
    label_set_text (the_hint, str);
    if (ok_to_refresh > 0)
        mc_refresh ();
}
Beispiel #2
0
void
clr_scr (void)
{
    standend ();
    dlg_erase (midnight_dlg);
    mc_refresh ();
    doupdate ();
}
Beispiel #3
0
static void
refresh_cmd (void)
{
#ifdef HAVE_SLANG
    tty_touch_screen ();
    mc_refresh ();
#else
    /* Use this if the refreshes fail */
    clr_scr ();
    repaint_screen ();
#endif /* HAVE_SLANG */
}
Beispiel #4
0
static int
learn_button (WButton * button, int action)
{
    WDialog *d;
    char *seq;

    (void) button;

    d = create_message (D_ERROR, _("Teach me a key"),
                        _("Please press the %s\n"
                          "and then wait until this message disappears.\n\n"
                          "Then, press it again to see if OK appears\n"
                          "next to its button.\n\n"
                          "If you want to escape, press a single Escape key\n"
                          "and wait as well."), _(key_name_conv_tab[action - B_USER].longname));
    mc_refresh ();
    if (learnkeys[action - B_USER].sequence != NULL)
    {
        g_free (learnkeys[action - B_USER].sequence);
        learnkeys[action - B_USER].sequence = NULL;
    }

    seq = learn_key ();
    if (seq != NULL)
    {
        /* Esc hides the dialog and do not allow definitions of
         * regular characters
         */
        gboolean seq_ok = FALSE;

        if (*seq != '\0' && strcmp (seq, "\\e") != 0 && strcmp (seq, "\\e\\e") != 0
            && strcmp (seq, "^m") != 0 && strcmp (seq, "^i") != 0
            && (seq[1] != '\0' || *seq < ' ' || *seq > '~'))
        {
            learnchanged = TRUE;
            learnkeys[action - B_USER].sequence = seq;
            seq = convert_controls (seq);
            seq_ok = define_sequence (key_name_conv_tab[action - B_USER].code, seq, MCKEY_NOACTION);
        }

        if (!seq_ok)
            message (D_NORMAL, _("Cannot accept this key"), _("You have entered \"%s\""), seq);

        g_free (seq);
    }

    dlg_run_done (d);
    dlg_destroy (d);

    dlg_select_widget (learnkeys[action - B_USER].button);

    return 0;                   /* Do not kill learn_dlg */
}
Beispiel #5
0
void rotate_dash (void)
{
    static const char rotating_dash [] = "|/-\\";
    static int pos = 0;

    if (!nice_rotating_dash || (ok_to_refresh <= 0))
	return;

    if (pos >= sizeof (rotating_dash)-1)
	pos = 0;
    move (0, COLS-1);
    attrset (NORMAL_COLOR);
    addch (rotating_dash [pos]);
    mc_refresh ();
    pos++;
}
Beispiel #6
0
void rotate_dash (void)
{
#ifndef HAVE_X
    static char rotating_dash [] = "|/-\\";
    static int pos = 0;

    if (!nice_rotating_dash || (ok_to_refresh <= 0))
	return;

    if (pos >= sizeof (rotating_dash)-1)
	pos = 0;
    move (0, COLS-1);
    addch (rotating_dash [pos]);
    mc_refresh ();
    pos++;
#endif
}
Beispiel #7
0
void
rotate_dash (void)
{
    static const char rotating_dash[] = "|/-\\";
    static size_t pos = 0;

    if (!nice_rotating_dash || (ok_to_refresh <= 0))
        return;

    if (pos >= sizeof (rotating_dash) - 1)
        pos = 0;
    tty_gotoyx (0, COLS - 1);
    tty_setcolor (NORMAL_COLOR);
    tty_print_char (rotating_dash[pos]);
    mc_refresh ();
    pos++;
}
static int learn_button (int action, void *param)
{
    unsigned char *seq;
    Dlg_head *d = message (D_INSERT | 1, _(" Teach me a key "),
_("Please press the %s\n"
"and then wait until this message disappears.\n\n"
"Then, press it again to see if OK appears\n"
"next to its button.\n\n"
"If you want to escape, press a single Escape key\n"
"and wait as well."), 
        _(key_name_conv_tab [action - B_USER].longname));
    mc_refresh ();
    if (learnkeys [action - B_USER].sequence != NULL) {
	free (learnkeys [action - B_USER].sequence);
	learnkeys [action - B_USER].sequence = NULL;
    }
    seq = learn_key ();

    if (seq){
	/* Esc hides the dialog and do not allow definitions of
	 * regular characters
	 */
	if (*seq && strcmp (seq, "\\e") && strcmp (seq, "\\e\\e")
	    && strcmp (seq, "^m" ) 
            && (seq [1] || (*seq < ' ' || *seq > '~'))){
	    
	    learnchanged = 1;
	    learnkeys [action - B_USER].sequence = seq;
	    seq = convert_controls (seq);
	    define_sequence (key_name_conv_tab [action - B_USER].code, seq, 
			     MCKEY_NOACTION);
	} else {
	    message (0, _(" Cannot accept this key "),
		_(" You have entered \"%s\""), seq);
	}
	
    	free (seq);
    }
    
    dlg_run_done (d);
    destroy_dlg (d);
    dlg_select_widget (learn_dlg, learnkeys [action - B_USER].button);
    return 0; /* Do not kill learn_dlg */
}
Beispiel #9
0
void
rotate_dash (gboolean show)
{
    static const char rotating_dash[4] = "|/-\\";
    static size_t pos = 0;
    Widget *w = WIDGET (midnight_dlg);

    if (!nice_rotating_dash || (ok_to_refresh <= 0))
        return;

    widget_move (w, (menubar_visible != 0) ? 1 : 0, w->cols - 1);
    tty_setcolor (NORMAL_COLOR);

    if (!show)
        tty_print_alt_char (ACS_URCORNER, FALSE);
    else
    {
        tty_print_char (rotating_dash[pos]);
        pos = (pos + 1) % sizeof (rotating_dash);
    }

    mc_refresh ();
}
Beispiel #10
0
void print_vfs_message (char *msg, ...)
{
    va_list ap;
    char str [128];

    va_start (ap, msg);

    g_vsnprintf (str, sizeof (str), msg, ap);
    va_end (ap);

    if (midnight_shutdown)
	return;

    if (!message_visible || !the_hint || !the_hint->widget.parent) {
	int col, row;

	if (!nice_rotating_dash || (ok_to_refresh <= 0))
	    return;

	/* Preserve current cursor position */
	getyx (stdscr, row, col);

	move (0, 0);
	attrset (NORMAL_COLOR);
	printw ("%-*s", COLS-1, str);

	/* Restore cursor position */
	move(row, col);
	mc_refresh ();
	return;
    }

    if (message_visible) {
        set_hintbar(str);
    }
}
Beispiel #11
0
Datei: main.c Projekt: BrEacK/mc
gboolean
do_load_prompt (void)
{
    gboolean ret = FALSE;

    if (!read_subshell_prompt ())
        return ret;

    /* Don't actually change the prompt if it's invisible */
    if (top_dlg != NULL && ((Dlg_head *) top_dlg->data == midnight_dlg) && command_prompt)
    {
        setup_cmdline ();

        /* since the prompt has changed, and we are called from one of the
         * tty_get_event channels, the prompt updating does not take place
         * automatically: force a cursor update and a screen refresh
         */
        update_cursor (midnight_dlg);
        mc_refresh ();
        ret = TRUE;
    }
    update_subshell_prompt = TRUE;
    return ret;
}