Changeset 317 for trunk/Settings.pas
- Timestamp:
- Mar 19, 2021, 9:59:02 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Settings.pas
r309 r317 28 28 TSettingsDlg = class(TDrawDlg) 29 29 ButtonFullscreen: TButtonC; 30 Down2Btn: TButtonC; 30 31 List: TListBox; 31 32 OKBtn: TButtonA; 32 33 CancelBtn: TButtonA; 34 Up2Btn: TButtonC; 33 35 procedure ButtonFullscreenClick(Sender: TObject); 34 36 procedure CancelBtnClick(Sender: TObject); 37 procedure Down2BtnClick(Sender: TObject); 35 38 procedure FormCreate(Sender: TObject); 36 39 procedure FormDestroy(Sender: TObject); … … 38 41 procedure FormShow(Sender: TObject); 39 42 procedure OKBtnClick(Sender: TObject); 43 procedure Up2BtnClick(Sender: TObject); 40 44 private 41 { private declarations }45 LocalGamma: Integer; 42 46 public 43 47 Languages: TLanguages; … … 111 115 end; 112 116 117 procedure TSettingsDlg.Down2BtnClick(Sender: TObject); 118 begin 119 if LocalGamma > 50 then 120 begin 121 Dec(LocalGamma); 122 Invalidate; 123 end; 124 end; 125 113 126 procedure TSettingsDlg.ButtonFullscreenClick(Sender: TObject); 114 127 begin … … 139 152 MainTexture.clBevelLight); 140 153 141 s:= Phrases.Lookup('SETTINGS', 0);154 S := Phrases.Lookup('SETTINGS', 0); 142 155 LoweredTextOut(Canvas, -2, MainTexture, ButtonFullscreen.Left + 32, 143 ButtonFullscreen.Top - 4, s); 156 ButtonFullscreen.Top - 4, S); 157 158 // Gamma 159 UnderlinedTitleValue(Canvas, Phrases.Lookup('SETTINGS', 1), IntToStr(LocalGamma) + '%', 160 Up2Btn.Left - 150 - 4, Up2Btn.Top + 2, 150); 144 161 end; 145 162 … … 155 172 SaveData; 156 173 ModalResult := mrOk; 174 end; 175 176 procedure TSettingsDlg.Up2BtnClick(Sender: TObject); 177 begin 178 if LocalGamma < 150 then begin 179 Inc(LocalGamma); 180 Invalidate; 181 end; 157 182 end; 158 183 … … 164 189 if FullScreen then ButtonFullscreen.ButtonIndex := 3 165 190 else ButtonFullscreen.ButtonIndex := 2; 191 LocalGamma := Gamma; 166 192 end; 167 193 168 194 procedure TSettingsDlg.SaveData; 169 begin 195 var 196 NeedRestart: Boolean; 197 begin 198 NeedRestart := Gamma <> LocalGamma; 170 199 LocaleCode := Languages[List.ItemIndex].ShortName; 171 200 FullScreen := (ButtonFullscreen.ButtonIndex and 1) = 1; 201 Gamma := LocalGamma; 202 if NeedRestart then SimpleMessage(Phrases.Lookup('SETTINGS', 2)); 172 203 end; 173 204
Note:
See TracChangeset
for help on using the changeset viewer.