-
Notifications
You must be signed in to change notification settings - Fork 1
/
unitframeotheroptions.pas
118 lines (92 loc) · 3.15 KB
/
unitframeotheroptions.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
unit UnitFrameOtherOptions;
// Copyright 2022-2024 Zoran Vučenović
// SPDX-License-Identifier: Apache-2.0
{$mode ObjFPC}{$H+}
{$i zxinc.inc}
interface
uses
Classes, SysUtils, UnitOptions, Forms, Controls, ExtCtrls, StdCtrls;
type
{ TFrameOtherOptions }
TFrameOtherOptions = class(TFrame)
CheckBoxSkipTapeInfoSzxLoad: TCheckBox;
CheckBoxSkipJoystickInfoSzxLoad: TCheckBox;
CheckBoxAutoShowTapePlayerOnLoadTape: TCheckBox;
ComboBox1: TComboBox;
Label1: TLabel;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
private
function GetAutoShowTapePlayerOnLoadTape: Boolean;
function GetSaveTapeInfoSzxSave: Integer;
function GetSkipJoystickInfoSzxLoad: Boolean;
function GetSkipTapeInfoSzxLoad: Boolean;
procedure SetAutoShowTapePlayerOnLoadTape(AValue: 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): TFrameOtherOptions;
property AutoShowTapePlayerOnLoadTape: Boolean read GetAutoShowTapePlayerOnLoadTape write SetAutoShowTapePlayerOnLoadTape;
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}
{ TFrameOtherOptions }
function TFrameOtherOptions.GetAutoShowTapePlayerOnLoadTape: Boolean;
begin
Result := CheckBoxAutoShowTapePlayerOnLoadTape.Checked;
end;
function TFrameOtherOptions.GetSaveTapeInfoSzxSave: Integer;
begin
Result := ComboBox1.ItemIndex;
end;
function TFrameOtherOptions.GetSkipJoystickInfoSzxLoad: Boolean;
begin
Result := CheckBoxSkipJoystickInfoSzxLoad.Checked;
end;
function TFrameOtherOptions.GetSkipTapeInfoSzxLoad: Boolean;
begin
Result := CheckBoxSkipTapeInfoSzxLoad.Checked;
end;
procedure TFrameOtherOptions.SetAutoShowTapePlayerOnLoadTape(AValue: Boolean);
begin
CheckBoxAutoShowTapePlayerOnLoadTape.Checked := AValue;
end;
procedure TFrameOtherOptions.SetSaveTapeInfoSzxSave(const AValue: Integer);
begin
if (AValue >= 0) and (AValue < ComboBox1.Items.Count) then
ComboBox1.ItemIndex := AValue;
end;
procedure TFrameOtherOptions.SetSkipJoystickInfoSzxLoad(AValue: Boolean);
begin
CheckBoxSkipJoystickInfoSzxLoad.Checked := AValue;
end;
procedure TFrameOtherOptions.SetSkipTapeInfoSzxLoad(AValue: Boolean);
begin
CheckBoxSkipTapeInfoSzxLoad.Checked := AValue;
end;
constructor TFrameOtherOptions.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
Caption := 'Other options';
end;
class function TFrameOtherOptions.CreateForAllOptions(AOptionsDialog: TFormOptions
): TFrameOtherOptions;
var
Fm: TFrameOtherOptions;
begin
Result := nil;
Fm := TFrameOtherOptions.Create(AOptionsDialog);
try
AOptionsDialog.AddAnOptionControl(Fm, 'Other');
Result := Fm;
except
Fm.Free;
end;
end;
end.