SynEdit: ensure primary selection is acquired (only focused or explicit user action)

git-svn-id: trunk@34619 -
This commit is contained in:
martin 2012-01-06 13:40:34 +00:00
parent f10bff7b73
commit 38d0f983df

View File

@ -2597,6 +2597,7 @@ begin
FreeMem(Data); FreeMem(Data);
end; end;
UpdateCursor; UpdateCursor;
SelAvailChange(nil);
//DebugLn('[TCustomSynEdit.KeyDown] END ',dbgs(Key),' ',dbgs(Shift)); //DebugLn('[TCustomSynEdit.KeyDown] END ',dbgs(Key),' ',dbgs(Shift));
end; end;
@ -3063,6 +3064,7 @@ begin
inherited MouseDown(Button, Shift, X, Y); inherited MouseDown(Button, Shift, X, Y);
LCLIntf.SetFocus(Handle); LCLIntf.SetFocus(Handle);
UpdateCaret; UpdateCaret;
SelAvailChange(nil);
//debugln('TCustomSynEdit.MouseDown END sfWaitForDragging=',dbgs(sfWaitForDragging in fStateFlags),' '); //debugln('TCustomSynEdit.MouseDown END sfWaitForDragging=',dbgs(sfWaitForDragging in fStateFlags),' ');
end; end;
@ -3293,6 +3295,7 @@ begin
PopupMenu.PopupComponent:=self; PopupMenu.PopupComponent:=self;
PopupMenu.PopUp; PopupMenu.PopUp;
end; end;
SelAvailChange(nil);
//DebugLn('TCustomSynEdit.MouseUp END Mouse=',X,',',Y,' Caret=',CaretX,',',CaretY,', BlockBegin=',BlockBegin.X,',',BlockBegin.Y,' BlockEnd=',BlockEnd.X,',',BlockEnd.Y); //DebugLn('TCustomSynEdit.MouseUp END Mouse=',X,',',Y,' Caret=',CaretX,',',CaretY,', BlockBegin=',BlockBegin.X,',',BlockBegin.Y,' BlockEnd=',BlockEnd.X,',',BlockEnd.Y);
end; end;
@ -3662,7 +3665,7 @@ end;
procedure TCustomSynEdit.DoBlockSelectionChanged(Sender : TObject); procedure TCustomSynEdit.DoBlockSelectionChanged(Sender : TObject);
begin begin
StatusChanged([scSelection]); StatusChanged([scSelection]);
//if HandleAllocated and Focused then if HandleAllocated and Focused then
SelAvailChange(nil); SelAvailChange(nil);
end; end;