Changeset 10 for trunk/Forms


Ignore:
Timestamp:
Jan 25, 2015, 9:54:33 PM (10 years ago)
Author:
chronos
Message:
  • Added: Option to choose interface language.
  • Added: Source of used packages.
Location:
trunk/Forms
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormPreferences.lfm

    r9 r10  
    2121    Top = 376
    2222    Width = 75
     23    Anchors = [akRight, akBottom]
    2324    Caption = 'Save'
    2425    ModalResult = 1
     
    3031    Top = 375
    3132    Width = 75
     33    Anchors = [akRight, akBottom]
    3234    Caption = 'Cancel'
    3335    ModalResult = 2
    3436    TabOrder = 2
    3537  end
     38  object ComboBoxLanguage: TComboBox
     39    Left = 192
     40    Height = 35
     41    Top = 64
     42    Width = 292
     43    ItemHeight = 0
     44    Style = csDropDownList
     45    TabOrder = 3
     46  end
     47  object Label1: TLabel
     48    Left = 18
     49    Height = 25
     50    Top = 65
     51    Width = 95
     52    Caption = 'Language:'
     53    ParentColor = False
     54  end
    3655end
  • trunk/Forms/UFormPreferences.pas

    r9 r10  
    1616    ButtonCancel: TButton;
    1717    CheckBoxRememberDatabase: TCheckBox;
     18    ComboBoxLanguage: TComboBox;
     19    Label1: TLabel;
    1820  private
    1921    { private declarations }
     
    3032{$R *.lfm}
    3133
     34uses
     35  UCore, ULanguages;
     36
    3237{ TFormPreferences }
    3338
     
    3540begin
    3641  CheckBoxRememberDatabase.Checked := Preferences.RememberDatabase;
     42  Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items);
     43  ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language);
     44  if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
    3745end;
    3846
     
    4048begin
    4149  Preferences.RememberDatabase := CheckBoxRememberDatabase.Checked;
     50  if ComboBoxLanguage.ItemIndex <> -1 then
     51    Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
    4252end;
    4353
Note: See TracChangeset for help on using the changeset viewer.