Changeset 18 for trunk/Forms


Ignore:
Timestamp:
Mar 19, 2013, 10:09:14 PM (12 years ago)
Author:
chronos
Message:
  • Přidáno: Možnost nastavit jazyk rozhraní v okně nastavení.
Location:
trunk/Forms
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormSettings.lfm

    r14 r18  
    11object FormSettings: TFormSettings
    22  Left = 420
    3   Height = 281
     3  Height = 393
    44  Top = 127
    55  Width = 558
    66  Caption = 'Settings'
    7   ClientHeight = 281
     7  ClientHeight = 393
    88  ClientWidth = 558
    99  OnCreate = FormCreate
     
    1313    Left = 384
    1414    Height = 25
    15     Top = 250
     15    Top = 362
    1616    Width = 75
    1717    Anchors = [akRight, akBottom]
     
    2323    Left = 472
    2424    Height = 25
    25     Top = 249
     25    Top = 360
    2626    Width = 75
    2727    Anchors = [akRight]
     
    3131    TabOrder = 1
    3232  end
    33   object ComboBox1: TComboBox
     33  object ComboBoxFormat: TComboBox
    3434    Left = 11
    3535    Height = 29
     
    104104    WordWrap = True
    105105  end
     106  object ComboBoxLang: TComboBox
     107    Left = 11
     108    Height = 29
     109    Top = 248
     110    Width = 208
     111    ItemHeight = 0
     112    Style = csDropDownList
     113    TabOrder = 6
     114  end
     115  object Label3: TLabel
     116    Left = 11
     117    Height = 17
     118    Top = 224
     119    Width = 126
     120    Caption = 'Interface language:'
     121    ParentColor = False
     122  end
    106123end
  • trunk/Forms/UFormSettings.lrt

    r14 r18  
    77TFORMSETTINGS.LABELEDEDITFILENAMEFORMAT.EDITLABEL.CAPTION=Output file name format:
    88TFORMSETTINGS.LABEL2.CAPTION=%f - data format, %d - date, %t - time, %a - account number, %n - account name, %% - percent symbol
     9TFORMSETTINGS.LABEL3.CAPTION=Interface language:
  • trunk/Forms/UFormSettings.pas

    r14 r18  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    9   StdCtrls;
     9  StdCtrls, ULanguages;
    1010
    1111type
     
    1717    ButtonCancel: TButton;
    1818    ButtonOk: TButton;
    19     ComboBox1: TComboBox;
     19    ComboBoxFormat: TComboBox;
     20    ComboBoxLang: TComboBox;
    2021    Label1: TLabel;
    2122    Label2: TLabel;
     23    Label3: TLabel;
    2224    LabeledEditFolder: TLabeledEdit;
    2325    LabeledEditFileNameFormat: TLabeledEdit;
     
    5052  I: TFioDataFormat;
    5153begin
    52   while ComboBox1.Items.Count < Length(DataFormatText) do
    53     ComboBox1.Items.Add('');
    54   while ComboBox1.Items.Count > Length(DataFormatText) do
    55     ComboBox1.Items.Delete(ComboBox1.Items.Count - 1);
     54  while ComboBoxFormat.Items.Count < Length(DataFormatText) do
     55    ComboBoxFormat.Items.Add('');
     56  while ComboBoxFormat.Items.Count > Length(DataFormatText) do
     57    ComboBoxFormat.Items.Delete(ComboBoxFormat.Items.Count - 1);
    5658  for I := Low(DataFormatText) to High(DataFormatText) do
    57     ComboBox1.Items.Strings[Integer(I)] := DataFormatText[I];
     59    ComboBoxFormat.Items.Strings[Integer(I)] := DataFormatText[I];
    5860end;
    5961
     
    6870procedure TFormSettings.Load;
    6971begin
     72  Core.CoolTranslator1.LanguageListToStrings(ComboBoxLang.Items);
     73  ComboBoxLang.ItemIndex := ComboBoxLang.Items.IndexOfObject(Core.CoolTranslator1.Language);
    7074  LabeledEditFileNameFormat.Text := Core.OutputFormat;
    71   ComboBox1.ItemIndex := Integer(Core.DataFormat);
     75  ComboBoxFormat.ItemIndex := Integer(Core.DataFormat);
    7276  LabeledEditFolder.Text := Core.TargetDirectory;
    7377end;
     
    7579procedure TFormSettings.Save;
    7680begin
     81  if ComboBoxLang.Items.Objects[ComboBoxLang.ItemIndex] <> Core.CoolTranslator1.Language then begin
     82    Core.CoolTranslator1.Language := TLanguage(ComboBoxLang.Items.Objects[ComboBoxLang.ItemIndex]);
     83
     84  end;
    7785  Core.OutputFormat := LabeledEditFileNameFormat.Text;
    78   Core.DataFormat := TFioDataFormat(ComboBox1.ItemIndex);
     86  Core.DataFormat := TFioDataFormat(ComboBoxFormat.ItemIndex);
    7987  Core.TargetDirectory := LabeledEditFolder.Text;
    8088end;
Note: See TracChangeset for help on using the changeset viewer.