Changeset 15 for trunk/UOptionsForm.pas


Ignore:
Timestamp:
Feb 11, 2012, 6:45:36 PM (13 years ago)
Author:
chronos
Message:
  • Added: Support for multiple interface languages.
  • Added: Used packages as zip archives.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UOptionsForm.pas

    r14 r15  
    1616    ButtonOk: TButton;
    1717    ButtonCancel: TButton;
     18    ComboBoxLanguage: TComboBox;
    1819    Label1: TLabel;
    1920    Label2: TLabel;
     21    Label3: TLabel;
    2022    SpinEditCellSize: TSpinEdit;
    2123    SpinEditMemorySize: TSpinEdit;
     24    procedure ButtonOkClick(Sender: TObject);
     25    procedure FormShow(Sender: TObject);
    2226  private
    2327    { private declarations }
     
    3438{$R *.lfm}
    3539
     40uses
     41  UMainForm, ULanguages;
     42
    3643{ TOptionsForm }
     44
     45procedure TOptionsForm.FormShow(Sender: TObject);
     46begin
     47  MainForm.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items);
     48  ComboBoxLanguage.ItemIndex := MainForm.CoolTranslator1.Languages.IndexOf(MainForm.CoolTranslator1.Language);
     49  if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
     50end;
     51
     52procedure TOptionsForm.ButtonOkClick(Sender: TObject);
     53begin
     54  if ComboBoxLanguage.ItemIndex <> -1 then
     55    MainForm.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
     56end;
    3757
    3858procedure TOptionsForm.LoadFromInterpretter(Interpretter: TBrainFuckInterpretter
Note: See TracChangeset for help on using the changeset viewer.