Ignore:
Timestamp:
Jun 29, 2024, 7:58:36 AM (5 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from units names.
  • Modified: Use TFormEx for all forms.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormPreferences.pas

    r31 r32  
    1 unit UFormPreferences;
     1unit FormPreferences;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   UDatabase;
     7  DbEngine, FormEx;
    88
    99type
    1010  { TFormPreferences }
    1111
    12   TFormPreferences = class(TForm)
     12  TFormPreferences = class(TFormEx)
    1313    ButtonSave: TButton;
    1414    ButtonCancel: TButton;
     
    1616    ComboBoxLanguage: TComboBox;
    1717    Label1: TLabel;
    18     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    19     procedure FormShow(Sender: TObject);
    2018  public
    2119    procedure Load(Preferences: TPreferences);
     
    2927
    3028uses
    31   UCore, Languages;
     29  Languages;
    3230
    3331{ TFormPreferences }
    34 
    35 procedure TFormPreferences.FormShow(Sender: TObject);
    36 begin
    37   Core.PersistentForm1.Load(Self);
    38 end;
    39 
    40 procedure TFormPreferences.FormClose(Sender: TObject;
    41   var CloseAction: TCloseAction);
    42 begin
    43   Core.PersistentForm1.Save(Self)
    44 end;
    4532
    4633procedure TFormPreferences.Load(Preferences: TPreferences);
    4734begin
    4835  CheckBoxRememberDatabase.Checked := Preferences.RememberDatabase;
    49   Core.Translator1.LanguageListToStrings(ComboBoxLanguage.Items);
    50   ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Translator1.Language);
     36  TFormEx.Translator.LanguageListToStrings(ComboBoxLanguage.Items);
     37  ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(
     38    TFormEx.Translator.Language);
    5139  if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
    5240end;
     
    5644  Preferences.RememberDatabase := CheckBoxRememberDatabase.Checked;
    5745  if ComboBoxLanguage.ItemIndex <> -1 then
    58     Core.Translator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
     46    TFormEx.Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
    5947end;
    6048
Note: See TracChangeset for help on using the changeset viewer.