lcl: TTreeView fixes by Anton Kavalenka

- call OnGetImageIndex, OnGetSelectedIndex when we need them,
  - don't start text editing when we click on icon
(issue #0013325)

git-svn-id: trunk@18990 -
This commit is contained in:
paul 2009-03-14 16:01:51 +00:00
parent 918eaf1a50
commit af8f77fb82

View File

@ -4447,11 +4447,17 @@ begin
if (Images<>nil) and PaintImages then
begin
if FSelectedNode <> Node then
begin
GetImageIndex(Node);
ImgIndex := Node.ImageIndex
end
else
begin
GetSelectedIndex(Node);
ImgIndex := Node.SelectedIndex;
end;
if (ImgIndex >= 0) and (ImgIndex < Images.Count) then
Images.Draw(Canvas,x+1,NodeRect.Top,ImgIndex,true);
Images.Draw(Canvas, x + 1, NodeRect.Top, ImgIndex, True);
inc(x, Images.Width + 2);
end;
@ -4661,7 +4667,7 @@ begin
and (LogicalX<CursorNode.DisplayExpandSignRight) then begin
// mousedown occured on expand sign -> expand/collapse
CursorNode.Expanded:=not CursorNode.Expanded;
end else if LogicalX>=CursorNode.DisplayIconLeft then begin
end else if LogicalX>=CursorNode.DisplayTextLeft then begin
// mousedown occured in text or icon
// -> select node and begin drag operation
{$IFDEF VerboseDrag}