Ignore:
Timestamp:
Mar 9, 2021, 9:19:49 AM (4 years ago)
Author:
chronos
Message:
  • Modified: Synced code with current trunk version.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Settings.pas

    r302 r303  
    1 unit Locale;
     1unit Settings;
    22
    33{$mode delphi}
     
    2424  end;
    2525
    26   { TLocaleDlg }
     26  { TSettingsDlg }
    2727
    28   TLocaleDlg = class(TDrawDlg)
     28  TSettingsDlg = class(TDrawDlg)
    2929    ButtonFullscreen: TButtonC;
    3030    List: TDpiListBox;
     
    4242  public
    4343    Languages: TLanguages;
     44    procedure LoadData;
     45    procedure SaveData;
    4446  end;
    4547
    4648var
    47   LocaleDlg: TLocaleDlg;
     49  SettingsDlg: TSettingsDlg;
    4850
    4951implementation
     
    8284end;
    8385
    84 { TLocaleDlg }
     86{ TSettingsDlg }
    8587
    86 procedure TLocaleDlg.FormCreate(Sender: TObject);
     88procedure TSettingsDlg.FormCreate(Sender: TObject);
    8789begin
    8890  Canvas.Font.Assign(UniFont[ftNormal]);
     
    105107
    106108  ButtonFullscreen.Graphic := GrExt[HGrSystem].Data;
    107   if FullScreen then ButtonFullscreen.ButtonIndex := 3
    108     else ButtonFullscreen.ButtonIndex := 2;
    109109end;
    110110
    111 procedure TLocaleDlg.CancelBtnClick(Sender: TObject);
     111procedure TSettingsDlg.CancelBtnClick(Sender: TObject);
    112112begin
    113113  ModalResult := mrCancel;
    114114end;
    115115
    116 procedure TLocaleDlg.ButtonFullscreenClick(Sender: TObject);
     116procedure TSettingsDlg.ButtonFullscreenClick(Sender: TObject);
    117117begin
    118   FullScreen := not FullScreen;
    119118  ButtonFullscreen.ButtonIndex := ButtonFullscreen.ButtonIndex xor 1;
    120119end;
    121120
    122 procedure TLocaleDlg.FormDestroy(Sender: TObject);
     121procedure TSettingsDlg.FormDestroy(Sender: TObject);
    123122begin
    124123  FreeAndNil(Languages);
    125124end;
    126125
    127 procedure TLocaleDlg.FormPaint(Sender: TObject);
     126procedure TSettingsDlg.FormPaint(Sender: TObject);
    128127var
    129128  S: string;
     
    148147end;
    149148
    150 procedure TLocaleDlg.FormShow(Sender: TObject);
     149procedure TSettingsDlg.FormShow(Sender: TObject);
    151150begin
    152151  Languages.LoadToStrings(List.Items);
     152  List.Font.Color := MainTexture.clMark;
     153  LoadData;
     154end;
     155
     156procedure TSettingsDlg.OKBtnClick(Sender: TObject);
     157begin
     158  SaveData;
     159  ModalResult := mrOk;
     160end;
     161
     162procedure TSettingsDlg.LoadData;
     163begin
    153164  List.ItemIndex := Languages.Search(LocaleCode);
    154165  if (List.ItemIndex = -1) and (Languages.Count > 0) then
    155166    List.ItemIndex := 0;
    156   List.Font.Color := MainTexture.clMark;
     167  if FullScreen then ButtonFullscreen.ButtonIndex := 3
     168    else ButtonFullscreen.ButtonIndex := 2;
    157169end;
    158170
    159 procedure TLocaleDlg.OKBtnClick(Sender: TObject);
     171procedure TSettingsDlg.SaveData;
    160172begin
    161173  LocaleCode := Languages[List.ItemIndex].ShortName;
    162   ModalResult := mrOk;
     174  FullScreen := (ButtonFullscreen.ButtonIndex and 1) = 1;
    163175end;
    164176
Note: See TracChangeset for help on using the changeset viewer.