From a144943e7b5537071f04e04b026529b4442a1a10 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 22 Jun 2012 14:01:56 +0000 Subject: [PATCH] DBG: Event-Log: Do not cache Options. Allow user to change options while debugging git-svn-id: trunk@37722 - --- debugger/debugeventsform.pp | 43 +++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/debugger/debugeventsform.pp b/debugger/debugeventsform.pp index c3712e9756..77120edf25 100644 --- a/debugger/debugeventsform.pp +++ b/debugger/debugeventsform.pp @@ -66,10 +66,12 @@ type procedure tvFilteredEventsAdvancedCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage; var PaintImages, DefaultDraw: Boolean); + private + function GetFilter: TDBGEventCategories; private FEvents: TStringList; - FFilter: TDBGEventCategories; procedure UpdateFilteredList; + property Filter: TDBGEventCategories read GetFilter; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -124,6 +126,25 @@ begin Sender.Canvas.TextOut(TextRect.Left, TextY, Node.Text); end; +function TDbgEventsForm.GetFilter: TDBGEventCategories; +begin + Result := []; + if EnvironmentOptions.DebuggerEventLogShowBreakpoint then + Include(Result, ecBreakpoint); + if EnvironmentOptions.DebuggerEventLogShowProcess then + Include(Result, ecProcess); + if EnvironmentOptions.DebuggerEventLogShowThread then + Include(Result, ecThread); + if EnvironmentOptions.DebuggerEventLogShowModule then + Include(Result, ecModule); + if EnvironmentOptions.DebuggerEventLogShowOutput then + Include(Result, ecOutput); + if EnvironmentOptions.DebuggerEventLogShowWindows then + Include(Result, ecWindows); + if EnvironmentOptions.DebuggerEventLogShowDebugger then + Include(Result, ecDebugger); +end; + procedure TDbgEventsForm.EditCopy1Execute(Sender: TObject); begin Clipboard.Open; @@ -204,7 +225,7 @@ begin Rec.Ptr := FEvents.Objects[i]; Cat := TDBGEventCategory(Rec.Category); - if Cat in FFilter then + if Cat in Filter then begin Item := tvFilteredEvents.Items.AddChild(nil, FEvents[i]); Item.Data := FEvents.Objects[i]; @@ -233,22 +254,6 @@ begin else FEvents.Clear; - FFilter := []; - if EnvironmentOptions.DebuggerEventLogShowBreakpoint then - Include(FFilter, ecBreakpoint); - if EnvironmentOptions.DebuggerEventLogShowProcess then - Include(FFilter, ecProcess); - if EnvironmentOptions.DebuggerEventLogShowThread then - Include(FFilter, ecThread); - if EnvironmentOptions.DebuggerEventLogShowModule then - Include(FFilter, ecModule); - if EnvironmentOptions.DebuggerEventLogShowOutput then - Include(FFilter, ecOutput); - if EnvironmentOptions.DebuggerEventLogShowWindows then - Include(FFilter, ecWindows); - if EnvironmentOptions.DebuggerEventLogShowDebugger then - Include(FFilter, ecDebugger); - UpdateFilteredList; end; @@ -300,7 +305,7 @@ begin Rec.Category := Ord(ACategory); Rec.EventType := Ord(AEventType); FEvents.AddObject(AText, TObject(Rec.Ptr)); - if ACategory in FFilter then + if ACategory in Filter then begin Item := tvFilteredEvents.Items.AddChild(nil, AText); Item.ImageIndex := Rec.Category;