DBG: Event-Log: Do not cache Options. Allow user to change options while debugging

git-svn-id: trunk@37722 -
This commit is contained in:
martin 2012-06-22 14:01:56 +00:00
parent f274a81bb1
commit a144943e7b

View File

@ -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;