Example #1
0
WEXPORT MAction::MAction( WTokenFile& fil, WString& tok )
    : _defAction( FALSE )
    , _button( FALSE )
    , _okForMask( FALSE )
{
    _accel = NULL;
    fil.token( _name );
    if( fil.eol() ) {
        _tool = _config->nilTool();
    } else {
        _tool = _config->findTool( fil.token( tok ) ); //this must work
        if( !_tool ) {
            _tool = _config->nilTool();
        }
        if( !fil.eol() ) {
            _okForMask = ( fil.token( tok ) == "OKFORMASK" );
        }
    }
    fil.token( tok );   //read ahead
    for(;;) {
        if( tok == "Command" ) {
            _commands.add( new MCommand( fil, tok ) );
        } else if( tok == "Hint" ) {
            fil.token( _hint );
            fil.token( tok );
        } else if( tok == "AccelKey" ) {
            fil.token( _accelString );
            fil.token( tok );
        } else if( tok == "Button" ) {
            _button = TRUE;
            fil.token( tok );
        } else if( tok == "Default" ) {
            _defAction = TRUE;
            fil.token( tok );
        } else if( tok == "Help" ) {
            fil.token( _help );
            fil.token( tok );
        } else if( tok == "HotKey" ) {
            if( _accel == NULL ) {
                _accel = new MAccelerator( fil, tok );
            }
        } else if( tok == "rem" ) {
            fil.flushLine( tok );
            fil.token( tok );
        } else {
            break;
        }
    }
}
Example #2
0
MFamily::MFamily( WTokenFile& fil, WString& tok )
{
    if( !fil.eol() ) {
        fil.token( _name );
    }
    WString rGroup;
    for(;;) {
        fil.token( tok );
        if( tok == "RGroup" ) {
            fil.token( rGroup );
        } else if( tok == "VSwitch" ) {
            _switches.add( new MVSwitch( fil, tok ) );
        } else if( tok == "C2Switch" ) {
            _switches.add( new MC2Switch( fil, tok ) );
        } else if( tok == "CSwitch" ) {
            _switches.add( new MCSwitch( fil, tok ) );
        } else if( tok == "RSwitch" ) {
            _switches.add( new MRSwitch( fil, tok, rGroup ) );
        } else if( tok == "rem" ) {
            fil.flushLine( tok );
        } else {
            break;
        }
    }
}
Example #3
0
MC2Switch::MC2Switch( WTokenFile& fil, WString& tok )
    : MSwitch( fil, tok )
{
    fil.token( _on );
    fil.token( _off );
    bool state = false;
    for( int i=0; i<SWMODE_COUNT; i++ ) {
        if( !fil.eol() ) {
            state = ( fil.token( tok ) == "ON" );
        }
        _state[i] = state;
    }
}
Example #4
0
void MConfig::configMsgLog( WTokenFile& fil, WString& tok )
{
    fil.token( tok );
    for(;;) {
        if( tok == "Scan" ) {
            _logScanPatterns.add( new WString( fil.token( tok ) ) );
            fil.token( tok );
        } else if( tok == "BatchServer" ) {
            fil.token( _batserv );
            fil.token( tok );
        } else if( tok == "Help" ) {
            _logHelpFiles.add( new WString( fil.token( tok ) ) );
            _logHelpFiles.add( new WString( fil.token( tok ) ) );
            if( !fil.eol() ) {
                _logHelpFiles.add( new WString( fil.token( tok ) ) );
            } else {
                _logHelpFiles.add( new WString( "0" ) );
            }
            fil.token( tok );
        } else if( tok == "HtmlHelp" ) {
            _logHtmlHelpFiles.add( new WString( fil.token( tok ) ) );
            _logHtmlHelpFiles.add( new WString( fil.token( tok ) ) );
            if( !fil.eol() ) {
                _logHtmlHelpFiles.add( new WString( fil.token( tok ) ) );
            } else {
                _logHtmlHelpFiles.add( new WString( "0" ) );
            }
            fil.token( tok );
        } else if( tok == "rem" ) {
            fil.flushLine( tok );
            fil.token( tok );
        } else {
            break;
        }
    }
}
Example #5
0
MTool::MTool( WTokenFile& fil, WString& tok )
{
    fil.token( _tag );
    fil.token( _name );
    fil.token( tok );
    for(;;) {
        if( tok == "Family" ) {
            _families.add( new MFamily( fil, tok ) );
        } else if( tok == "IncludeTool" ) {
            MTool* tool = _config->findTool( fil.token( tok ) );
            if( tool != NULL ) {
                _incTools.add( tool );
            }
            fil.token( tok );
#if CUR_CFG_VERSION > 4
        } else if( _config->version() > 4 && tok == "SwitchText" ) {
            WString id;
            fil.token( id );
            fil.token( tok );
            if( tok.size() > 0 ) {
                _switchesTexts.setThis( new WString( tok ), new WString( id ) );
            }
            // define map "text -> id" for older versions of project files
            while( !fil.eol() ) {
                fil.token( tok );
                if( tok.size() > 0 ) {
                    // define new switch text for map
                    _switchesIds.setThis( new WString( id ), new WString( tok ) );
                }
            }
            fil.token( tok );
#endif
        } else if( tok == "Help" ) {
            fil.token( _help );
            fil.token( tok );
        } else if( tok == "rem" ) {
            fil.flushLine( tok );
            fil.token( tok );
        } else {
            break;
        }
    }
}