-
Notifications
You must be signed in to change notification settings - Fork 0
/
USetting.pas
93 lines (77 loc) · 2.36 KB
/
USetting.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
{ KOL MCK } // Do not remove this line!
{$DEFINE KOL_MCK}
unit USetting;
interface
{$IFDEF KOL_MCK}
uses Windows, Messages, KOL {$IF Defined(KOL_MCK)}{$ELSE}, mirror, Classes, Controls, mckCtrls, mckObjs, Graphics {$IFEND (place your units here->)};
{$ELSE}
{$I uses.inc}
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, mirror;
{$ENDIF}
type
{$IF Defined(KOL_MCK)}
{$I MCKfakeClasses.inc}
{$IFDEF KOLCLASSES} {$I TFSettingclass.inc} {$ELSE OBJECTS} PFSetting = ^TFSetting; {$ENDIF CLASSES/OBJECTS}
{$IFDEF KOLCLASSES}{$I TFSetting.inc}{$ELSE} TFSetting = object(TObj) {$ENDIF}
Form: PControl;
{$ELSE not_KOL_MCK}
TFSetting = class(TForm)
{$IFEND KOL_MCK}
KOLForm1: TKOLForm;
chAuto: TKOLCheckBox;
Label1: TKOLLabel;
btnSimpan: TKOLButton;
edMaxPage: TKOLEditBox;
btnBatal: TKOLButton;
Label2: TKOLLabel;
edRndMax: TKOLEditBox;
chSound: TKOLCheckBox;
procedure KOLForm1FormCreate(Sender: PObj);
procedure btnSimpanClick(Sender: PObj);
procedure btnBatalClick(Sender: PObj);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FSetting {$IFDEF KOL_MCK} : PFSetting {$ELSE} : TFSetting {$ENDIF} ;
{$IFDEF KOL_MCK}
procedure NewFSetting( var Result: PFSetting; AParent: PControl );
{$ENDIF}
implementation
uses
Unit1;
{$IF Defined(KOL_MCK)}{$ELSE}{$R *.DFM}{$IFEND}
{$IFDEF KOL_MCK}
{$I USetting_1.inc}
{$ENDIF}
procedure TFSetting.KOLForm1FormCreate(Sender: PObj);
begin
Form.Caption := 'Pengaturan KBBI';
setting.Mode := ifmRead;
chAuto.Checked := setting.ValueBoolean('Auto Search',False);
edMaxPage.Text := Int2Str(setting.ValueInteger('MaxPage', 300 ));
chSound.Checked := setting.ValueBoolean('NoSound',True);
end;
procedure TFSetting.btnSimpanClick(Sender: PObj);
var
i : Integer;
begin
setting.Mode := ifmWrite;
setting.ValueBoolean('Auto Search',chAuto.Checked);
setting.ValueBoolean('NoSound',chSound.Checked);
setting.ValueInteger('MaxPage', Str2Int(edMaxPage.Text));
i := Str2Int(edRndMax.Text);
if i=0 then i := 20;
setting.ValueInteger('RandomCount', i);
AutoSearch := chAuto.Checked;
MsgOK('OK, setting telah disimpan');
Form.Close;
end;
procedure TFSetting.btnBatalClick(Sender: PObj);
begin
form.Close;
end;
end.