Changeset 22 for trunk/UMainForm.pas


Ignore:
Timestamp:
Feb 12, 2012, 8:15:36 PM (13 years ago)
Author:
chronos
Message:
  • Fixed: Default language selection and remeber explicitly selected language.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UMainForm.pas

    r21 r22  
    221221    OpenKey(Key, True);
    222222    OpenProjectOnStart := ReadBoolWithDefault('OpenProjectOnStart', True);
     223    BrainFuckInterpreter.CellSize := ReadIntegerWithDefault('CellSize', 256);
     224    BrainFuckInterpreter.MemorySize := ReadIntegerWithDefault('MemorySize', 30000);
     225    if ValueExists('LanguageCode') then
     226      CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', ''))
     227      else CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode('');
    223228  finally
    224229    Free;
     
    235240    OpenKey(Key, True);
    236241    WriteBool('OpenProjectOnStart', OpenProjectOnStart);
     242    WriteInteger('CellSize', BrainFuckInterpreter.CellSize);
     243    WriteInteger('MemorySize', BrainFuckInterpreter.MemorySize);
     244    if Assigned(CoolTranslator1.Language) and (CoolTranslator1.Language.Code <> '') then
     245      WriteString('LanguageCode', CoolTranslator1.Language.Code)
     246      else DeleteValue('LanguageCode');
    237247  finally
    238248    Free;
     
    284294  BrainFuckInterpreter.OnChangeState := BrainFuckInterpreterChangeState;
    285295  BrainFuckCompiler := TBrainFuckCompiler.Create;
    286   CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode('cs');
    287296  Compilers := TListObject.Create;
    288297  Compilers.Add(TBrainFuckCompilerDelphi.Create);
Note: See TracChangeset for help on using the changeset viewer.