mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-11 12:30:00 +01:00
reduced message window selection events
git-svn-id: trunk@7985 -
This commit is contained in:
parent
adcfb30dbe
commit
e4c6c02a98
@ -105,8 +105,10 @@ type
|
||||
function GetMessage: string;
|
||||
function GetVisibleItems(Index: integer): TMessageLine;
|
||||
procedure SetLastLineIsProgress(const AValue: boolean);
|
||||
procedure DoSelectionChange;
|
||||
protected
|
||||
fBlockCount: integer;
|
||||
FLastSelectedIndex: integer;
|
||||
function GetSelectedLineIndex: integer;
|
||||
procedure SetSelectedLineIndex(const AValue: integer);
|
||||
public
|
||||
@ -186,6 +188,7 @@ begin
|
||||
Name := NonModalIDEWindowNames[nmiwMessagesViewName];
|
||||
FItems := TList.Create;
|
||||
FVisibleItems := TList.Create;
|
||||
FLastSelectedIndex := -1;
|
||||
|
||||
Caption := lisMenuViewMessages;
|
||||
|
||||
@ -443,9 +446,7 @@ procedure TMessagesView.MessageViewDblClicked(Sender: TObject);
|
||||
begin
|
||||
if not EnvironmentOptions.MsgViewDblClickJumps then
|
||||
exit;
|
||||
if (MessageView.Items.Count > 0) and (MessageView.SelCount > 0) then
|
||||
if Assigned(OnSelectionChanged) then
|
||||
OnSelectionChanged(self);
|
||||
DoSelectionChange;
|
||||
end;
|
||||
|
||||
procedure TMessagesView.CopyAllMenuItemClick(Sender: TObject);
|
||||
@ -469,9 +470,7 @@ procedure TMessagesView.MessageViewClicked(Sender: TObject);
|
||||
begin
|
||||
if EnvironmentOptions.MsgViewDblClickJumps then
|
||||
exit;
|
||||
if (MessageView.Items.Count > 0) and (MessageView.SelCount > 0) then
|
||||
if Assigned(OnSelectionChanged) then
|
||||
OnSelectionChanged(self);
|
||||
DoSelectionChange;
|
||||
end;
|
||||
|
||||
procedure TMessagesView.MessagesViewKeyDown(Sender: TObject; var Key: word;
|
||||
@ -542,6 +541,20 @@ begin
|
||||
FLastLineIsProgress := AValue;
|
||||
end;
|
||||
|
||||
procedure TMessagesView.DoSelectionChange;
|
||||
var
|
||||
NewSelectedIndex: LongInt;
|
||||
begin
|
||||
if (MessageView.Items.Count > 0) and (MessageView.SelCount > 0) then begin
|
||||
NewSelectedIndex:=GetSelectedLineIndex;
|
||||
if NewSelectedIndex<>FLastSelectedIndex then begin
|
||||
FLastSelectedIndex:=NewSelectedIndex;
|
||||
if Assigned(OnSelectionChanged) then
|
||||
OnSelectionChanged(Self);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMessagesView.SetSelectedLineIndex(const AValue: integer);
|
||||
begin
|
||||
MessageView.ItemIndex := AValue;
|
||||
|
||||
@ -847,9 +847,11 @@ begin
|
||||
and FActiveControl.Visible and FActiveControl.Enabled
|
||||
and ([csLoading,csDestroying]*ComponentState=[])
|
||||
and not FActiveControl.ParentDestroyingHandle
|
||||
then
|
||||
then begin
|
||||
// get or create handle of FActiveControl
|
||||
FocusHandle := FActiveControl.Handle;
|
||||
//debugln('TCustomForm.WndProc A ',DbgSName(Self),' FActiveControl=',DbgSName(FActiveControl),' FocusHandle=',dbgs(FocusHandle));
|
||||
end;
|
||||
end;
|
||||
|
||||
TheMessage.Result:=0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user