mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 06:17:14 +02:00
MG: added TListView notification from Vincent
git-svn-id: trunk@3340 -
This commit is contained in:
parent
7c2bb90b7b
commit
44e3418b75
@ -156,6 +156,8 @@ type
|
|||||||
const AnAtom: shortstring): boolean; // 0=current, 1=prior current, ...
|
const AnAtom: shortstring): boolean; // 0=current, 1=prior current, ...
|
||||||
function GetAtom: string;
|
function GetAtom: string;
|
||||||
function GetUpAtom: string;
|
function GetUpAtom: string;
|
||||||
|
function GetAtom(Atom: TAtomPosition): string;
|
||||||
|
function GetUpAtom(Atom: TAtomPosition): string;
|
||||||
function CompareNodeIdentChars(ANode: TCodeTreeNode;
|
function CompareNodeIdentChars(ANode: TCodeTreeNode;
|
||||||
const AnUpperIdent: string): integer;
|
const AnUpperIdent: string): integer;
|
||||||
function CompareSrcIdentifiers(
|
function CompareSrcIdentifiers(
|
||||||
@ -598,6 +600,16 @@ begin
|
|||||||
Result:=copy(UpperSrc,CurPos.StartPos,CurPos.EndPos-CurPos.StartPos);
|
Result:=copy(UpperSrc,CurPos.StartPos,CurPos.EndPos-CurPos.StartPos);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomCodeTool.GetAtom(Atom: TAtomPosition): string;
|
||||||
|
begin
|
||||||
|
Result:=copy(Src,Atom.StartPos,Atom.EndPos-Atom.StartPos);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCustomCodeTool.GetUpAtom(Atom: TAtomPosition): string;
|
||||||
|
begin
|
||||||
|
Result:=copy(UpperSrc,Atom.StartPos,Atom.EndPos-Atom.StartPos);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomCodeTool.ReadNextAtom;
|
procedure TCustomCodeTool.ReadNextAtom;
|
||||||
var c1, c2: char;
|
var c1, c2: char;
|
||||||
CommentLvl: integer;
|
CommentLvl: integer;
|
||||||
|
@ -2527,31 +2527,15 @@ function TFindDeclarationTool.FindIdentifierInUsesSection(
|
|||||||
search backwards through the uses section
|
search backwards through the uses section
|
||||||
compare first the unit name, then load the unit and search there
|
compare first the unit name, then load the unit and search there
|
||||||
}
|
}
|
||||||
var InAtom, UnitNameAtom: TAtomPosition;
|
var
|
||||||
|
InAtom, UnitNameAtom: TAtomPosition;
|
||||||
NewCodeTool: TFindDeclarationTool;
|
NewCodeTool: TFindDeclarationTool;
|
||||||
OldInput: TFindDeclarationInput;
|
OldInput: TFindDeclarationInput;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if (UsesNode=nil) or (UsesNode.Desc<>ctnUsesSection) then
|
MoveCursorToUsesEnd(UsesNode);
|
||||||
RaiseException('[TFindDeclarationTool.FindIdentifierInUsesSection] '
|
|
||||||
+'internal error: invalid UsesNode');
|
|
||||||
// search backwards through the uses section
|
|
||||||
MoveCursorToCleanPos(UsesNode.EndPos);
|
|
||||||
ReadPriorAtom; // read ';'
|
|
||||||
if not AtomIsChar(';') then
|
|
||||||
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[';',GetAtom]);
|
|
||||||
repeat
|
repeat
|
||||||
ReadPriorAtom; // read unitname
|
ReadPriorUsedUnit(UnitNameAtom, InAtom);
|
||||||
if AtomIsStringConstant then begin
|
|
||||||
InAtom:=CurPos;
|
|
||||||
ReadPriorAtom; // read 'in'
|
|
||||||
if not UpAtomIs('IN') then
|
|
||||||
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[ctsKeywordIn,GetAtom]);
|
|
||||||
ReadPriorAtom; // read unitname
|
|
||||||
end else
|
|
||||||
InAtom.StartPos:=-1;
|
|
||||||
AtomIsIdentifier(true);
|
|
||||||
UnitNameAtom:=CurPos;
|
|
||||||
if (fdfIgnoreUsedUnits in Params.Flags) then begin
|
if (fdfIgnoreUsedUnits in Params.Flags) then begin
|
||||||
if CompareSrcIdentifiers(UnitNameAtom.StartPos,Params.Identifier) then
|
if CompareSrcIdentifiers(UnitNameAtom.StartPos,Params.Identifier) then
|
||||||
begin
|
begin
|
||||||
@ -2568,12 +2552,10 @@ begin
|
|||||||
NewCodeTool:=FindCodeToolForUsedUnit(UnitNameAtom,InAtom,false);
|
NewCodeTool:=FindCodeToolForUsedUnit(UnitNameAtom,InAtom,false);
|
||||||
if NewCodeTool=nil then begin
|
if NewCodeTool=nil then begin
|
||||||
MoveCursorToCleanPos(UnitNameAtom.StartPos);
|
MoveCursorToCleanPos(UnitNameAtom.StartPos);
|
||||||
RaiseExceptionFmt(ctsUnitNotFound,[copy(Src,UnitNameAtom.StartPos,
|
RaiseExceptionFmt(ctsUnitNotFound,[GetAtom(UnitNameAtom)]);
|
||||||
UnitNameAtom.EndPos-UnitNameAtom.StartPos)]);
|
|
||||||
end else if NewCodeTool=Self then begin
|
end else if NewCodeTool=Self then begin
|
||||||
MoveCursorToCleanPos(UnitNameAtom.StartPos);
|
MoveCursorToCleanPos(UnitNameAtom.StartPos);
|
||||||
RaiseExceptionFmt(ctsIllegalCircleInUsedUnits,[copy(Src,
|
RaiseExceptionFmt(ctsIllegalCircleInUsedUnits,[GetAtom(UnitNameAtom)]);
|
||||||
UnitNameAtom.StartPos,UnitNameAtom.EndPos-UnitNameAtom.StartPos)]);
|
|
||||||
end;
|
end;
|
||||||
// search the identifier in the interface of the used unit
|
// search the identifier in the interface of the used unit
|
||||||
Params.Save(OldInput);
|
Params.Save(OldInput);
|
||||||
|
@ -171,6 +171,7 @@ type
|
|||||||
|
|
||||||
function CleanPosIsInComment(CleanPos, CleanCodePosInFront: integer;
|
function CleanPosIsInComment(CleanPos, CleanCodePosInFront: integer;
|
||||||
var CommentStart, CommentEnd: integer): boolean;
|
var CommentStart, CommentEnd: integer): boolean;
|
||||||
|
|
||||||
procedure BuildTree(OnlyInterfaceNeeded: boolean); virtual;
|
procedure BuildTree(OnlyInterfaceNeeded: boolean); virtual;
|
||||||
procedure BuildTreeAndGetCleanPos(TreeRange: TTreeRange;
|
procedure BuildTreeAndGetCleanPos(TreeRange: TTreeRange;
|
||||||
CursorPos: TCodeXYPosition; var CleanCursorPos: integer);
|
CursorPos: TCodeXYPosition; var CleanCursorPos: integer);
|
||||||
@ -179,7 +180,9 @@ type
|
|||||||
procedure BuildSubTreeForProcHead(ProcNode: TCodeTreeNode); virtual;
|
procedure BuildSubTreeForProcHead(ProcNode: TCodeTreeNode); virtual;
|
||||||
procedure BuildSubTreeForProcHead(ProcNode: TCodeTreeNode;
|
procedure BuildSubTreeForProcHead(ProcNode: TCodeTreeNode;
|
||||||
var FunctionResult: TCodeTreeNode);
|
var FunctionResult: TCodeTreeNode);
|
||||||
|
|
||||||
function DoAtom: boolean; override;
|
function DoAtom: boolean; override;
|
||||||
|
|
||||||
function ExtractPropName(PropNode: TCodeTreeNode;
|
function ExtractPropName(PropNode: TCodeTreeNode;
|
||||||
InUpperCase: boolean): string;
|
InUpperCase: boolean): string;
|
||||||
function ExtractPropType(PropNode: TCodeTreeNode;
|
function ExtractPropType(PropNode: TCodeTreeNode;
|
||||||
@ -194,35 +197,43 @@ type
|
|||||||
function FindProcNode(StartNode: TCodeTreeNode; const AProcHead: string;
|
function FindProcNode(StartNode: TCodeTreeNode; const AProcHead: string;
|
||||||
Attr: TProcHeadAttributes): TCodeTreeNode;
|
Attr: TProcHeadAttributes): TCodeTreeNode;
|
||||||
function FindProcBody(ProcNode: TCodeTreeNode): TCodeTreeNode;
|
function FindProcBody(ProcNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
|
procedure MoveCursorToFirstProcSpecifier(ProcNode: TCodeTreeNode);
|
||||||
|
function MoveCursorToProcSpecifier(ProcNode: TCodeTreeNode;
|
||||||
|
ProcSpec: TProcedureSpecifier): boolean;
|
||||||
|
function ProcNodeHasSpecifier(ProcNode: TCodeTreeNode;
|
||||||
|
ProcSpec: TProcedureSpecifier): boolean;
|
||||||
|
|
||||||
function FindVarNode(StartNode: TCodeTreeNode;
|
function FindVarNode(StartNode: TCodeTreeNode;
|
||||||
const UpperVarName: string): TCodeTreeNode;
|
const UpperVarName: string): TCodeTreeNode;
|
||||||
|
function FindTypeNodeOfDefinition(
|
||||||
|
DefinitionNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
|
|
||||||
function FindFirstNodeOnSameLvl(StartNode: TCodeTreeNode): TCodeTreeNode;
|
function FindFirstNodeOnSameLvl(StartNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
function FindNextNodeOnSameLvl(StartNode: TCodeTreeNode): TCodeTreeNode;
|
function FindNextNodeOnSameLvl(StartNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
|
|
||||||
function FindClassNode(StartNode: TCodeTreeNode;
|
function FindClassNode(StartNode: TCodeTreeNode;
|
||||||
const UpperClassName: string;
|
const UpperClassName: string;
|
||||||
IgnoreForwards, IgnoreNonForwards: boolean): TCodeTreeNode;
|
IgnoreForwards, IgnoreNonForwards: boolean): TCodeTreeNode;
|
||||||
function FindClassNodeInInterface(const UpperClassName: string;
|
function FindClassNodeInInterface(const UpperClassName: string;
|
||||||
IgnoreForwards, IgnoreNonForwards: boolean): TCodeTreeNode;
|
IgnoreForwards, IgnoreNonForwards: boolean): TCodeTreeNode;
|
||||||
function FindFirstIdentNodeInClass(ClassNode: TCodeTreeNode): TCodeTreeNode;
|
function FindFirstIdentNodeInClass(ClassNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
|
function ClassSectionNodeStartsWithWord(ANode: TCodeTreeNode): boolean;
|
||||||
|
|
||||||
|
function GetSourceType: TCodeTreeNodeDesc;
|
||||||
function FindInterfaceNode: TCodeTreeNode;
|
function FindInterfaceNode: TCodeTreeNode;
|
||||||
function FindImplementationNode: TCodeTreeNode;
|
function FindImplementationNode: TCodeTreeNode;
|
||||||
function FindInitializationNode: TCodeTreeNode;
|
function FindInitializationNode: TCodeTreeNode;
|
||||||
function FindMainBeginEndNode: TCodeTreeNode;
|
function FindMainBeginEndNode: TCodeTreeNode;
|
||||||
function FindTypeNodeOfDefinition(
|
|
||||||
DefinitionNode: TCodeTreeNode): TCodeTreeNode;
|
|
||||||
function GetSourceType: TCodeTreeNodeDesc;
|
|
||||||
function NodeHasParentOfType(ANode: TCodeTreeNode;
|
function NodeHasParentOfType(ANode: TCodeTreeNode;
|
||||||
NodeDesc: TCodeTreeNodeDesc): boolean;
|
NodeDesc: TCodeTreeNodeDesc): boolean;
|
||||||
function NodeIsInAMethod(Node: TCodeTreeNode): boolean;
|
function NodeIsInAMethod(Node: TCodeTreeNode): boolean;
|
||||||
function NodeIsFunction(ProcNode: TCodeTreeNode): boolean;
|
function NodeIsFunction(ProcNode: TCodeTreeNode): boolean;
|
||||||
function NodeIsPartOfTypeDefinition(ANode: TCodeTreeNode): boolean;
|
function NodeIsPartOfTypeDefinition(ANode: TCodeTreeNode): boolean;
|
||||||
function PropertyIsDefault(PropertyNode: TCodeTreeNode): boolean;
|
function PropertyIsDefault(PropertyNode: TCodeTreeNode): boolean;
|
||||||
procedure MoveCursorToFirstProcSpecifier(ProcNode: TCodeTreeNode);
|
|
||||||
function MoveCursorToProcSpecifier(ProcNode: TCodeTreeNode;
|
procedure MoveCursorToUsesEnd(UsesNode: TCodeTreeNode);
|
||||||
ProcSpec: TProcedureSpecifier): boolean;
|
procedure ReadPriorUsedUnit(var UnitNameAtom, InAtom: TAtomPosition);
|
||||||
function ProcNodeHasSpecifier(ProcNode: TCodeTreeNode;
|
|
||||||
ProcSpec: TProcedureSpecifier): boolean;
|
|
||||||
function ClassSectionNodeStartsWithWord(ANode: TCodeTreeNode): boolean;
|
|
||||||
|
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -492,21 +503,39 @@ end;
|
|||||||
|
|
||||||
procedure TPascalParserTool.BuildSubTreeForClass(ClassNode: TCodeTreeNode);
|
procedure TPascalParserTool.BuildSubTreeForClass(ClassNode: TCodeTreeNode);
|
||||||
// reparse a quick parsed class and build the child nodes
|
// reparse a quick parsed class and build the child nodes
|
||||||
|
|
||||||
|
procedure RaiseClassNodeNil;
|
||||||
|
begin
|
||||||
|
SaveRaiseException(
|
||||||
|
'TPascalParserTool.BuildSubTreeForClass: Classnode=nil');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure RaiseClassDescInvalid;
|
||||||
|
begin
|
||||||
|
SaveRaiseException('[TPascalParserTool.BuildSubTreeForClass] ClassNode.Desc='
|
||||||
|
+ClassNode.DescAsString);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure RaiseClassKeyWordExpected;
|
||||||
|
begin
|
||||||
|
SaveRaiseException(
|
||||||
|
'TPascalParserTool.BuildSubTreeForClass:'
|
||||||
|
+' class/object keyword expected, but '+GetAtom+' found');
|
||||||
|
end;
|
||||||
|
|
||||||
var OldPhase: integer;
|
var OldPhase: integer;
|
||||||
begin
|
begin
|
||||||
OldPhase:=CurrentPhase;
|
OldPhase:=CurrentPhase;
|
||||||
CurrentPhase:=CodeToolPhaseParse;
|
CurrentPhase:=CodeToolPhaseParse;
|
||||||
try
|
try
|
||||||
if ClassNode=nil then
|
if ClassNode=nil then
|
||||||
SaveRaiseException(
|
RaiseClassNodeNil;
|
||||||
'TPascalParserTool.BuildSubTreeForClass: Classnode=nil');
|
|
||||||
if (ClassNode.FirstChild<>nil)
|
if (ClassNode.FirstChild<>nil)
|
||||||
or ((ClassNode.SubDesc and ctnsNeedJITParsing)=0) then
|
or ((ClassNode.SubDesc and ctnsNeedJITParsing)=0) then
|
||||||
// class already parsed
|
// class already parsed
|
||||||
exit;
|
exit;
|
||||||
if ClassNode.Desc<>ctnClass then
|
if ClassNode.Desc<>ctnClass then
|
||||||
SaveRaiseException('[TPascalParserTool.BuildSubTreeForClass] ClassNode.Desc='
|
RaiseClassDescInvalid;
|
||||||
+ClassNode.DescAsString);
|
|
||||||
// set CursorPos after class head
|
// set CursorPos after class head
|
||||||
MoveCursorToNodeStart(ClassNode);
|
MoveCursorToNodeStart(ClassNode);
|
||||||
// parse
|
// parse
|
||||||
@ -519,9 +548,7 @@ begin
|
|||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
if UpAtomIs('PACKED') then ReadNextAtom;
|
if UpAtomIs('PACKED') then ReadNextAtom;
|
||||||
if (not UpAtomIs('CLASS')) and (not UpAtomIs('OBJECT')) then
|
if (not UpAtomIs('CLASS')) and (not UpAtomIs('OBJECT')) then
|
||||||
SaveRaiseException(
|
RaiseClassKeyWordExpected;
|
||||||
'TPascalParserTool.BuildSubTreeForClass:'
|
|
||||||
+' class/object keyword expected, but '+GetAtom+' found');
|
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
if CurPos.Flag=cafRoundBracketOpen then
|
if CurPos.Flag=cafRoundBracketOpen then
|
||||||
// read inheritage
|
// read inheritage
|
||||||
@ -3660,6 +3687,34 @@ begin
|
|||||||
Result:=UpAtomIs('DEFAULT');
|
Result:=UpAtomIs('DEFAULT');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPascalParserTool.MoveCursorToUsesEnd(UsesNode: TCodeTreeNode);
|
||||||
|
begin
|
||||||
|
if (UsesNode=nil) or (UsesNode.Desc<>ctnUsesSection) then
|
||||||
|
RaiseException('[TPascalParserTool.MoveCursorToUsesEnd] '
|
||||||
|
+'internal error: invalid UsesNode');
|
||||||
|
// search backwards through the uses section
|
||||||
|
MoveCursorToCleanPos(UsesNode.EndPos);
|
||||||
|
ReadPriorAtom; // read ';'
|
||||||
|
if not AtomIsChar(';') then
|
||||||
|
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[';',GetAtom]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPascalParserTool.ReadPriorUsedUnit(var UnitNameAtom,
|
||||||
|
InAtom: TAtomPosition);
|
||||||
|
begin
|
||||||
|
ReadPriorAtom; // read unitname
|
||||||
|
if AtomIsStringConstant then begin
|
||||||
|
InAtom:=CurPos;
|
||||||
|
ReadPriorAtom; // read 'in'
|
||||||
|
if not UpAtomIs('IN') then
|
||||||
|
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[ctsKeywordIn,GetAtom]);
|
||||||
|
ReadPriorAtom; // read unitname
|
||||||
|
end else
|
||||||
|
InAtom.StartPos:=-1;
|
||||||
|
AtomIsIdentifier(true);
|
||||||
|
UnitNameAtom:=CurPos;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TPascalParserTool.MoveCursorToFirstProcSpecifier(
|
procedure TPascalParserTool.MoveCursorToFirstProcSpecifier(
|
||||||
ProcNode: TCodeTreeNode);
|
ProcNode: TCodeTreeNode);
|
||||||
// After the call,
|
// After the call,
|
||||||
|
@ -89,6 +89,7 @@ type
|
|||||||
SourceChangeCache: TSourceChangeCache): boolean;
|
SourceChangeCache: TSourceChangeCache): boolean;
|
||||||
function FindUsedUnits(var MainUsesSection,
|
function FindUsedUnits(var MainUsesSection,
|
||||||
ImplementationUsesSection: TStrings): boolean;
|
ImplementationUsesSection: TStrings): boolean;
|
||||||
|
function UsesSectionToFilenames(UsesNode: TCodeTreeNode): TStrings;
|
||||||
|
|
||||||
// lazarus resources
|
// lazarus resources
|
||||||
function FindNextIncludeInInitialization(
|
function FindNextIncludeInInitialization(
|
||||||
@ -521,27 +522,71 @@ end;
|
|||||||
|
|
||||||
function TStandardCodeTool.FindUsedUnits(var MainUsesSection,
|
function TStandardCodeTool.FindUsedUnits(var MainUsesSection,
|
||||||
ImplementationUsesSection: TStrings): boolean;
|
ImplementationUsesSection: TStrings): boolean;
|
||||||
|
|
||||||
function UsesSectionToStrings(ANode: TCodeTreeNode): TStrings;
|
|
||||||
begin
|
|
||||||
Result:=TStringList.Create;
|
|
||||||
if ANode=nil then exit;
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
var
|
var
|
||||||
MainUsesNode, ImplementatioUsesNode: TCodeTreeNode;
|
MainUsesNode, ImplementatioUsesNode: TCodeTreeNode;
|
||||||
begin
|
begin
|
||||||
|
MainUsesSection:=nil;
|
||||||
|
ImplementationUsesSection:=nil;
|
||||||
// find the uses sections
|
// find the uses sections
|
||||||
BuildTree(false);
|
BuildTree(false);
|
||||||
MainUsesNode:=FindMainUsesSection;
|
MainUsesNode:=FindMainUsesSection;
|
||||||
ImplementatioUsesNode:=FindImplementationUsesSection;
|
ImplementatioUsesNode:=FindImplementationUsesSection;
|
||||||
// create lists
|
// create lists
|
||||||
MainUsesSection:=UsesSectionToStrings(MainUsesNode);
|
try
|
||||||
ImplementationUsesSection:=UsesSectionToStrings(ImplementatioUsesNode);
|
MainUsesSection:=UsesSectionToFilenames(MainUsesNode);
|
||||||
|
ImplementationUsesSection:=UsesSectionToFilenames(ImplementatioUsesNode);
|
||||||
|
finally
|
||||||
|
FreeAndNil(MainUsesSection);
|
||||||
|
FreeAndNil(ImplementationUsesSection);
|
||||||
|
end;
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
function TStandardCodeTool.UsesSectionToFilenames(UsesNode: TCodeTreeNode
|
||||||
|
): TStrings;
|
||||||
|
|
||||||
|
Reads the uses section backwards and tries to find each unit file
|
||||||
|
The associated objects in the list will be the found codebuffers.
|
||||||
|
If no codebuffer was found/created then the filename will be the unit name
|
||||||
|
plus the 'in' extension.
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
function TStandardCodeTool.UsesSectionToFilenames(UsesNode: TCodeTreeNode
|
||||||
|
): TStrings;
|
||||||
|
var
|
||||||
|
InAtom, UnitNameAtom: TAtomPosition;
|
||||||
|
AnUnitName, AnUnitInFilename: string;
|
||||||
|
NewCode: TCodeBuffer;
|
||||||
|
UnitFilename: string;
|
||||||
|
begin
|
||||||
|
MoveCursorToUsesEnd(UsesNode);
|
||||||
|
Result:=TStringList.Create;
|
||||||
|
repeat
|
||||||
|
// read prior unit name
|
||||||
|
ReadPriorUsedUnit(UnitNameAtom, InAtom);
|
||||||
|
AnUnitName:=GetAtom(UnitNameAtom);
|
||||||
|
if InAtom.StartPos>0 then
|
||||||
|
AnUnitInFilename:=GetAtom(InAtom)
|
||||||
|
else
|
||||||
|
AnUnitInFilename:='';
|
||||||
|
// find unit file
|
||||||
|
NewCode:=FindUnitSource(AnUnitName,AnUnitInFilename);
|
||||||
|
if (NewCode=nil) then begin
|
||||||
|
// no source found
|
||||||
|
UnitFilename:=AnUnitName;
|
||||||
|
if AnUnitInFilename<>'' then
|
||||||
|
UnitFilename:=UnitFilename+' in '+AnUnitInFilename;
|
||||||
|
end else begin
|
||||||
|
// source found
|
||||||
|
UnitFilename:=NewCode.Filename;
|
||||||
|
end;
|
||||||
|
// add filename to list
|
||||||
|
Result.AddObject(UnitFilename,NewCode);
|
||||||
|
// read keyword 'uses' or comma
|
||||||
|
ReadPriorAtom;
|
||||||
|
until not AtomIsChar(',');
|
||||||
|
end;
|
||||||
|
|
||||||
function TStandardCodeTool.FindNextIncludeInInitialization(
|
function TStandardCodeTool.FindNextIncludeInInitialization(
|
||||||
var LinkIndex: integer): TCodeBuffer;
|
var LinkIndex: integer): TCodeBuffer;
|
||||||
// LinkIndex < 0 -> search first
|
// LinkIndex < 0 -> search first
|
||||||
|
@ -297,7 +297,7 @@ procedure TUnitNode.CreateChilds;
|
|||||||
//var
|
//var
|
||||||
// UsedInterfaceFilenames, UsedImplementation: TStrings;
|
// UsedInterfaceFilenames, UsedImplementation: TStrings;
|
||||||
begin
|
begin
|
||||||
|
//CodeToolBoss.FindUsedUnits();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -121,6 +121,7 @@ type
|
|||||||
property Visible;
|
property Visible;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ Custom draw }
|
{ Custom draw }
|
||||||
|
|
||||||
TCustomDrawTarget = (dtControl, dtItem, dtSubItem);
|
TCustomDrawTarget = (dtControl, dtItem, dtSubItem);
|
||||||
@ -130,7 +131,8 @@ type
|
|||||||
TCustomDrawState = set of TCustomDrawStateFlag;
|
TCustomDrawState = set of TCustomDrawStateFlag;
|
||||||
|
|
||||||
|
|
||||||
{TListView}
|
{ TListView }
|
||||||
|
|
||||||
TListItems = class; //forward declaration!
|
TListItems = class; //forward declaration!
|
||||||
TCustomListView = class; //forward declaration!
|
TCustomListView = class; //forward declaration!
|
||||||
TSortType = (stNone, stData, stText, stBoth);
|
TSortType = (stNone, stData, stText, stBoth);
|
||||||
@ -171,7 +173,7 @@ type
|
|||||||
property ImageIndex : Integer read FImageIndex write SetImageIndex default -1;
|
property ImageIndex : Integer read FImageIndex write SetImageIndex default -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TListItems = class(TPersistent)
|
TListItems = class(TPersistent)
|
||||||
private
|
private
|
||||||
FOwner : TCustomListView;
|
FOwner : TCustomListView;
|
||||||
FItems : TList;
|
FItems : TList;
|
||||||
@ -272,7 +274,7 @@ type
|
|||||||
FScrollBars: TScrollStyle;
|
FScrollBars: TScrollStyle;
|
||||||
FScrolledLeft: integer; // horizontal scrolled pixels (hidden pixels at top)
|
FScrolledLeft: integer; // horizontal scrolled pixels (hidden pixels at top)
|
||||||
FScrolledTop: integer; // vertical scrolled pixels (hidden pixels at top)
|
FScrolledTop: integer; // vertical scrolled pixels (hidden pixels at top)
|
||||||
FSelected: TListItem; // temp copy of the selected item
|
FSelected: TListItem; // temp copy of the selected item
|
||||||
FLastHorzScrollInfo: TScrollInfo;
|
FLastHorzScrollInfo: TScrollInfo;
|
||||||
FLastVertScrollInfo: TScrollInfo;
|
FLastVertScrollInfo: TScrollInfo;
|
||||||
FUpdateCount: integer;
|
FUpdateCount: integer;
|
||||||
@ -1598,6 +1600,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.46 2002/09/14 08:38:05 lazarus
|
||||||
|
MG: added TListView notification from Vincent
|
||||||
|
|
||||||
Revision 1.45 2002/09/13 16:07:20 lazarus
|
Revision 1.45 2002/09/13 16:07:20 lazarus
|
||||||
Reverting statusbar changes.
|
Reverting statusbar changes.
|
||||||
|
|
||||||
|
@ -80,7 +80,10 @@ var
|
|||||||
begin
|
begin
|
||||||
idx := FItems.Remove(AItem);
|
idx := FItems.Remove(AItem);
|
||||||
if (idx >= 0) and (FOwner <> nil)
|
if (idx >= 0) and (FOwner <> nil)
|
||||||
then FOwner.ItemDeleted(idx);
|
then begin
|
||||||
|
if FOwner.FSelected=AItem then FOwner.FSelected:=nil;
|
||||||
|
FOwner.ItemDeleted(idx);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
@ -134,6 +137,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.12 2002/09/14 08:38:06 lazarus
|
||||||
|
MG: added TListView notification from Vincent
|
||||||
|
|
||||||
Revision 1.11 2002/05/10 06:05:53 lazarus
|
Revision 1.11 2002/05/10 06:05:53 lazarus
|
||||||
MG: changed license to LGPL
|
MG: changed license to LGPL
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ var
|
|||||||
NM: TNMListView;
|
NM: TNMListView;
|
||||||
begin
|
begin
|
||||||
EventTrace('click-column', Adata);
|
EventTrace('click-column', Adata);
|
||||||
msg.Msg := LM_NOTIFY;
|
msg.Msg := CN_NOTIFY;
|
||||||
|
|
||||||
FillChar(NM, SizeOf(NM), 0);
|
FillChar(NM, SizeOf(NM), 0);
|
||||||
NM.hdr.hwndfrom := longint(AList);
|
NM.hdr.hwndfrom := longint(AList);
|
||||||
@ -96,7 +96,7 @@ begin
|
|||||||
// Simulate move by remove and insert
|
// Simulate move by remove and insert
|
||||||
|
|
||||||
EventTrace('row-move', Adata);
|
EventTrace('row-move', Adata);
|
||||||
msg.Msg := LM_NOTIFY;
|
msg.Msg := CN_NOTIFY;
|
||||||
|
|
||||||
FillChar(NM, SizeOf(NM), 0);
|
FillChar(NM, SizeOf(NM), 0);
|
||||||
NM.hdr.hwndfrom := longint(AList);
|
NM.hdr.hwndfrom := longint(AList);
|
||||||
@ -119,7 +119,7 @@ var
|
|||||||
NM: TNMListView;
|
NM: TNMListView;
|
||||||
begin
|
begin
|
||||||
EventTrace('select-row', Adata);
|
EventTrace('select-row', Adata);
|
||||||
msg.Msg := LM_NOTIFY;
|
msg.Msg := CN_NOTIFY;
|
||||||
|
|
||||||
FillChar(NM, SizeOf(NM), 0);
|
FillChar(NM, SizeOf(NM), 0);
|
||||||
NM.hdr.hwndfrom := longint(AList);
|
NM.hdr.hwndfrom := longint(AList);
|
||||||
@ -138,7 +138,7 @@ var
|
|||||||
NM: TNMListView;
|
NM: TNMListView;
|
||||||
begin
|
begin
|
||||||
EventTrace('unselect-row', Adata);
|
EventTrace('unselect-row', Adata);
|
||||||
msg.Msg := LM_NOTIFY;
|
msg.Msg := CN_NOTIFY;
|
||||||
|
|
||||||
FillChar(NM, SizeOf(NM), 0);
|
FillChar(NM, SizeOf(NM), 0);
|
||||||
NM.hdr.hwndfrom := longint(AList);
|
NM.hdr.hwndfrom := longint(AList);
|
||||||
@ -157,7 +157,7 @@ function gtkLVToggleFocusRow(AList: PGTKCList; AData: gPointer): GBoolean; cdecl
|
|||||||
//NM: TNMListView;
|
//NM: TNMListView;
|
||||||
begin
|
begin
|
||||||
EventTrace('toggle-focus-row', Adata);
|
EventTrace('toggle-focus-row', Adata);
|
||||||
//msg.Msg := LM_NOTIFY;
|
//msg.Msg := CN_NOTIFY;
|
||||||
(*
|
(*
|
||||||
TODO:
|
TODO:
|
||||||
Do we need this?
|
Do we need this?
|
||||||
@ -173,8 +173,8 @@ var
|
|||||||
n: Integer;
|
n: Integer;
|
||||||
begin
|
begin
|
||||||
EventTrace('select-all', Adata);
|
EventTrace('select-all', Adata);
|
||||||
msg.Msg := LM_NOTIFY;
|
msg.Msg := CN_NOTIFY;
|
||||||
|
|
||||||
ListView := TObject(AData) as TListView;
|
ListView := TObject(AData) as TListView;
|
||||||
|
|
||||||
FillChar(NM, SizeOf(NM), 0);
|
FillChar(NM, SizeOf(NM), 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user