Пример #1
0
/* Call every time the board size might have changed! */
void
setup_display (void)
{
    set_zoom_display (0);       /* 0 means set to default */

    /* The cursor starts out in the top right of the board
     * (on the hoshi point for most board sizes), unless the board
     * is really small in which case the cursor starts at the center
     * of the board.
     */
    int start_x, start_y;
    if (board_width >= 7)
    {
        start_x = board_width - 4;
    }
    else
    {
        start_x = board_width / 2;
    }

    if (board_height >= 7)
    {
        start_y = 3;
    }
    else
    {
        start_y = board_height / 2;
    }
    cursor_pos = POS (start_x, start_y);
    last_cursor_pos = INVALID_POS;
    last_int_size = -1;

    clear_marks_display ();
}
Пример #2
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;
        };
    }

}