mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-03 04:50:01 +01:00
Unit info dlg: added button to jump to include directive
git-svn-id: trunk@9703 -
This commit is contained in:
parent
b4de789eaa
commit
a97b122dcc
@ -170,6 +170,9 @@ resourcestring
|
||||
lisMenuInsertText = 'Insert text';
|
||||
lisMenuInsertCVSKeyword = 'CVS keyword';
|
||||
lisMenuInsertGeneral = 'General';
|
||||
lisUnitPaths = 'Unit paths';
|
||||
lisIncludePaths = 'Include paths';
|
||||
lisSourcePaths = 'Source paths';
|
||||
lisMenuCompleteCode = 'Complete Code';
|
||||
lisMenuExtractProc = 'Extract procedure ...';
|
||||
lisMenuFindIdentifierRefs = 'Find Identifier References ...';
|
||||
|
||||
@ -6351,13 +6351,14 @@ var ActiveSrcEdit:TSourceEditor;
|
||||
ActiveUnitInfo:TUnitInfo;
|
||||
ShortUnitName, AFilename, FileDir: string;
|
||||
ClearIncludedByFile: boolean;
|
||||
DlgResult: TModalResult;
|
||||
begin
|
||||
GetCurrentUnit(ActiveSrcEdit,ActiveUnitInfo);
|
||||
if (ActiveSrcEdit=nil) or (ActiveUnitInfo=nil) then exit;
|
||||
ShortUnitName:=ActiveSrcEdit.PageName;
|
||||
AFilename:=ActiveUnitInfo.Filename;
|
||||
FileDir:=ExtractFilePath(AFilename);
|
||||
ShowUnitInfoDlg(ShortUnitName,
|
||||
DlgResult:=ShowUnitInfoDlg(ShortUnitName,
|
||||
LazSyntaxHighlighterNames[ActiveUnitInfo.SyntaxHighlighter],
|
||||
ActiveUnitInfo.IsPartOfProject, length(ActiveSrcEdit.Source.Text),
|
||||
ActiveSrcEdit.Source.Count,
|
||||
@ -6370,6 +6371,8 @@ begin
|
||||
);
|
||||
if ClearIncludedByFile then
|
||||
ActiveUnitInfo.Source.LastIncludedByFile:='';
|
||||
if (DlgResult=mrYes) and (ActiveUnitInfo.Source.LastIncludedByFile<>'') then
|
||||
DoGotoIncludeDirective;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.DoShowCodeExplorer;
|
||||
|
||||
@ -1,290 +1,293 @@
|
||||
object UnitInfoDialog: TUnitInfoDialog
|
||||
ActiveControl = OkButton
|
||||
BorderStyle = bsSizeToolWin
|
||||
Caption = 'UnitInfoDialog'
|
||||
ClientHeight = 283
|
||||
ClientWidth = 500
|
||||
OnResize = UnitInfoDlgResize
|
||||
PixelsPerInch = 96
|
||||
Position = poScreenCenter
|
||||
HorzScrollBar.Page = 499
|
||||
VertScrollBar.Page = 282
|
||||
Left = 349
|
||||
Height = 283
|
||||
Top = 244
|
||||
Width = 500
|
||||
HorzScrollBar.Page = 499
|
||||
VertScrollBar.Page = 282
|
||||
ActiveControl = OkButton
|
||||
BorderStyle = bsSizeToolWin
|
||||
Caption = 'UnitInfoDialog'
|
||||
OnCreate = FormCreate
|
||||
OnResize = UnitInfoDlgResize
|
||||
Position = poScreenCenter
|
||||
object OkButton: TBitBtn
|
||||
Left = 439
|
||||
Height = 28
|
||||
Top = 242
|
||||
Width = 55
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
|
||||
Cancel = True
|
||||
Caption = '&OK'
|
||||
Default = True
|
||||
Kind = bkOK
|
||||
ModalResult = 1
|
||||
NumGlyphs = 0
|
||||
OnClick = OkButtonClick
|
||||
TabOrder = 0
|
||||
Left = 426
|
||||
Height = 34
|
||||
Top = 239
|
||||
Width = 68
|
||||
end
|
||||
object Notebook: TNotebook
|
||||
Align = alTop
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Around = 6
|
||||
PageIndex = 3
|
||||
Left = 6
|
||||
Height = 226
|
||||
Top = 6
|
||||
Width = 488
|
||||
object Page1: TPage
|
||||
Caption = 'Page1'
|
||||
ClientWidth = 480
|
||||
ClientHeight = 200
|
||||
Height = 200
|
||||
Width = 480
|
||||
Align = alTop
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Around = 6
|
||||
PageIndex = 0
|
||||
object GeneralPage: TPage
|
||||
Caption = 'GeneralPage'
|
||||
object ULines: TLabel
|
||||
Left = 12
|
||||
Height = 13
|
||||
Top = 92
|
||||
Width = 39
|
||||
Alignment = taRightJustify
|
||||
Caption = 'ULines'
|
||||
Color = clNone
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
Left = 12
|
||||
Height = 14
|
||||
Top = 92
|
||||
Width = 38
|
||||
end
|
||||
object OutLines: TLabel
|
||||
AnchorSideLeft.Control = ULines
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 63
|
||||
Height = 13
|
||||
Top = 92
|
||||
Width = 51
|
||||
BorderSpacing.Left = 12
|
||||
Caption = 'OutLines'
|
||||
Color = clNone
|
||||
ParentColor = False
|
||||
AnchorSideLeft.Control = ULines
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 62
|
||||
Height = 14
|
||||
Top = 92
|
||||
Width = 43
|
||||
end
|
||||
object OutPath: TLabel
|
||||
AnchorSideLeft.Control = UPath
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 58
|
||||
Height = 13
|
||||
Top = 112
|
||||
Width = 46
|
||||
BorderSpacing.Left = 12
|
||||
Caption = 'OutPath'
|
||||
Color = clNone
|
||||
ParentColor = False
|
||||
AnchorSideLeft.Control = UPath
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 59
|
||||
Height = 14
|
||||
Top = 112
|
||||
Width = 41
|
||||
end
|
||||
object UPath: TLabel
|
||||
Left = 12
|
||||
Height = 13
|
||||
Top = 112
|
||||
Width = 34
|
||||
Alignment = taRightJustify
|
||||
Caption = 'UPath'
|
||||
Color = clNone
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
Left = 12
|
||||
Height = 14
|
||||
Top = 112
|
||||
Width = 35
|
||||
end
|
||||
object UIncludedBy: TLabel
|
||||
Left = 12
|
||||
Height = 13
|
||||
Top = 132
|
||||
Width = 72
|
||||
Alignment = taRightJustify
|
||||
Caption = 'UIncludedBy'
|
||||
Color = clNone
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
Left = 12
|
||||
Height = 14
|
||||
Top = 132
|
||||
Width = 72
|
||||
end
|
||||
object OutIncludedBy: TLabel
|
||||
AnchorSideLeft.Control = UIncludedBy
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 96
|
||||
Height = 13
|
||||
Top = 132
|
||||
Width = 84
|
||||
BorderSpacing.Left = 12
|
||||
Caption = 'OutIncludedBy'
|
||||
Color = clNone
|
||||
ParentColor = False
|
||||
AnchorSideLeft.Control = UIncludedBy
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 96
|
||||
Height = 14
|
||||
Top = 132
|
||||
Width = 72
|
||||
end
|
||||
object OutSize: TLabel
|
||||
AnchorSideLeft.Control = USize
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 57
|
||||
Height = 13
|
||||
Top = 72
|
||||
Width = 45
|
||||
BorderSpacing.Left = 12
|
||||
Caption = 'OutSize'
|
||||
Color = clNone
|
||||
ParentColor = False
|
||||
AnchorSideLeft.Control = USize
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 56
|
||||
Height = 14
|
||||
Top = 72
|
||||
Width = 38
|
||||
end
|
||||
object USize: TLabel
|
||||
Left = 12
|
||||
Height = 13
|
||||
Top = 72
|
||||
Width = 33
|
||||
Alignment = taRightJustify
|
||||
Caption = 'USize'
|
||||
Color = clNone
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
Left = 12
|
||||
Height = 14
|
||||
Top = 72
|
||||
Width = 32
|
||||
end
|
||||
object UInProject: TLabel
|
||||
Left = 12
|
||||
Height = 13
|
||||
Top = 52
|
||||
Width = 58
|
||||
Alignment = taRightJustify
|
||||
Caption = 'UInProject'
|
||||
Color = clNone
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
Left = 12
|
||||
Height = 14
|
||||
Top = 52
|
||||
Width = 62
|
||||
end
|
||||
object OutInProject: TLabel
|
||||
AnchorSideLeft.Control = UInProject
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 82
|
||||
Height = 13
|
||||
Top = 52
|
||||
Width = 70
|
||||
BorderSpacing.Left = 12
|
||||
Caption = 'OutInProject'
|
||||
Color = clNone
|
||||
ParentColor = False
|
||||
AnchorSideLeft.Control = UInProject
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 86
|
||||
Height = 14
|
||||
Top = 52
|
||||
Width = 63
|
||||
end
|
||||
object OutType: TLabel
|
||||
AnchorSideLeft.Control = UType
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 61
|
||||
Height = 13
|
||||
Top = 32
|
||||
Width = 49
|
||||
BorderSpacing.Left = 12
|
||||
Caption = 'OutType'
|
||||
Color = clNone
|
||||
ParentColor = False
|
||||
AnchorSideLeft.Control = UType
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 61
|
||||
Height = 14
|
||||
Top = 32
|
||||
Width = 43
|
||||
end
|
||||
object UType: TLabel
|
||||
Left = 12
|
||||
Height = 13
|
||||
Top = 32
|
||||
Width = 37
|
||||
Alignment = taRightJustify
|
||||
Caption = 'UType'
|
||||
Color = clNone
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
Left = 12
|
||||
Height = 14
|
||||
Top = 32
|
||||
Width = 37
|
||||
end
|
||||
object OutName: TLabel
|
||||
AnchorSideLeft.Control = UName
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 65
|
||||
Height = 13
|
||||
Top = 12
|
||||
Width = 53
|
||||
BorderSpacing.Left = 12
|
||||
Caption = 'OutName'
|
||||
Color = clNone
|
||||
ParentColor = False
|
||||
AnchorSideLeft.Control = UName
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
Left = 65
|
||||
Height = 14
|
||||
Top = 12
|
||||
Width = 46
|
||||
end
|
||||
object UName: TLabel
|
||||
Left = 12
|
||||
Height = 13
|
||||
Top = 12
|
||||
Width = 41
|
||||
Alignment = taRightJustify
|
||||
Caption = 'UName'
|
||||
Color = clNone
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
OnResize = UnitInfoDlgResize
|
||||
Left = 12
|
||||
Height = 14
|
||||
Top = 12
|
||||
Width = 41
|
||||
end
|
||||
object ClearIncludedBy: TButton
|
||||
AnchorSideTop.Control = UIncludedBy
|
||||
Left = 12
|
||||
Height = 26
|
||||
Top = 152
|
||||
Width = 107
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 20
|
||||
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Caption = 'ClearIncludedBy'
|
||||
OnClick = clearIncludedByClick
|
||||
TabOrder = 0
|
||||
AnchorSideTop.Control = UIncludedBy
|
||||
Left = 12
|
||||
Height = 29
|
||||
Top = 152
|
||||
Width = 101
|
||||
end
|
||||
end
|
||||
object Page2: TPage
|
||||
Caption = 'Page2'
|
||||
ClientWidth = 480
|
||||
ClientHeight = 200
|
||||
Height = 200
|
||||
Width = 480
|
||||
object UnitPathsPage: TPage
|
||||
Caption = 'UnitPathsPage'
|
||||
object UnitPathMemo: TMemo
|
||||
Left = 6
|
||||
Height = 184
|
||||
Top = 6
|
||||
Width = 472
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 6
|
||||
ReadOnly = True
|
||||
ScrollBars = ssAutoBoth
|
||||
TabOrder = 0
|
||||
Left = 6
|
||||
Height = 188
|
||||
Top = 6
|
||||
Width = 468
|
||||
end
|
||||
end
|
||||
object Page3: TPage
|
||||
Caption = 'Page3'
|
||||
ClientWidth = 480
|
||||
ClientHeight = 200
|
||||
Height = 200
|
||||
Width = 480
|
||||
object IncludePathsPage: TPage
|
||||
Caption = 'IncludePathsPage'
|
||||
object IncludePathMemo: TMemo
|
||||
Left = 6
|
||||
Height = 184
|
||||
Top = 6
|
||||
Width = 472
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 6
|
||||
ReadOnly = True
|
||||
ScrollBars = ssAutoBoth
|
||||
TabOrder = 0
|
||||
Left = 6
|
||||
Height = 188
|
||||
Top = 6
|
||||
Width = 468
|
||||
end
|
||||
end
|
||||
object Page4: TPage
|
||||
Caption = 'Page4'
|
||||
ClientWidth = 480
|
||||
ClientHeight = 200
|
||||
Height = 200
|
||||
Width = 480
|
||||
object CompleteUnitPathsPage: TPage
|
||||
Caption = 'CompleteUnitPathsPage'
|
||||
object SrcPathMemo: TMemo
|
||||
Left = 6
|
||||
Height = 184
|
||||
Top = 6
|
||||
Width = 472
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 6
|
||||
ReadOnly = True
|
||||
ScrollBars = ssAutoBoth
|
||||
TabOrder = 0
|
||||
Left = 6
|
||||
Height = 188
|
||||
Top = 6
|
||||
Width = 468
|
||||
end
|
||||
end
|
||||
end
|
||||
object CodeToolsDefsButton: TButton
|
||||
Anchors = [akLeft, akBottom]
|
||||
AnchorSideTop.Control = OkButton
|
||||
AnchorSideBottom.Control = OkButton
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 28
|
||||
Top = 242
|
||||
Width = 134
|
||||
Anchors = [akTop, akLeft, akBottom]
|
||||
AutoSize = True
|
||||
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Caption = 'CodeToolsDefsButton'
|
||||
OnClick = CodeToolsDefsButtonClick
|
||||
TabOrder = 2
|
||||
Left = 6
|
||||
Height = 29
|
||||
Top = 239
|
||||
Width = 128
|
||||
end
|
||||
object GotoIncludeDirectiveButton: TButton
|
||||
AnchorSideTop.Control = OkButton
|
||||
AnchorSideRight.Control = OkButton
|
||||
AnchorSideBottom.Control = OkButton
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 263
|
||||
Height = 28
|
||||
Top = 242
|
||||
Width = 166
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Right = 10
|
||||
BorderSpacing.InnerBorder = 4
|
||||
Caption = 'GotoIncludeDirectiveButton'
|
||||
ModalResult = 6
|
||||
OnClick = GotoIncludeDirectiveButtonClick
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,79 +1,87 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TUnitInfoDialog','FORMDATA',[
|
||||
'TPF0'#15'TUnitInfoDialog'#14'UnitInfoDialog'#13'ActiveControl'#7#8'OkButton'
|
||||
+#11'BorderStyle'#7#13'bsSizeToolWin'#7'Caption'#6#14'UnitInfoDialog'#12'Clie'
|
||||
+'ntHeight'#3#27#1#11'ClientWidth'#3#244#1#8'OnResize'#7#17'UnitInfoDlgResize'
|
||||
+#13'PixelsPerInch'#2'`'#8'Position'#7#14'poScreenCenter'#18'HorzScrollBar.Pa'
|
||||
+'ge'#3#243#1#18'VertScrollBar.Page'#3#26#1#4'Left'#3']'#1#6'Height'#3#27#1#3
|
||||
+'Top'#3#244#0#5'Width'#3#244#1#0#7'TBitBtn'#8'OkButton'#7'Anchors'#11#7'akRi'
|
||||
+'ght'#8'akBottom'#0#8'AutoSize'#9#6'Cancel'#9#7'Caption'#6#3'&OK'#7'Default'
|
||||
+#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#8'TabOrder'#2#0#4
|
||||
+'Left'#3#170#1#6'Height'#2'"'#3'Top'#3#239#0#5'Width'#2'D'#0#0#9'TNotebook'#8
|
||||
+'Notebook'#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8
|
||||
+'akBottom'#0#20'BorderSpacing.Around'#2#6#9'PageIndex'#2#3#4'Left'#2#6#6'Hei'
|
||||
+'ght'#3#226#0#3'Top'#2#6#5'Width'#3#232#1#0#5'TPage'#5'Page1'#7'Caption'#6#5
|
||||
+'Page1'#11'ClientWidth'#3#224#1#12'ClientHeight'#3#200#0#6'Height'#3#200#0#5
|
||||
+'Width'#3#224#1#0#6'TLabel'#6'ULines'#9'Alignment'#7#14'taRightJustify'#7'Ca'
|
||||
+'ption'#6#6'ULines'#5'Color'#7#6'clNone'#10'Font.Style'#11#6'fsBold'#0#11'Pa'
|
||||
+'rentColor'#8#4'Left'#2#12#6'Height'#2#14#3'Top'#2'\'#5'Width'#2'&'#0#0#6'TL'
|
||||
+'abel'#8'OutLines'#18'BorderSpacing.Left'#2#12#7'Caption'#6#8'OutLines'#5'Co'
|
||||
+'lor'#7#6'clNone'#11'ParentColor'#8#22'AnchorSideLeft.Control'#7#6'ULines'#19
|
||||
+'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#2'>'#6'Height'#2#14#3'Top'#2'\'
|
||||
+#5'Width'#2'+'#0#0#6'TLabel'#7'OutPath'#18'BorderSpacing.Left'#2#12#7'Captio'
|
||||
+'n'#6#7'OutPath'#5'Color'#7#6'clNone'#11'ParentColor'#8#22'AnchorSideLeft.Co'
|
||||
+'ntrol'#7#5'UPath'#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#2';'#6'Hei'
|
||||
+'ght'#2#14#3'Top'#2'p'#5'Width'#2')'#0#0#6'TLabel'#5'UPath'#9'Alignment'#7#14
|
||||
+'taRightJustify'#7'Caption'#6#5'UPath'#5'Color'#7#6'clNone'#10'Font.Style'#11
|
||||
+#6'fsBold'#0#11'ParentColor'#8#4'Left'#2#12#6'Height'#2#14#3'Top'#2'p'#5'Wid'
|
||||
+'th'#2'#'#0#0#6'TLabel'#11'UIncludedBy'#9'Alignment'#7#14'taRightJustify'#7
|
||||
+'Caption'#6#11'UIncludedBy'#5'Color'#7#6'clNone'#10'Font.Style'#11#6'fsBold'
|
||||
+#0#11'ParentColor'#8#4'Left'#2#12#6'Height'#2#14#3'Top'#3#132#0#5'Width'#2'H'
|
||||
+#0#0#6'TLabel'#13'OutIncludedBy'#18'BorderSpacing.Left'#2#12#7'Caption'#6#13
|
||||
+'OutIncludedBy'#5'Color'#7#6'clNone'#11'ParentColor'#8#22'AnchorSideLeft.Con'
|
||||
+'trol'#7#11'UIncludedBy'#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#2'`'
|
||||
+#6'Height'#2#14#3'Top'#3#132#0#5'Width'#2'H'#0#0#6'TLabel'#7'OutSize'#18'Bor'
|
||||
+'derSpacing.Left'#2#12#7'Caption'#6#7'OutSize'#5'Color'#7#6'clNone'#11'Paren'
|
||||
+'tColor'#8#22'AnchorSideLeft.Control'#7#5'USize'#19'AnchorSideLeft.Side'#7#9
|
||||
+'asrBottom'#4'Left'#2'8'#6'Height'#2#14#3'Top'#2'H'#5'Width'#2'&'#0#0#6'TLab'
|
||||
+'el'#5'USize'#9'Alignment'#7#14'taRightJustify'#7'Caption'#6#5'USize'#5'Colo'
|
||||
+'r'#7#6'clNone'#10'Font.Style'#11#6'fsBold'#0#11'ParentColor'#8#4'Left'#2#12
|
||||
+#6'Height'#2#14#3'Top'#2'H'#5'Width'#2' '#0#0#6'TLabel'#10'UInProject'#9'Ali'
|
||||
+'gnment'#7#14'taRightJustify'#7'Caption'#6#10'UInProject'#5'Color'#7#6'clNon'
|
||||
+'e'#10'Font.Style'#11#6'fsBold'#0#11'ParentColor'#8#4'Left'#2#12#6'Height'#2
|
||||
+#14#3'Top'#2'4'#5'Width'#2'>'#0#0#6'TLabel'#12'OutInProject'#18'BorderSpacin'
|
||||
+'g.Left'#2#12#7'Caption'#6#12'OutInProject'#5'Color'#7#6'clNone'#11'ParentCo'
|
||||
+'lor'#8#22'AnchorSideLeft.Control'#7#10'UInProject'#19'AnchorSideLeft.Side'#7
|
||||
+#9'asrBottom'#4'Left'#2'V'#6'Height'#2#14#3'Top'#2'4'#5'Width'#2'?'#0#0#6'TL'
|
||||
+'abel'#7'OutType'#18'BorderSpacing.Left'#2#12#7'Caption'#6#7'OutType'#5'Colo'
|
||||
+'r'#7#6'clNone'#11'ParentColor'#8#22'AnchorSideLeft.Control'#7#5'UType'#19'A'
|
||||
+'nchorSideLeft.Side'#7#9'asrBottom'#4'Left'#2'='#6'Height'#2#14#3'Top'#2' '#5
|
||||
+'Width'#2'+'#0#0#6'TLabel'#5'UType'#9'Alignment'#7#14'taRightJustify'#7'Capt'
|
||||
+'ion'#6#5'UType'#5'Color'#7#6'clNone'#10'Font.Style'#11#6'fsBold'#0#11'Paren'
|
||||
+'tColor'#8#4'Left'#2#12#6'Height'#2#14#3'Top'#2' '#5'Width'#2'%'#0#0#6'TLabe'
|
||||
+'l'#7'OutName'#18'BorderSpacing.Left'#2#12#7'Caption'#6#7'OutName'#5'Color'#7
|
||||
+#6'clNone'#11'ParentColor'#8#22'AnchorSideLeft.Control'#7#5'UName'#19'Anchor'
|
||||
+'SideLeft.Side'#7#9'asrBottom'#4'Left'#2'A'#6'Height'#2#14#3'Top'#2#12#5'Wid'
|
||||
+'th'#2'.'#0#0#6'TLabel'#5'UName'#9'Alignment'#7#14'taRightJustify'#7'Caption'
|
||||
+#6#5'UName'#5'Color'#7#6'clNone'#10'Font.Style'#11#6'fsBold'#0#11'ParentColo'
|
||||
+'r'#8#8'OnResize'#7#17'UnitInfoDlgResize'#4'Left'#2#12#6'Height'#2#14#3'Top'
|
||||
+#2#12#5'Width'#2')'#0#0#7'TButton'#15'ClearIncludedBy'#8'AutoSize'#9#17'Bord'
|
||||
+'erSpacing.Top'#2#20#7'Caption'#6#15'ClearIncludedBy'#7'OnClick'#7#20'clearI'
|
||||
+'ncludedByClick'#8'TabOrder'#2#0#21'AnchorSideTop.Control'#7#11'UIncludedBy'
|
||||
+#4'Left'#2#12#6'Height'#2#29#3'Top'#3#152#0#5'Width'#2'e'#0#0#0#5'TPage'#5'P'
|
||||
+'age2'#7'Caption'#6#5'Page2'#11'ClientWidth'#3#224#1#12'ClientHeight'#3#200#0
|
||||
+#6'Height'#3#200#0#5'Width'#3#224#1#0#5'TMemo'#12'UnitPathMemo'#5'Align'#7#8
|
||||
+'alClient'#20'BorderSpacing.Around'#2#6#8'ReadOnly'#9#10'ScrollBars'#7#10'ss'
|
||||
+'AutoBoth'#8'TabOrder'#2#0#4'Left'#2#6#6'Height'#3#188#0#3'Top'#2#6#5'Width'
|
||||
,#3#212#1#0#0#0#5'TPage'#5'Page3'#7'Caption'#6#5'Page3'#11'ClientWidth'#3#224
|
||||
+#1#12'ClientHeight'#3#200#0#6'Height'#3#200#0#5'Width'#3#224#1#0#5'TMemo'#15
|
||||
+'IncludePathMemo'#5'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#8'Read'
|
||||
+'Only'#9#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#4'Left'#2#6#6'Heigh'
|
||||
+'t'#3#188#0#3'Top'#2#6#5'Width'#3#212#1#0#0#0#5'TPage'#5'Page4'#7'Caption'#6
|
||||
+#5'Page4'#11'ClientWidth'#3#224#1#12'ClientHeight'#3#200#0#6'Height'#3#200#0
|
||||
+#5'Width'#3#224#1#0#5'TMemo'#11'SrcPathMemo'#5'Align'#7#8'alClient'#20'Borde'
|
||||
+'rSpacing.Around'#2#6#8'ReadOnly'#9#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrd'
|
||||
+'er'#2#0#4'Left'#2#6#6'Height'#3#188#0#3'Top'#2#6#5'Width'#3#212#1#0#0#0#0#7
|
||||
+'TButton'#19'CodeToolsDefsButton'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'Au'
|
||||
+'toSize'#9#7'Caption'#6#19'CodeToolsDefsButton'#7'OnClick'#7#24'CodeToolsDef'
|
||||
+'sButtonClick'#8'TabOrder'#2#2#4'Left'#2#6#6'Height'#2#29#3'Top'#3#239#0#5'W'
|
||||
+'idth'#3#128#0#0#0#0
|
||||
'TPF0'#15'TUnitInfoDialog'#14'UnitInfoDialog'#4'Left'#3']'#1#6'Height'#3#27#1
|
||||
+#3'Top'#3#244#0#5'Width'#3#244#1#18'HorzScrollBar.Page'#3#243#1#18'VertScrol'
|
||||
+'lBar.Page'#3#26#1#13'ActiveControl'#7#8'OkButton'#11'BorderStyle'#7#13'bsSi'
|
||||
+'zeToolWin'#7'Caption'#6#14'UnitInfoDialog'#8'OnCreate'#7#10'FormCreate'#8'O'
|
||||
+'nResize'#7#17'UnitInfoDlgResize'#8'Position'#7#14'poScreenCenter'#0#7'TBitB'
|
||||
+'tn'#8'OkButton'#4'Left'#3#183#1#6'Height'#2#28#3'Top'#3#242#0#5'Width'#2'7'
|
||||
+#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#6'Cancel'#9#7'Caption'
|
||||
+#6#3'&OK'#7'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0
|
||||
+#7'OnClick'#7#13'OkButtonClick'#8'TabOrder'#2#0#0#0#9'TNotebook'#8'Notebook'
|
||||
+#4'Left'#2#6#6'Height'#3#226#0#3'Top'#2#6#5'Width'#3#232#1#5'Align'#7#5'alTo'
|
||||
+'p'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20'BorderSpaci'
|
||||
+'ng.Around'#2#6#9'PageIndex'#2#0#0#5'TPage'#11'GeneralPage'#7'Caption'#6#11
|
||||
+'GeneralPage'#0#6'TLabel'#6'ULines'#4'Left'#2#12#6'Height'#2#13#3'Top'#2'\'#5
|
||||
+'Width'#2''''#9'Alignment'#7#14'taRightJustify'#7'Caption'#6#6'ULines'#5'Col'
|
||||
+'or'#7#6'clNone'#10'Font.Style'#11#6'fsBold'#0#11'ParentColor'#8#0#0#6'TLabe'
|
||||
+'l'#8'OutLines'#22'AnchorSideLeft.Control'#7#6'ULines'#19'AnchorSideLeft.Sid'
|
||||
+'e'#7#9'asrBottom'#4'Left'#2'?'#6'Height'#2#13#3'Top'#2'\'#5'Width'#2'3'#18
|
||||
+'BorderSpacing.Left'#2#12#7'Caption'#6#8'OutLines'#5'Color'#7#6'clNone'#11'P'
|
||||
+'arentColor'#8#0#0#6'TLabel'#7'OutPath'#22'AnchorSideLeft.Control'#7#5'UPath'
|
||||
+#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#2':'#6'Height'#2#13#3'Top'#2
|
||||
+'p'#5'Width'#2'.'#18'BorderSpacing.Left'#2#12#7'Caption'#6#7'OutPath'#5'Colo'
|
||||
+'r'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#5'UPath'#4'Left'#2#12#6'Heig'
|
||||
+'ht'#2#13#3'Top'#2'p'#5'Width'#2'"'#9'Alignment'#7#14'taRightJustify'#7'Capt'
|
||||
+'ion'#6#5'UPath'#5'Color'#7#6'clNone'#10'Font.Style'#11#6'fsBold'#0#11'Paren'
|
||||
+'tColor'#8#0#0#6'TLabel'#11'UIncludedBy'#4'Left'#2#12#6'Height'#2#13#3'Top'#3
|
||||
+#132#0#5'Width'#2'H'#9'Alignment'#7#14'taRightJustify'#7'Caption'#6#11'UIncl'
|
||||
+'udedBy'#5'Color'#7#6'clNone'#10'Font.Style'#11#6'fsBold'#0#11'ParentColor'#8
|
||||
+#0#0#6'TLabel'#13'OutIncludedBy'#22'AnchorSideLeft.Control'#7#11'UIncludedBy'
|
||||
+#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#2'`'#6'Height'#2#13#3'Top'#3
|
||||
+#132#0#5'Width'#2'T'#18'BorderSpacing.Left'#2#12#7'Caption'#6#13'OutIncluded'
|
||||
+'By'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#7'OutSize'#22'Anch'
|
||||
+'orSideLeft.Control'#7#5'USize'#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Lef'
|
||||
+'t'#2'9'#6'Height'#2#13#3'Top'#2'H'#5'Width'#2'-'#18'BorderSpacing.Left'#2#12
|
||||
+#7'Caption'#6#7'OutSize'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'
|
||||
+#5'USize'#4'Left'#2#12#6'Height'#2#13#3'Top'#2'H'#5'Width'#2'!'#9'Alignment'
|
||||
+#7#14'taRightJustify'#7'Caption'#6#5'USize'#5'Color'#7#6'clNone'#10'Font.Sty'
|
||||
+'le'#11#6'fsBold'#0#11'ParentColor'#8#0#0#6'TLabel'#10'UInProject'#4'Left'#2
|
||||
+#12#6'Height'#2#13#3'Top'#2'4'#5'Width'#2':'#9'Alignment'#7#14'taRightJustif'
|
||||
+'y'#7'Caption'#6#10'UInProject'#5'Color'#7#6'clNone'#10'Font.Style'#11#6'fsB'
|
||||
+'old'#0#11'ParentColor'#8#0#0#6'TLabel'#12'OutInProject'#22'AnchorSideLeft.C'
|
||||
+'ontrol'#7#10'UInProject'#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#2'R'
|
||||
+#6'Height'#2#13#3'Top'#2'4'#5'Width'#2'F'#18'BorderSpacing.Left'#2#12#7'Capt'
|
||||
+'ion'#6#12'OutInProject'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'
|
||||
+#7'OutType'#22'AnchorSideLeft.Control'#7#5'UType'#19'AnchorSideLeft.Side'#7#9
|
||||
+'asrBottom'#4'Left'#2'='#6'Height'#2#13#3'Top'#2' '#5'Width'#2'1'#18'BorderS'
|
||||
+'pacing.Left'#2#12#7'Caption'#6#7'OutType'#5'Color'#7#6'clNone'#11'ParentCol'
|
||||
+'or'#8#0#0#6'TLabel'#5'UType'#4'Left'#2#12#6'Height'#2#13#3'Top'#2' '#5'Widt'
|
||||
+'h'#2'%'#9'Alignment'#7#14'taRightJustify'#7'Caption'#6#5'UType'#5'Color'#7#6
|
||||
+'clNone'#10'Font.Style'#11#6'fsBold'#0#11'ParentColor'#8#0#0#6'TLabel'#7'Out'
|
||||
+'Name'#22'AnchorSideLeft.Control'#7#5'UName'#19'AnchorSideLeft.Side'#7#9'asr'
|
||||
+'Bottom'#4'Left'#2'A'#6'Height'#2#13#3'Top'#2#12#5'Width'#2'5'#18'BorderSpac'
|
||||
+'ing.Left'#2#12#7'Caption'#6#7'OutName'#5'Color'#7#6'clNone'#11'ParentColor'
|
||||
+#8#0#0#6'TLabel'#5'UName'#4'Left'#2#12#6'Height'#2#13#3'Top'#2#12#5'Width'#2
|
||||
+')'#9'Alignment'#7#14'taRightJustify'#7'Caption'#6#5'UName'#5'Color'#7#6'clN'
|
||||
+'one'#10'Font.Style'#11#6'fsBold'#0#11'ParentColor'#8#8'OnResize'#7#17'UnitI'
|
||||
+'nfoDlgResize'#0#0#7'TButton'#15'ClearIncludedBy'#21'AnchorSideTop.Control'#7
|
||||
+#11'UIncludedBy'#4'Left'#2#12#6'Height'#2#26#3'Top'#3#152#0#5'Width'#2'k'#8
|
||||
+'AutoSize'#9#17'BorderSpacing.Top'#2#20#25'BorderSpacing.InnerBorder'#2#4#7
|
||||
+'Caption'#6#15'ClearIncludedBy'#7'OnClick'#7#20'clearIncludedByClick'#8'TabO'
|
||||
+'rder'#2#0#0#0#0#5'TPage'#13'UnitPathsPage'#7'Caption'#6#13'UnitPathsPage'#0
|
||||
+#5'TMemo'#12'UnitPathMemo'#4'Left'#2#6#6'Height'#3#184#0#3'Top'#2#6#5'Width'
|
||||
+#3#216#1#5'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#8'ReadOnly'#9#10
|
||||
+'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#0#0#0#5'TPage'#16'IncludePaths'
|
||||
+'Page'#7'Caption'#6#16'IncludePathsPage'#0#5'TMemo'#15'IncludePathMemo'#4'Le'
|
||||
,'ft'#2#6#6'Height'#3#184#0#3'Top'#2#6#5'Width'#3#216#1#5'Align'#7#8'alClient'
|
||||
+#20'BorderSpacing.Around'#2#6#8'ReadOnly'#9#10'ScrollBars'#7#10'ssAutoBoth'#8
|
||||
+'TabOrder'#2#0#0#0#0#5'TPage'#21'CompleteUnitPathsPage'#7'Caption'#6#21'Comp'
|
||||
+'leteUnitPathsPage'#0#5'TMemo'#11'SrcPathMemo'#4'Left'#2#6#6'Height'#3#184#0
|
||||
+#3'Top'#2#6#5'Width'#3#216#1#5'Align'#7#8'alClient'#20'BorderSpacing.Around'
|
||||
+#2#6#8'ReadOnly'#9#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#0#0#0#0#7
|
||||
+'TButton'#19'CodeToolsDefsButton'#21'AnchorSideTop.Control'#7#8'OkButton'#24
|
||||
+'AnchorSideBottom.Control'#7#8'OkButton'#21'AnchorSideBottom.Side'#7#9'asrBo'
|
||||
+'ttom'#4'Left'#2#6#6'Height'#2#28#3'Top'#3#242#0#5'Width'#3#134#0#7'Anchors'
|
||||
+#11#5'akTop'#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBor'
|
||||
+'der'#2#4#7'Caption'#6#19'CodeToolsDefsButton'#7'OnClick'#7#24'CodeToolsDefs'
|
||||
+'ButtonClick'#8'TabOrder'#2#2#0#0#7'TButton'#26'GotoIncludeDirectiveButton'
|
||||
+#21'AnchorSideTop.Control'#7#8'OkButton'#23'AnchorSideRight.Control'#7#8'OkB'
|
||||
+'utton'#24'AnchorSideBottom.Control'#7#8'OkButton'#21'AnchorSideBottom.Side'
|
||||
+#7#9'asrBottom'#4'Left'#3#7#1#6'Height'#2#28#3'Top'#3#242#0#5'Width'#3#166#0
|
||||
+#7'Anchors'#11#5'akTop'#7'akRight'#8'akBottom'#0#8'AutoSize'#9#19'BorderSpac'
|
||||
+'ing.Right'#2#10#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#26'GotoInclu'
|
||||
+'deDirectiveButton'#11'ModalResult'#2#6#7'OnClick'#7#31'GotoIncludeDirective'
|
||||
+'ButtonClick'#8'TabOrder'#2#3#0#0#0
|
||||
]);
|
||||
|
||||
@ -35,6 +35,7 @@ type
|
||||
{ TUnitInfoDialog }
|
||||
|
||||
TUnitInfoDialog = class(TForm)
|
||||
GotoIncludeDirectiveButton: TButton;
|
||||
CodeToolsDefsButton: TButton;
|
||||
OkButton: TBitBtn;
|
||||
ClearIncludedBy: TButton;
|
||||
@ -49,10 +50,10 @@ type
|
||||
OutPath: TLabel;
|
||||
OutSize: TLabel;
|
||||
OutType: TLabel;
|
||||
Page1: TPage;
|
||||
Page2: TPage;
|
||||
Page3: TPage;
|
||||
Page4: TPage;
|
||||
GeneralPage: TPage;
|
||||
UnitPathsPage: TPage;
|
||||
IncludePathsPage: TPage;
|
||||
CompleteUnitPathsPage: TPage;
|
||||
PathsGroupBox: TGroupBox;
|
||||
UIncludedBy: TLabel;
|
||||
UInProject: TLabel;
|
||||
@ -62,13 +63,14 @@ type
|
||||
USize: TLabel;
|
||||
UType: TLabel;
|
||||
procedure CodeToolsDefsButtonClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure GotoIncludeDirectiveButtonClick(Sender: TObject);
|
||||
procedure OkButtonClick(Sender: TObject);
|
||||
procedure UnitInfoDlgResize(Sender: TObject);
|
||||
procedure clearIncludedByClick(Sender: TObject);
|
||||
private
|
||||
FFilePath: string;
|
||||
function getIncludedBy: string;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
end;
|
||||
|
||||
function ShowUnitInfoDlg(const AnUnitName, AType: string;
|
||||
@ -115,42 +117,17 @@ begin
|
||||
SrcPathMemo.Lines.Delimiter := ';';
|
||||
SrcPathMemo.Lines.DelimitedText := MinimizeSearchPath(SrcPath);
|
||||
|
||||
Width := Width + 1;
|
||||
GotoIncludeDirectiveButton.Visible:=IncludedBy<>'';
|
||||
end;
|
||||
|
||||
Result:=Dlg.ShowModal;
|
||||
ClearIncludedBy:=(Result=mrOk) and (IncludedBy<>'') and (Dlg.getIncludedBy='');
|
||||
ClearIncludedBy:=(Result in [mrOk,mrYes]) and (IncludedBy<>'')
|
||||
and (Dlg.getIncludedBy='');
|
||||
Dlg.Free;
|
||||
end;
|
||||
|
||||
{ TUnitInfoDialog }
|
||||
|
||||
constructor TUnitInfoDialog.Create(AOwner:TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
|
||||
//if LazarusResources.Find(ClassName)=nil then
|
||||
begin
|
||||
Notebook.Page[0].Caption := 'General';
|
||||
Notebook.Page[1].Caption := 'Unit paths';
|
||||
Notebook.Page[2].Caption := 'Include paths';
|
||||
Notebook.Page[3].Caption := 'Source paths';
|
||||
Notebook.PageIndex := 0;
|
||||
|
||||
UName.Caption:=lisUIDName;
|
||||
UType.Caption:=lisUIDType;
|
||||
UInProject.Caption:=lisUIDinProject;
|
||||
USize.Caption:=lisUIDSize;
|
||||
ULines.Caption:=lisUIDLines;
|
||||
UPath.Caption:='Path:';
|
||||
UIncludedBy.Caption:=lisUIDIncludedBy;
|
||||
ClearIncludedBy.Caption := lisUIDClear;
|
||||
CodeToolsDefsButton.Caption:=lisUIShowCodeToolsValues;
|
||||
end;
|
||||
|
||||
UnitInfoDlgResize(nil);
|
||||
end;
|
||||
|
||||
procedure TUnitInfoDialog.UnitInfoDlgResize(Sender: TObject);
|
||||
var MaxLength: integer;
|
||||
begin
|
||||
@ -188,6 +165,35 @@ begin
|
||||
ShowCodeToolsDefinesValuesDialog(CodeToolBoss.DefineTree, ExtractFilePath(FFilePath));
|
||||
end;
|
||||
|
||||
procedure TUnitInfoDialog.FormCreate(Sender: TObject);
|
||||
begin
|
||||
Notebook.Page[0].Caption := lisMenuInsertGeneral;
|
||||
Notebook.Page[1].Caption := lisUnitPaths;
|
||||
Notebook.Page[2].Caption := lisIncludePaths;
|
||||
Notebook.Page[3].Caption := lisSourcePaths;
|
||||
Notebook.PageIndex := 0;
|
||||
|
||||
UName.Caption:=lisUIDName;
|
||||
UType.Caption:=lisUIDType;
|
||||
UInProject.Caption:=lisUIDinProject;
|
||||
USize.Caption:=lisUIDSize;
|
||||
ULines.Caption:=lisUIDLines;
|
||||
UPath.Caption:=lisToFPCPath;
|
||||
UIncludedBy.Caption:=lisUIDIncludedBy;
|
||||
ClearIncludedBy.Caption := 'Clear included by reference';
|
||||
CodeToolsDefsButton.Caption:=lisUIShowCodeToolsValues;
|
||||
end;
|
||||
|
||||
procedure TUnitInfoDialog.GotoIncludeDirectiveButtonClick(Sender: TObject);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TUnitInfoDialog.OkButtonClick(Sender: TObject);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TUnitInfoDialog.clearIncludedByClick(Sender: TObject);
|
||||
begin
|
||||
OutIncludedBy.Caption:='';
|
||||
|
||||
@ -106,6 +106,10 @@ type
|
||||
WithRoot: boolean = true): TLazDockConfigNode;
|
||||
function IndexOf(const AName: string): Integer;
|
||||
function GetScreenBounds: TRect;
|
||||
function FindNeighbour(SiblingSide: TAnchorKind;
|
||||
NilIfAmbiguous: boolean): TLazDockConfigNode;
|
||||
function IsTheOnlyNeighbour(Node: TLazDockConfigNode;
|
||||
SiblingSide: TAnchorKind): boolean;
|
||||
procedure SaveToConfig(Config: TConfigStorage; const Path: string = '');
|
||||
procedure LoadFromConfig(Config: TConfigStorage; const Path: string = '');
|
||||
function GetPath: string;
|
||||
@ -119,7 +123,8 @@ type
|
||||
property ChildCount: Integer read GetChildCount;
|
||||
property Childs[Index: integer]: TLazDockConfigNode read GetChilds; default;
|
||||
published
|
||||
property TheType: TLDConfigNodeType read FTheType write SetTheType default ldcntControl;
|
||||
property TheType: TLDConfigNodeType read FTheType write SetTheType
|
||||
default ldcntControl;
|
||||
property Name: string read FName write SetName;
|
||||
end;
|
||||
|
||||
@ -217,6 +222,8 @@ type
|
||||
function GetLocalizedName: string;
|
||||
procedure ControlVisibleChanging(Sender: TObject);
|
||||
procedure ControlVisibleChanged(Sender: TObject);
|
||||
function CreateFormAndDockWithSplitter(Layout: TLazDockConfigNode;
|
||||
Side: TAnchorKind): boolean;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
procedure ShowDockingEditor; virtual;
|
||||
@ -433,6 +440,39 @@ begin
|
||||
DumpStack;
|
||||
end;
|
||||
|
||||
function TCustomLazControlDocker.CreateFormAndDockWithSplitter(
|
||||
Layout: TLazDockConfigNode; Side: TAnchorKind): boolean;
|
||||
{ Add a splitter to Side and dock to it. For example:
|
||||
----------------+ ----------------------+
|
||||
-----------+| ------------+#+------+|
|
||||
Neighbour || -> Neighbour |#| Self ||
|
||||
-----------+| ------------+#+------+|
|
||||
----------------+ ----------------------+
|
||||
If B has no parent, a TLazDockForm is created.
|
||||
|
||||
To get space for A, either B is shrinked and/or the parent of B is enlarged
|
||||
(including the grand parents of B).
|
||||
}
|
||||
var
|
||||
SelfNode: TLazDockConfigNode;
|
||||
SplitterNode: TLazDockConfigNode;
|
||||
NeighbourNode: TLazDockConfigNode;
|
||||
NeighbourControl: TControl;
|
||||
begin
|
||||
Result:=false;
|
||||
SelfNode:=Layout.FindByName(DockerName,true);
|
||||
SplitterNode:=Layout.FindByName(SelfNode.Sides[Side]);
|
||||
NeighbourNode:=Layout.FindByName(SplitterNode.Sides[Side]);
|
||||
NeighbourControl:=Manager.FindControlByDockerName(NeighbourNode.Name);
|
||||
if NeighbourControl.Parent=nil then begin
|
||||
|
||||
end else begin
|
||||
|
||||
end;
|
||||
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function TCustomLazControlDocker.GetControlName(AControl: TControl): string;
|
||||
var
|
||||
i: Integer;
|
||||
@ -782,44 +822,16 @@ var
|
||||
Result:=Layout.FindByName(ANodeName,true,true);
|
||||
end;
|
||||
|
||||
function FindNodeUsingSplitter(Splitter: TLazDockConfigNode;
|
||||
SiblingSide: TAnchorKind; NilIfAmbiguous: boolean): TLazDockConfigNode;
|
||||
var
|
||||
i: Integer;
|
||||
ParentNode: TLazDockConfigNode;
|
||||
Child: TLazDockConfigNode;
|
||||
function FindControl(const ADockerName: string): TControl;
|
||||
begin
|
||||
Result:=nil;
|
||||
ParentNode:=Splitter.Parent;
|
||||
for i:=0 to ParentNode.ChildCount-1 do begin
|
||||
Child:=ParentNode.Childs[i];
|
||||
if CompareText(Child.Sides[SiblingSide],Splitter.Name)=0 then begin
|
||||
if Result=nil then
|
||||
Result:=Child
|
||||
else if NilIfAmbiguous then
|
||||
exit(nil);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function SplitterIsOnlyUsedByNodeAtSide(Splitter, Node: TLazDockConfigNode;
|
||||
SiblingSide: TAnchorKind): boolean;
|
||||
{ check if one side of the Splitter is only used by Node.
|
||||
For example: If only Node.Sides[SiblingSide]=Splitter.Name
|
||||
---------+
|
||||
--+#+---+|
|
||||
B |#| A ||
|
||||
--+#+---+|
|
||||
---------+}
|
||||
begin
|
||||
Result:=FindNodeUsingSplitter(Splitter,SiblingSide,true)<>nil;
|
||||
Result:=Manager.FindControlByDockerName(ADockerName);
|
||||
end;
|
||||
|
||||
function DockWithOwnSplitter(Side: TAnchorKind): boolean;
|
||||
{ Add a splitter to Side and dock to it. For example:
|
||||
--------+ -----------+
|
||||
---+| ----+#+---+|
|
||||
B | -> B |#| A ||
|
||||
B || -> B |#| A ||
|
||||
---+| ----+#+---+|
|
||||
--------+ -----------+
|
||||
If B has no parent, a TLazDockForm is created.
|
||||
@ -830,11 +842,21 @@ var
|
||||
var
|
||||
SplitterNode: TLazDockConfigNode;
|
||||
NeighbourNode: TLazDockConfigNode;
|
||||
NeighbourControl: TControl;
|
||||
begin
|
||||
// TODO
|
||||
SplitterNode:=FindNode(SelfNode.Sides[Side]);
|
||||
NeighbourNode:=FindNodeUsingSplitter(SplitterNode,OppositeAnchor[Side],true);
|
||||
if NeighbourNode=nil then ;
|
||||
NeighbourNode:=SplitterNode.FindNeighbour(OppositeAnchor[Side],true);
|
||||
NeighbourControl:=FindControl(NeighbourNode.Name);
|
||||
if NeighbourControl=nil then RaiseGDBException('inconsistency');
|
||||
if NeighbourNode.Parent=nil then begin
|
||||
// Neighbour is a standalone control
|
||||
// => combine Neighbour and Self onto a dummy form
|
||||
Result:=CreateFormAndDockWithSplitter(Layout,Side);
|
||||
exit;
|
||||
end else begin
|
||||
|
||||
end;
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
@ -856,7 +878,7 @@ var
|
||||
if (SideNode<>nil)
|
||||
and (SideNode.TheType in [ldcntSplitterLeftRight,ldcntSplitterUpDown])
|
||||
then begin
|
||||
if SplitterIsOnlyUsedByNodeAtSide(SideNode,SelfNode,a)
|
||||
if SideNode.IsTheOnlyNeighbour(SelfNode,a)
|
||||
and DockWithOwnSplitter(a) then
|
||||
exit(true);
|
||||
inc(SplitterCount);
|
||||
@ -1219,39 +1241,6 @@ var
|
||||
Result:=Root.FindByName(AName,true,true);
|
||||
end;
|
||||
|
||||
function FindNodeUsingSplitter(Splitter: TLazDockConfigNode;
|
||||
SiblingSide: TAnchorKind; NilIfAmbiguous: boolean): TLazDockConfigNode;
|
||||
var
|
||||
i: Integer;
|
||||
ParentNode: TLazDockConfigNode;
|
||||
Child: TLazDockConfigNode;
|
||||
begin
|
||||
Result:=nil;
|
||||
ParentNode:=Splitter.Parent;
|
||||
for i:=0 to ParentNode.ChildCount-1 do begin
|
||||
Child:=ParentNode.Childs[i];
|
||||
if CompareText(Child.Sides[SiblingSide],Splitter.Name)=0 then begin
|
||||
if Result=nil then
|
||||
Result:=Child
|
||||
else if NilIfAmbiguous then
|
||||
exit(nil);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function SplitterIsOnlyUsedByNodeAtSide(Splitter, Node: TLazDockConfigNode;
|
||||
SiblingSide: TAnchorKind): boolean;
|
||||
{ check if one side of the Splitter is only used by Node.
|
||||
For example: If only Node.Sides[SiblingSide]=Splitter.Name
|
||||
---------+
|
||||
--+#+---+|
|
||||
B |#| A ||
|
||||
--+#+---+|
|
||||
---------+}
|
||||
begin
|
||||
Result:=FindNodeUsingSplitter(Splitter,SiblingSide,true)<>nil;
|
||||
end;
|
||||
|
||||
procedure DeleteNode(var DeletingNode: TLazDockConfigNode);
|
||||
|
||||
function DeleteOwnSideSplitter(Side: TAnchorKind;
|
||||
@ -1274,7 +1263,7 @@ var
|
||||
begin
|
||||
Result:=false;
|
||||
// check if this is the only node using this Side of the splitter
|
||||
if not SplitterIsOnlyUsedByNodeAtSide(SplitterNode,DeletingNode,Side) then
|
||||
if not SplitterNode.IsTheOnlyNeighbour(DeletingNode,Side) then
|
||||
exit;
|
||||
|
||||
// All nodes, that uses the splitter from the other side will now be
|
||||
@ -1562,9 +1551,8 @@ var
|
||||
if Node.Sides[a]='' then continue;
|
||||
SplitterNode:=FindNode(Node.Sides[a]);
|
||||
if (SplitterNode.TheType in [ldcntSplitterLeftRight,ldcntSplitterUpDown])
|
||||
and SplitterIsOnlyUsedByNodeAtSide(SplitterNode,Node,a) then
|
||||
begin
|
||||
Result:=FindNodeUsingSplitter(SplitterNode,OppositeAnchor[a],true);
|
||||
and SplitterNode.IsTheOnlyNeighbour(Node,a) then begin
|
||||
Result:=SplitterNode.FindNeighbour(OppositeAnchor[a],true);
|
||||
if Result<>nil then exit;
|
||||
end;
|
||||
end;
|
||||
@ -2109,6 +2097,40 @@ begin
|
||||
Result:=Classes.Bounds(NewLeft,NewTop,NewWidth,NewHeight);
|
||||
end;
|
||||
|
||||
function TLazDockConfigNode.FindNeighbour(SiblingSide: TAnchorKind;
|
||||
NilIfAmbiguous: boolean): TLazDockConfigNode;
|
||||
var
|
||||
i: Integer;
|
||||
ParentNode: TLazDockConfigNode;
|
||||
Child: TLazDockConfigNode;
|
||||
begin
|
||||
Result:=nil;
|
||||
ParentNode:=Parent;
|
||||
for i:=0 to ParentNode.ChildCount-1 do begin
|
||||
Child:=ParentNode.Childs[i];
|
||||
if Child=Self then continue;
|
||||
if CompareText(Child.Sides[SiblingSide],Name)=0 then begin
|
||||
if Result=nil then
|
||||
Result:=Child
|
||||
else if NilIfAmbiguous then
|
||||
exit(nil);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TLazDockConfigNode.IsTheOnlyNeighbour(Node: TLazDockConfigNode;
|
||||
SiblingSide: TAnchorKind): boolean;
|
||||
{ check if one side is only used by Node.
|
||||
For example: If only Node.Sides[SiblingSide]=Name
|
||||
---------+
|
||||
--+#+---+|
|
||||
B |#| A ||
|
||||
--+#+---+|
|
||||
---------+}
|
||||
begin
|
||||
Result:=FindNeighbour(SiblingSide,true)<>nil;
|
||||
end;
|
||||
|
||||
procedure TLazDockConfigNode.SaveToConfig(Config: TConfigStorage;
|
||||
const Path: string);
|
||||
var
|
||||
|
||||
Loading…
Reference in New Issue
Block a user