Changeset 31 for trunk/Form/UFormProject.pas
- Timestamp:
- Apr 30, 2016, 12:16:19 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Form/UFormProject.pas
r15 r31 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Spin, 9 StdCtrls, UProject ;9 StdCtrls, UProject, Math; 10 10 11 11 type … … 22 22 Label3: TLabel; 23 23 Label4: TLabel; 24 Label5: TLabel; 25 Label6: TLabel; 24 26 LabelSectorCount: TLabel; 25 27 SpinEditSectorSize: TSpinEdit; 28 procedure SpinEditSectorSizeChange(Sender: TObject); 26 29 private 30 procedure UpdateSectorSize; 27 31 public 28 32 procedure Load(Project: TProject); … … 42 46 { TFormProject } 43 47 48 procedure TFormProject.SpinEditSectorSizeChange(Sender: TObject); 49 begin 50 UpdateSectorSize; 51 end; 52 53 procedure TFormProject.UpdateSectorSize; 54 begin 55 Label6.Caption := '= ' + IntToStr(Trunc(IntPower(2, SpinEditSectorSize.Value))) + ' bytes'; 56 end; 57 44 58 procedure TFormProject.Load(Project: TProject); 45 59 begin 46 60 Core.DriveList.LoadToStrings(ComboBoxDrive.Items); 47 61 EditName.Text := Project.Name; 48 SpinEditSectorSize.Value := Project.DriveInfo.SectorSize;62 SpinEditSectorSize.Value := Trunc(Log2(Project.DriveInfo.SectorSize)); 49 63 ComboBoxDrive.ItemIndex := Core.DriveList.IndexOf(Core.DriveList.FindByModel(Project.DriveInfo.Model)); 64 UpdateSectorSize; 50 65 end; 51 66 … … 53 68 begin 54 69 Project.Name := EditName.Text; 55 Project.DriveInfo.SectorSize := SpinEditSectorSize.Value;70 Project.DriveInfo.SectorSize := Trunc(IntPower(2, SpinEditSectorSize.Value)); 56 71 end; 57 72
Note:
See TracChangeset
for help on using the changeset viewer.