Exemplo n.º 1
0
static void
do_options_menu (void)
{
    int selection;
    bool done = false;

    MENUITEM_STRINGLIST (options_menu, "Options Menu", NULL,
                         "Show Child Variations?",
                         "Disable Idle Poweroff?",
                         "Idle Autosave Time",
                         "Automatically Show Comments?");

    while (!done)
    {
        selection = rb->do_menu (&options_menu, &selection, NULL, false);

        switch (selection)
        {
        case OMENU_SHOW_VARIATIONS:
            rb->set_bool("Draw Variations?", &draw_variations);
            clear_marks_display ();
            set_all_marks_sgf ();
            if (draw_variations)
            {
                mark_child_variations_sgf ();
            }
            break;

        case OMENU_DISABLE_POWEROFF:
            rb->set_bool("Disable Idle Poweroff?", &disable_shutdown);
            break;

        case OMENU_AUTOSAVE_TIME:
            rb->set_int("Idle Autosave Time", "minutes", UNIT_INT,
                        &autosave_time, NULL, 1, 0, MAX_AUTOSAVE,
                        &autosave_formatter);
            autosave_counter = 0;
            break;

        case OMENU_AUTO_COMMENT:
            rb->set_bool("Auto Show Comments?", &auto_show_comments);
            break;

        case GO_TO_ROOT:
        case GO_TO_PREVIOUS:
        case MENU_ATTACHED_USB:
        default:
            done = true;
            break;
        };
    }

}
Exemplo n.º 2
0
void
draw_screen_display (void)
{
#if LCD_DEPTH > 1
    int saved_fg = rb->lcd_get_foreground ();
    int saved_bg = rb->lcd_get_background ();
#endif
    int saved_drmode = rb->lcd_get_drawmode ();

    if (cursor_pos != last_cursor_pos || intersection_size != last_int_size)
    {
        cursor_updated ();
    }

#if LCD_DEPTH > 1
    rb->lcd_set_backdrop (NULL);

    rb->lcd_set_foreground (BOARD_COLOR);
    rb->lcd_set_background (BACKGROUND_COLOR);
    rb->lcd_set_drawmode (DRMODE_SOLID);

#else
    rb->lcd_set_drawmode (DRMODE_SOLID + DRMODE_INVERSEVID);
#endif

    rb->lcd_clear_display ();

    rb->lcd_fillrect (pixel_x (POS (MIN_X, MIN_Y)),
                      pixel_y (POS (MIN_X, MIN_Y)),
                      (MAX_X - MIN_X) * intersection_size,
                      (MAX_Y - MIN_Y) * intersection_size);

#if LCD_DEPTH > 1
    rb->lcd_set_foreground (LINE_COLOR);
#else
    rb->lcd_set_drawmode (DRMODE_SOLID);
#endif

    unsigned int i;
    for (i = MIN_Y; i < MAX_Y; ++i)
    {
        rb->lcd_hline (pixel_x (POS (MIN_X, i)) + LINE_OFFSET + extend_l,
                       pixel_x (POS (MAX_X - 1, i)) + LINE_OFFSET + extend_r,
                       pixel_y (POS (MIN_X, i)) + LINE_OFFSET);
    }

    for (i = MIN_X; i < MAX_X; ++i)
    {
        rb->lcd_vline (pixel_x (POS (i, MIN_Y)) + LINE_OFFSET,
                       pixel_y (POS (i, MIN_Y)) + LINE_OFFSET + extend_t,
                       pixel_y (POS (i, MAX_Y - 1)) + LINE_OFFSET + extend_b);
    }

    draw_all_hoshi ();
    draw_all_stones ();
    draw_cursor (cursor_pos);

    if (draw_variations)
    {
        mark_child_variations_sgf ();
    }

    draw_all_marks ();

    draw_footer ();
    rb->lcd_update ();

#if LCD_DEPTH > 1
    rb->lcd_set_foreground (saved_fg);
    rb->lcd_set_background (saved_bg);
#endif
    rb->lcd_set_drawmode (saved_drmode);
}