-
Notifications
You must be signed in to change notification settings - Fork 4
/
fmSrcPaneU.pas
54 lines (47 loc) · 1.39 KB
/
fmSrcPaneU.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
(************************************************************************)
(* Bee22 - Particle Swarm Optimization framework http:https://bee22.com *)
(* developed by and copyright(c) Teodor Krastev 2015-2016 *)
(************************************************************************)
unit fmSrcPaneU;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, SynEdit, Vcl.StdCtrls,
Vcl.Buttons, Vcl.ExtCtrls, SynEditHighlighter, SynHighlighterPython,
MVC_U, Vcl.Samples.Spin;
type
TfmSrcPane = class(TFrame)
pnlHeader: TPanel;
sbGoLeft: TSpeedButton;
chkEnabled: TCheckBox;
seCode: TSynEdit;
SynPythonSyn1: TSynPythonSyn;
private
{ Private declarations }
fFunc: rFunc;
updating: boolean;
function getFunc: rFunc;
procedure setFunc(fn: rFunc);
public
{ Public declarations }
property Func: rFunc read getFunc write setFunc;
end;
implementation
{$R *.dfm}
function TfmSrcPane.getFunc: rFunc;
begin
if updating then exit;
Result:= fFunc;
Result.enabled:= chkEnabled.Checked;
Result.code:= seCode.Lines.Text;
end;
procedure TfmSrcPane.setFunc(fn: rFunc);
begin
updating:= true;
fFunc:= fn;
pnlHeader.Caption:= ' def '+fn.nm+'('+fn.prms+'):';
chkEnabled.Checked:= fn.enabled;
seCode.Lines.Text:= fn.code;
updating:= false;
end;
end.