Changeset 59 for trunk/Forms/UFormOptions.pas
- Timestamp:
- Dec 3, 2014, 9:09:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormOptions.pas
r51 r59 1 1 unit UFormOptions; 2 2 3 {$mode objfpc}{$H+}3 {$mode delphi}{$H+} 4 4 5 5 interface … … 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Spin, ComCtrls,UTargetInterpretter;9 Spin, UTargetInterpretter; 10 10 11 11 type … … 17 17 ButtonCancel: TButton; 18 18 CheckBox1: TCheckBox; 19 CheckBoxDPIAuto: TCheckBox; 19 20 ComboBoxLanguage: TComboBox; 20 21 Label1: TLabel; 21 22 Label2: TLabel; 22 23 Label3: TLabel; 24 LabelDPI: TLabel; 25 LabelX: TLabel; 26 SpinEditDPIX: TSpinEdit; 27 SpinEditDPIY: TSpinEdit; 23 28 SpinEditCellSize: TSpinEdit; 24 29 SpinEditMemorySize: TSpinEdit; 25 30 procedure ButtonOkClick(Sender: TObject); 31 procedure CheckBoxDPIAutoChange(Sender: TObject); 26 32 procedure FormShow(Sender: TObject); 27 33 private 28 34 { private declarations } 29 35 public 36 procedure UpdateInterface; 37 procedure Load; 38 procedure Save; 30 39 procedure LoadFromInterpretter(Interpretter: TTargetInterpretter); 31 40 procedure SaveToInterpretter(Interpretter: TTargetInterpretter); … … 52 61 end; 53 62 63 procedure TOptionsForm.UpdateInterface; 64 begin 65 SpinEditDPIX.Enabled := not CheckBoxDPIAuto.Checked; 66 SpinEditDPIY.Enabled := not CheckBoxDPIAuto.Checked; 67 LabelDPI.Enabled := not CheckBoxDPIAuto.Checked; 68 LabelX.Enabled := not CheckBoxDPIAuto.Checked; 69 if CheckBoxDPIAuto.Checked then begin 70 SpinEditDPIX.Value := ScreenInfo.PixelsPerInchX; 71 SpinEditDPIY.Value := ScreenInfo.PixelsPerInchY; 72 end; 73 end; 74 75 procedure TOptionsForm.Load; 76 begin 77 SpinEditDPIX.Value := Core.ScaleDPI.DPI.X; 78 SpinEditDPIY.Value := Core.ScaleDPI.DPI.Y; 79 CheckBoxDPIAuto.Checked := Core.ScaleDPI.AutoDetect; 80 UpdateInterface; 81 end; 82 83 procedure TOptionsForm.Save; 84 begin 85 Core.ScaleDPI.DPI.X := SpinEditDPIX.Value; 86 Core.ScaleDPI.DPI.Y := SpinEditDPIY.Value; 87 Core.ScaleDPI.AutoDetect := CheckBoxDPIAuto.Checked; 88 end; 89 54 90 procedure TOptionsForm.ButtonOkClick(Sender: TObject); 55 91 begin … … 57 93 Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 58 94 Core.OpenProjectOnStart := CheckBox1.Checked; 95 end; 96 97 procedure TOptionsForm.CheckBoxDPIAutoChange(Sender: TObject); 98 begin 99 UpdateInterface; 59 100 end; 60 101
Note:
See TracChangeset
for help on using the changeset viewer.