forked from geraldholdsworth/DiscImageManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRFSDetailUnit.pas
97 lines (79 loc) · 2.88 KB
/
RFSDetailUnit.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
unit RFSDetailUnit;
{$mode ObjFPC}{$H+}
interface
uses
Classes,SysUtils,Forms,Controls,Graphics,Dialogs,ExtCtrls,ComCtrls,StdCtrls,
GJHCustomComponents;
type
{ TRFSDetailForm }
TRFSDetailForm = class(TForm)
ROMFS: TPanel;
ROMFSLabel: TLabel;
ROMFSTitle: TLabeledEdit;
ROMFSVersion: TLabeledEdit;
ROMFSBinVersAdj: TUpDown;
ROMFSBinVersLabel: TLabel;
ROMFSBinVers: TLabel;
ROMFSCopy: TLabeledEdit;
btn_OK,
btn_Cancel: TGJHButton;
procedure FormCreate(Sender: TObject);
procedure ROMFSBinVersAdjClick(Sender: TObject; Button: TUDBtnType);
procedure FormPaint(Sender: TObject);
private
public
end;
var
RFSDetailForm: TRFSDetailForm;
implementation
{$R *.lfm}
uses MainUnit;
{ TRFSDetailForm }
{-------------------------------------------------------------------------------
The ROM FS binary version is changing
-------------------------------------------------------------------------------}
procedure TRFSDetailForm.ROMFSBinVersAdjClick(Sender: TObject;
Button: TUDBtnType);
begin
//Update the display
ROMFSBinVers.Caption:=IntToHex(ROMFSBinVersAdj.Position,2);
end;
{-------------------------------------------------------------------------------
Form creation
-------------------------------------------------------------------------------}
procedure TRFSDetailForm.FormCreate(Sender: TObject);
var
ratio: Real;
begin
ratio:=PixelsPerInch/DesignTimePPI;
ROMFSTitle.Width:=ROMFS.Width-Round(12*ratio)-ROMFSTitle.Left;
ROMFSVersion.Width:=ROMFSTitle.Width;
ROMFSVersion.Top:=ROMFSTitle.Top+ROMFSTitle.Height+Round(8*ratio);
ROMFSBinVersLabel.Top:=ROMFSVersion.Top+ROMFSVersion.Height+Round(8*ratio);
ROMFSBinVers.Left:=ROMFSBinVersLabel.Width+ROMFSBinVersLabel.Left+Round(8*ratio);
ROMFSBinVers.Top:=ROMFSBinVersLabel.Top;
ROMFSBinVersAdj.Left:=ROMFSBinVers.Left+ROMFSBinVers.Width+Round(8*ratio);
ROMFSBinVersAdj.Height:=ROMFSBinVers.Height;
ROMFSBinVersAdj.Top:=ROMFSBinVersLabel.Top;
ROMFSCopy.Width:=ROMFSTitle.Width;
ROMFSCopy.Top:=ROMFSBinVers.Top+ROMFSBinVers.Height+Round(8*ratio);
//Align the buttons -----------------------------------------------------------
btn_Cancel:=MainForm.CreateButton(RFSDetailForm as TControl,'Cancel',False,0,
ROMFS.Top+ROMFS.Height+Round(8*ratio),
mrCancel);
btn_OK:=MainForm.CreateButton(RFSDetailForm as TControl,'OK',True,0,
btn_Cancel.Top-Round(4*ratio),mrOK);
btn_OK.Left:=Width-btn_OK.Width-Round(8*ratio);
btn_Cancel.Left:=btn_OK.Left-Round(4*ratio)-btn_Cancel.Width;
//Adjust the form size
Height:=btn_OK.Top+btn_OK.Height+Round(8*ratio);
Width:=ROMFS.Width;
end;
{-------------------------------------------------------------------------------
Texturise the form
-------------------------------------------------------------------------------}
procedure TRFSDetailForm.FormPaint(Sender: TObject);
begin
MainForm.FileInfoPanelPaint(Sender);
end;
end.