示例#1
0
/*
 * SettingSelected - a setting was selected from the dialog
 */
vi_rc SettingSelected( char *item, char *value, int *winflag )
{
    int         id;
    bool        isnonbool;

    id = Tokenize( SetTokens1, item, FALSE );
    if( id != TOK_INVALID ) {
        isnonbool = TRUE;
    } else {
        id = Tokenize( SetTokens2, item, FALSE );
        if( id == TOK_INVALID ) {
            return( ERR_INVALID_SET_COMMAND );
        }
        isnonbool = FALSE;
    }
    return( processSetToken( id, value, winflag, isnonbool ) );

} /* SettingSelected */
示例#2
0
/*
 * SettingSelected - a setting was selected from the dialog
 */
vi_rc SettingSelected( char *item, char *value, int *winflag )
{
    int         id;
    bool        isnonbool;

    id = Tokenize( TokensSetVar, item, false );
    if( id != TOK_INVALID ) {
        isnonbool = true;
    } else {
        id = Tokenize( TokensSetFlag, item, false );
        if( id == TOK_INVALID ) {
            return( ERR_INVALID_SET_COMMAND );
        }
        isnonbool = false;
    }
    return( processSetToken( id, value, winflag, isnonbool ) );

} /* SettingSelected */
示例#3
0
/*
 * Set - set editor control variable
 */
vi_rc Set( char *name )
{
    char        fn[MAX_STR];
    vi_rc       rc = ERR_NO_ERR;
    int         j, i;
#ifndef VICOMP
#ifndef __WIN__
    int         tmp, tc;
    char        **vals = NULL;
    char        **list;
    int         longest;
#endif
#endif

    /*
     * get item to set
     */
#ifndef VICOMP
    msgFlag = FALSE;
    if( !EditFlags.ScriptIsCompiled ) {
#endif
        RemoveLeadingSpaces( name );
        j = strlen( name );
        for( i = 0; i < j; i++ ) {
            if( name[i] == '=' || name[i] == ',' ) {
                name[i] = ' ';
            }
        }
#ifndef VICOMP
    }
#endif

    if( NextWord1( name, fn ) <=0 ) {
#ifndef VICOMP
        if( !EditFlags.WindowsStarted ) {
            return( ERR_NO_ERR );
        }
#ifndef __WIN__
        tc = getSetInfo( &vals, &list, &longest );
        tmp = setw_info.y2;
        i = setw_info.y2 - setw_info.y1 + 1;
        if( setw_info.has_border ) {
            i -= 2;
        }
        if( tc < i ) {
            setw_info.y2 -= (i - tc);
        }
        rc = SelectItemAndValue( &setw_info, "Settings", list,
                          tc, SettingSelected, 1, vals, longest + 3 );
        setw_info.y2 = tmp;
        MemFreeList( tc, vals );
        MemFreeList( tc, list );
        ReDisplayScreen();
#endif
#endif /* VICOMP */
        return( rc );
    } else {
#ifndef VICOMP
        if( !EditFlags.Starting) {
            msgFlag = TRUE;
        }
#endif
        do {
#ifndef VICOMP
            if( !EditFlags.ScriptIsCompiled ) {
#endif
                if( tolower( fn[0] ) == 'n' && tolower( fn[1] ) == 'o' ) {
                    EliminateFirstN( fn, 2 );
                    i = -1;
                } else {
                    i = 1;
                }
                j = Tokenize( SetTokens1, fn, FALSE );
                if( j == TOK_INVALID ) {
                    j = Tokenize( SetTokens2a, fn, FALSE );
                    if( j == TOK_INVALID ) {
                        j = Tokenize( SetTokens2, fn, FALSE );
                        if( j == TOK_INVALID ) {
                            return( ERR_INVALID_SET_COMMAND );
                        }
                    }
                    j += SET1_T_;
                }
                j *= i;
#ifndef VICOMP
            } else {
                j = atoi( fn );
            }
#endif
            i = TRUE;
            rc = processSetToken( j, name, &i, FALSE );
            if( rc > ERR_NO_ERR ) {
                break;
            }
            RemoveLeadingSpaces( name );
        } while( NextWord1( name, fn ) > 0 );
#ifndef VICOMP
        if( msgFlag ) {
            putMessage();
        }
#endif
        return( rc );
    }

} /* Set */