- constructor/destructor is now supported

- resourcestrings are being used
from Darius

git-svn-id: trunk@7709 -
This commit is contained in:
vincents 2005-09-15 10:42:38 +00:00
parent e15d34e787
commit 5602b9a48c
5 changed files with 73 additions and 58 deletions

View File

@ -2835,6 +2835,14 @@ resourcestring
lisCEOWhenSwitchingFile = 'When switching file in source editor';
lisCEOOnIdle = 'On idle';
lisMenuLazDoc = 'LazDoc';
lisLazDocMainFormCaption = 'LazDoc editor';
lisLazDocNoTagCaption = '<NONE>';
lisLazDocNoDocumentation = 'Documentation entry does not exist';
lisLazDocShortTag = 'Short';
lisLazDocDescrTag = 'Description';
lisLazDocErrorsTag = 'Errors';
implementation
end.

View File

@ -1,34 +1,34 @@
object LazDocForm: TLazDocForm
ActiveControl = ErrorsTabSheet
ActiveControl = ShortTabSheet
BorderStyle = bsSizeToolWin
Caption = 'LazDoc editor'
ClientHeight = 195
ClientHeight = 117
ClientWidth = 753
OnCreate = FormCreate
PixelsPerInch = 96
HorzScrollBar.Page = 752
VertScrollBar.Page = 194
Left = 245
Height = 195
Top = 506
VertScrollBar.Page = 116
Left = 260
Height = 117
Top = 584
Width = 753
object PageControl: TPageControl
ActivePage = ErrorsTabSheet
ActivePage = ShortTabSheet
Align = alClient
BorderSpacing.OnChange = nil
TabIndex = 2
TabIndex = 0
TabOrder = 0
TabPosition = tpBottom
Height = 195
Height = 117
Width = 753
object ShortTabSheet: TTabSheet
Caption = 'ShortTabSheet'
ClientHeight = 169
ClientHeight = 91
ClientWidth = 745
Height = 169
Height = 91
Width = 745
object ShortEdit: TEdit
Align = alTop
BorderSpacing.OnChange = nil
OnChange = DescrMemoChange
TabOrder = 0
Text = 'ShortEdit'
@ -38,13 +38,12 @@ object LazDocForm: TLazDocForm
end
object DescrTabSheet: TTabSheet
Caption = 'DescrTabSheet'
ClientHeight = 169
ClientHeight = 91
ClientWidth = 745
Height = 169
Height = 91
Width = 745
object DescrMemo: TMemo
Align = alClient
BorderSpacing.OnChange = nil
Font.CharSet = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -12
@ -55,18 +54,19 @@ object LazDocForm: TLazDocForm
)
OnChange = DescrMemoChange
TabOrder = 0
Height = 169
Height = 91
Width = 745
end
end
object ErrorsTabSheet: TTabSheet
Caption = 'ErrorsTabSheet'
ClientHeight = 169
ClientHeight = 91
ClientWidth = 745
Height = 169
Height = 91
Width = 745
object ErrorsMemo: TMemo
Align = alClient
BorderSpacing.OnChange = nil
Font.CharSet = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -12
@ -77,7 +77,7 @@ object LazDocForm: TLazDocForm
)
OnChange = DescrMemoChange
TabOrder = 0
Height = 169
Height = 91
Width = 745
end
end

View File

@ -1,29 +1,29 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TLazDocForm','FORMDATA',[
'TPF0'#11'TLazDocForm'#10'LazDocForm'#13'ActiveControl'#7#14'ErrorsTabSheet'
+#11'BorderStyle'#7#13'bsSizeToolWin'#7'Caption'#6#13'LazDoc editor'#12'Clien'
+'tHeight'#3#195#0#11'ClientWidth'#3#241#2#8'OnCreate'#7#10'FormCreate'#13'Pi'
+'xelsPerInch'#2'`'#18'HorzScrollBar.Page'#3#240#2#18'VertScrollBar.Page'#3
+#194#0#4'Left'#3#245#0#6'Height'#3#195#0#3'Top'#3#250#1#5'Width'#3#241#2#0#12
+'TPageControl'#11'PageControl'#10'ActivePage'#7#14'ErrorsTabSheet'#5'Align'#7
+#8'alClient'#22'BorderSpacing.OnChange'#13#8'TabIndex'#2#2#8'TabOrder'#2#0#11
+'TabPosition'#7#8'tpBottom'#6'Height'#3#195#0#5'Width'#3#241#2#0#9'TTabSheet'
+#13'ShortTabSheet'#7'Caption'#6#13'ShortTabSheet'#12'ClientHeight'#3#169#0#11
+'ClientWidth'#3#233#2#6'Height'#3#169#0#5'Width'#3#233#2#0#5'TEdit'#9'ShortE'
+'dit'#5'Align'#7#5'alTop'#8'OnChange'#7#15'DescrMemoChange'#8'TabOrder'#2#0#4
+'Text'#6#9'ShortEdit'#6'Height'#2#23#5'Width'#3#233#2#0#0#0#9'TTabSheet'#13
+'DescrTabSheet'#7'Caption'#6#13'DescrTabSheet'#12'ClientHeight'#3#169#0#11'C'
+'lientWidth'#3#233#2#6'Height'#3#169#0#5'Width'#3#233#2#0#5'TMemo'#9'DescrMe'
+'mo'#5'Align'#7#8'alClient'#22'BorderSpacing.OnChange'#13#12'Font.CharSet'#7
+#12'ANSI_CHARSET'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#244#9'Font.N'
+'ame'#6#11'Courier New'#10'Font.Pitch'#7#7'fpFixed'#13'Lines.Strings'#1#6#9
+'DescrMemo'#0#8'OnChange'#7#15'DescrMemoChange'#8'TabOrder'#2#0#6'Height'#3
+#169#0#5'Width'#3#233#2#0#0#0#9'TTabSheet'#14'ErrorsTabSheet'#7'Caption'#6#14
+'ErrorsTabSheet'#12'ClientHeight'#3#169#0#11'ClientWidth'#3#233#2#6'Height'#3
+#169#0#5'Width'#3#233#2#0#5'TMemo'#10'ErrorsMemo'#5'Align'#7#8'alClient'#12
+'Font.CharSet'#7#12'ANSI_CHARSET'#10'Font.Color'#7#7'clBlack'#11'Font.Height'
+#2#244#9'Font.Name'#6#11'Courier New'#10'Font.Pitch'#7#7'fpFixed'#13'Lines.S'
+'trings'#1#6#10'ErrorsMemo'#0#8'OnChange'#7#15'DescrMemoChange'#8'TabOrder'#2
+#0#6'Height'#3#169#0#5'Width'#3#233#2#0#0#0#0#0
'TPF0'#11'TLazDocForm'#10'LazDocForm'#13'ActiveControl'#7#13'ShortTabSheet'#11
+'BorderStyle'#7#13'bsSizeToolWin'#7'Caption'#6#13'LazDoc editor'#12'ClientHe'
+'ight'#2'u'#11'ClientWidth'#3#241#2#8'OnCreate'#7#10'FormCreate'#13'PixelsPe'
+'rInch'#2'`'#18'HorzScrollBar.Page'#3#240#2#18'VertScrollBar.Page'#2't'#4'Le'
+'ft'#3#4#1#6'Height'#2'u'#3'Top'#3'H'#2#5'Width'#3#241#2#0#12'TPageControl'
+#11'PageControl'#10'ActivePage'#7#13'ShortTabSheet'#5'Align'#7#8'alClient'#8
+'TabIndex'#2#0#8'TabOrder'#2#0#11'TabPosition'#7#8'tpBottom'#6'Height'#2'u'#5
+'Width'#3#241#2#0#9'TTabSheet'#13'ShortTabSheet'#7'Caption'#6#13'ShortTabShe'
+'et'#12'ClientHeight'#2'['#11'ClientWidth'#3#233#2#6'Height'#2'['#5'Width'#3
+#233#2#0#5'TEdit'#9'ShortEdit'#5'Align'#7#5'alTop'#22'BorderSpacing.OnChange'
+#13#8'OnChange'#7#15'DescrMemoChange'#8'TabOrder'#2#0#4'Text'#6#9'ShortEdit'
+#6'Height'#2#23#5'Width'#3#233#2#0#0#0#9'TTabSheet'#13'DescrTabSheet'#7'Capt'
+'ion'#6#13'DescrTabSheet'#12'ClientHeight'#2'['#11'ClientWidth'#3#233#2#6'He'
+'ight'#2'['#5'Width'#3#233#2#0#5'TMemo'#9'DescrMemo'#5'Align'#7#8'alClient'
+#12'Font.CharSet'#7#12'ANSI_CHARSET'#10'Font.Color'#7#7'clBlack'#11'Font.Hei'
+'ght'#2#244#9'Font.Name'#6#11'Courier New'#10'Font.Pitch'#7#7'fpFixed'#13'Li'
+'nes.Strings'#1#6#9'DescrMemo'#0#8'OnChange'#7#15'DescrMemoChange'#8'TabOrde'
+'r'#2#0#6'Height'#2'['#5'Width'#3#233#2#0#0#0#9'TTabSheet'#14'ErrorsTabSheet'
+#7'Caption'#6#14'ErrorsTabSheet'#12'ClientHeight'#2'['#11'ClientWidth'#3#233
+#2#6'Height'#2'['#5'Width'#3#233#2#0#5'TMemo'#10'ErrorsMemo'#5'Align'#7#8'al'
+'Client'#22'BorderSpacing.OnChange'#13#12'Font.CharSet'#7#12'ANSI_CHARSET'#10
+'Font.Color'#7#7'clBlack'#11'Font.Height'#2#244#9'Font.Name'#6#11'Courier Ne'
+'w'#10'Font.Pitch'#7#7'fpFixed'#13'Lines.Strings'#1#6#10'ErrorsMemo'#0#8'OnC'
+'hange'#7#15'DescrMemoChange'#8'TabOrder'#2#0#6'Height'#2'['#5'Width'#3#233#2
+#0#0#0#0#0
]);

View File

@ -41,6 +41,7 @@ uses
DOM,
Forms,
Graphics,
LazarusIDEStrConsts,
LCLProc,
LResources,
StdCtrls,
@ -89,10 +90,6 @@ type
property DocFileName: String read FDocFileName write SetDocFileName;
end;
const
MAINFORMCAPTION = 'LazDoc editor';
NODOCUMENTATION = 'Documentation entry does not exist';
var
LazDocForm: TLazDocForm;
doc: TXMLdocument = nil; // maybe better to make it a member field of TLazFormDoc
@ -139,13 +136,13 @@ end;
procedure TLazDocForm.FormCreate(Sender: TObject);
begin
Caption := MAINFORMCAPTION;
Caption := lisLazDocMainFormCaption;
with PageControl do
begin
Page[0].Caption := 'Short';
Page[1].Caption := 'Description';
Page[2].Caption := 'Errors';
Page[0].Caption := lisLazDocShortTag;
Page[1].Caption := lisLazDocDescrTag;
Page[2].Caption := lisLazDocErrorsTag;
PageIndex := 0;
end;
@ -302,6 +299,16 @@ begin
Result := ExtractFuncProc(Point(xpos, ypos), 'function', source);
Exit;
end;
if PosEx('constructor', source[ypos], xpos) = 1 then
begin
Result := ExtractFuncProc(Point(xpos, ypos), 'constructor', source);
Exit;
end;
if PosEx('desctructor', source[ypos], xpos) = 1 then
begin
Result := ExtractFuncProc(Point(xpos, ypos), 'desctructor', source);
Exit;
end;
end;
end;
@ -309,12 +316,12 @@ procedure TLazDocForm.SetCaption;
var
strCaption: String;
begin
strCaption := MAINFORMCAPTION + ' - ';
strCaption := lisLazDocMainFormCaption + ' - ';
if FCurrentElement <> '' then
strCaption := strCaption + FCurrentElement + ' - '
else
strCaption := strCaption + '<NONE> - ';
strCaption := strCaption + lisLazDocNoTagCaption + ' - ';
Caption := strCaption + FDocFileName;
end;
@ -369,9 +376,9 @@ begin
end
else
begin
ShortEdit.Text := NODOCUMENTATION;
DescrMemo.Lines.Text := NODOCUMENTATION;
ErrorsMemo.Lines.Text := NODOCUMENTATION;
ShortEdit.Text := lisLazDocNoDocumentation;
DescrMemo.Lines.Text := lisLazDocNoDocumentation;
ErrorsMemo.Lines.Text := lisLazDocNoDocumentation;
end;
//attach the update method again

View File

@ -653,7 +653,7 @@ begin
CreateMenuItem(ParentMI,itmToolGuessMisplacedIFDEF,'itmToolGuessMisplacedIFDEF',lisMenuGuessMisplacedIFDEF);
CreateMenuItem(ParentMI,itmToolMakeResourceString,'itmToolMakeResourceString',lisMenuMakeResourceString);
CreateMenuItem(ParentMI,itmToolDiff,'itmToolDiff',lisMenuDiff);
CreateMenuItem(ParentMI,itmToolLazDoc,'itmToolLazDoc','LazDoc'); //DBlaszijk 5-sep-05
CreateMenuItem(ParentMI,itmToolLazDoc,'itmToolLazDoc',lisMenuLazDoc); //DBlaszijk 5-sep-05
ParentMI.Add(CreateMenuSeparator);
CreateMenuItem(ParentMI,itmToolCheckLFM,'itmToolCheckLFM',lisMenuCheckLFM);