From 47ab093dfb7513be93b0540eb94ed75e7a8f7773 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 3 Aug 2009 09:42:00 +0000 Subject: [PATCH] IDE: fpdoc editor: see also git-svn-id: trunk@21084 - --- ide/fpdoceditwindow.lfm | 125 +++++------------- ide/fpdoceditwindow.lrs | 97 ++++++-------- ide/fpdoceditwindow.pas | 273 ++++++++-------------------------------- 3 files changed, 128 insertions(+), 367 deletions(-) diff --git a/ide/fpdoceditwindow.lfm b/ide/fpdoceditwindow.lfm index 2888a92d41..b54f10b955 100644 --- a/ide/fpdoceditwindow.lfm +++ b/ide/fpdoceditwindow.lfm @@ -1,7 +1,7 @@ object FPDocEditor: TFPDocEditor - Left = 303 + Left = 313 Height = 126 - Top = 548 + Top = 596 Width = 753 ActiveControl = LeftBtnPanel Caption = 'FPDoc editor' @@ -16,17 +16,17 @@ object FPDocEditor: TFPDocEditor Height = 126 Top = 0 Width = 713 - ActivePage = ShortTabSheet + ActivePage = SeeAlsoTabSheet Align = alClient - TabIndex = 0 + TabIndex = 4 TabOrder = 0 TabPosition = tpBottom OnChange = PageControlChange OnPageChanged = PageControlChange object ShortTabSheet: TTabSheet Caption = 'ShortTabSheet' - ClientHeight = 99 - ClientWidth = 711 + ClientHeight = 95 + ClientWidth = 709 object LinkLabel: TLabel AnchorSideTop.Control = LinkEdit AnchorSideTop.Side = asrCenter @@ -58,7 +58,7 @@ object FPDocEditor: TFPDocEditor Left = 82 Height = 27 Top = 0 - Width = 627 + Width = 625 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 6 BorderSpacing.Right = 2 @@ -104,7 +104,7 @@ object FPDocEditor: TFPDocEditor Left = 72 Height = 27 Top = 29 - Width = 637 + Width = 635 Anchors = [akTop, akLeft, akRight] BorderSpacing.Left = 6 BorderSpacing.Top = 2 @@ -117,13 +117,13 @@ object FPDocEditor: TFPDocEditor end object InheritedTabSheet: TTabSheet Caption = 'InheritedTabSheet' - ClientHeight = 99 - ClientWidth = 711 + ClientHeight = 95 + ClientWidth = 709 object InheritedShortLabel: TLabel Left = 0 Height = 14 Top = 2 - Width = 711 + Width = 709 Align = alTop BorderSpacing.Top = 2 Caption = 'InheritedShortLabel' @@ -138,7 +138,7 @@ object FPDocEditor: TFPDocEditor Left = 0 Height = 27 Top = 18 - Width = 711 + Width = 709 Anchors = [akTop, akLeft, akRight] BorderSpacing.Top = 2 ReadOnly = True @@ -190,13 +190,13 @@ object FPDocEditor: TFPDocEditor end object DescrTabSheet: TTabSheet Caption = 'DescrTabSheet' - ClientHeight = 99 - ClientWidth = 711 + ClientHeight = 95 + ClientWidth = 709 object DescrMemo: TMemo Left = 0 - Height = 95 + Height = 91 Top = 0 - Width = 709 + Width = 707 Align = alClient BorderSpacing.Right = 2 BorderSpacing.Bottom = 4 @@ -209,13 +209,13 @@ object FPDocEditor: TFPDocEditor end object ErrorsTabSheet: TTabSheet Caption = 'ErrorsTabSheet' - ClientHeight = 99 - ClientWidth = 711 + ClientHeight = 95 + ClientWidth = 709 object ErrorsMemo: TMemo Left = 0 - Height = 95 + Height = 91 Top = 0 - Width = 709 + Width = 707 Align = alClient BorderSpacing.Right = 2 BorderSpacing.Bottom = 4 @@ -228,87 +228,30 @@ object FPDocEditor: TFPDocEditor end object SeeAlsoTabSheet: TTabSheet Caption = 'SeeAlsoTabSheet' - ClientHeight = 99 - ClientWidth = 711 - object LinkListBox: TListBox - AnchorSideTop.Control = AddLinkButton - AnchorSideTop.Side = asrBottom + ClientHeight = 95 + ClientWidth = 709 + object SeeAlsoMemo: TMemo Left = 0 - Height = 68 - Top = 27 + Height = 95 + Top = 0 Width = 709 - Align = alBottom - Anchors = [akTop, akLeft, akRight, akBottom] - BorderSpacing.Top = 4 - BorderSpacing.Right = 2 - BorderSpacing.Bottom = 4 - ItemHeight = 0 - OnClick = LinkListBoxClick + Align = alClient + Lines.Strings = ( + 'SeeAlsoMemo' + ) + OnEditingDone = SeeAlsoMemoEditingDone TabOrder = 0 - TopIndex = -1 - end - object AddLinkButton: TButton - AnchorSideRight.Control = DeleteLinkButton - Left = 501 - Height = 23 - Top = 0 - Width = 95 - Anchors = [akTop, akRight] - AutoSize = True - BorderSpacing.Right = 6 - Caption = 'AddLinkButton' - OnClick = AddLinkButtonClick - TabOrder = 1 - end - object DeleteLinkButton: TButton - AnchorSideRight.Control = SeeAlsoTabSheet - AnchorSideRight.Side = asrBottom - Left = 602 - Height = 23 - Top = 0 - Width = 107 - Anchors = [akTop, akRight] - AutoSize = True - BorderSpacing.Right = 2 - Caption = 'DeleteLinkButton' - OnClick = DeleteLinkButtonClick - TabOrder = 2 - end - object LinkTextEdit: TEdit - AnchorSideLeft.Control = LinkIdComboBox - AnchorSideLeft.Side = asrBottom - AnchorSideRight.Control = AddLinkButton - Left = 229 - Height = 27 - Top = 1 - Width = 268 - Anchors = [akTop, akLeft, akRight] - BorderSpacing.Left = 4 - BorderSpacing.Right = 4 - OnChange = LinkChange - TabOrder = 3 - Text = 'LinkTextEdit' - end - object LinkIdComboBox: TComboBox - Left = 0 - Height = 21 - Top = 1 - Width = 225 - ItemHeight = 0 - OnChange = LinkChange - TabOrder = 4 - Text = 'LinkIdComboBox' end end object ExampleTabSheet: TTabSheet Caption = 'ExampleTabSheet' - ClientHeight = 99 - ClientWidth = 711 + ClientHeight = 95 + ClientWidth = 709 object ExampleEdit: TEdit Left = 0 Height = 27 Top = 0 - Width = 709 + Width = 707 Align = alTop BorderSpacing.Right = 2 OnChange = ExampleEditChange @@ -320,7 +263,7 @@ object FPDocEditor: TFPDocEditor AnchorSideTop.Side = asrBottom AnchorSideRight.Control = ExampleTabSheet AnchorSideRight.Side = asrBottom - Left = 572 + Left = 570 Height = 23 Top = 33 Width = 133 diff --git a/ide/fpdoceditwindow.lrs b/ide/fpdoceditwindow.lrs index ee0b4b0fbc..4aed28fc82 100644 --- a/ide/fpdoceditwindow.lrs +++ b/ide/fpdoceditwindow.lrs @@ -1,16 +1,16 @@ { This is an automatically generated lazarus resource file } LazarusResources.Add('TFPDocEditor','FORMDATA',[ - 'TPF0'#12'TFPDocEditor'#11'FPDocEditor'#4'Left'#3'/'#1#6'Height'#2'~'#3'Top'#3 - +'$'#2#5'Width'#3#241#2#13'ActiveControl'#7#12'LeftBtnPanel'#7'Caption'#6#12 + 'TPF0'#12'TFPDocEditor'#11'FPDocEditor'#4'Left'#3'9'#1#6'Height'#2'~'#3'Top'#3 + +'T'#2#5'Width'#3#241#2#13'ActiveControl'#7#12'LeftBtnPanel'#7'Caption'#6#12 +'FPDoc editor'#12'ClientHeight'#2'~'#11'ClientWidth'#3#241#2#8'OnCreate'#7#10 +'FormCreate'#9'OnDestroy'#7#11'FormDestroy'#8'OnResize'#7#10'FormResize'#10 +'LCLVersion'#6#6'0.9.27'#0#12'TPageControl'#11'PageControl'#4'Left'#2'('#6'H' - +'eight'#2'~'#3'Top'#2#0#5'Width'#3#201#2#10'ActivePage'#7#13'ShortTabSheet'#5 - +'Align'#7#8'alClient'#8'TabIndex'#2#0#8'TabOrder'#2#0#11'TabPosition'#7#8'tp' - +'Bottom'#8'OnChange'#7#17'PageControlChange'#13'OnPageChanged'#7#17'PageCont' - +'rolChange'#0#9'TTabSheet'#13'ShortTabSheet'#7'Caption'#6#13'ShortTabSheet' - +#12'ClientHeight'#2'c'#11'ClientWidth'#3#199#2#0#6'TLabel'#9'LinkLabel'#21'A' + +'eight'#2'~'#3'Top'#2#0#5'Width'#3#201#2#10'ActivePage'#7#15'SeeAlsoTabSheet' + +#5'Align'#7#8'alClient'#8'TabIndex'#2#4#8'TabOrder'#2#0#11'TabPosition'#7#8 + +'tpBottom'#8'OnChange'#7#17'PageControlChange'#13'OnPageChanged'#7#17'PageCo' + +'ntrolChange'#0#9'TTabSheet'#13'ShortTabSheet'#7'Caption'#6#13'ShortTabSheet' + +#12'ClientHeight'#2'_'#11'ClientWidth'#3#197#2#0#6'TLabel'#9'LinkLabel'#21'A' +'nchorSideTop.Control'#7#8'LinkEdit'#18'AnchorSideTop.Side'#7#9'asrCenter'#4 +'Left'#2#6#6'Height'#2#18#3'Top'#2'!'#5'Width'#2'<'#17'BorderSpacing.Top'#2#6 +#7'Caption'#6#9'LinkLabel'#11'ParentColor'#8#0#0#6'TLabel'#10'ShortLabel'#22 @@ -20,7 +20,7 @@ LazarusResources.Add('TFPDocEditor','FORMDATA',[ +'l'#11'ParentColor'#8#0#0#5'TEdit'#9'ShortEdit'#22'AnchorSideLeft.Control'#7 +#10'ShortLabel'#19'AnchorSideLeft.Side'#7#9'asrBottom'#23'AnchorSideRight.Co' +'ntrol'#7#13'ShortTabSheet'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2 - +'R'#6'Height'#2#27#3'Top'#2#0#5'Width'#3's'#2#7'Anchors'#11#5'akTop'#6'akLef' + +'R'#6'Height'#2#27#3'Top'#2#0#5'Width'#3'q'#2#7'Anchors'#11#5'akTop'#6'akLef' +'t'#7'akRight'#0#18'BorderSpacing.Left'#2#6#19'BorderSpacing.Right'#2#2#8'On' +'Change'#7#20'ShortEditEditingDone'#13'OnEditingDone'#7#20'ShortEditEditingD' +'one'#8'TabOrder'#2#0#4'Text'#6#9'ShortEdit'#0#0#7'TButton'#12'CreateButton' @@ -36,18 +36,18 @@ LazarusResources.Add('TFPDocEditor','FORMDATA',[ +#7#9'asrBottom'#21'AnchorSideTop.Control'#7#9'ShortEdit'#18'AnchorSideTop.Si' +'de'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#13'ShortTabSheet'#20'Ancho' +'rSideRight.Side'#7#9'asrBottom'#4'Left'#2'H'#6'Height'#2#27#3'Top'#2#29#5'W' - +'idth'#3'}'#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#18'BorderSpacing' + +'idth'#3'{'#2#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#18'BorderSpacing' +'.Left'#2#6#17'BorderSpacing.Top'#2#2#19'BorderSpacing.Right'#2#2#8'OnChange' +#7#19'LinkEditEditingDone'#13'OnEditingDone'#7#19'LinkEditEditingDone'#8'Tab' +'Order'#2#3#4'Text'#6#8'LinkEdit'#0#0#0#9'TTabSheet'#17'InheritedTabSheet'#7 - +'Caption'#6#17'InheritedTabSheet'#12'ClientHeight'#2'c'#11'ClientWidth'#3#199 + +'Caption'#6#17'InheritedTabSheet'#12'ClientHeight'#2'_'#11'ClientWidth'#3#197 +#2#0#6'TLabel'#19'InheritedShortLabel'#4'Left'#2#0#6'Height'#2#14#3'Top'#2#2 - +#5'Width'#3#199#2#5'Align'#7#5'alTop'#17'BorderSpacing.Top'#2#2#7'Caption'#6 + +#5'Width'#3#197#2#5'Align'#7#5'alTop'#17'BorderSpacing.Top'#2#2#7'Caption'#6 +#19'InheritedShortLabel'#11'ParentColor'#8#0#0#5'TEdit'#18'InheritedShortEdi' +'t'#22'AnchorSideLeft.Control'#7#17'InheritedTabSheet'#21'AnchorSideTop.Cont' +'rol'#7#19'InheritedShortLabel'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'Anc' +'horSideRight.Control'#7#17'InheritedTabSheet'#20'AnchorSideRight.Side'#7#9 - +'asrBottom'#4'Left'#2#0#6'Height'#2#27#3'Top'#2#18#5'Width'#3#199#2#7'Anchor' + +'asrBottom'#4'Left'#2#0#6'Height'#2#27#3'Top'#2#18#5'Width'#3#197#2#7'Anchor' +'s'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2#2#8'ReadOnly' +#9#8'TabOrder'#2#0#4'Text'#6#18'InheritedShortEdit'#0#0#7'TButton'#21'MoveTo' +'InheritedButton'#21'AnchorSideTop.Control'#7#18'InheritedShortEdit'#18'Anch' @@ -66,56 +66,37 @@ LazarusResources.Add('TFPDocEditor','FORMDATA',[ +'th'#3#151#0#8'AutoSize'#9#18'BorderSpacing.Left'#2#10#7'Caption'#6#24'AddLi' +'nkToInheritedButton'#7'OnClick'#7#29'AddLinkToInheritedButtonClick'#8'TabOr' ,'der'#2#3#0#0#0#9'TTabSheet'#13'DescrTabSheet'#7'Caption'#6#13'DescrTabSheet' - +#12'ClientHeight'#2'c'#11'ClientWidth'#3#199#2#0#5'TMemo'#9'DescrMemo'#4'Lef' - +'t'#2#0#6'Height'#2'_'#3'Top'#2#0#5'Width'#3#197#2#5'Align'#7#8'alClient'#19 + +#12'ClientHeight'#2'_'#11'ClientWidth'#3#197#2#0#5'TMemo'#9'DescrMemo'#4'Lef' + +'t'#2#0#6'Height'#2'['#3'Top'#2#0#5'Width'#3#195#2#5'Align'#7#8'alClient'#19 +'BorderSpacing.Right'#2#2#20'BorderSpacing.Bottom'#2#4#13'Lines.Strings'#1#6 +#9'DescrMemo'#0#8'OnChange'#7#15'DescrMemoChange'#8'TabOrder'#2#0#0#0#0#9'TT' +'abSheet'#14'ErrorsTabSheet'#7'Caption'#6#14'ErrorsTabSheet'#12'ClientHeight' - +#2'c'#11'ClientWidth'#3#199#2#0#5'TMemo'#10'ErrorsMemo'#4'Left'#2#0#6'Height' - +#2'_'#3'Top'#2#0#5'Width'#3#197#2#5'Align'#7#8'alClient'#19'BorderSpacing.Ri' + +#2'_'#11'ClientWidth'#3#197#2#0#5'TMemo'#10'ErrorsMemo'#4'Left'#2#0#6'Height' + +#2'['#3'Top'#2#0#5'Width'#3#195#2#5'Align'#7#8'alClient'#19'BorderSpacing.Ri' +'ght'#2#2#20'BorderSpacing.Bottom'#2#4#13'Lines.Strings'#1#6#10'ErrorsMemo'#0 +#8'OnChange'#7#16'ErrorsMemoChange'#8'TabOrder'#2#0#0#0#0#9'TTabSheet'#15'Se' - +'eAlsoTabSheet'#7'Caption'#6#15'SeeAlsoTabSheet'#12'ClientHeight'#2'c'#11'Cl' - +'ientWidth'#3#199#2#0#8'TListBox'#11'LinkListBox'#21'AnchorSideTop.Control'#7 - +#13'AddLinkButton'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#0#6'Heigh' - +'t'#2'D'#3'Top'#2#27#5'Width'#3#197#2#5'Align'#7#8'alBottom'#7'Anchors'#11#5 - +'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#17'BorderSpacing.Top'#2#4#19'Bord' - +'erSpacing.Right'#2#2#20'BorderSpacing.Bottom'#2#4#10'ItemHeight'#2#0#7'OnCl' - +'ick'#7#16'LinkListBoxClick'#8'TabOrder'#2#0#8'TopIndex'#2#255#0#0#7'TButton' - +#13'AddLinkButton'#23'AnchorSideRight.Control'#7#16'DeleteLinkButton'#4'Left' - +#3#245#1#6'Height'#2#23#3'Top'#2#0#5'Width'#2'_'#7'Anchors'#11#5'akTop'#7'ak' - +'Right'#0#8'AutoSize'#9#19'BorderSpacing.Right'#2#6#7'Caption'#6#13'AddLinkB' - +'utton'#7'OnClick'#7#18'AddLinkButtonClick'#8'TabOrder'#2#1#0#0#7'TButton'#16 - +'DeleteLinkButton'#23'AnchorSideRight.Control'#7#15'SeeAlsoTabSheet'#20'Anch' - +'orSideRight.Side'#7#9'asrBottom'#4'Left'#3'Z'#2#6'Height'#2#23#3'Top'#2#0#5 - +'Width'#2'k'#7'Anchors'#11#5'akTop'#7'akRight'#0#8'AutoSize'#9#19'BorderSpac' - +'ing.Right'#2#2#7'Caption'#6#16'DeleteLinkButton'#7'OnClick'#7#21'DeleteLink' - +'ButtonClick'#8'TabOrder'#2#2#0#0#5'TEdit'#12'LinkTextEdit'#22'AnchorSideLef' - +'t.Control'#7#14'LinkIdComboBox'#19'AnchorSideLeft.Side'#7#9'asrBottom'#23'A' - +'nchorSideRight.Control'#7#13'AddLinkButton'#4'Left'#3#229#0#6'Height'#2#27#3 - +'Top'#2#1#5'Width'#3#12#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#18'B' - +'orderSpacing.Left'#2#4#19'BorderSpacing.Right'#2#4#8'OnChange'#7#10'LinkCha' - +'nge'#8'TabOrder'#2#3#4'Text'#6#12'LinkTextEdit'#0#0#9'TComboBox'#14'LinkIdC' - +'omboBox'#4'Left'#2#0#6'Height'#2#21#3'Top'#2#1#5'Width'#3#225#0#10'ItemHeig' - +'ht'#2#0#8'OnChange'#7#10'LinkChange'#8'TabOrder'#2#4#4'Text'#6#14'LinkIdCom' - +'boBox'#0#0#0#9'TTabSheet'#15'ExampleTabSheet'#7'Caption'#6#15'ExampleTabShe' - +'et'#12'ClientHeight'#2'c'#11'ClientWidth'#3#199#2#0#5'TEdit'#11'ExampleEdit' - +#4'Left'#2#0#6'Height'#2#27#3'Top'#2#0#5'Width'#3#197#2#5'Align'#7#5'alTop' - +#19'BorderSpacing.Right'#2#2#8'OnChange'#7#17'ExampleEditChange'#8'TabOrder' - +#2#0#4'Text'#6#11'ExampleEdit'#0#0#7'TButton'#19'BrowseExampleButton'#21'Anc' - +'horSideTop.Control'#7#11'ExampleEdit'#18'AnchorSideTop.Side'#7#9'asrBottom' - +#23'AnchorSideRight.Control'#7#15'ExampleTabSheet'#20'AnchorSideRight.Side'#7 - +#9'asrBottom'#4'Left'#3'<'#2#6'Height'#2#23#3'Top'#2'!'#5'Width'#3#133#0#7'A' - +'nchors'#11#5'akTop'#7'akRight'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6 - +#7'Caption'#6#19'BrowseExampleButton'#7'OnClick'#7#24'BrowseExampleButtonCli' - +'ck'#8'TabOrder'#2#1#0#0#0#0#6'TPanel'#12'LeftBtnPanel'#4'Left'#2#0#6'Height' - +#2'~'#3'Top'#2#0#5'Width'#2#20#5'Align'#7#6'alLeft'#10'BevelOuter'#7#6'bvNon' - +'e'#12'ClientHeight'#2'~'#11'ClientWidth'#2#20#11'FullRepaint'#8#14'ParentSh' - +'owHint'#8#8'ShowHint'#9#8'TabOrder'#2#1#0#12'TSpeedButton'#16'BoldFormatBut' - +'ton'#4'Left'#2#0#6'Height'#2#23#3'Top'#2#0#5'Width'#2#20#5'Align'#7#5'alTop' - +#5'Color'#7#9'clBtnFace'#9'NumGlyphs'#2#0#7'OnClick'#7#17'FormatButtonClick' - +#0#0#12'TSpeedButton'#18'ItalicFormatButton'#3'Tag'#2#1#4'Left'#2#0#6'Height' - +#2#23#3'Top'#2'.'#5'Width'#2#20#5'Align'#7#5'alTop'#5'Color'#7#9'clBtnFace'#9 + +'eAlsoTabSheet'#7'Caption'#6#15'SeeAlsoTabSheet'#12'ClientHeight'#2'_'#11'Cl' + +'ientWidth'#3#197#2#0#5'TMemo'#11'SeeAlsoMemo'#4'Left'#2#0#6'Height'#2'_'#3 + +'Top'#2#0#5'Width'#3#197#2#5'Align'#7#8'alClient'#13'Lines.Strings'#1#6#11'S' + +'eeAlsoMemo'#0#13'OnEditingDone'#7#22'SeeAlsoMemoEditingDone'#8'TabOrder'#2#0 + +#0#0#0#9'TTabSheet'#15'ExampleTabSheet'#7'Caption'#6#15'ExampleTabSheet'#12 + +'ClientHeight'#2'_'#11'ClientWidth'#3#197#2#0#5'TEdit'#11'ExampleEdit'#4'Lef' + +'t'#2#0#6'Height'#2#27#3'Top'#2#0#5'Width'#3#195#2#5'Align'#7#5'alTop'#19'Bo' + +'rderSpacing.Right'#2#2#8'OnChange'#7#17'ExampleEditChange'#8'TabOrder'#2#0#4 + +'Text'#6#11'ExampleEdit'#0#0#7'TButton'#19'BrowseExampleButton'#21'AnchorSid' + +'eTop.Control'#7#11'ExampleEdit'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'An' + +'chorSideRight.Control'#7#15'ExampleTabSheet'#20'AnchorSideRight.Side'#7#9'a' + +'srBottom'#4'Left'#3':'#2#6'Height'#2#23#3'Top'#2'!'#5'Width'#3#133#0#7'Anch' + +'ors'#11#5'akTop'#7'akRight'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7 + +'Caption'#6#19'BrowseExampleButton'#7'OnClick'#7#24'BrowseExampleButtonClick' + +#8'TabOrder'#2#1#0#0#0#0#6'TPanel'#12'LeftBtnPanel'#4'Left'#2#0#6'Height'#2 + +'~'#3'Top'#2#0#5'Width'#2#20#5'Align'#7#6'alLeft'#10'BevelOuter'#7#6'bvNone' + +#12'ClientHeight'#2'~'#11'ClientWidth'#2#20#11'FullRepaint'#8#14'ParentShowH' + +'int'#8#8'ShowHint'#9#8'TabOrder'#2#1#0#12'TSpeedButton'#16'BoldFormatButton' + +#4'Left'#2#0#6'Height'#2#23#3'Top'#2#0#5'Width'#2#20#5'Align'#7#5'alTop'#5'C' + +'olor'#7#9'clBtnFace'#9'NumGlyphs'#2#0#7'OnClick'#7#17'FormatButtonClick'#0#0 + +#12'TSpeedButton'#18'ItalicFormatButton'#3'Tag'#2#1#4'Left'#2#0#6'Height'#2 + +#23#3'Top'#2'.'#5'Width'#2#20#5'Align'#7#5'alTop'#5'Color'#7#9'clBtnFace'#9 +'NumGlyphs'#2#0#7'OnClick'#7#17'FormatButtonClick'#0#0#12'TSpeedButton'#21'U' +'nderlineFormatButton'#3'Tag'#2#2#4'Left'#2#0#6'Height'#2#23#3'Top'#2#23#5'W' +'idth'#2#20#5'Align'#7#5'alTop'#5'Color'#7#9'clBtnFace'#9'NumGlyphs'#2#0#7'O' @@ -129,7 +110,7 @@ LazarusResources.Add('TFPDocEditor','FORMDATA',[ +'Top'#2#0#5'Width'#2#20#5'Align'#7#6'alLeft'#10'BevelOuter'#7#6'bvNone'#12'C' +'lientHeight'#2'~'#11'ClientWidth'#2#20#8'TabOrder'#2#2#0#12'TSpeedButton'#21 +'InsertLinkSpeedButton'#4'Left'#2#0#6'Height'#2#23#3'Top'#2#0#5'Width'#2#20#5 - ,'Align'#7#5'alTop'#7'Caption'#6#2'Li'#5'Color'#7#9'clBtnFace'#7'Enabled'#8#9 + +'Align'#7#5'alTop'#7'Caption'#6#2'Li'#5'Color'#7#9'clBtnFace'#7'Enabled'#8#9 +'NumGlyphs'#2#0#7'OnClick'#7#26'InsertLinkSpeedButtonClick'#8'ShowHint'#9#14 +'ParentShowHint'#8#0#0#12'TSpeedButton'#19'InsertCodeTagButton'#3'Tag'#2#3#4 +'Left'#2#0#6'Height'#2#23#3'Top'#2#23#5'Width'#2#20#5'Align'#7#5'alTop'#5'Co' diff --git a/ide/fpdoceditwindow.pas b/ide/fpdoceditwindow.pas index 53da7e336e..560075bcd0 100644 --- a/ide/fpdoceditwindow.pas +++ b/ide/fpdoceditwindow.pas @@ -38,14 +38,13 @@ uses // Synedit SynEdit, // codetools - FileProcs, CodeAtom, CodeCache, CodeToolManager, + BasicCodeTools, FileProcs, CodeAtom, CodeCache, CodeToolManager, Laz_DOM, Laz_XMLRead, Laz_XMLWrite, // IDEIntf ProjectIntf, LazIDEIntf, IDEHelpIntf, LazHelpIntf, // IDE - IDEOptionDefs, EnvironmentOpts, - IDEProcs, LazarusIDEStrConsts, FPDocSelectInherited, FPDocSelectLink, - PackageSystem, CodeHelp; + IDEOptionDefs, EnvironmentOpts, PackageSystem, IDEProcs, LazarusIDEStrConsts, + FPDocSelectInherited, FPDocSelectLink, CodeHelp; type TFPDocEditorFlag = ( @@ -54,74 +53,66 @@ type fpdefChainNeedsUpdate, fpdefCaptionNeedsUpdate, fpdefValueControlsNeedsUpdate, - fpdefInheritedControlsNeedsUpdate, - fpdefLinkIDComboNeedsUpdate + fpdefInheritedControlsNeedsUpdate ); TFPDocEditorFlags = set of TFPDocEditorFlag; { TFPDocEditor } TFPDocEditor = class(TForm) - AddLinkButton: TButton; - BrowseExampleButton: TButton; - ShortLabel: TLabel; - LinkEdit: TEdit; - LinkLabel: TLabel; AddLinkToInheritedButton: TButton; - RightBtnPanel: TPanel; - SaveButton: TButton; - CreateButton: TButton; - CopyFromInheritedButton: TButton; - MoveToInheritedButton: TButton; - InheritedShortEdit: TEdit; - ExampleEdit: TEdit; - InheritedShortLabel: TLabel; - LinkIdComboBox: TComboBox; - DeleteLinkButton: TButton; - DescrMemo: TMemo; - LinkTextEdit: TEdit; - LinkListBox: TListBox; - OpenDialog: TOpenDialog; - LeftBtnPanel: TPanel; - ShortEdit: TEdit; - ErrorsMemo: TMemo; - PageControl: TPageControl; - DescrTabSheet: TTabSheet; - ErrorsTabSheet: TTabSheet; - ShortTabSheet: TTabSheet; BoldFormatButton: TSpeedButton; - ItalicFormatButton: TSpeedButton; + BrowseExampleButton: TButton; + ControlDocker: TLazControlDocker; + CopyFromInheritedButton: TButton; + CreateButton: TButton; + DescrMemo: TMemo; + DescrTabSheet: TTabSheet; + ErrorsMemo: TMemo; + ErrorsTabSheet: TTabSheet; + ExampleEdit: TEdit; + ExampleTabSheet: TTabSheet; + InheritedShortEdit: TEdit; + InheritedShortLabel: TLabel; + InheritedTabSheet: TTabSheet; InsertCodeTagButton: TSpeedButton; + InsertLinkSpeedButton: TSpeedButton; + InsertParagraphSpeedButton: TSpeedButton; InsertRemarkButton: TSpeedButton; InsertVarTagButton: TSpeedButton; - ExampleTabSheet: TTabSheet; - InheritedTabSheet: TTabSheet; - InsertParagraphSpeedButton: TSpeedButton; - InsertLinkSpeedButton: TSpeedButton; - UnderlineFormatButton: TSpeedButton; + ItalicFormatButton: TSpeedButton; + LeftBtnPanel: TPanel; + LinkEdit: TEdit; + LinkLabel: TLabel; + SeeAlsoMemo: TMemo; + MoveToInheritedButton: TButton; + OpenDialog: TOpenDialog; + PageControl: TPageControl; + RightBtnPanel: TPanel; + SaveButton: TButton; SeeAlsoTabSheet: TTabSheet; - ControlDocker: TLazControlDocker; - procedure AddLinkButtonClick(Sender: TObject); - procedure LinkEditEditingDone(Sender: TObject); + ShortEdit: TEdit; + ShortLabel: TLabel; + ShortTabSheet: TTabSheet; + UnderlineFormatButton: TSpeedButton; procedure AddLinkToInheritedButtonClick(Sender: TObject); + procedure ApplicationIdle(Sender: TObject; var Done: Boolean); procedure BrowseExampleButtonClick(Sender: TObject); procedure CopyFromInheritedButtonClick(Sender: TObject); procedure CreateButtonClick(Sender: TObject); - procedure DeleteLinkButtonClick(Sender: TObject); procedure DescrMemoChange(Sender: TObject); procedure ErrorsMemoChange(Sender: TObject); procedure ExampleEditChange(Sender: TObject); + procedure FormatButtonClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure FormResize(Sender: TObject); - procedure FormatButtonClick(Sender: TObject); procedure InsertLinkSpeedButtonClick(Sender: TObject); - procedure LinkChange(Sender: TObject); - procedure LinkListBoxClick(Sender: TObject); - procedure ApplicationIdle(Sender: TObject; var Done: Boolean); + procedure LinkEditEditingDone(Sender: TObject); procedure MoveToInheritedButtonClick(Sender: TObject); procedure PageControlChange(Sender: TObject); procedure SaveButtonClick(Sender: TObject); + procedure SeeAlsoMemoEditingDone(Sender: TObject); procedure ShortEditEditingDone(Sender: TObject); private FCaretXY: TPoint; @@ -139,7 +130,6 @@ type function GetContextTitle(Element: TCodeHelpElement): string; - function MakeLink: String; function FindInheritedIndex: integer; procedure Save; function GetGUIValues: TFPDocElementValues; @@ -149,15 +139,12 @@ type procedure UpdateCodeCache; procedure UpdateChain; procedure UpdateCaption; - procedure UpdateLinkIdComboBox; procedure UpdateValueControls; procedure UpdateInheritedControls; procedure OnLazDocChanging(Sender: TObject; LazDocFPFile: TLazFPDocFile); procedure OnLazDocChanged(Sender: TObject; LazDocFPFile: TLazFPDocFile); procedure LoadGUIValues(Element: TCodeHelpElement); procedure MoveToInherited(Element: TCodeHelpElement); - procedure AddSeeAlsoLink(Link, LinkTitle: string); - function FindSeeAlsoLink(Link: string): integer; function ExtractIDFromLinkTag(const LinkTag: string; out ID, Title: string): boolean; function CreateElement(Element: TCodeHelpElement): Boolean; procedure UpdateButtons; @@ -208,39 +195,6 @@ begin Result:=CurDocFile.GetFirstElement; end; -procedure TFPDocEditor.UpdateLinkIdComboBox; -// fills LinkIdComboBox.Items -var - sl: TStringList; - Node: TDOMNode; -begin - if fUpdateLock>0 then begin - Include(FFlags,fpdefLinkIDComboNeedsUpdate); - exit; - end; - Exclude(FFlags,fpdefLinkIDComboNeedsUpdate); - - {$IFDEF VerboseCodeHelp} - DebugLn(['TFPDocEditForm.UpdateLinkIdComboBox START']); - {$ENDIF} - LinkIdComboBox.Clear; - if Doc=nil then exit; - Node:=DocFile.GetElementWithName('seealso',false); - if Node=nil then exit; - Node:=Node.FirstChild; - if Node=nil then exit; - - sl:=TStringList.Create; - // element nodes - while Node<>nil do begin - if (Node.NodeName='link') and (Node is TDomElement) then - sl.Add(TDomElement(Node)['name']); - Node := Node.NextSibling; - end; - LinkIdComboBox.Items.Assign(sl); - sl.Free; -end; - procedure TFPDocEditor.FormCreate(Sender: TObject); begin Caption := lisCodeHelpMainFormCaption; @@ -270,9 +224,6 @@ begin SaveButton.Caption := lisCodeHelpSaveButton; SaveButton.Enabled:=false; - AddLinkButton.Caption := lisCodeHelpAddLinkButton; - DeleteLinkButton.Caption := lisCodeHelpDeleteLinkButton; - BrowseExampleButton.Caption := lisCodeHelpBrowseExampleButton; MoveToInheritedButton.Caption:=lisLDMoveEntriesToInherited; @@ -312,7 +263,7 @@ end; procedure TFPDocEditor.FormResize(Sender: TObject); begin - LinkIdComboBox.Width := (AddLinkButton.Left - LinkIdComboBox.Left - 8) div 2; + end; procedure TFPDocEditor.FormatButtonClick(Sender: TObject); @@ -371,39 +322,11 @@ begin ShortEdit.SelText := LinkSrc; if PageControl.ActivePage = DescrTabSheet then DescrMemo.SelText := LinkSrc; + if PageControl.ActivePage = SeeAlsoTabSheet then + SeeAlsoMemo.SelText := LinkSrc; if PageControl.ActivePage = ErrorsTabSheet then ErrorsMemo.SelText := LinkSrc; -end; - -procedure TFPDocEditor.LinkChange(Sender: TObject); -var - NewLink: String; - OldLink: string; -begin - if LinkListBox.ItemIndex<0 then - Exit; - NewLink:=MakeLink; - OldLink:=LinkListBox.Items[LinkListBox.ItemIndex]; - if NewLink<>OldLink then begin - LinkListBox.Items[LinkListBox.ItemIndex] := NewLink; - Modified:=true; - end; -end; - -procedure TFPDocEditor.LinkListBoxClick(Sender: TObject); -var - LinkIndex: LongInt; - LinkTag: string; - ID: string; - Title: string; -begin - LinkIndex := LinkListBox.ItemIndex; - if LinkIndex = -1 then - Exit; - LinkTag:=LinkListBox.Items[LinkIndex]; - ExtractIDFromLinkTag(LinkTag,ID,Title); - LinkIdComboBox.Text := ID; - LinkTextEdit.Text := Title; + Modified:=true; end; procedure TFPDocEditor.ApplicationIdle(Sender: TObject; var Done: Boolean); @@ -424,8 +347,6 @@ begin UpdateValueControls else if fpdefInheritedControlsNeedsUpdate in FFlags then UpdateInheritedControls - else if fpdefLinkIDComboNeedsUpdate in FFlags then - UpdateLinkIdComboBox else Done:=true; end; @@ -504,6 +425,12 @@ begin Save; end; +procedure TFPDocEditor.SeeAlsoMemoEditingDone(Sender: TObject); +begin + if SeeAlsoMemo.Text<>FOldVisualValues[fpdiSeeAlso] then + Modified:=true; +end; + procedure TFPDocEditor.ShortEditEditingDone(Sender: TObject); begin if ShortEdit.Text<>FOldVisualValues[fpdiShort] then @@ -720,9 +647,6 @@ begin FOldVisualValues[fpdiSeeAlso]:=ConvertLineEndings(FOldValues[fpdiSeeAlso]); FOldVisualValues[fpdiExample]:=ConvertLineEndings(FOldValues[fpdiExample]); DebugLn(['TFPDocEditor.LoadGUIValues Short="',dbgstr(FOldValues[fpdiShort]),'"']); - LinkListBox.Items.Text := FOldVisualValues[fpdiSeeAlso]; - LinkIdComboBox.Text := ''; - LinkTextEdit.Clear; end else begin @@ -732,25 +656,19 @@ begin FOldVisualValues[fpdiErrors]:=lisCodeHelpNoDocumentation; FOldVisualValues[fpdiSeeAlso]:=lisCodeHelpNoDocumentation; FOldVisualValues[fpdiExample]:=lisCodeHelpNoDocumentation; - LinkIdComboBox.Text := lisCodeHelpNoDocumentation; - LinkTextEdit.Text := lisCodeHelpNoDocumentation; - LinkListBox.Clear; end; ShortEdit.Text := FOldVisualValues[fpdiShort]; LinkEdit.Text := FOldVisualValues[fpdiElementLink]; DescrMemo.Lines.Text := FOldVisualValues[fpdiDescription]; + SeeAlsoMemo.Text := FOldVisualValues[fpdiSeeAlso]; ErrorsMemo.Lines.Text := FOldVisualValues[fpdiErrors]; ExampleEdit.Text := FOldVisualValues[fpdiExample]; ShortEdit.Enabled := EnabledState; LinkEdit.Enabled := EnabledState; DescrMemo.Enabled := EnabledState; + SeeAlsoMemo.Enabled := EnabledState; ErrorsMemo.Enabled := EnabledState; - LinkIdComboBox.Enabled := EnabledState; - LinkTextEdit.Enabled := EnabledState; - LinkListBox.Enabled := EnabledState; - AddLinkButton.Enabled := EnabledState; - DeleteLinkButton.Enabled := EnabledState; ExampleEdit.Enabled := EnabledState; BrowseExampleButton.Enabled := EnabledState; @@ -765,59 +683,6 @@ begin WriteNode(Element,Values,true); end; -procedure TFPDocEditor.AddSeeAlsoLink(Link, LinkTitle: string); -var - s: String; -begin - DebugLn(['TFPDocEditor.AddSeeAlsoLink Link="',Link,'" LinkTitle="',LinkTitle,'"']); - if FindSeeAlsoLink(Link)>=0 then exit; - s:=''' then begin - s:=s+'>'+LinkTitle+''; - end; - DebugLn(['TFPDocEditor.AddSeeAlsoLink Adding: ',s]); - LinkListBox.Items.Add(s); - Modified:=true; -end; - -function TFPDocEditor.FindSeeAlsoLink(Link: string): integer; -var - LinkTag: string; - ID: string; - Element: TCodeHelpElement; - ExpandedLink: String; - ExpandedID: String; - Title: string; -begin - ExpandedLink:=''; - Result:=LinkListBox.Items.Count-1; - while (Result>=0) do begin - LinkTag:=LinkListBox.Items[Result]; - if ExtractIDFromLinkTag(LinkTag,ID,Title) then begin - // check absolute: ID=Link - if SysUtils.CompareText(ID,Link)=0 then - exit; - // check relative - if (System.Pos(Link,'.')>0) and (ID<>'') then begin - if (fChain<>nil) and (fChain.Count>0) then begin - Element:=fChain[0]; - if (ExpandedLink='') then begin - ExpandedLink:=CodeHelpBoss.ExpandFPDocLinkID(Link, - Element.ElementUnitName,Element.ElementOwnerName); - end; - ExpandedID:=CodeHelpBoss.ExpandFPDocLinkID(ID, - Element.ElementUnitName,Element.ElementOwnerName); - if SysUtils.CompareText(ExpandedID,ExpandedLink)=0 then - exit; - end; - end; - end; - dec(Result); - end; -end; - function TFPDocEditor.ExtractIDFromLinkTag(const LinkTag: string; out ID, Title: string ): boolean; // extract id and title from example: @@ -882,6 +747,7 @@ var begin HasEdit:=(PageControl.ActivePage = ShortTabSheet) or (PageControl.ActivePage = DescrTabSheet) + or (PageControl.ActivePage = SeeAlsoTabSheet) or (PageControl.ActivePage = ErrorsTabSheet); BoldFormatButton.Enabled:=HasEdit; ItalicFormatButton.Enabled:=HasEdit; @@ -917,10 +783,8 @@ begin ShortEdit.Clear; LinkEdit.Clear; DescrMemo.Clear; + SeeAlsoMemo.Clear; ErrorsMemo.Clear; - LinkIdComboBox.Text := ''; - LinkTextEdit.Clear; - LinkListBox.Clear; ExampleEdit.Clear; Modified := False; @@ -932,7 +796,7 @@ begin FreeAndNil(fChain); FFlags:=FFlags+[fpdefCodeCacheNeedsUpdate,fpdefChainNeedsUpdate, fpdefCaptionNeedsUpdate,fpdefValueControlsNeedsUpdate, - fpdefInheritedControlsNeedsUpdate,fpdefLinkIDComboNeedsUpdate]; + fpdefInheritedControlsNeedsUpdate]; end; procedure TFPDocEditor.UpdateFPDocEditor(const SrcFilename: string; @@ -977,8 +841,8 @@ begin Modified:=true; ShortEdit.Text:=''; DescrMemo.Text:=''; + SeeAlsoMemo.Text:=''; ErrorsMemo.Text:=''; - LinkListBox.Items.Clear; ExampleEdit.Text:=''; if DoSave then Save; end; @@ -1007,11 +871,11 @@ begin Result[fpdiShort]:=ShortEdit.Text; Result[fpdiDescription]:=DescrMemo.Text; Result[fpdiErrors]:=ErrorsMemo.Text; - Result[fpdiSeeAlso]:=LinkListBox.Items.Text; + Result[fpdiSeeAlso]:=SeeAlsoMemo.Text; Result[fpdiExample]:=ExampleEdit.Text; Result[fpdiElementLink]:=LinkEdit.Text; for i:=Low(TFPDocItem) to High(TFPDocItem) do - if Result[i]=lisCodeHelpNoDocumentation then + if Trim(Result[i])=lisCodeHelpNoDocumentation then Result[i]:=''; end; @@ -1115,15 +979,6 @@ begin Modified:=true; end; -function TFPDocEditor.MakeLink: String; -begin - if Trim(LinkTextEdit.Text) = '' then - Result := '' - else - Result := '' + - LinkTextEdit.Text + ''; -end; - function TFPDocEditor.FindInheritedIndex: integer; // returns Index in chain of an overriden Element with a short description // returns -1 if not found @@ -1144,15 +999,6 @@ begin Result:=-1; end; -procedure TFPDocEditor.AddLinkButtonClick(Sender: TObject); -begin - if Trim(LinkIdComboBox.Text) <> '' then - begin - LinkListBox.Items.Add(MakeLink); - Modified := True; - end; -end; - procedure TFPDocEditor.LinkEditEditingDone(Sender: TObject); begin if LinkEdit.Text<>FOldVisualValues[fpdiElementLink] then @@ -1212,15 +1058,6 @@ begin CreateElement(fChain[0]); end; -procedure TFPDocEditor.DeleteLinkButtonClick(Sender: TObject); -begin - if LinkListBox.ItemIndex >= 0 then begin - LinkListBox.Items.Delete(LinkListBox.ItemIndex); - DebugLn(['TFPDocEditForm.DeleteLinkButtonClick ']); - Modified := True; - end; -end; - procedure TFPDocEditor.DescrMemoChange(Sender: TObject); begin if DescrMemo.Text<>FOldVisualValues[fpdiDescription] then