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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -959,11 +959,26 @@ function TPackagePainter.Paint(
):TTreeNode; ):TTreeNode;
var var
objPtr : ISymbolPainter; objPtr : ISymbolPainter;
i : Integer;
locImportedNode : TTreeNode;
locModule : TPasModule;
begin begin
Result := AParent; Result := AParent;
objPtr := FindPainter(AContainer.CurrentModule) ; objPtr := FindPainter(AContainer.CurrentModule) ;
if Assigned(objPtr) then begin if Assigned(objPtr) then
objPtr.Paint(AContainer,AContainer.CurrentModule,Result); 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;
end; end;

View File

@ -236,6 +236,7 @@ type
) : TPasArgument; ) : TPasArgument;
function FindMember(AClass : TPasClassType; const AName : string) : TPasElement ; overload; function FindMember(AClass : TPasClassType; const AName : string) : TPasElement ; overload;
function FindMember(AClass : TPasRecordType; 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 GetElementCount(AList : TList2; AElementClass : TPTreeElement):Integer ;
function GetUltimeType(AType : TPasType) : TPasType;overload; function GetUltimeType(AType : TPasType) : TPasType;overload;
@ -657,6 +658,18 @@ begin
end; end;
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 ; function MakeInternalSymbolNameFrom(const AName : string) : string ;
begin begin
Result := ExtractIdentifier(AName); Result := ExtractIdentifier(AName);