-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathunitframesnapshotoptions.pas
104 lines (81 loc) · 2.67 KB
/
unitframesnapshotoptions.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
97
98
99
100
101
102
103
unit UnitFrameSnapshotOptions;
// Copyright 2022-2025 Zoran Vučenović
// SPDX-License-Identifier: Apache-2.0
{$mode ObjFPC}{$H+}
{$i zxinc.inc}
interface
uses
Classes, SysUtils, UnitOptions, UnitCommon, Forms, Controls, ExtCtrls,
StdCtrls;
type
TFrameSnapshotOptions = class(TFrame)
CheckBoxSkipTapeInfoSzxLoad: TCheckBox;
CheckBoxSkipJoystickInfoSzxLoad: TCheckBox;
ComboBox1: TComboBox;
Label1: TLabel;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
private
function GetSaveTapeInfoSzxSave: Integer;
function GetSkipJoystickInfoSzxLoad: Boolean;
function GetSkipTapeInfoSzxLoad: Boolean;
procedure SetSaveTapeInfoSzxSave(const AValue: Integer);
procedure SetSkipJoystickInfoSzxLoad(AValue: Boolean);
procedure SetSkipTapeInfoSzxLoad(AValue: Boolean);
public
constructor Create(TheOwner: TComponent); override;
class function CreateForAllOptions(AOptionsDialog: TFormOptions): TFrameSnapshotOptions;
property SkipJoystickInfoSzxLoad: Boolean read GetSkipJoystickInfoSzxLoad write SetSkipJoystickInfoSzxLoad;
property SkipTapeInfoSzxLoad: Boolean read GetSkipTapeInfoSzxLoad write SetSkipTapeInfoSzxLoad;
property SaveTapeInfoSzxSave: Integer read GetSaveTapeInfoSzxSave write SetSaveTapeInfoSzxSave;
end;
implementation
{$R *.lfm}
{ TFrameSnapshotOptions }
function TFrameSnapshotOptions.GetSaveTapeInfoSzxSave: Integer;
begin
Result := ComboBox1.ItemIndex;
end;
function TFrameSnapshotOptions.GetSkipJoystickInfoSzxLoad: Boolean;
begin
Result := CheckBoxSkipJoystickInfoSzxLoad.Checked;
end;
function TFrameSnapshotOptions.GetSkipTapeInfoSzxLoad: Boolean;
begin
Result := CheckBoxSkipTapeInfoSzxLoad.Checked;
end;
procedure TFrameSnapshotOptions.SetSaveTapeInfoSzxSave(const AValue: Integer);
begin
if (AValue >= 0) and (AValue < ComboBox1.Items.Count) then
ComboBox1.ItemIndex := AValue;
end;
procedure TFrameSnapshotOptions.SetSkipJoystickInfoSzxLoad(AValue: Boolean);
begin
CheckBoxSkipJoystickInfoSzxLoad.Checked := AValue;
end;
procedure TFrameSnapshotOptions.SetSkipTapeInfoSzxLoad(AValue: Boolean);
begin
CheckBoxSkipTapeInfoSzxLoad.Checked := AValue;
end;
constructor TFrameSnapshotOptions.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
Name := TCommonFunctions.GlobalObjectNameGenerator(Self);
Caption := 'Snapshot options';
end;
class function TFrameSnapshotOptions.CreateForAllOptions(AOptionsDialog: TFormOptions
): TFrameSnapshotOptions;
var
Fm: TFrameSnapshotOptions;
begin
Result := nil;
Fm := TFrameSnapshotOptions.Create(AOptionsDialog);
try
AOptionsDialog.AddAnOptionControl(Fm, 'Snapshots');
Result := Fm;
except
Fm.Free;
end;
end;
end.