Changeset 465 for branches/highdpi/Settings.pas
- Timestamp:
- Nov 30, 2023, 10:16:14 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Settings.pas
r412 r465 1 1 unit Settings; 2 3 {$mode delphi}4 2 5 3 interface … … 7 5 uses 8 6 UDpiControls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 LCLProc, ScreenTools, Messg, ButtonA, Registry, fgl, Directories, DrawDlg,10 ButtonC, UKeyBindings, ULanguages;7 LCLProc, ScreenTools, Messg, ButtonA, Directories, DrawDlg, ButtonC, 8 KeyBindings, Languages; 11 9 12 10 type … … 58 56 {$R *.lfm} 59 57 58 uses 59 Start; 60 60 61 var 61 62 SFullScreen, SGamma, SRestartMsg, SShortCutPrimary, SShortCutSecondary, … … 77 78 procedure TSettingsDlg.FormCreate(Sender: TObject); 78 79 begin 80 Color := clBlack; 79 81 LocalKeyBindings := TKeyBindings.Create; 80 82 … … 117 119 Shift: TShiftState); 118 120 begin 119 if Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin121 if (Sender is TDpiEdit) and Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin 120 122 CurrentKeyBinding.ShortCut := Key or 121 123 (scShift * Integer(ssShift in Shift)) or … … 131 133 var Key: Word; Shift: TShiftState); 132 134 begin 133 if Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin135 if (Sender is TDpiEdit) and Assigned(CurrentKeyBinding) and not (Key in [16..18]) then begin 134 136 CurrentKeyBinding.ShortCut2 := Key or 135 137 (scShift * Integer(ssShift in Shift)) or … … 192 194 procedure TSettingsDlg.FormShow(Sender: TObject); 193 195 begin 196 Caption := Phrases2.Lookup('ACTIONHEADER_CONFIG'); 194 197 ReloadLanguages; 195 Languages.LoadToStrings(ListLanguages.Items);198 StartDlg.Translator.LanguageListToStrings(ListLanguages.Items); 196 199 ListLanguages.Font.Color := MainTexture.ColorMark; 197 200 ListKeyBindings.Font.Color := MainTexture.ColorMark; … … 260 263 procedure TSettingsDlg.LoadData; 261 264 begin 262 ListLanguages.ItemIndex := Languages.Search(LocaleCode); 263 if (ListLanguages.ItemIndex = -1) and (Languages.Count > 0) then 264 ListLanguages.ItemIndex := 0; 265 StartDlg.Translator.Language := StartDlg.Translator.Languages.SearchByCode(LocaleCode); 266 StartDlg.Translator.LanguageListToStrings(ListLanguages.Items, False); 267 ListLanguages.ItemIndex := ListLanguages.Items.IndexOfObject(StartDlg.Translator.Language); 268 if ListLanguages.ItemIndex = -1 then ListLanguages.ItemIndex := 0; 265 269 if FullScreen then ButtonFullscreen.ButtonIndex := 3 266 270 else ButtonFullscreen.ButtonIndex := 2; 267 271 LocalGamma := Gamma; 268 LocalKeyBindings.Assign(KeyBindings );272 LocalKeyBindings.Assign(KeyBindings.KeyBindings); 269 273 end; 270 274 … … 274 278 begin 275 279 NeedRestart := Gamma <> LocalGamma; 276 LocaleCode := Languages[ListLanguages.ItemIndex].ShortName; 280 if ListLanguages.ItemIndex <> -1 then begin 281 StartDlg.Translator.Language := TLanguage(ListLanguages.Items.Objects[ListLanguages.ItemIndex]); 282 LocaleCode := StartDlg.Translator.Language.Code; 283 end else begin 284 StartDlg.Translator.Language := nil; 285 LocaleCode := ''; 286 end; 277 287 FullScreen := (ButtonFullscreen.ButtonIndex and 1) = 1; 278 288 Gamma := LocalGamma; 279 289 if NeedRestart then SimpleMessage(SRestartMsg); 280 KeyBindings. Assign(LocalKeyBindings);290 KeyBindings.KeyBindings.Assign(LocalKeyBindings); 281 291 end; 282 292 283 293 end. 284 294 295 296
Note:
See TracChangeset
for help on using the changeset viewer.