Changeset 293 for trunk/Settings.pas
- Timestamp:
- Mar 5, 2021, 1:36:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Settings.pas
r259 r293 42 42 public 43 43 Languages: TLanguages; 44 procedure LoadData; 45 procedure SaveData; 44 46 end; 45 47 … … 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 … … 116 116 procedure TSettingsDlg.ButtonFullscreenClick(Sender: TObject); 117 117 begin 118 FullScreen := not FullScreen;119 118 ButtonFullscreen.ButtonIndex := ButtonFullscreen.ButtonIndex xor 1; 120 119 end; … … 151 150 begin 152 151 Languages.LoadToStrings(List.Items); 153 List.ItemIndex := Languages.Search(LocaleCode);154 if (List.ItemIndex = -1) and (Languages.Count > 0) then155 List.ItemIndex := 0;156 152 List.Font.Color := MainTexture.clMark; 153 LoadData; 157 154 end; 158 155 159 156 procedure TSettingsDlg.OKBtnClick(Sender: TObject); 160 157 begin 158 SaveData; 159 ModalResult := mrOk; 160 end; 161 162 procedure TSettingsDlg.LoadData; 163 begin 164 List.ItemIndex := Languages.Search(LocaleCode); 165 if (List.ItemIndex = -1) and (Languages.Count > 0) then 166 List.ItemIndex := 0; 167 if FullScreen then ButtonFullscreen.ButtonIndex := 3 168 else ButtonFullscreen.ButtonIndex := 2; 169 end; 170 171 procedure TSettingsDlg.SaveData; 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.