Add support for External Schema referencing.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2947 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2014-04-18 13:36:57 +00:00
parent d12bca1cb6
commit 2ba7ee7cd2
7 changed files with 860 additions and 732 deletions

View File

@ -1,7 +1,7 @@
object fInterfaceEdit: TfInterfaceEdit
Left = 361
Left = 363
Height = 564
Top = 293
Top = 268
Width = 531
HorzScrollBar.Page = 530
VertScrollBar.Page = 563
@ -12,7 +12,7 @@ object fInterfaceEdit: TfInterfaceEdit
ClientWidth = 531
OnCreate = FormCreate
Position = poDesktopCenter
LCLVersion = '1.0.1.4'
LCLVersion = '1.0.11.0'
object Panel1: TPanel
Left = 0
Height = 50

View File

@ -1,12 +1,12 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TfInterfaceEdit','FORMDATA',[
'TPF0'#15'TfInterfaceEdit'#14'fInterfaceEdit'#4'Left'#3'i'#1#6'Height'#3'4'#2
+#3'Top'#3'%'#1#5'Width'#3#19#2#18'HorzScrollBar.Page'#3#18#2#18'VertScrollBa'
'TPF0'#15'TfInterfaceEdit'#14'fInterfaceEdit'#4'Left'#3'k'#1#6'Height'#3'4'#2
+#3'Top'#3#12#1#5'Width'#3#19#2#18'HorzScrollBar.Page'#3#18#2#18'VertScrollBa'
+'r.Page'#3'3'#2#13'ActiveControl'#7#7'Button1'#11'BorderStyle'#7#13'bsSizeTo'
+'olWin'#7'Caption'#6#14'fInterfaceEdit'#12'ClientHeight'#3'4'#2#11'ClientWid'
+'th'#3#19#2#8'OnCreate'#7#10'FormCreate'#8'Position'#7#15'poDesktopCenter'#10
+'LCLVersion'#6#7'1.0.1.4'#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Height'#2'2'#3
+'LCLVersion'#6#8'1.0.11.0'#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Height'#2'2'#3
+'Top'#3#2#2#5'Width'#3#19#2#5'Align'#7#8'alBottom'#12'ClientHeight'#2'2'#11
+'ClientWidth'#3#19#2#8'TabOrder'#2#0#0#7'TButton'#7'Button1'#4'Left'#3#180#1
+#6'Height'#2#25#3'Top'#2#10#5'Width'#2'K'#7'Anchors'#11#5'akTop'#7'akRight'#0

View File

@ -1,22 +1,22 @@
object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
Left = 141
Height = 644
Top = 163
Top = 165
Width = 833
AllowDropFiles = True
Caption = '[Web Services Toolkit ] Type Library Editor'
ClientHeight = 619
ClientHeight = 625
ClientWidth = 833
Menu = MainMenu1
OnClose = FormClose
OnDropFiles = FormDropFiles
OnShow = FormShow
Position = poDesktopCenter
LCLVersion = '1.0.1.4'
LCLVersion = '1.0.11.0'
object SB: TStatusBar
Left = 0
Height = 21
Top = 598
Height = 20
Top = 605
Width = 833
Panels = <
item
@ -29,19 +29,20 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
end
object Panel1: TPanel
Left = 0
Height = 598
Height = 605
Top = 0
Width = 314
Align = alLeft
ClientHeight = 598
ClientHeight = 605
ClientWidth = 314
TabOrder = 0
object trvSchema: TTreeView
Left = 1
Height = 596
Height = 603
Top = 1
Width = 312
Align = alClient
DefaultItemHeight = 16
PopupMenu = PopupMenu1
ReadOnly = True
TabOrder = 0
@ -51,16 +52,16 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
end
object Panel2: TPanel
Left = 322
Height = 598
Height = 605
Top = 0
Width = 511
Align = alClient
ClientHeight = 598
ClientHeight = 605
ClientWidth = 511
TabOrder = 1
object PC: TPageControl
Left = 1
Height = 460
Height = 467
Top = 1
Width = 509
ActivePage = tsInterface
@ -69,13 +70,13 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
TabOrder = 0
object tsInterface: TTabSheet
Caption = '&Interface'
ClientHeight = 425
ClientWidth = 503
ClientHeight = 441
ClientWidth = 501
inline srcInterface: TSynEdit
Left = 0
Height = 425
Height = 441
Top = 0
Width = 503
Width = 501
Align = alClient
Font.Color = clBlack
Font.Height = -13
@ -501,6 +502,12 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
end>
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
SelectedColor.BoldPriority = 50
SelectedColor.ItalicPriority = 50
SelectedColor.UnderlinePriority = 50
BracketHighlightStyle = sbhsBoth
BracketMatchColor.Background = clNone
BracketMatchColor.Foreground = clNone
@ -536,6 +543,8 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
object TSynGutterSeparator
Width = 2
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
end
object TSynGutterCodeFolding
MouseActions = <
@ -1026,6 +1035,12 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
end>
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
SelectedColor.BoldPriority = 50
SelectedColor.ItalicPriority = 50
SelectedColor.UnderlinePriority = 50
BracketHighlightStyle = sbhsBoth
BracketMatchColor.Background = clNone
BracketMatchColor.Foreground = clNone
@ -1061,6 +1076,8 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
object TSynGutterSeparator
Width = 2
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
end
object TSynGutterCodeFolding
MouseActions = <
@ -1551,6 +1568,12 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
end>
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
SelectedColor.BoldPriority = 50
SelectedColor.ItalicPriority = 50
SelectedColor.UnderlinePriority = 50
BracketHighlightStyle = sbhsBoth
BracketMatchColor.Background = clNone
BracketMatchColor.Foreground = clNone
@ -1586,6 +1609,8 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
object TSynGutterSeparator
Width = 2
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
end
object TSynGutterCodeFolding
MouseActions = <
@ -2076,6 +2101,12 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
end>
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
SelectedColor.BoldPriority = 50
SelectedColor.ItalicPriority = 50
SelectedColor.UnderlinePriority = 50
BracketHighlightStyle = sbhsBoth
BracketMatchColor.Background = clNone
BracketMatchColor.Foreground = clNone
@ -2111,6 +2142,8 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
object TSynGutterSeparator
Width = 2
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
end
object TSynGutterCodeFolding
MouseActions = <
@ -2601,6 +2634,12 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
end>
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
SelectedColor.BoldPriority = 50
SelectedColor.ItalicPriority = 50
SelectedColor.UnderlinePriority = 50
BracketHighlightStyle = sbhsBoth
BracketMatchColor.Background = clNone
BracketMatchColor.Foreground = clNone
@ -2636,6 +2675,8 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
object TSynGutterSeparator
Width = 2
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
end
object TSynGutterCodeFolding
MouseActions = <
@ -2712,7 +2753,7 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
object PCInfos: TPageControl
Left = 1
Height = 128
Top = 469
Top = 476
Width = 509
ActivePage = tsDocumentation
Align = alBottom
@ -2720,13 +2761,13 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
TabOrder = 1
object tsDocumentation: TTabSheet
Caption = 'Documentation'
ClientHeight = 93
ClientWidth = 503
ClientHeight = 102
ClientWidth = 501
object edtDocumentation: TMemo
Left = 0
Height = 93
Height = 102
Top = 0
Width = 503
Width = 501
Align = alClient
Color = clSilver
ReadOnly = True
@ -3169,6 +3210,12 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
end>
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
SelectedColor.BoldPriority = 50
SelectedColor.ItalicPriority = 50
SelectedColor.UnderlinePriority = 50
BracketHighlightStyle = sbhsBoth
BracketMatchColor.Background = clNone
BracketMatchColor.Foreground = clNone
@ -3204,6 +3251,8 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
object TSynGutterSeparator
Width = 2
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
end
object TSynGutterCodeFolding
MouseActions = <
@ -3282,7 +3331,7 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
Cursor = crVSplit
Left = 1
Height = 8
Top = 461
Top = 468
Width = 509
Align = alBottom
Color = clBlack
@ -3292,7 +3341,7 @@ object fWstTypeLibraryEdit: TfWstTypeLibraryEdit
end
object Splitter1: TSplitter
Left = 314
Height = 598
Height = 605
Top = 0
Width = 8
Color = clBlack

File diff suppressed because it is too large Load Diff

View File

@ -652,11 +652,22 @@ begin
end;
procedure TfWstTypeLibraryEdit.actUpdateObjectUpdate(Sender: TObject);
var
ok : Boolean;
locItem : TPasElement;
begin
TAction(Sender).Enabled :=
Assigned(trvSchema.Selected) and
Assigned(trvSchema.Selected.Data) and
HasEditor(TPasElement(trvSchema.Selected.Data),etUpdate);
ok := Assigned(trvSchema.Selected) and Assigned(trvSchema.Selected.Data);
if ok then begin
locItem := TPasElement(trvSchema.Selected.Data);
if locItem.InheritsFrom(TPasModule) and (locItem <> FSymbolTable.CurrentModule) then
ok := False
else
ok := ( not(locItem.InheritsFrom(TPasType)) or
(FindModule(TPasType(locItem)) = FSymbolTable.CurrentModule)
);
ok := ok and HasEditor(locItem,etUpdate);
end;
TAction(Sender).Enabled := ok;
end;
procedure TfWstTypeLibraryEdit.FDFind(Sender : TObject);
@ -879,11 +890,19 @@ begin
end;
procedure TfWstTypeLibraryEdit.actCloneUpdate(Sender : TObject);
var
ok : Boolean;
locItem : TPasElement;
begin
TAction(Sender).Enabled :=
Assigned(trvSchema.Selected) and
Assigned(trvSchema.Selected.Data) and
HasEditor(TPasElement(trvSchema.Selected.Data),etClone);
ok := Assigned(trvSchema.Selected) and Assigned(trvSchema.Selected.Data);
if ok then begin
locItem := TPasElement(trvSchema.Selected.Data);
ok := ( not(locItem.InheritsFrom(TPasType)) or
(FindModule(TPasType(locItem)) = FSymbolTable.CurrentModule)
) and
HasEditor(locItem,etClone);
end;
TAction(Sender).Enabled := ok;
end;
procedure TfWstTypeLibraryEdit.actCompoundCreateExecute(Sender: TObject);
@ -919,11 +938,19 @@ begin
end;
procedure TfWstTypeLibraryEdit.actDeleteUpdate(Sender : TObject);
var
ok : Boolean;
locItem : TPasElement;
begin
TAction(Sender).Enabled :=
Assigned(trvSchema.Selected) and
Assigned(trvSchema.Selected.Data) and
HasEditor(TPasElement(trvSchema.Selected.Data),etDelete);
ok := Assigned(trvSchema.Selected) and Assigned(trvSchema.Selected.Data);
if ok then begin
locItem := TPasElement(trvSchema.Selected.Data);
ok := ( not(locItem.InheritsFrom(TPasType)) or
(FindModule(TPasType(locItem)) = FSymbolTable.CurrentModule)
) and
HasEditor(locItem,etDelete);
end;
TAction(Sender).Enabled := ok;
end;
procedure TfWstTypeLibraryEdit.actEnumCreateExecute(Sender: TObject);

View File

@ -959,11 +959,26 @@ function TPackagePainter.Paint(
):TTreeNode;
var
objPtr : ISymbolPainter;
i : Integer;
locImportedNode : TTreeNode;
locModule : TPasModule;
begin
Result := AParent;
objPtr := FindPainter(AContainer.CurrentModule) ;
if Assigned(objPtr) then begin
if Assigned(objPtr) then
objPtr.Paint(AContainer,AContainer.CurrentModule,Result);
if (AContainer.Package.Modules.Count > 1) then begin
locImportedNode := nil;
for i := 0 to AContainer.Package.Modules.Count - 1 do begin
locModule := TPasModule(AContainer.Package.Modules[i]);
if (locModule <> AContainer.CurrentModule) and
not(locModule.InheritsFrom(TPasNativeModule))
then begin
if (locImportedNode = nil) then
locImportedNode := AddChildNode(AParent,'Imported Schemas');
objPtr.Paint(AContainer,locModule,locImportedNode);
end;
end;
end;
end;

View File

@ -236,6 +236,7 @@ type
) : TPasArgument;
function FindMember(AClass : TPasClassType; const AName : string) : TPasElement ; overload;
function FindMember(AClass : TPasRecordType; const AName : string) : TPasElement ; overload;
function FindModule(AType: TPasType) : TPasModule;
function GetElementCount(AList : TList2; AElementClass : TPTreeElement):Integer ;
function GetUltimeType(AType : TPasType) : TPasType;overload;
@ -657,6 +658,18 @@ begin
end;
end;
function FindModule(AType: TPasType) : TPasModule;
begin
if Assigned(AType) and
Assigned(AType.Parent{Section}) and
Assigned(AType.Parent.Parent{Module})
then begin
Result := AType.Parent.Parent as TPasModule;
end else begin
Result := nil;
end;
end;
function MakeInternalSymbolNameFrom(const AName : string) : string ;
begin
Result := ExtractIdentifier(AName);