Пример #1
0
/**
 * Call string_input_win / ui_element_input::input_filter and filter the entries list interactively
 */
std::string uimenu::inputfilter()
{
    std::string identifier = ""; // @todo: uimenu.filter_identifier ?
    mvwprintz(window, w_height - 1, 2, border_color, "< ");
    mvwprintz(window, w_height - 1, w_width - 3, border_color, " >");
    /*
    //debatable merit
        std::string origfilter = filter;
        int origselected = selected;
        int origfselected = fselected;
        int origvshift = vshift;
    */
    string_input_popup popup;
    popup.text( filter )
         .max_length( 256 )
         .window( window, 4, w_height - 1, w_width - 4 )
         .identifier( identifier );
    input_event event;
#ifdef __ANDROID__
    if( get_option<bool>( "ANDROID_AUTO_KEYBOARD" ) ) {
        SDL_StartTextInput();
    }
#endif
	do {
        // filter=filter_input->query(filter, false);
        filter = popup.query_string( false );
        event = popup.context().get_raw_input();
        // key = filter_input->keypress;
        if ( event.get_first_input() != KEY_ESCAPE ) {
            if( !scrollby( scroll_amount_from_key( event.get_first_input() ) ) ) {
                filterlist();
            }
            show();
        }
    } while(event.get_first_input() != '\n' && event.get_first_input() != KEY_ESCAPE);

    if ( event.get_first_input() == KEY_ESCAPE ) {
        /*
        //perhaps as an option
                filter = origfilter;
                selected = origselected;
                fselected = origfselected;
                vshift = origvshift;
        */
        filterlist();
    }

    wattron(window, border_color);
    for( int i = 1; i < w_width - 1; i++ ) {
        mvwaddch(window, w_height - 1, i, LINE_OXOX);
    }
    wattroff(window, border_color);

    return filter;
}
Пример #2
0
/*
 * Call string_input_win / ui_element_input::input_filter and filter the entries list interactively
 */
std::string uimenu::inputfilter()
{
    std::string identifier = ""; // todo: uimenu.filter_identifier ?
    long key = 0;
    int spos = -1;
    mvwprintz(window, w_height - 1, 2, border_color, "< ");
    mvwprintz(window, w_height - 1, w_width - 3, border_color, " >");
/*
//debatable merit
    std::string origfilter = filter;
    int origselected = selected;
    int origfselected = fselected;
    int origvshift = vshift;
*/
    do {
        // filter=filter_input->query(filter, false);
        filter = string_input_win( window, filter, 256, 4, w_height - 1, w_width - 4,
                                   false, key, spos, identifier, 4, w_height - 1 );
        // key = filter_input->keypress;
        if ( key != KEY_ESCAPE ) {
            if ( scrollby(0, key) == false ) {
                filterlist();
            }
            show();
        }
    } while(key != '\n' && key != KEY_ESCAPE);

    if ( key == KEY_ESCAPE ) {
/*
//perhaps as an option
        filter = origfilter;
        selected = origselected;
        fselected = origfselected;
        vshift = origvshift;
*/
        filterlist();
}

    wattron(window, border_color);
    for( int i = 1; i < w_width - 1; i++ ) {
        mvwaddch(window, w_height-1, i, LINE_OXOX);
    }
    wattroff(window, border_color);

    return filter;
}
Пример #3
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //importcsvfile("bullware.csv");
    load();
    // Add options to filter combo box
    fillfilters();
    filterlist();
}
Пример #4
0
void MainWindow::on_comboBox_2_currentIndexChanged(const QString &arg1)
{
    filterlist();
}