Beispiel #1
0
bool GUIAddText( gui_window *wnd, unsigned id, char *text )
{
    VFIELD      *field;
    a_list      *list;

    if( GetList( wnd, id, &field, &list ) ) {
        return( GUIListBoxAddText( list, text, -1 ) );
    }
    return( FALSE );
}
bool GUIAddText( gui_window *wnd, gui_ctl_id id, const char *text )
{
    VFIELD      *field;
    a_list      *list;

    if( GetList( wnd, id, &field, &list ) ) {
        return( GUIListBoxAddText( list, text, -1 ) );
    }
    return( false );
}
Beispiel #3
0
bool GUIInsertText( gui_window *wnd, unsigned id, int choice, const char *text )
{
    VFIELD      *field;
    a_list      *list;

    if( GetList( wnd, id, &field, &list ) ) {
        return( GUIListBoxAddText( list, text, choice ) );
    }
    return( false );
}
Beispiel #4
0
a_list *GUICreateEditMLE( char * text )
{
    a_list      *list;
    char        *text_copy;
    char        *line;
    char        *end;
    char        *absolute_end;
    #define     MLE_NEWLINE     "\r\n"

    list = (a_list * )GUIMemAlloc( sizeof( a_list ) );
    if( list == NULL ) {
        return( NULL );
    }
    if( !GUIFillInListBox( list ) ) {
        GUIMemFree( list );
        list = NULL;
    } else {
        GUIStrDup( text, &text_copy );
        line = text_copy;
        absolute_end = text_copy + strlen( text_copy );
        end = strstr( line, MLE_NEWLINE );
        if( end != NULL ) {
            *end = '\0';
        }
        while( line != absolute_end && end != NULL ) {
            GUIListBoxAddText( list, line, -1 );
            line = end + 2;
            end = strstr( line, MLE_NEWLINE );
            if( end != NULL ) {
                *end = '\0';
            }
        }
        GUIListBoxAddText( list, line, -1 );
        GUIMemFree( text_copy );
    }
    return( list );
}