fixed linux compilation, fixed codetools searching class header comment

git-svn-id: trunk@8127 -
This commit is contained in:
mattias 2005-11-10 18:36:27 +00:00
parent 26272265eb
commit 9542928f63
9 changed files with 167 additions and 21 deletions

2
.gitattributes vendored
View File

@ -931,7 +931,6 @@ ide/lazarus_dci.lrs svneol=native#text/pascal
ide/lazarusidestrconsts.pas svneol=native#text/pascal
ide/lazarusmanager.pas svneol=native#text/pascal
ide/lazconf.pp svneol=native#text/pascal
ide/lazcwstring.pas svneol=native#text/plain
ide/lazdocfrm.lfm svneol=native#text/plain
ide/lazdocfrm.lrs svneol=native#text/plain
ide/lazdocfrm.pas svneol=native#text/plain
@ -1921,6 +1920,7 @@ lcl/languages/lcl.ru.po svneol=native#text/plain
lcl/languages/lcl.ruold.po svneol=native#text/plain
lcl/languages/lcl.ruwin.po svneol=native#text/plain
lcl/languages/lcl.ua.po svneol=native#text/plain
lcl/lazcwstring.pas svneol=native#text/plain
lcl/lazlinkedlist.pas svneol=native#text/pascal
lcl/lclclasses.pp svneol=native#text/pascal
lcl/lclicons.lrs svneol=native#text/pascal

View File

@ -3272,7 +3272,6 @@ var
var
CleanCursorPos: integer;
ANode: TCodeTreeNode;
PrevNode: TCodeTreeNode;
p: LongInt;
CommentLvl: Integer;
CommentStartPos: LongInt;
@ -3286,7 +3285,8 @@ begin
' SearchInParentNode='+dbgs(SearchInParentNode),
' WithCommentBounds='+dbgs(WithCommentBounds),
' CaseSensitive='+dbgs(CaseSensitive),
' IgnoreSpaces='+dbgs(IgnoreSpaces));}
' IgnoreSpaces='+dbgs(IgnoreSpaces),
' CompareOnlyStart='+dbgs(CompareOnlyStart)); }
// parse source and find clean positions
if InvokeBuildTree then
@ -3299,21 +3299,31 @@ begin
ANode:=FindDeepestNodeAtPos(CleanCursorPos,true);
if (ANode=nil) then exit;
if SearchInParentNode and (ANode.Parent<>nil) then
ANode:=ANode.Parent;
{ find end of last atom in front of node
for example:
uses classes;
// Comment
type
If ANode is the 'type' block, the position after the semicolon is searched
}
PrevNode:=ANode.Prior;
if PrevNode<>nil then begin
MoveCursorToLastNodeAtom(PrevNode);
if SearchInParentNode and (ANode.Parent<>nil) then begin
// search all siblings in front
ANode:=ANode.Parent;
MoveCursorToCleanPos(ANode.Parent.StartPos);
end else if ANode.Prior<>nil then begin
// search between prior sibling and this node
//DebugLn('TStandardCodeTool.FindCommentInFront ANode.Prior=',ANode.Prior.DescAsString);
MoveCursorToLastNodeAtom(ANode.Prior);
end else if ANode.Parent<>nil then begin
// search from start of parent node to this node
//DebugLn('TStandardCodeTool.FindCommentInFront ANode.Parent=',ANode.Parent.DescAsString);
MoveCursorToCleanPos(ANode.Parent.StartPos);
end else begin
// search in this node
//DebugLn('TStandardCodeTool.FindCommentInFront Aode=',ANode.DescAsString);
MoveCursorToCleanPos(ANode.StartPos);
end;
@ -3386,6 +3396,7 @@ begin
end;
end;
ReadNextAtom;
//DebugLn('TStandardCodeTool.FindCommentInFront NextAtom=',GetAtom);
until (CurPos.EndPos>=CleanCursorPos) or (CurPos.EndPos>=SrcLen);
Result:=(FoundStartPos>=1)

View File

@ -179,6 +179,7 @@ function SpecialCharsToSpaces(const s: string): string;
function StringListToText(List: TStrings; const Delimiter: string;
IgnoreEmptyLines: boolean = false): string;
// environment
function EnvironmentAsStringList: TStringList;
procedure AssignEnvironmentTo(DestStrings, Overrides: TStrings);

View File

@ -60,8 +60,6 @@ type
{ TProgressWait }
{ TProgressWait }
TProgressWait = class
public
StartTime: TDateTime;

View File

@ -1,2 +1,2 @@
// Created by Svn2RevisionInc
const RevisionStr = '8117M';
const RevisionStr = '8123M';

View File

@ -20,7 +20,7 @@ unit SrcEditorIntf;
interface
uses
Classes, SysUtils, Forms, Controls;
Classes, SysUtils, LCLProc, Forms, Controls;
type
TSrcEditSearchOption = (sesoMatchCase, sesoWholeWord, sesoBackwards,
@ -216,8 +216,8 @@ var
begin
NewName:=IDECodeMacros.CreateUniqueName(Name);
Result:=TIDECodeMacro.Create(NewName);
Result.ShortDescription:=ShortDescription;
Result.LongDescription:=LongDescription;
Result.ShortDescription:=ConvertLineEndings(ShortDescription);
Result.LongDescription:=ConvertLineEndings(LongDescription);
Result.OnGetValueProc:=OnGetValueProc;
Result.OnGetValueMethod:=OnGetValueMethod;
IDECodeMacros.Add(Result);

View File

@ -492,7 +492,7 @@ begin
for i:=0 to AnchoredControlCount-1 do begin
CurResizeControl:=AnchoredControls[i];
debugln('TCustomSplitter.MouseMove ',DbgSName(Self),' CurResizeControl=',DbgSName(CurResizeControl));
//debugln('TCustomSplitter.MouseMove ',DbgSName(Self),' CurResizeControl=',DbgSName(CurResizeControl));
if (CurResizeControl.AnchorSide[ResizeAnchor].Control=Self)
or (CurResizeControl.AnchorSide[OppositeAnchor[ResizeAnchor]].Control=Self)
then begin
@ -507,7 +507,7 @@ begin
// calculate how much the CurResizeControl can be enlarged
CurMaxEnlarge:=Max(0,GetControlConstraintsMaxSize(CurResizeControl)
-GetControlSize(CurResizeControl));
debugln('TCustomSplitter.MouseMove ',DbgSName(Self),' CurResizeControl=',DbgSName(CurResizeControl),' CurMaxShrink=',dbgs(CurMaxShrink),' CurMaxEnlarge=',dbgs(CurMaxEnlarge));
//debugln('TCustomSplitter.MouseMove ',DbgSName(Self),' CurResizeControl=',DbgSName(CurResizeControl),' CurMaxShrink=',dbgs(CurMaxShrink),' CurMaxEnlarge=',dbgs(CurMaxEnlarge));
// apply to the offset boundaries
if (CurResizeControl.AnchorSide[akLeft].Control=Self)

View File

@ -144,6 +144,9 @@ type
procedure EndUpdate; override;
procedure GetControlBounds(Control: TControl;
out AControlBounds: TRect); override;
procedure DockControl(Control: TControl; InsertAt: TAlign;
DropCtl: TControl);
procedure UndockControl(Control: TControl);
procedure InsertControl(Control: TControl; InsertAt: TAlign;
DropCtl: TControl); override;
procedure LoadFromStream(Stream: TStream); override;
@ -712,7 +715,7 @@ begin
end;
{-------------------------------------------------------------------------------
procedure TAnchoredDockManager.InsertControl(Control: TControl;
procedure TAnchoredDockManager.DockControl(Control: TControl;
InsertAt: TAlign; DropCtl: TControl);
Docks Control to or into DropCtl.
@ -734,7 +737,7 @@ end;
and replaces DropCtl and DropCtl is added as page.
Then Control is added as page.
-------------------------------------------------------------------------------}
procedure TAnchoredDockManager.InsertControl(Control: TControl;
procedure TAnchoredDockManager.DockControl(Control: TControl;
InsertAt: TAlign; DropCtl: TControl);
var
Splitter: TLazDockSplitter;
@ -909,6 +912,139 @@ begin
end;
end;
{-------------------------------------------------------------------------------
procedure TAnchoredDockManager.UndockControl(Control: TControl);
Removes a control from a docking form.
It breaks all anchors and cleans up.
The created gap will be tried to fill up.
It removes TLazDockSplitter, TLazDockPage and TLazDockPages if they are no
longer needed.
-------------------------------------------------------------------------------}
procedure TAnchoredDockManager.UndockControl(Control: TControl);
{
Examples:
Search Order:
1. A TLazDockSplitter dividing only two controls:
Before:
|-------------
| +--+ | +---
| | | | | B
| +--+ | +---
|-------------
The splitter will be deleted and the right control will be anchored to the
left.
After:
|-------------
| +---
| | B
| +---
|-------------
2. Four spiral splitters:
Before:
|
A |
---------|
| +--+ | C
B | | | |
| +--+ |
| ----------
| D
The left and right splitter will be combined to one.
After:
|
A |
-------|
| C
B |
|
|------
| D
3. No TLazDockSplitter. Control is the only child of a TLazDockPage
In this case the page will be deleted.
If the TLazDockPages has no childs left, it is recursively undocked.
4. No TLazDockSplitter, Control is the only child of a TLazDockForm.
The TLazDockForm is deleted and the Control is floated.
This normally means: A form will simply be placed on the desktop, other
controls will be docked into their DockSite.
}
var
a: TAnchorKind;
AnchorControl: TControl;
AnchorSplitter: TLazDockSplitter;
i: Integer;
Sibling: TControl;
OldAnchorControls: array[TAnchorKind] of TControl;
begin
if Control.Parent=nil then begin
// already undocked
RaiseGDBException('TAnchoredDockManager.UndockControl Control.Parent=nil');
end;
// break anchors
Control.Align:=alNone;
for a:=Low(TAnchorKind) to High(TAnchorKind) do begin
OldAnchorControls[a]:=Control.AnchorSide[a].Control;
Control.AnchorSide[a].Control:=nil;
end;
Control.Anchors:=[akLeft,akTop];
// check if their is a splitter, that has a side with only Control anchored
// to it.
for a:=Low(TAnchorKind) to High(TAnchorKind) do begin
AnchorControl:=OldAnchorControls[a];
if AnchorControl is TLazDockSplitter then begin
AnchorSplitter:=TLazDockSplitter(AnchorControl);
i:=Control.Parent.ControlCount-1;
while i>=0 do begin
Sibling:=Control.Parent.Controls[i];
if (Sibling.AnchorSide[a].Control=AnchorSplitter) then begin
// Sibling is anchored with the same side to the splitter
// => this splitter is needed, can not be deleted.
break;
end;
end;
if i<0 then begin
// this splitter is not needed anymore
RaiseGDBException('');
//DeleteSideSplitter(AnchorSplitter,OppositeAnchor[a],
// OldAnchorControls[OppositeAnchor[a]]);
end;
end;
end;
// check if there are four spiral splitters around Control
for a:=Low(TAnchorKind) to High(TAnchorKind) do begin
AnchorControl:=OldAnchorControls[a];
if not (AnchorControl is TLazDockSplitter) then begin
RaiseGDBException('TAnchoredDockManager.UndockControl neither');
end;
end;
end;
procedure TAnchoredDockManager.InsertControl(Control: TControl;
InsertAt: TAlign; DropCtl: TControl);
begin
DockControl(Control, InsertAt, DropCtl);
end;
procedure TAnchoredDockManager.LoadFromStream(Stream: TStream);
begin
RaiseGDBException('TAnchoredDockManager.LoadFromStream TODO');
@ -927,7 +1063,7 @@ end;
procedure TAnchoredDockManager.RemoveControl(Control: TControl);
begin
RaiseGDBException('TAnchoredDockManager.RemoveControl TODO');
UndockControl(Control);
end;
procedure TAnchoredDockManager.ResetBounds(Force: Boolean);