From e1ba27ef0954e5a82e2f30157ab6adf3d3090c2d Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 27 Dec 2002 10:23:40 +0000 Subject: [PATCH] implemented TListBox.TopIndex git-svn-id: trunk@3739 - --- components/codetools/finddeclarationtool.pas | 18 ++++++++++++++---- lcl/include/customlistbox.inc | 4 ++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 5767ff8da4..1e52355855 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -5566,11 +5566,21 @@ begin xtContext: begin - Params.Flags:=[fdfSearchInParentNodes,fdfSearchInAncestors, - fdfTopLvlResolving,fdfFunctionResult] - +fdfAllClassVisibilities; - FindContext:=ExprType.Context.Tool.FindBaseTypeOfNode(Params, + FindContext:=ExprType.Context; + if not (FindContext.Node.Desc in AllIdentifierDefinitions) then + begin + if (FindContext.Node.Parent<>nil) + and (FindContext.Node.Parent.Desc in AllIdentifierDefinitions) then + begin + FindContext.Node:=FindContext.Node.Parent; + end else begin + Params.Flags:=[fdfSearchInParentNodes,fdfSearchInAncestors, + fdfTopLvlResolving,fdfFunctionResult] + +fdfAllClassVisibilities; + FindContext:=ExprType.Context.Tool.FindBaseTypeOfNode(Params, ExprType.Context.Node); + end; + end; // ToDo: PPU, PPW, DCU diff --git a/lcl/include/customlistbox.inc b/lcl/include/customlistbox.inc index 27065c1bdd..e88e6563c2 100644 --- a/lcl/include/customlistbox.inc +++ b/lcl/include/customlistbox.inc @@ -130,7 +130,7 @@ end; function TCustomListBox.GetTopIndex: Integer; begin if HandleAllocated then - FTopIndex:=SendMessage(Handle, LB_GETTOPINDEX, 0, 0); + FTopIndex:=CNSendMessage(LB_GETTOPINDEX, Self, nil); Result := FTopIndex; end; @@ -142,7 +142,7 @@ begin if FTopIndex=AValue then exit; FTopIndex:=AValue; if HandleAllocated then - SendMessage(Handle, LB_SETTOPINDEX, FTopIndex, 0); + CNSendMessage(LB_SETTOPINDEX, Self, Pointer(FTopIndex)); end; {------------------------------------------------------------------------------