ide: rename "Debug Events" to "Event Log", simplify Event log form - remove checkgroup - this options can be set in the options dialog, workaround listview column autosize

git-svn-id: trunk@24775 -
This commit is contained in:
paul 2010-04-21 01:39:50 +00:00
parent ffee9b5bd4
commit 7693e5163a
6 changed files with 40 additions and 96 deletions

View File

@ -1,62 +1,28 @@
inherited DbgEventsForm: TDbgEventsForm
Left = 514
Height = 348
Top = 228
Height = 208
Top = 368
Width = 577
ActiveControl = ckgFilter.CheckBox0
ClientHeight = 348
ClientHeight = 208
ClientWidth = 577
object ckgFilter: TCheckGroup[0]
object lstFilteredEvents: TListView[0]
Left = 0
Height = 48
Height = 208
Top = 0
Width = 577
Align = alTop
AutoFill = True
AutoSize = True
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 1
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclTopToBottomThenLeftToRight
ChildSizing.ControlsPerLine = 2
Color = clForm
ColumnLayout = clVerticalThenHorizontal
Columns = 4
Items.Strings = (
'Breakpoint'
'Process'
'Thread'
'Module'
'Output'
'Window'
'Debugger'
)
OnItemClick = ckgFilterItemClick
ParentColor = False
TabOrder = 0
Data = {
0700000002020202020202
}
end
object lstFilteredEvents: TListView[1]
Left = 0
Height = 300
Top = 48
Width = 577
Align = alClient
Columns = <
item
Width = 100
end>
ItemIndex = -1
ShowColumnHeaders = False
SmallImages = imlMain
TabOrder = 1
TabOrder = 0
ViewStyle = vsReport
OnResize = lstFilteredEventsResize
end
object imlMain: TImageList[2]
object imlMain: TImageList[1]
left = 199
top = 232
Bitmap = {

View File

@ -37,15 +37,12 @@ uses
Debugger, DebuggerDlg, LazarusIDEStrConsts, EnvironmentOpts;
type
TDBGEventCategories = set of TDBGEventCategory;
{ TDbgEventsForm }
TDbgEventsForm = class(TDebuggerDlg)
ckgFilter: TCheckGroup;
imlMain: TImageList;
lstFilteredEvents: TListView;
procedure ckgFilterItemClick(Sender: TObject; Index: integer);
procedure lstFilteredEventsResize(Sender: TObject);
private
FEvents: TStringList;
FFilter: TDBGEventCategories;
@ -53,8 +50,8 @@ type
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure SetEvents(const AEvents: TStrings; const AFilter: TDBGEventCategories);
procedure GetEvents(const AResultEvents: TStrings; var AResultFilter: TDBGEventCategories);
procedure SetEvents(const AEvents: TStrings);
procedure GetEvents(const AResultEvents: TStrings);
procedure Clear;
procedure AddEvent(const ACategory: TDBGEventCategory; const AText: String);
end;
@ -65,13 +62,10 @@ implementation
{ TDbgEventsForm }
procedure TDbgEventsForm.ckgFilterItemClick(Sender: TObject; Index: integer);
procedure TDbgEventsForm.lstFilteredEventsResize(Sender: TObject);
begin
if ckgFilter.Checked[Index] then
Include(FFilter, TDBGEventCategory(Index))
else
Exclude(FFilter, TDBGEventCategory(Index));
UpdateFilteredList;
// workaround: ListColumn.AutoSize does not work properly
lstFilteredEvents.Column[0].Width := lstFilteredEvents.ClientWidth;
end;
procedure TDbgEventsForm.UpdateFilteredList;
@ -116,25 +110,35 @@ begin
lstFilteredEvents.Items[lstFilteredEvents.Items.Count -1].MakeVisible(False);
end;
procedure TDbgEventsForm.SetEvents(const AEvents: TStrings; const AFilter: TDBGEventCategories);
var
i: TDBGEventCategory;
procedure TDbgEventsForm.SetEvents(const AEvents: TStrings);
begin
if AEvents <> nil then
FEvents.Assign(AEvents)
else
FEvents.Clear;
FFilter := AFilter;
for i := Low(TDBGEventCategory) to High(TDBGEventCategory) do
ckgFilter.Checked[Ord(i)] := i in FFilter;
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.DebuggerEventLogShowWindow then
Include(FFilter, ecWindow);
if EnvironmentOptions.DebuggerEventLogShowDebugger then
Include(FFilter, ecDebugger);
UpdateFilteredList;
end;
procedure TDbgEventsForm.GetEvents(const AResultEvents: TStrings;
var AResultFilter: TDBGEventCategories);
procedure TDbgEventsForm.GetEvents(const AResultEvents: TStrings);
begin
AResultEvents.Assign(FEvents);
AResultFilter := FFilter;
end;
procedure TDbgEventsForm.Clear;
@ -148,14 +152,6 @@ begin
inherited Create(AOwner);
Caption := lisMenuViewDebugEvents;
FEvents := TStringList.Create;
ckgFilter.Items.Clear;
ckgFilter.Items.Add(lisDebugOptionsFrmBreakpoint);
ckgFilter.Items.Add(lisDebugOptionsFrmProcess);
ckgFilter.Items.Add(lisDebugOptionsFrmThread);
ckgFilter.Items.Add(lisDebugOptionsFrmModule);
ckgFilter.Items.Add(lisDebugOptionsFrmOutput);
ckgFilter.Items.Add(lisDebugOptionsFrmWindow);
ckgFilter.Items.Add(lisDebugOptionsFrmDebugger);
end;
destructor TDbgEventsForm.Destroy;

View File

@ -1231,6 +1231,7 @@ type
ecOutput, // DebugOutput calls
ecWindow,
ecDebugger); // debugger errors and warnings
TDBGEventCategories = set of TDBGEventCategory;
TDBGEventNotify = procedure(Sender: TObject; const ACategory: TDBGEventCategory;
const AText: String) of object;

View File

@ -111,9 +111,6 @@ type
// here are all choices stored
FUserSourceFiles: TStringList;
// Filter events that are show in the event log
FEventsFilter: set of TDBGEventCategory;
// when the debug output log is not open, store the debug log internally
FHiddenDebugOutputLog: TStringList;
FHiddenDebugEventsLog: TStringList;
@ -1742,7 +1739,7 @@ begin
begin
if FHiddenDebugEventsLog=nil then
FHiddenDebugEventsLog:=TStringList.Create;
TDbgEventsForm(FDialogs[ddtEvents]).GetEvents(FHiddenDebugEventsLog, FEventsFilter);
TDbgEventsForm(FDialogs[ddtEvents]).GetEvents(FHiddenDebugEventsLog);
end;
end;
FDialogs[DlgType]:=nil;
@ -1818,7 +1815,7 @@ var
TheDialog: TDbgEventsForm;
begin
TheDialog := TDbgEventsForm(FDialogs[ddtEvents]);
TheDialog.SetEvents(FHiddenDebugEventsLog, FEventsFilter);
TheDialog.SetEvents(FHiddenDebugEventsLog);
if FHiddenDebugEventsLog <> nil then
FreeAndNil(FHiddenDebugEventsLog);
end;
@ -1923,22 +1920,6 @@ begin
FRunTimer.Interval := 1;
FRunTimer.OnTimer := @OnRunTimer;
FEventsFilter := [];
if EnvironmentOptions.DebuggerEventLogShowBreakpoint then
Include(FEventsFilter, ecBreakpoint);
if EnvironmentOptions.DebuggerEventLogShowProcess then
Include(FEventsFilter, ecProcess);
if EnvironmentOptions.DebuggerEventLogShowThread then
Include(FEventsFilter, ecThread);
if EnvironmentOptions.DebuggerEventLogShowModule then
Include(FEventsFilter, ecModule);
if EnvironmentOptions.DebuggerEventLogShowOutput then
Include(FEventsFilter, ecOutput);
if EnvironmentOptions.DebuggerEventLogShowWindow then
Include(FEventsFilter, ecWindow);
if EnvironmentOptions.DebuggerEventLogShowDebugger then
Include(FEventsFilter, ecDebugger);
inherited Create(TheOwner);
end;

View File

@ -2773,7 +2773,7 @@ begin
ecToggleRegisters);
AddDefault(C, 'Toggle view Assembler', lisKMToggleViewAssembler,
ecToggleAssembler);
AddDefault(C, 'Toggle view Debug Events', lisKMToggleViewDebugEvents, ecToggleDebugEvents);
AddDefault(C, 'Toggle view Event Log', lisKMToggleViewDebugEvents, ecToggleDebugEvents);
AddDefault(C, 'Toggle view Debugger Output', lisKMToggleViewDebuggerOutput,
ecToggleDebuggerOut);
AddDefault(C, 'View Units', lisHintViewUnits, ecViewUnits);

View File

@ -301,7 +301,7 @@ resourcestring
lisMenuViewCallStack = 'Call Stack';
lisMenuViewAssembler = 'Assembler';
lisMenuViewDebugOutput = 'Debug output';
lisMenuViewDebugEvents = 'Debug events';
lisMenuViewDebugEvents = 'Event Log';
lisMenuIDEInternals = 'IDE internals';
lisMenuPackageLinks = 'Package links ...';
@ -2515,7 +2515,7 @@ resourcestring
lisKMToggleViewCallStack = 'Toggle view Call Stack';
lisKMToggleViewRegisters = 'Toggle view Registers';
lisKMToggleViewAssembler = 'Toggle view Assembler';
lisKMToggleViewDebugEvents = 'Toggle view Debug Events';
lisKMToggleViewDebugEvents = 'Toggle view Debuger Event Log';
lisKMToggleViewDebuggerOutput = 'Toggle view Debugger Output';
srkmCatProjectMenu = 'Project menu commands';
lisKMNewProject = 'New project';