forked from farshadmohajeri/extpascal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLayoutWindow.pas
71 lines (63 loc) · 1.66 KB
/
LayoutWindow.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
unit LayoutWindow;
interface
uses
Ext;
type
TLayoutWindow = class(TExtWindow)
constructor Create;
procedure ExtTabPanelOnTabchange(AThis : TExtTabPanel; NewTab, OldTab : TExtComponent);
end;
implementation
uses
Session, ExtPascalUtils;
constructor TLayoutWindow.Create;
var
Tabs : TExtTabPanel;
Nav : TExtPanel;
begin
inherited;
SelfSession.SetCodePress;
Tabs := TExtTabPanel.AddTo(Items);
with Tabs do begin
Region := reCenter;
Margin := 3;
Defaults := JSObject('autoScroll:true');
ActiveTab := 0;
OnTabChange := ExtTabPanelOnTabchange;
with TExtPanel.AddTo(Items) do begin
Title := 'Bogus Tab';
Html := 'Blah blah blah';
end;
with TExtPanel.AddTo(Items) do begin
Title := 'Another Tab';
Html := 'Blah blah blah';
end;
with TExtPanel.AddTo(Items) do begin
Title := 'Closable Tab';
Html := 'Blah blah blah';
Closable := true;
end;
end;
Nav := TExtPanel.Create;
with Nav do begin
Title := 'Navigation';
Region := reWest;
Split := true;
Width := 200;
Collapsible := true;
MarginString:= SetMargins(3, 0, 3, 3);
end;
Title := 'Layout Window';
Closable := true;
Width := 600;
Height := 350;
Plain := true;
Layout := laBorder;
Modal := true;
Nav.AddTo(Items);
SelfSession.AddShowSourceButton(Buttons, 'LayoutWindow');
end;
procedure TLayoutWindow.ExtTabPanelOnTabchange(AThis : TExtTabPanel; NewTab, OldTab : TExtComponent); begin
ExtMessageBox.Alert('Active Tab is', TExtTabPanel(NewTab).Title);
end;
end.