Changeset 303 for branches/highdpi/Settings.pas
- Timestamp:
- Mar 9, 2021, 9:19:49 AM (4 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Settings.pas
r302 r303 1 unit Locale;1 unit Settings; 2 2 3 3 {$mode delphi} … … 24 24 end; 25 25 26 { T LocaleDlg }26 { TSettingsDlg } 27 27 28 T LocaleDlg = class(TDrawDlg)28 TSettingsDlg = class(TDrawDlg) 29 29 ButtonFullscreen: TButtonC; 30 30 List: TDpiListBox; … … 42 42 public 43 43 Languages: TLanguages; 44 procedure LoadData; 45 procedure SaveData; 44 46 end; 45 47 46 48 var 47 LocaleDlg: TLocaleDlg;49 SettingsDlg: TSettingsDlg; 48 50 49 51 implementation … … 82 84 end; 83 85 84 { T LocaleDlg }86 { TSettingsDlg } 85 87 86 procedure T LocaleDlg.FormCreate(Sender: TObject);88 procedure TSettingsDlg.FormCreate(Sender: TObject); 87 89 begin 88 90 Canvas.Font.Assign(UniFont[ftNormal]); … … 105 107 106 108 ButtonFullscreen.Graphic := GrExt[HGrSystem].Data; 107 if FullScreen then ButtonFullscreen.ButtonIndex := 3108 else ButtonFullscreen.ButtonIndex := 2;109 109 end; 110 110 111 procedure T LocaleDlg.CancelBtnClick(Sender: TObject);111 procedure TSettingsDlg.CancelBtnClick(Sender: TObject); 112 112 begin 113 113 ModalResult := mrCancel; 114 114 end; 115 115 116 procedure T LocaleDlg.ButtonFullscreenClick(Sender: TObject);116 procedure TSettingsDlg.ButtonFullscreenClick(Sender: TObject); 117 117 begin 118 FullScreen := not FullScreen;119 118 ButtonFullscreen.ButtonIndex := ButtonFullscreen.ButtonIndex xor 1; 120 119 end; 121 120 122 procedure T LocaleDlg.FormDestroy(Sender: TObject);121 procedure TSettingsDlg.FormDestroy(Sender: TObject); 123 122 begin 124 123 FreeAndNil(Languages); 125 124 end; 126 125 127 procedure T LocaleDlg.FormPaint(Sender: TObject);126 procedure TSettingsDlg.FormPaint(Sender: TObject); 128 127 var 129 128 S: string; … … 148 147 end; 149 148 150 procedure T LocaleDlg.FormShow(Sender: TObject);149 procedure TSettingsDlg.FormShow(Sender: TObject); 151 150 begin 152 151 Languages.LoadToStrings(List.Items); 152 List.Font.Color := MainTexture.clMark; 153 LoadData; 154 end; 155 156 procedure TSettingsDlg.OKBtnClick(Sender: TObject); 157 begin 158 SaveData; 159 ModalResult := mrOk; 160 end; 161 162 procedure TSettingsDlg.LoadData; 163 begin 153 164 List.ItemIndex := Languages.Search(LocaleCode); 154 165 if (List.ItemIndex = -1) and (Languages.Count > 0) then 155 166 List.ItemIndex := 0; 156 List.Font.Color := MainTexture.clMark; 167 if FullScreen then ButtonFullscreen.ButtonIndex := 3 168 else ButtonFullscreen.ButtonIndex := 2; 157 169 end; 158 170 159 procedure T LocaleDlg.OKBtnClick(Sender: TObject);171 procedure TSettingsDlg.SaveData; 160 172 begin 161 173 LocaleCode := Languages[List.ItemIndex].ShortName; 162 ModalResult := mrOk;174 FullScreen := (ButtonFullscreen.ButtonIndex and 1) = 1; 163 175 end; 164 176
Note:
See TracChangeset
for help on using the changeset viewer.