-
Notifications
You must be signed in to change notification settings - Fork 10
/
DW.DESIGN.TabControlEditor.pas
55 lines (44 loc) · 1.27 KB
/
DW.DESIGN.TabControlEditor.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
unit DW.DESIGN.TabControlEditor;
interface
uses
DesignEditors, DesignIntf, Forms, DW.VCL.TabControl;
type
TDWTabControlEditor = class(TComponentEditor)
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): string; override;
function GetVerbCount: Integer; override;
end;
implementation
{ TCSDBGridEditor }
procedure TDWTabControlEditor.ExecuteVerb(Index: Integer);
var
Tab: TDWTabPage;
begin
inherited;
case Index of
0:
begin
Tab := TDWTabPage(Designer.CreateChild(TDWTabPage, Component));
TDWTabControl(Component).InsertTab(Tab);
// Item:= TDWAccordion(Component).CreateItem(Component);
// Item.Name:= Designer.UniqueName(Item.ClassName);
// TDWAccordion(Component).CreateItem(Component).Name:= Designer.UniqueName(Item.ClassName);;
end;
(* 1: Application.MessageBox(PChar(' TSDDBGrid' + #13#10#13#10 + '版本: 6.0'
+ ' (编译版本: 6.0.6.12)' + #13#10#13#10 + ''),
'About ...', 64); *)
end;
end;
function TDWTabControlEditor.GetVerb(Index: Integer): string;
begin
case Index of
0:
Result := 'Add TabPage';
// 1: Result := 'Remove Item';
end;
end;
function TDWTabControlEditor.GetVerbCount: Integer;
begin
Result := 1;
end;
end.