-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGDK.ToolsAPI.CustomEditor.pas
104 lines (86 loc) · 2.73 KB
/
GDK.ToolsAPI.CustomEditor.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
unit GDK.ToolsAPI.CustomEditor;
interface
uses
ToolsAPI,
DesignIntf,
VCL.Forms,
Vcl.Graphics;
type
{$IF CompilerVersion >= 35.0}
TCustomEditorView = class(TInterfacedObject, INTACustomEditorView, INTACustomEditorView150, INTACustomEditorView280)
{$ELSEIF CompilerVersion >= 22.0}
TCustomEditorView = class(TInterfacedObject, INTACustomEditorView, INTACustomEditorView150)
{$ELSE}
TCustomEditorView = class(TInterfacedObject, INTACustomEditorView)
{$ENDIF}
strict protected
function GetCaption: string; virtual; abstract;
function GetEditorWindowCaption: string; virtual; abstract;
function GetViewIdentifier: string; virtual; abstract;
function GetFrameClass: TCustomFrameClass; virtual; abstract;
procedure FrameCreated(AFrame: TCustomFrame); virtual; abstract;
{$IF CompilerVersion >= 22.0}
function GetImageIndex: Integer; virtual; abstract;
function GetTabHintText: string; virtual; abstract;
procedure Close(var Allowed: Boolean); virtual;
{$ENDIF}
function GetCanCloneView: Boolean; virtual;
function CloneEditorView: INTACustomEditorView; virtual;
function GetEditState: TEditState; virtual;
function EditAction(Action: TEditAction): Boolean; virtual;
procedure CloseAllCalled(var ShouldClose: Boolean); virtual;
procedure SelectView; virtual;
procedure DeselectView; virtual;
{$IF CompilerVersion >= 35.0}
function GetTabColor: TColor; virtual;
{$ENDIF}
public
property CanCloneView: Boolean read GetCanCloneView;
property Caption: string read GetCaption;
property EditorWindowCaption: string read GetEditorWindowCaption;
property FrameClass: TCustomFrameClass read GetFrameClass;
property ViewIdentifier: string read GetViewIdentifier;
end;
implementation
{ TCustomEditorView }
function TCustomEditorView.GetCanCloneView: Boolean;
begin
Result := False;
end;
function TCustomEditorView.CloneEditorView: INTACustomEditorView;
begin
Result := nil;
end;
function TCustomEditorView.GetEditState: TEditState;
begin
Result := [TEditStates.esCanCut, TEditStates.esCanCopy, TEditStates.esCanPaste, TEditStates.esCanDelete];
end;
function TCustomEditorView.EditAction(Action: TEditAction): Boolean;
begin
Result := False;
end;
procedure TCustomEditorView.CloseAllCalled(var ShouldClose: Boolean);
begin
ShouldClose := True
end;
procedure TCustomEditorView.SelectView;
begin
// No default implementation
end;
procedure TCustomEditorView.DeselectView;
begin
// No default implementation
end;
{$IF CompilerVersion >= 22.0}
procedure TCustomEditorView.Close(var Allowed: Boolean);
begin
Allowed := True;
end;
{$ENDIF}
{$IF CompilerVersion >= 35.0}
function TCustomEditorView.GetTabColor: TColor;
begin
Result := clNone;
end;
{$ENDIF}
end.