LCL: added treeview option to disable expanding on double clicking a tree node.

git-svn-id: trunk@10408 -
This commit is contained in:
vincents 2007-01-09 10:41:00 +00:00
parent d40c271e2f
commit 0780f4b56b
3 changed files with 6 additions and 2 deletions

View File

@ -2025,7 +2025,8 @@ type
tvoShowLines,
tvoShowRoot,
tvoShowSeparators,
tvoToolTips
tvoToolTips,
tvoNoDoubleClickExpand
);
TTreeViewOptions = set of TTreeViewOption;

View File

@ -32,6 +32,8 @@ procedure TListColumns.BeginUpdate;
begin
{$IFNDEF VER2_0}
inherited;
// if 2.0 is not supported anymore, maybe FUpdateCount can be removed and
// the Changed notification can be used.
{$ENDIF}
inc(FUpdateCount);
end;

View File

@ -4267,7 +4267,8 @@ begin
Include(fStates,tvsWaitForDragging);
end;
end else
if (ssDouble in Shift) and (Button = mbLeft) and (CursorNode<>nil) then
if not (tvoNoDoubleClickExpand in Options) and (ssDouble in Shift)
and (Button = mbLeft) and (CursorNode<>nil) then
CursorNode.Expanded := not CursorNode.Expanded;
end;