* Fix: Selection is not cleared when focus change is not allowed

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@260 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2007-09-06 17:41:35 +00:00
parent 2a100b7b09
commit c3bc3cc808

View File

@ -20931,6 +20931,8 @@ var
NewCheckState: TCheckState; NewCheckState: TCheckState;
AltPressed: Boolean; // Pressing the Alt key enables special processing for selection. AltPressed: Boolean; // Pressing the Alt key enables special processing for selection.
FullRowDrag: Boolean; // Start dragging anywhere within a node's bound. FullRowDrag: Boolean; // Start dragging anywhere within a node's bound.
//LCL
FocusCanChange: Boolean; // Focus changing is allowed
begin begin
if [tsWheelPanning, tsWheelScrolling] * FStates <> [] then if [tsWheelPanning, tsWheelScrolling] * FStates <> [] then
@ -21049,8 +21051,12 @@ begin
with HitInfo, Message do with HitInfo, Message do
CanClear := not AutoDrag and CanClear := not AutoDrag and
(not (tsRightButtonDown in FStates) or not HasPopupMenu(HitNode, HitColumn, Point(XPos, YPos))); (not (tsRightButtonDown in FStates) or not HasPopupMenu(HitNode, HitColumn, Point(XPos, YPos)));
if (not (IsAnyHit or FullRowDrag) and MultiSelect and ShiftEmpty) or
(IsAnyHit and (not NodeSelected or (NodeSelected and CanClear)) and (ShiftEmpty or not MultiSelect)) then //lcl
FocusCanChange := DoFocusChanging(FFocusedNode, HitInfo.HitNode, FFocusedColumn, Column);
if FocusCanChange and ((not (IsAnyHit or FullRowDrag) and MultiSelect and ShiftEmpty) or
(IsAnyHit and (not NodeSelected or (NodeSelected and CanClear)) and (ShiftEmpty or not MultiSelect))) then
begin begin
Assert(not (tsClearPending in FStates), 'Pending and direct clearance are mutual exclusive!'); Assert(not (tsClearPending in FStates), 'Pending and direct clearance are mutual exclusive!');
@ -21096,8 +21102,7 @@ begin
FLastClickPos := Point(Message.XPos, Message.YPos); FLastClickPos := Point(Message.XPos, Message.YPos);
// Handle selection and node focus change. // Handle selection and node focus change.
if (IsHit or IsCellHit) and if IsAnyHit and FocusCanChange then
DoFocusChanging(FFocusedNode, HitInfo.HitNode, FFocusedColumn, Column) then
begin begin
if NewColumn then if NewColumn then
begin begin