mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 07:29:21 +02:00
ide: use TDBGEventCategory enumeration instead of own
git-svn-id: trunk@24772 -
This commit is contained in:
parent
c9f5fd7573
commit
f10f9aec82
@ -26,18 +26,9 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, Forms, StdCtrls, Spin, CheckLst,
|
Classes, SysUtils, FileUtil, Forms, StdCtrls, Spin, CheckLst,
|
||||||
LazarusIDEStrConsts, IDEOptionsIntf, EnvironmentOpts;
|
Debugger, LazarusIDEStrConsts, IDEOptionsIntf, EnvironmentOpts;
|
||||||
|
|
||||||
type
|
type
|
||||||
TEventLogEvent = (
|
|
||||||
eeBreakpoint,
|
|
||||||
eeProcess,
|
|
||||||
eeThread,
|
|
||||||
eeModule,
|
|
||||||
eeOutput,
|
|
||||||
eeWindow,
|
|
||||||
eeDebugger
|
|
||||||
);
|
|
||||||
{ TDebuggerEventLogOptionsFrame }
|
{ TDebuggerEventLogOptionsFrame }
|
||||||
|
|
||||||
TDebuggerEventLogOptionsFrame = class(TAbstractIDEOptionsEditor)
|
TDebuggerEventLogOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||||
@ -49,7 +40,7 @@ type
|
|||||||
gbColors: TGroupBox;
|
gbColors: TGroupBox;
|
||||||
seLimitLinecount: TSpinEdit;
|
seLimitLinecount: TSpinEdit;
|
||||||
private
|
private
|
||||||
class function GetEventStr(AEvent: TEventLogEvent): String;
|
class function GetCategoryStr(ACategory: TDBGEventCategory): String;
|
||||||
public
|
public
|
||||||
function GetTitle: String; override;
|
function GetTitle: String; override;
|
||||||
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
|
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
|
||||||
@ -64,16 +55,16 @@ implementation
|
|||||||
|
|
||||||
{ TDebuggerEventLogOptionsFrame }
|
{ TDebuggerEventLogOptionsFrame }
|
||||||
|
|
||||||
class function TDebuggerEventLogOptionsFrame.GetEventStr(AEvent: TEventLogEvent): String;
|
class function TDebuggerEventLogOptionsFrame.GetCategoryStr(ACategory: TDBGEventCategory): String;
|
||||||
begin
|
begin
|
||||||
case AEvent of
|
case ACategory of
|
||||||
eeBreakpoint: Result := lisDebugOptionsFrmBreakpoint;
|
ecBreakpoint: Result := lisDebugOptionsFrmBreakpoint;
|
||||||
eeProcess: Result := lisDebugOptionsFrmProcess;
|
ecProcess: Result := lisDebugOptionsFrmProcess;
|
||||||
eeThread: Result := lisDebugOptionsFrmThread;
|
ecThread: Result := lisDebugOptionsFrmThread;
|
||||||
eeModule: Result := lisDebugOptionsFrmModule;
|
ecModule: Result := lisDebugOptionsFrmModule;
|
||||||
eeOutput: Result := lisDebugOptionsFrmOutput;
|
ecOutput: Result := lisDebugOptionsFrmOutput;
|
||||||
eeWindow: Result := lisDebugOptionsFrmWindow;
|
ecWindow: Result := lisDebugOptionsFrmWindow;
|
||||||
eeDebugger: Result := lisDebugOptionsFrmDebugger;
|
ecDebugger: Result := lisDebugOptionsFrmDebugger;
|
||||||
else
|
else
|
||||||
Result := '???';
|
Result := '???';
|
||||||
end;
|
end;
|
||||||
@ -86,7 +77,7 @@ end;
|
|||||||
|
|
||||||
procedure TDebuggerEventLogOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
procedure TDebuggerEventLogOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
||||||
var
|
var
|
||||||
Event: TEventLogEvent;
|
Category: TDBGEventCategory;
|
||||||
begin
|
begin
|
||||||
// general
|
// general
|
||||||
gbGeneral.Caption := lisMenuInsertGeneral;
|
gbGeneral.Caption := lisMenuInsertGeneral;
|
||||||
@ -95,8 +86,8 @@ begin
|
|||||||
|
|
||||||
// messages
|
// messages
|
||||||
gbMessages.Caption := lisMenuViewMessages;
|
gbMessages.Caption := lisMenuViewMessages;
|
||||||
for Event := Low(TEventLogEvent) to High(TEventLogEvent) do
|
for Category := Low(TDBGEventCategory) to High(TDBGEventCategory) do
|
||||||
cbMessages.Items.Add(GetEventStr(Event));
|
cbMessages.Items.Add(GetCategoryStr(Category));
|
||||||
|
|
||||||
// colors
|
// colors
|
||||||
gbColors.Caption := dlgEnvColors;
|
gbColors.Caption := dlgEnvColors;
|
||||||
@ -105,9 +96,9 @@ end;
|
|||||||
|
|
||||||
procedure TDebuggerEventLogOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
procedure TDebuggerEventLogOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||||
|
|
||||||
procedure SetChecked(AEvent: TEventLogEvent; AChecked: Boolean); inline;
|
procedure SetChecked(ACategory: TDBGEventCategory; AChecked: Boolean); inline;
|
||||||
begin
|
begin
|
||||||
cbMessages.Checked[Ord(AEvent)] := AChecked;
|
cbMessages.Checked[Ord(ACategory)] := AChecked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -116,21 +107,21 @@ begin
|
|||||||
chkClearLogOnRun.Checked := DebuggerEventLogClearOnRun;
|
chkClearLogOnRun.Checked := DebuggerEventLogClearOnRun;
|
||||||
chkLimitLinecount.Checked := DebuggerEventLogCheckLineLimit;
|
chkLimitLinecount.Checked := DebuggerEventLogCheckLineLimit;
|
||||||
seLimitLinecount.Value := DebuggerEventLogLineLimit;
|
seLimitLinecount.Value := DebuggerEventLogLineLimit;
|
||||||
SetChecked(eeBreakpoint, DebuggerEventLogShowBreakpoint);
|
SetChecked(ecBreakpoint, DebuggerEventLogShowBreakpoint);
|
||||||
SetChecked(eeProcess, DebuggerEventLogShowProcess);
|
SetChecked(ecProcess, DebuggerEventLogShowProcess);
|
||||||
SetChecked(eeThread, DebuggerEventLogShowThread);
|
SetChecked(ecThread, DebuggerEventLogShowThread);
|
||||||
SetChecked(eeModule, DebuggerEventLogShowModule);
|
SetChecked(ecModule, DebuggerEventLogShowModule);
|
||||||
SetChecked(eeOutput, DebuggerEventLogShowOutput);
|
SetChecked(ecOutput, DebuggerEventLogShowOutput);
|
||||||
SetChecked(eeWindow, DebuggerEventLogShowWindow);
|
SetChecked(ecWindow, DebuggerEventLogShowWindow);
|
||||||
SetChecked(eeDebugger, DebuggerEventLogShowDebugger);
|
SetChecked(ecDebugger, DebuggerEventLogShowDebugger);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDebuggerEventLogOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
procedure TDebuggerEventLogOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||||
|
|
||||||
function GetChecked(AEvent: TEventLogEvent): Boolean; inline;
|
function GetChecked(ACategory: TDBGEventCategory): Boolean; inline;
|
||||||
begin
|
begin
|
||||||
Result := cbMessages.Checked[Ord(AEvent)];
|
Result := cbMessages.Checked[Ord(ACategory)];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -139,13 +130,13 @@ begin
|
|||||||
DebuggerEventLogClearOnRun := chkClearLogOnRun.Checked;
|
DebuggerEventLogClearOnRun := chkClearLogOnRun.Checked;
|
||||||
DebuggerEventLogCheckLineLimit := chkLimitLinecount.Checked;
|
DebuggerEventLogCheckLineLimit := chkLimitLinecount.Checked;
|
||||||
DebuggerEventLogLineLimit := seLimitLinecount.Value;
|
DebuggerEventLogLineLimit := seLimitLinecount.Value;
|
||||||
DebuggerEventLogShowBreakpoint := GetChecked(eeBreakpoint);
|
DebuggerEventLogShowBreakpoint := GetChecked(ecBreakpoint);
|
||||||
DebuggerEventLogShowProcess := GetChecked(eeProcess);
|
DebuggerEventLogShowProcess := GetChecked(ecProcess);
|
||||||
DebuggerEventLogShowThread := GetChecked(eeThread);
|
DebuggerEventLogShowThread := GetChecked(ecThread);
|
||||||
DebuggerEventLogShowModule := GetChecked(eeModule);
|
DebuggerEventLogShowModule := GetChecked(ecModule);
|
||||||
DebuggerEventLogShowOutput := GetChecked(eeOutput);
|
DebuggerEventLogShowOutput := GetChecked(ecOutput);
|
||||||
DebuggerEventLogShowWindow := GetChecked(eeWindow);
|
DebuggerEventLogShowWindow := GetChecked(ecWindow);
|
||||||
DebuggerEventLogShowDebugger := GetChecked(eeDebugger);
|
DebuggerEventLogShowDebugger := GetChecked(ecDebugger);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user