started loading/saving breakpoints

git-svn-id: trunk@4165 -
This commit is contained in:
mattias 2003-05-20 21:41:07 +00:00
parent 4c966d7cfa
commit 401808c861
5 changed files with 470 additions and 191 deletions

View File

@ -3085,9 +3085,10 @@ begin
DirTempl:=TDefineTemplate.Create('Debugger',ctsDebuggerDirectory,
'','debugger',da_Directory);
DirTempl.AddChild(TDefineTemplate.Create('LCL path addition',
Format(ctsAddsDirToSourcePath,['lcl']),
Format(ctsAddsDirToSourcePath,['lcl, components']),
ExternalMacroStart+'SrcPath',
'..'
+';..'+ds+'components'+ds+'codetools'
+';..'+ds+'lcl'
+';..'+ds+'lcl'+ds+'interfaces'+ds+WidgetType
+';'+SrcPath

View File

@ -37,7 +37,7 @@ unit Debugger;
interface
uses
Classes;
Classes, SysUtils, DBGUtils, Laz_XMLCfg;
type
TDBGLocationRec = record
@ -47,11 +47,32 @@ type
SrcLine: Integer;
end;
TDBGCommand = (dcRun, dcPause, dcStop, dcStepOver, dcStepInto, dcRunTo, dcJumpto, dcBreak, dcWatch, dcLocal, dcEvaluate, dcModify);
TDBGCommand = (
dcRun,
dcPause,
dcStop,
dcStepOver,
dcStepInto,
dcRunTo,
dcJumpto,
dcBreak,
dcWatch,
dcLocal,
dcEvaluate,
dcModify
);
TDBGCommands = set of TDBGCommand;
TDBGState = (dsNone, dsIdle, dsStop, dsPause, dsRun, dsError);
TDBGState = (
dsNone,
dsIdle,
dsStop,
dsPause,
dsRun,
dsError
);
(*
{
Debugger states
--------------------------------------------------------------------------
dsNone:
@ -61,16 +82,16 @@ type
dsIdle:
The external debugger is started, but no filename (or no other params
requred to start) were given.
required to start) were given.
dsStop:
(Optional) The execution of the target is stopped
The external debugger is loaded and ready to (re)start the execution
of the target.
Breakpoints, wathes etc can be defined
Breakpoints, watches etc can be defined
dsPause:
De debugger has paused the target. Targer variables canbe examined
The debugger has paused the target. Target variables can be examined
dsRun:
The target is running.
@ -80,7 +101,8 @@ type
most cases needed.
--------------------------------------------------------------------------
*)
}
{ ---------------------------------------------------------
TDebuggerNotification is a reference counted baseclass
@ -96,15 +118,28 @@ type
procedure ReleaseReference;
end;
TDBGBreakPointAction = (bpaStop, bpaEnableGroup, bpaDisableGroup);
TDBGBreakPointActions =set of TDBGBreakPointAction;
TDebugger = class;
TDBGBreakPointGroup = class;
TDBGBreakPointClass = class of TDBGBreakPoint;
TDBGWatches = class;
TDBGBreakPoints = class;
TOnSaveFilenameToConfig = procedure(var Filename: string) of object;
TOnLoadFilenameFromConfig = procedure(var Filename: string) of object;
TOnGetGroupByName = function(const GroupName: string): TDBGBreakPointGroup of object;
{ TDBGBreakPoint }
TDBGBreakPointAction = (
bpaStop,
bpaEnableGroup,
bpaDisableGroup
);
TDBGBreakPointActions = set of TDBGBreakPointAction;
TDBGBreakPoint = class(TCollectionItem)
private
FGroup: TDBGBreakPointGroup;
FLoading: Boolean;
FValid: Boolean;
FEnabled: Boolean;
FHitCount: Integer;
@ -132,34 +167,47 @@ type
procedure SetLocation(const ASource: String; const ALine: Integer); virtual;
procedure SetValid(const AValue: Boolean);
property Debugger: TDebugger read GetDebugger;
procedure RemoveFromGroupList(const AGroup: TDBGBreakPointGroup;
const AGroupList: TList);
procedure ClearGroupList(const AGroupList: TList);
public
procedure AddDisableGroup(const AGroup: TDBGBreakPointGroup);
procedure AddEnableGroup(const AGroup: TDBGBreakPointGroup);
constructor Create(ACollection: TCollection); override;
destructor Destroy; override;
procedure AddDisableGroup(const AGroup: TDBGBreakPointGroup);
procedure AddEnableGroup(const AGroup: TDBGBreakPointGroup);
procedure RemoveDisableGroup(const AGroup: TDBGBreakPointGroup);
procedure RemoveEnableGroup(const AGroup: TDBGBreakPointGroup);
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string;
const OnLoadFilename: TOnLoadFilenameFromConfig;
const OnGetGroup: TOnGetGroupByName); virtual;
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string;
const OnSaveFilename: TOnSaveFilenameToConfig); virtual;
public
property Actions: TDBGBreakPointActions read FActions write SetActions;
property Enabled: Boolean read FEnabled write SetEnabled;
property Expression: String read FExpression write SetExpression;
property Group: TDBGBreakPointGroup read FGroup write SetGroup;
property HitCount: Integer read FHitCount;
property Expression: String read FExpression write SetExpression;
property Source: String read FSource;
property Line: Integer read FLine;
property Source: String read FSource;
property Valid: Boolean read FValid;
property Loading: Boolean read FLoading;
end;
TDBGBreakPointClass = class of TDBGBreakPoint;
{ TDBGBreakPoints }
TDBGBreakPointsEvent = procedure(const ASender: TDBGBreakPoints;
const ABreakpoint: TDBGBreakPoint) of object;
TDBGBreakPoints = class;
TDBGBreakPointsEvent =
procedure(const ASender: TDBGBreakPoints;
const ABreakpoint: TDBGBreakPoint) of object;
TDBGBreakPointsNotification = class(TDebuggerNotification)
private
FOnAdd: TDBGBreakPointsEvent;
FOnUpdate: TDBGBreakPointsEvent; //Item will be nil in case all items need to be updated
FOnUpdate: TDBGBreakPointsEvent;//Item will be nil in case all items need to be updated
FOnRemove: TDBGBreakPointsEvent;
public
property OnAdd: TDBGBreakPointsEvent read FOnAdd write FOnAdd;
property OnAdd: TDBGBreakPointsEvent read FOnAdd write FOnAdd;
property OnUpdate: TDBGBreakPointsEvent read FOnUpdate write FOnUpdate;
property OnRemove: TDBGBreakPointsEvent read FOnRemove write FonRemove;
end;
@ -175,21 +223,33 @@ type
procedure DoStateChange; virtual;
procedure Update(Item: TCollectionItem); override;
public
function Add(const ASource: String; const ALine: Integer): TDBGBreakPoint;
procedure AddNotification(const ANotification: TDBGBreakPointsNotification);
constructor Create(const ADebugger: TDebugger; const ABreakPointClass: TDBGBreakPointClass);
constructor Create(const ADebugger: TDebugger;
const ABreakPointClass: TDBGBreakPointClass);
destructor Destroy; override;
function Add(const ASource: String; const ALine: Integer): TDBGBreakPoint;
procedure Add(NewBreakPoint: TDBGBreakPoint);
function Find(const ASource: String; const ALine: Integer): TDBGBreakPoint;
procedure AddNotification(const ANotification: TDBGBreakPointsNotification);
procedure RemoveNotification(const ANotification: TDBGBreakPointsNotification);
property Items[const AnIndex: Integer]: TDBGBreakPoint read GetItem write SetItem; default;
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string;
const OnLoadFilename: TOnLoadFilenameFromConfig;
const OnGetGroup: TOnGetGroupByName); virtual;
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string;
const OnSaveFilename: TOnSaveFilenameToConfig); virtual;
public
property Items[const AnIndex: Integer]: TDBGBreakPoint read GetItem
write SetItem; default;
end;
{ TDBGBreakPointGroup }
TDBGBreakPointGroup = class(TCollectionItem)
private
FEnabled: Boolean;
FName: String;
FBreakpoints: TList; // A list of breakpoints that member
FReferences: TList; // A list of breakpoints that refer to us through En/disable group
FBreakpoints: TList;// A list of breakpoints that member
FReferences: TList; // A list of breakpoints that refer to us through En/disable group
function GetBreakpoint(const AIndex: Integer): TDBGBreakPoint;
procedure SetEnabled(const AValue: Boolean);
procedure SetName(const AValue: String);
@ -203,11 +263,15 @@ type
procedure Delete(const AIndex: Integer);
destructor Destroy; override;
function Remove(const ABreakPoint: TDBGBreakPoint): Integer;
public
property Breakpoints[const AIndex: Integer]: TDBGBreakPoint read GetBreakpoint;
property Enabled: Boolean read FEnabled write SetEnabled;
property Name: String read FName write SetName;
end;
{ TDBGBreakPointGroups }
TDBGBreakPointGroups = class(TCollection)
private
function GetItem(const AnIndex: Integer): TDBGBreakPointGroup;
@ -218,8 +282,10 @@ type
property Items[const AnIndex: Integer]: TDBGBreakPointGroup
read GetItem write SetItem; default;
end;
{ TDBGWatch }
TDBGWatchClass = class of TDBGWatch;
TDBGWatch = class(TCollectionItem)
private
FEnabled: Boolean;
@ -245,16 +311,21 @@ type
property Value: String read GetValue;
end;
TDBGWatches = class;
TDBGWatchClass = class of TDBGWatch;
{ TDBGWatches }
TDBGWatchesEvent =
procedure(const ASender: TDBGWatches; const AWatch: TDBGWatch) of object;
TDBGWatchesNotification = class(TDebuggerNotification)
private
FOnAdd: TDBGWatchesEvent;
FOnUpdate: TDBGWatchesEvent; //Item will be nil in case all items need to be updated
FOnUpdate: TDBGWatchesEvent;//Item will be nil in case all items need to be updated
FOnRemove: TDBGWatchesEvent;
public
property OnAdd: TDBGWatchesEvent read FOnAdd write FOnAdd;
property OnAdd: TDBGWatchesEvent read FOnAdd write FOnAdd;
property OnUpdate: TDBGWatchesEvent read FOnUpdate write FOnUpdate;
property OnRemove: TDBGWatchesEvent read FOnRemove write FonRemove;
end;
@ -270,14 +341,17 @@ type
procedure DoStateChange; virtual;
procedure Update(Item: TCollectionItem); override;
public
function Add(const AExpression: String): TDBGWatch;
procedure AddNotification(const ANotification: TDBGWatchesNotification);
constructor Create(const ADebugger: TDebugger; const AWatchClass: TDBGWatchClass);
destructor Destroy; override;
function Add(const AExpression: String): TDBGWatch;
function Find(const AExpression: String): TDBGWatch;
procedure AddNotification(const ANotification: TDBGWatchesNotification);
procedure RemoveNotification(const ANotification: TDBGWatchesNotification);
property Items[const AnIndex: Integer]: TDBGWatch read GetItem write SetItem; default;
end;
{ TDBGLocals }
TDBGLocals = class(TObject)
private
@ -290,12 +364,15 @@ type
function GetValue(const AnIndex: Integer): String; virtual;
property Debugger: TDebugger read FDebugger;
public
function Count: Integer; virtual;
constructor Create(const ADebugger: TDebugger);
function Count: Integer; virtual;
property Names[const AnIndex: Integer]: String read GetName;
property Values[const AnIndex: Integer]: String read GetValue;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property Values[const AnIndex: Integer]: String read GetValue;
end;
{ TDBGCallStackEntry }
TDBGCallStackEntry = class(TObject)
private
@ -313,13 +390,16 @@ type
constructor Create(const AIndex:Integer; const AnAdress: Pointer; const AnArguments: TStrings; const AFunctionName: String; const ASource: String; const ALine: Integer);
destructor Destroy; override;
property Adress: Pointer read FAdress;
property ArgumentCount: Integer read GetArgumentCount;
property ArgumentCount: Integer read GetArgumentCount;
property ArgumentNames[const AnIndex: Integer]: String read GetArgumentName;
property ArgumentValues[const AnIndex: Integer]: String read GetArgumentValue;
property FunctionName: String read FFunctionName;
property Source: String read FSource;
property Line: Integer read FLine;
property Source: String read FSource;
end;
{ TDBGCallStack }
TDBGCallStack = class(TObject)
private
@ -343,9 +423,14 @@ type
property OnChange: TNotifyEvent read FOnChange write FOnChange;
end;
{ TDebugger }
TDBGOutputEvent = procedure(Sender: TObject; const AText: String) of object;
TDBGCurrentLineEvent = procedure(Sender: TObject; const ALocation: TDBGLocationRec) of object;
TDBGExceptionEvent = procedure(Sender: TObject; const AExceptionID: Integer; const AExceptionText: String) of object;
TDBGCurrentLineEvent = procedure(Sender: TObject;
const ALocation: TDBGLocationRec) of object;
TDBGExceptionEvent = procedure(Sender: TObject; const AExceptionID: Integer;
const AExceptionText: String) of object;
TDebugger = class(TObject)
private
@ -366,7 +451,8 @@ type
FOnDbgOutput: TDBGOutputEvent;
FOnState: TNotifyEvent;
function GetState: TDBGState;
function ReqCmd(const ACommand: TDBGCommand; const AParams: array of const): Boolean;
function ReqCmd(const ACommand: TDBGCommand;
const AParams: array of const): Boolean;
procedure SetEnvironment(const AValue: TStrings);
procedure SetFileName(const AValue: String);
protected
@ -382,12 +468,15 @@ type
function ChangeFileName: Boolean; virtual;
function GetCommands: TDBGCommands;
function GetSupportedCommands: TDBGCommands; virtual;
function RequestCommand(const ACommand: TDBGCommand; const AParams: array of const): Boolean; virtual; abstract; // True if succesful
function RequestCommand(const ACommand: TDBGCommand;
const AParams: array of const): Boolean;
virtual; abstract; // True if succesful
procedure SetExitCode(const AValue: Integer);
procedure SetState(const AValue: TDBGState);
public
constructor Create(const AExternalDebugger: String); {virtual; Virtual constructor makes no sense}
//MWE: there will be a day that they do make sense :-)
// MG: there will be a day that they do make troubles :)
destructor Destroy; override;
procedure Init; virtual; // Initializes the debugger
@ -403,41 +492,96 @@ type
function Evaluate(const AExpression: String; var AResult: String): Boolean; // Evaluates the given expression, returns true if valid
function Modify(const AExpression, AValue: String): Boolean; // Modifies the given expression, returns true if valid
property SupportedCommands: TDBGCommands read GetSupportedCommands; // All available commands of the debugger
property Arguments: String read FArguments write FArguments; // Arguments feed to the program
property BreakPoints: TDBGBreakPoints read FBreakPoints; // list of all breakpoints
property BreakPointGroups: TDBGBreakPointGroups read FBreakPointGroups; // list of all breakpointgroups
property Commands: TDBGCommands read GetCommands; // All current available commands of the debugger
property BreakPoints: TDBGBreakPoints read FBreakPoints; // list of all breakpoints
property CallStack: TDBGCallStack read FCallStack;
property Commands: TDBGCommands read GetCommands; // All current available commands of the debugger
property Environment: TStrings read FEnvironment write SetEnvironment;
property ExitCode: Integer read FExitCode;
property ExternalDebugger: String read FExternalDebugger;
property FileName: String read FFileName write SetFileName; // The name of the exe to be debugged
property Locals: TDBGLocals read FLocals;
property State: TDBGState read FState; // The current state of the debugger
property Watches: TDBGWatches read FWatches; // list of all watches localvars etc
property OnCurrent: TDBGCurrentLineEvent read FOnCurrent write FOnCurrent; // Passes info about the current line being debugged
property OnException: TDBGExceptionEvent read FOnException write FOnException; // Fires when the debugger received an exeption
property OnState: TNotifyEvent read FOnState write FOnState; // Fires when the current state of the debugger changes
property OnOutput: TDBGOutputEvent read FOnOutput write FOnOutput; // Passes all output of the debugged target
property OnDbgOutput: TDBGOutputEvent read FOnDbgOutput write FOnDbgOutput; // Passes all debuggeroutput
property OnException: TDBGExceptionEvent read FOnException write FOnException; // Fires when the debugger received an exeption
property OnOutput: TDBGOutputEvent read FOnOutput write FOnOutput; // Passes all output of the debugged target
property OnState: TNotifyEvent read FOnState write FOnState; // Fires when the current state of the debugger changes
property State: TDBGState read FState; // The current state of the debugger
property SupportedCommands: TDBGCommands read GetSupportedCommands; // All available commands of the debugger
property Watches: TDBGWatches read FWatches; // list of all watches localvars etc
end;
const
DBGCommandNames: array[TDBGCommand] of string = (
'Run',
'Pause',
'Stop',
'StepOver',
'StepInto',
'RunTo',
'Jumpto',
'Break',
'Watch',
'Local',
'Evaluate',
'Modify'
);
DBGStateNames: array[TDBGState] of string = (
'None',
'Idle',
'Stop',
'Pause',
'Run',
'Error'
);
DBGBreakPointActionNames: array[TDBGBreakPointAction] of string = (
'Stop',
'EnableGroup',
'DisableGroup'
);
function DBGCommandNameToCommand(const s: string): TDBGCommand;
function DBGStateNameToState(const s: string): TDBGState;
function DBGBreakPointActionNameToAction(const s: string): TDBGBreakPointAction;
implementation
uses
SysUtils, DBGUtils;
const
COMMANDMAP: array[TDBGState] of TDBGCommands = (
{dsNone } [],
{dsIdle } [],
{dsStop } [dcRun, dcStepOver, dcStepInto, dcRunTo, dcJumpto, dcBreak, dcWatch, dcEvaluate],
{dsPause} [dcRun, dcStop, dcStepOver, dcStepInto, dcRunTo, dcJumpto, dcBreak, dcWatch, dcLocal, dcEvaluate, dcModify],
{dsStop } [dcRun, dcStepOver, dcStepInto, dcRunTo, dcJumpto, dcBreak, dcWatch,
dcEvaluate],
{dsPause} [dcRun, dcStop, dcStepOver, dcStepInto, dcRunTo, dcJumpto, dcBreak,
dcWatch, dcLocal, dcEvaluate, dcModify],
{dsRun } [dcPause, dcStop, dcBreak, dcWatch],
{dsError} [dcStop]
);
function DBGCommandNameToCommand(const s: string): TDBGCommand;
begin
for Result:=Low(TDBGCommand) to High(TDBGCommand) do
if AnsiCompareText(s,DBGCommandNames[Result])=0 then exit;
Result:=dcStop;
end;
function DBGStateNameToState(const s: string): TDBGState;
begin
for Result:=Low(TDBGState) to High(TDBGState) do
if AnsiCompareText(s,DBGStateNames[Result])=0 then exit;
Result:=dsNone;
end;
function DBGBreakPointActionNameToAction(const s: string): TDBGBreakPointAction;
begin
for Result:=Low(TDBGBreakPointAction) to High(TDBGBreakPointAction) do
if AnsiCompareText(s,DBGBreakPointActionNames[Result])=0 then exit;
Result:=bpaStop;
end;
{ =========================================================================== }
{ TDebugger }
{ =========================================================================== }
@ -715,8 +859,6 @@ begin
end;
destructor TDBGBreakPoint.Destroy;
var
n: Integer;
begin
if (TDBGBreakPoints(Collection) <> nil)
then TDBGBreakPoints(Collection).Removed(Self);
@ -724,10 +866,8 @@ begin
if FGroup <> nil
then FGroup.Remove(Self);
for n := 0 to FDisableGroupList.Count - 1 do
TDBGBreakPointGroup(FDisableGroupList[n]).RemoveReference(Self);
for n := 0 to FEnableGroupList.Count - 1 do
TDBGBreakPointGroup(FEnableGroupList[n]).RemoveReference(Self);
ClearGroupList(FDisableGroupList);
ClearGroupList(FEnableGroupList);
inherited;
FreeAndNil(FDisableGroupList);
@ -788,16 +928,102 @@ end;
procedure TDBGBreakPoint.RemoveDisableGroup(const AGroup: TDBGBreakPointGroup);
begin
if AGroup = nil then Exit;
FDisableGroupList.Remove(AGroup);
AGroup.RemoveReference(Self);
RemoveFromGroupList(AGroup,FDisableGroupList);
end;
procedure TDBGBreakPoint.RemoveEnableGroup(const AGroup: TDBGBreakPointGroup);
begin
if AGroup = nil then Exit;
FEnableGroupList.Remove(AGroup);
AGroup.RemoveReference(Self);
RemoveFromGroupList(AGroup,FEnableGroupList);
end;
procedure TDBGBreakPoint.LoadFromXMLConfig(XMLConfig: TXMLConfig;
const Path: string; const OnLoadFilename: TOnLoadFilenameFromConfig;
const OnGetGroup: TOnGetGroupByName);
procedure LoadGroupList(GroupList: TList; const ListPath: string);
var
i: Integer;
CurGroup: TDBGBreakPointGroup;
NewCount: Integer;
GroupName: String;
begin
ClearGroupList(GroupList);
NewCount:=XMLConfig.GetValue(ListPath+'Count',0);
for i:=0 to NewCount-1 do begin
GroupName:=XMLConfig.GetValue(ListPath+'Group'+IntToStr(i+1)+'/Name','');
if GroupName='' then continue;
CurGroup:=OnGetGroup(GroupName);
if CurGroup=nil then continue;
if GroupList=FDisableGroupList then
AddDisableGroup(CurGroup)
else if GroupList=FEnableGroupList then
AddEnableGroup(CurGroup);
end;
end;
var
Filename: String;
GroupName: String;
NewActions: TDBGBreakPointActions;
CurAction: TDBGBreakPointAction;
begin
FLoading:=true;
try
GroupName:=XMLConfig.GetValue(Path+'Group/Name','');
Group:=OnGetGroup(GroupName);
Expression:=XMLConfig.GetValue(Path+'Expression/Value','');
Filename:=XMLConfig.GetValue(Path+'Source/Value','');
if Assigned(OnLoadFilename) then OnLoadFilename(Filename);
FSource:=Filename;
FLine:=XMLConfig.GetValue(Path+'Line/Value',-1);
NewActions:=[];
for CurAction:=Low(TDBGBreakPointAction) to High(TDBGBreakPointAction) do
if XMLConfig.GetValue(
Path+'Actions/'+DBGBreakPointActionNames[CurAction],
CurAction in [bpaStop])
then
Include(NewActions,CurAction);
Actions:=NewActions;
LoadGroupList(FDisableGroupList,Path+'DisableGroups/');
LoadGroupList(FEnableGroupList,Path+'EnableGroups/');
finally
FLoading:=false;
end;
end;
procedure TDBGBreakPoint.SaveToXMLConfig(XMLConfig: TXMLConfig;
const Path: string; const OnSaveFilename: TOnSaveFilenameToConfig);
procedure SaveGroupList(GroupList: TList; const ListPath: string);
var
i: Integer;
CurGroup: TDBGBreakPointGroup;
begin
XMLConfig.SetDeleteValue(ListPath+'Count',GroupList.Count,0);
for i:=0 to GroupList.Count-1 do begin
CurGroup:=TDBGBreakPointGroup(GroupList[i]);
XMLConfig.SetDeleteValue(ListPath+'Group'+IntToStr(i+1)+'/Name',
CurGroup.Name,'');
end;
end;
var
Filename: String;
CurAction: TDBGBreakPointAction;
begin
if Group<>nil then
XMLConfig.SetDeleteValue(Path+'Group/Name',Group.Name,'');
XMLConfig.SetDeleteValue(Path+'Expression/Value',Expression,'');
Filename:=Source;
if Assigned(OnSaveFilename) then OnSaveFilename(Filename);
XMLConfig.SetDeleteValue(Path+'Source/Value',Filename,'');
XMLConfig.SetDeleteValue(Path+'Line/Value',Line,-1);
for CurAction:=Low(TDBGBreakPointAction) to High(TDBGBreakPointAction) do
XMLConfig.SetDeleteValue(
Path+'Actions/'+DBGBreakPointActionNames[CurAction],
CurAction in Actions,CurAction in [bpaStop]);
SaveGroupList(FDisableGroupList,Path+'DisableGroups/');
SaveGroupList(FEnableGroupList,Path+'EnableGroups/');
end;
procedure TDBGBreakPoint.SetActions(const AValue: TDBGBreakPointActions);
@ -879,32 +1105,60 @@ begin
end;
end;
procedure TDBGBreakPoint.RemoveFromGroupList(const AGroup: TDBGBreakPointGroup;
const AGroupList: TList);
begin
if (AGroup = nil) then Exit;
AGroupList.Remove(AGroup);
AGroup.RemoveReference(Self);
end;
procedure TDBGBreakPoint.ClearGroupList(const AGroupList: TList);
var
i: Integer;
AGroup: TDBGBreakPointGroup;
begin
for i:=0 to AGroupList.Count-1 do begin
AGroup:=TDBGBreakPointGroup(AGroupList[i]);
AGroup.RemoveReference(Self);
end;
AGroupList.Clear;
end;
{ =========================================================================== }
{ TDBGBreakPoints }
{ =========================================================================== }
function TDBGBreakPoints.Add(const ASource: String; const ALine: Integer): TDBGBreakPoint;
function TDBGBreakPoints.Add(const ASource: String;
const ALine: Integer): TDBGBreakPoint;
begin
Result := TDBGBreakPoint(inherited Add);
Result.SetLocation(ASource, ALine);
Add(Result);
end;
procedure TDBGBreakPoints.Add(NewBreakPoint: TDBGBreakPoint);
var
n: Integer;
Notification: TDBGBreakPointsNotification;
begin
Result := TDBGBreakPoint(inherited Add);
Result.SetLocation(ASource, ALine);
for n := 0 to FNotificationList.Count - 1 do
begin
Notification := TDBGBreakPointsNotification(FNotificationList[n]);
if Assigned(Notification.FOnAdd)
then Notification.FOnAdd(Self, Result);
then Notification.FOnAdd(Self, NewBreakPoint);
end;
end;
procedure TDBGBreakPoints.AddNotification(const ANotification: TDBGBreakPointsNotification);
procedure TDBGBreakPoints.AddNotification(
const ANotification: TDBGBreakPointsNotification);
begin
FNotificationList.Add(ANotification);
ANotification.AddReference;
end;
constructor TDBGBreakPoints.Create(const ADebugger: TDebugger; const ABreakPointClass: TDBGBreakPointClass);
constructor TDBGBreakPoints.Create(const ADebugger: TDebugger;
const ABreakPointClass: TDBGBreakPointClass);
begin
FDebugger := ADebugger;
FNotificationList := TList.Create;
@ -969,9 +1223,44 @@ begin
ANotification.ReleaseReference;
end;
procedure TDBGBreakPoints.SetItem(const AnIndex: Integer; const AValue: TDBGBreakPoint);
procedure TDBGBreakPoints.LoadFromXMLConfig(XMLConfig: TXMLConfig;
const Path: string; const OnLoadFilename: TOnLoadFilenameFromConfig;
const OnGetGroup: TOnGetGroupByName);
var
NewCount: Integer;
i: Integer;
NewBreakPoint: TDBGBreakPoint;
begin
SetItem(AnIndex, AValue);
Clear;
NewCount:=XMLConfig.GetValue(Path+'BreakPoints/Count',0);
for i:=0 to NewCount-1 do begin
NewBreakPoint:=TDBGBreakPoint.Create(Self);
Add(NewBreakPoint);
NewBreakPoint.LoadFromXMLConfig(XMLConfig,
Path+'BreakPoints/Item'+IntToStr(i+1)+'/',OnLoadFilename,OnGetGroup);
end;
end;
procedure TDBGBreakPoints.SaveToXMLConfig(XMLConfig: TXMLConfig;
const Path: string; const OnSaveFilename: TOnSaveFilenameToConfig);
var
Cnt: Integer;
i: Integer;
CurBreakPoint: TDBGBreakPoint;
begin
Cnt:=Count;
XMLConfig.SetDeleteValue(Path+'BreakPoints/Count',Cnt,0);
for i:=0 to Cnt-1 do begin
CurBreakPoint:=Items[i];
CurBreakPoint.SaveToXMLConfig(XMLConfig,
Path+'BreakPoints/Item'+IntToStr(i+1)+'/',OnSaveFilename);
end;
end;
procedure TDBGBreakPoints.SetItem(const AnIndex: Integer;
const AValue: TDBGBreakPoint);
begin
inherited SetItem(AnIndex, AValue);
end;
procedure TDBGBreakPoints.Update(Item: TCollectionItem);
@ -1475,6 +1764,9 @@ end;
end.
{ =============================================================================
$Log$
Revision 1.18 2003/05/20 21:41:07 mattias
started loading/saving breakpoints
Revision 1.17 2003/02/28 19:10:25 mattias
added new ... dialog

View File

@ -343,26 +343,16 @@ const
begin
if FDialogs[ADialogType] = nil
then begin
//try
FDialogs[ADialogType] := DEBUGDIALOGCLASS[ADialogType].Create(Self);
{except
on E: Exception do begin
WriteLN('[ERROR] IDE: Probably FPC bug #1888 caused an exception while creating class ''', DEBUGDIALOGCLASS[ADialogType].ClassName, '''');
WriteLN('[ERROR] IDE: Exception message: ', E.Message);
Exit;
end;
end;}
FDialogs[ADialogType] := DEBUGDIALOGCLASS[ADialogType].Create(Self);
FDialogs[ADialogType].Name:=
NonModalIDEWindowNames[DebugDlgIDEWindow[ADialogType]];
FDialogs[ADialogType].Tag := Integer(ADialogType);
FDialogs[ADialogType].OnDestroy := @DebugDialogDestroy;
DoInitDebugger;
FDialogs[ADialogType].Debugger := FDebugger;
writeln('TDebugManager.ViewDebugDialog A ',FDialogs[ADialogType].Name);
EnvironmentOptions.IDEWindowLayoutList.Apply(
FDialogs[ADialogType],FDialogs[ADialogType].Name);
end;
writeln('TDebugManager.ViewDebugDialog B ',FDialogs[ADialogType].Name,' ',FDialogs[ADialogType].Left,',',FDialogs[ADialogType].Top,',',FDialogs[ADialogType].Width,',',FDialogs[ADialogType].Height);
FDialogs[ADialogType].Show;
FDialogs[ADialogType].BringToFront;
end;
@ -680,6 +670,9 @@ end.
{ =============================================================================
$Log$
Revision 1.15 2003/05/20 21:41:07 mattias
started loading/saving breakpoints
Revision 1.14 2003/05/18 10:42:57 mattias
implemented deleting empty submenus

View File

@ -157,6 +157,7 @@ type
fCtrlMouseLinks: boolean;
fUndoAfterSave:boolean;
fUseSyntaxHighlight:boolean;
FCopyWordAtCursorOnCopyNone: boolean;
fBlockIndent:integer;
fUndoLimit:integer;
fTabWidth:integer;
@ -188,6 +189,7 @@ type
fAutoDelayInMSec:integer;
fCodeTemplateFileName:Ansistring;
fCTemplIndentToTokenStart: boolean;
procedure SetCopyWordAtCursorOnCopyNone(const AValue: boolean);
public
constructor Create;
destructor Destroy; override;
@ -228,6 +230,8 @@ type
read fFindTextAtCursor write fFindTextAtCursor default true;
property UseSyntaxHighlight:boolean
read fUseSyntaxHighlight write fUseSyntaxHighlight default true;
property CopyWordAtCursorOnCopyNone: boolean read FCopyWordAtCursorOnCopyNone
write SetCopyWordAtCursorOnCopyNone;
property BlockIndent:integer read fBlockIndent write fBlockIndent default 2;
property UndoLimit:integer read fUndoLimit write fUndoLimit default 32767;
property TabWidth:integer read fTabWidth write fTabWidth default 8;
@ -324,6 +328,7 @@ type
DoubleClickLineCheckBox:TCheckBox;
FindTextAtCursorCheckBox:TCheckBox;
UseSyntaxHighlightCheckBox:TCheckBox;
CopyWordAtCursorOnCopyNoneCheckBox:TCheckBox;
MouseLinksCheckBox: TCheckBox;
BlockIndentComboBox:TComboBox;
BlockIndentLabel:TLabel;
@ -1028,6 +1033,12 @@ end;
{ TEditorOptions }
procedure TEditorOptions.SetCopyWordAtCursorOnCopyNone(const AValue: boolean);
begin
if FCopyWordAtCursorOnCopyNone=AValue then exit;
FCopyWordAtCursorOnCopyNone:=AValue;
end;
constructor TEditorOptions.Create;
var ConfFileName: string;
fs:TFileStream;
@ -1053,6 +1064,7 @@ begin
// General options
fCtrlMouseLinks:=true;
fShowTabCloseButtons:=true;
FCopyWordAtCursorOnCopyNone:=true;
fBlockIndent:=2;
fUndoLimit:=32767;
fTabWidth:=8;
@ -1140,6 +1152,8 @@ begin
XMLConfig.GetValue('EditorOptions/General/Editor/CtrlMouseLinks',true);
fShowTabCloseButtons:=
XMLConfig.GetValue('EditorOptions/General/Editor/ShowTabCloseButtons',true);
FCopyWordAtCursorOnCopyNone:=
XMLConfig.GetValue('EditorOptions/General/Editor/CopyWordAtCursorOnCopyNone',true);
fUndoAfterSave:=
XMLConfig.GetValue('EditorOptions/General/Editor/UndoAfterSave',true);
fFindTextAtCursor:=
@ -1147,11 +1161,11 @@ begin
fUseSyntaxHighlight:=
XMLConfig.GetValue('EditorOptions/General/Editor/UseSyntaxHighlight',true);
fBlockIndent:=
XMLConfig.GetValue('EditorOptions/General/Editor/BlockIndent',fBlockIndent);
XMLConfig.GetValue('EditorOptions/General/Editor/BlockIndent',2);
fUndoLimit:=
XMLConfig.GetValue('EditorOptions/General/Editor/UndoLimit',fUndoLimit);
XMLConfig.GetValue('EditorOptions/General/Editor/UndoLimit',32767);
fTabWidth:=
XMLConfig.GetValue('EditorOptions/General/Editor/TabWidth',fTabWidth);
XMLConfig.GetValue('EditorOptions/General/Editor/TabWidth',8);
// Display options
fVisibleRightMargin:=
@ -1248,42 +1262,52 @@ begin
SynEditOptName:='';
end;
if SynEditOptName<>'' then begin
XMLConfig.SetValue('EditorOptions/General/Editor/'+SynEditOptName,
SynEditOpt in fSynEditOptions);
XMLConfig.SetDeleteValue('EditorOptions/General/Editor/'+SynEditOptName,
SynEditOpt in fSynEditOptions,SynEditOpt in SynEditDefaultOptions);
end;
end;
XMLConfig.SetValue('EditorOptions/General/Editor/CtrlMouseLinks'
,fCtrlMouseLinks);
XMLConfig.SetValue('EditorOptions/General/Editor/ShowTabCloseButtons'
,fShowTabCloseButtons);
XMLConfig.SetValue('EditorOptions/General/Editor/UndoAfterSave'
,fUndoAfterSave);
XMLConfig.SetValue('EditorOptions/General/Editor/FindTextAtCursor'
,fFindTextAtCursor);
XMLConfig.SetValue('EditorOptions/General/Editor/UseSyntaxHighlight'
,fUseSyntaxHighlight);
XMLConfig.SetValue('EditorOptions/General/Editor/BlockIndent'
,fBlockIndent);
XMLConfig.SetValue('EditorOptions/General/Editor/UndoLimit'
,fUndoLimit);
XMLConfig.SetValue('EditorOptions/General/Editor/TabWidth'
,fTabWidth);
XMLConfig.SetDeleteValue('EditorOptions/General/Editor/CtrlMouseLinks'
,fCtrlMouseLinks,true);
XMLConfig.SetDeleteValue('EditorOptions/General/Editor/ShowTabCloseButtons'
,fShowTabCloseButtons,true);
XMLConfig.SetDeleteValue(
'EditorOptions/General/Editor/CopyWordAtCursorOnCopyNone',
FCopyWordAtCursorOnCopyNone,true);
XMLConfig.SetDeleteValue('EditorOptions/General/Editor/UndoAfterSave'
,fUndoAfterSave,true);
XMLConfig.SetDeleteValue('EditorOptions/General/Editor/FindTextAtCursor'
,fFindTextAtCursor,true);
XMLConfig.SetDeleteValue('EditorOptions/General/Editor/UseSyntaxHighlight'
,fUseSyntaxHighlight,true);
XMLConfig.SetDeleteValue('EditorOptions/General/Editor/BlockIndent'
,fBlockIndent,2);
XMLConfig.SetDeleteValue('EditorOptions/General/Editor/UndoLimit'
,fUndoLimit,32767);
XMLConfig.SetDeleteValue('EditorOptions/General/Editor/TabWidth'
,fTabWidth,8);
// Display options
XMLConfig.SetValue('EditorOptions/Display/VisibleRightMargin'
,fVisibleRightMargin);
XMLConfig.SetValue('EditorOptions/Display/VisibleGutter',fVisibleGutter);
XMLConfig.SetValue('EditorOptions/Display/ShowLineNumbers',fShowLineNumbers);
XMLConfig.SetValue('EditorOptions/Display/GutterColor',fGutterColor);
XMLConfig.SetValue('EditorOptions/Display/GutterWidth',fGutterWidth);
XMLConfig.SetValue('EditorOptions/Display/RightMargin',fRightMargin);
XMLConfig.SetValue('EditorOptions/Display/RightMarginColor',fRightMarginColor);
XMLConfig.SetValue('EditorOptions/Display/EditorFont',fEditorFont);
XMLConfig.SetValue('EditorOptions/Display/EditorFontHeight'
,fEditorFontHeight);
XMLConfig.SetValue('EditorOptions/Display/ExtraLineSpacing'
,fExtraLineSpacing);
XMLConfig.SetDeleteValue('EditorOptions/Display/VisibleRightMargin'
,fVisibleRightMargin,true);
XMLConfig.SetDeleteValue('EditorOptions/Display/VisibleGutter',
fVisibleGutter,true);
XMLConfig.SetDeleteValue('EditorOptions/Display/ShowLineNumbers',
fShowLineNumbers,true);
XMLConfig.SetDeleteValue('EditorOptions/Display/GutterColor',
fGutterColor,clBtnFace);
XMLConfig.SetDeleteValue('EditorOptions/Display/GutterWidth',
fGutterWidth,30);
XMLConfig.SetDeleteValue('EditorOptions/Display/RightMargin',
fRightMargin,80);
XMLConfig.SetDeleteValue('EditorOptions/Display/RightMarginColor',
fRightMarginColor,clBtnFace);
XMLConfig.SetDeleteValue('EditorOptions/Display/EditorFont',
fEditorFont,'courier');
XMLConfig.SetDeleteValue('EditorOptions/Display/EditorFontHeight'
,fEditorFontHeight,12);
XMLConfig.SetDeleteValue('EditorOptions/Display/ExtraLineSpacing'
,fExtraLineSpacing,1);
// Key Mappings options
XMLConfig.SetValue('EditorOptions/KeyMapping/Scheme',fKeyMappingScheme);
@ -1299,20 +1323,21 @@ begin
end;
// Code Tools options
XMLConfig.SetValue('EditorOptions/CodeTools/AutoIdentifierCompletion'
,fAutoIdentifierCompletion);
XMLConfig.SetValue('EditorOptions/CodeTools/AutoCodeParameters'
,fAutoCodeParameters);
XMLConfig.SetValue('EditorOptions/CodeTools/AutoToolTipExprEval'
,fAutoToolTipExprEval);
XMLConfig.SetValue('EditorOptions/CodeTools/AutoToolTipSymbTools'
,fAutoToolTipSymbTools);
XMLConfig.SetValue('EditorOptions/CodeTools/AutoDelayInMSec'
,fAutoDelayInMSec);
XMLConfig.SetValue('EditorOptions/CodeTools/CodeTemplateFileName'
,fCodeTemplateFileName);
XMLConfig.GetValue('EditorOptions/CodeTools/CodeTemplateIndentToTokenStart/Value'
,fCTemplIndentToTokenStart);
XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoIdentifierCompletion'
,fAutoIdentifierCompletion,true);
XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoCodeParameters'
,fAutoCodeParameters,true);
XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoToolTipExprEval'
,fAutoToolTipExprEval,true);
XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoToolTipSymbTools'
,fAutoToolTipSymbTools,false);
XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoDelayInMSec'
,fAutoDelayInMSec,1000);
XMLConfig.SetDeleteValue('EditorOptions/CodeTools/CodeTemplateFileName'
,fCodeTemplateFileName,'');
XMLConfig.SetDeleteValue(
'EditorOptions/CodeTools/CodeTemplateIndentToTokenStart/Value'
,fCTemplIndentToTokenStart,false);
XMLConfig.Flush;
@ -1974,8 +1999,6 @@ begin
SetupColorPage;
SetupCodeToolsPage;
MainNoteBook.Show;
SetupButtonBar;
end;
@ -2641,7 +2664,6 @@ begin
Top:=0;
Width:=Self.ClientWidth-4;
Height:=Self.ClientHeight-50;
Show;
end;
BackButton:=TButton.Create(Self);
@ -2654,7 +2676,6 @@ begin
Left:=((Self.ClientWidth-4)-Width) div 2;
Top:=Self.ClientHeight-38;
OnClick:=@BackButtonClick;
Show;
end;
end;
end;
@ -3158,7 +3179,6 @@ begin
Width:=MaxX-10;
Height:=24*11; // 24 pixels per line
Caption:=lismenueditoroptions;
Show;
end;
// many, many checkboxes ...
@ -3175,7 +3195,6 @@ begin
Caption:=dlgAltSetClMode;
Checked:=eoAltSetsColumnMode in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
AutoIndentCheckBox:=TCheckBox.Create(Self);
@ -3189,7 +3208,6 @@ begin
Caption:=dlgAutoIdent;
Checked:=eoAutoIndent in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
BracketHighlightCheckBox:=TCheckBox.Create(Self);
@ -3203,7 +3221,6 @@ begin
Caption:=dlgBracHighlight;
Checked:=eoBracketHighlight in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
DragDropEditingCheckBox:=TCheckBox.Create(Self);
@ -3217,7 +3234,6 @@ begin
Caption:=dlgDragDropEd;
Checked:=eoDragDropEditing in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
DropFilesCheckBox:=TCheckBox.Create(Self);
@ -3232,7 +3248,6 @@ begin
Checked:=eoDropFiles in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Enabled:=false;
Show;
end;
HalfPageScrollCheckBox:=TCheckBox.Create(Self);
@ -3246,7 +3261,6 @@ begin
Caption:=dlgHalfPageScroll;
Checked:=eoHalfPageScroll in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
KeepCaretXCheckBox:=TCheckBox.Create(Self);
@ -3260,7 +3274,6 @@ begin
Caption:=dlgKeepCaretX;
Checked:=eoKeepCaretX in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
PersistentCaretCheckBox:=TCheckBox.Create(Self);
@ -3274,7 +3287,6 @@ begin
Caption:=dlgPersistentCaret;
Checked:=eoPersistentCaret in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
ScrollByOneLessCheckBox:=TCheckBox.Create(Self);
@ -3288,7 +3300,6 @@ begin
Caption:=dlgScrollByOneLess;
Checked:=eoScrollByOneLess in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
ScrollPastEoFCheckBox:=TCheckBox.Create(Self);
@ -3302,7 +3313,6 @@ begin
Caption:=dlgScrollPastEndFile;
Checked:=eoScrollPastEoF in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
MouseLinksCheckBox:=TCheckBox.Create(Self);
@ -3315,7 +3325,6 @@ begin
Height:=AltSetsColumnModeCheckBox.Height;
Caption:=dlgMouseLinks;
Checked:=EditorOpts.CtrlMouseLinks;
Show;
end;
// right side
@ -3330,7 +3339,6 @@ begin
Caption:=dlgScrollPastEndLine;
Checked:=eoScrollPastEoL in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
ShowCloseBtnInNoteBookCheckBox:=TCheckBox.Create(Self);
@ -3344,7 +3352,6 @@ begin
Caption:=dlgCloseButtonsNotebook;
Checked:=EditorOpts.ShowTabCloseButtons;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
ShowScrollHintCheckBox:=TCheckBox.Create(Self);
@ -3359,7 +3366,6 @@ begin
Caption:=dlgShowScrollHint;
Checked:=eoShowScrollHint in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
SmartTabsCheckBox:=TCheckBox.Create(Self);
@ -3373,7 +3379,6 @@ begin
Caption:=dlgSmartTabs;
Checked:=eoSmartTabs in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
TabsToSpacesCheckBox:=TCheckBox.Create(Self);
@ -3387,7 +3392,6 @@ begin
Caption:=dlgTabsToSpaces;
Checked:=eoTabsToSpaces in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
TrimTrailingSpacesCheckBox:=TCheckBox.Create(Self);
@ -3401,7 +3405,6 @@ begin
Caption:=dlgTrimTrailingSpaces ;
Checked:=eoTrimTrailingSpaces in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
UndoAfterSaveCheckBox:=TCheckBox.Create(Self);
@ -3415,7 +3418,6 @@ begin
Caption:=dlgUndoAfterSave;
Checked:=EditorOpts.UndoAfterSave;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
DoubleClickLineCheckBox:=TCheckBox.Create(Self);
@ -3429,7 +3431,6 @@ begin
Caption:=dlgDoubleClickLine;
Checked:=eoDoubleClickSelectsLine in EditorOpts.SynEditOptions;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
FindTextAtCursorCheckBox:=TCheckBox.Create(Self);
@ -3443,7 +3444,6 @@ begin
Caption:=dlgFindTextatCursor;
Checked:=EditorOpts.FindTextAtCursor;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
UseSyntaxHighlightCheckBox:=TCheckBox.Create(Self);
@ -3457,10 +3457,22 @@ begin
Caption:=dlgUseSyntaxHighlight;
Checked:=EditorOpts.UseSyntaxHighlight;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
//
CopyWordAtCursorOnCopyNoneCheckBox:=TCheckBox.Create(Self);
with CopyWordAtCursorOnCopyNoneCheckBox do begin
Name:='CopyWordAtCursorOnCopyNoneCheckBox';
Parent:=EditorOptionsGroupBox;
Top:=UseSyntaxHighlightCheckBox.Top+UseSyntaxHighlightCheckBox.Height+5;
Left:=ShowScrollHintCheckBox.Left;
Width:=ChkBoxW;
Height:=AltSetsColumnModeCheckBox.Height;
Caption:=dlgCopyWordAtCursorOnCopyNone;
Checked:=EditorOpts.CopyWordAtCursorOnCopyNone;
OnClick:=@GeneralCheckBoxOnClick;
end;
//
BlockIndentComboBox:=TComboBox.Create(Self);
with BlockIndentComboBox do begin
@ -3479,7 +3491,6 @@ begin
OnChange:=@ComboBoxOnChange;
OnKeyDown:=@ComboBoxOnKeyDown;
OnExit:=@ComboBoxOnExit;
Show;
end;
BlockIndentLabel:=TLabel.Create(Self);
@ -3490,7 +3501,6 @@ begin
Left:=EditorOptionsGroupBox.Left+2;
Width:=BlockIndentComboBox.Left-2-Left;
Caption:=dlgBlockIndent;
Show;
end;
UndoLimitComboBox:=TComboBox.Create(Self);
@ -3509,7 +3519,6 @@ begin
OnChange:=@ComboBoxOnChange;
OnKeyDown:=@ComboBoxOnKeyDown;
OnExit:=@ComboBoxOnExit;
Show;
end;
UndoLimitLabel:=TLabel.Create(Self);
@ -3520,7 +3529,6 @@ begin
Left:=EditorOptionsGroupBox.Left+2;
Width:=UndoLimitComboBox.Left-Left-2;
Caption:=dlgUndoLimit;
Show;
end;
TabWidthsComboBox:=TComboBox.Create(Self);
@ -3540,7 +3548,6 @@ begin
OnChange:=@ComboBoxOnChange;
OnKeyDown:=@ComboBoxOnKeyDown;
OnExit:=@ComboBoxOnExit;
Show;
end;
TabWidthsLabel:=TLabel.Create(Self);
@ -3551,7 +3558,6 @@ begin
Left:=EditorOptionsGroupBox.Left+2;
Width:=TabWidthsComboBox.Left-Left-2;
Caption:='Tab widths:';
Show;
end;
end;
@ -3720,6 +3726,13 @@ begin
Height:=AltSetsColumnModeCheckBox.Height;
end;
with CopyWordAtCursorOnCopyNoneCheckBox do begin
Top:=UseSyntaxHighlightCheckBox.Top+UseSyntaxHighlightCheckBox.Height+5;
Left:=ShowScrollHintCheckBox.Left;
Width:=ChkBoxW;
Height:=AltSetsColumnModeCheckBox.Height;
end;
//
with BlockIndentComboBox do begin
@ -3775,7 +3788,6 @@ begin
Width:=MaxX-10;
Height:=109;
Caption:=dlgMarginGutter;
Show;
end;
VisibleRightMarginCheckBox:=TCheckBox.Create(Self);
@ -3790,7 +3802,6 @@ begin
Checked:=EditorOpts.VisibleRightMargin;
OnClick:=@GeneralCheckBoxOnClick;
Enabled:=false;
Show;
end;
VisibleGutterCheckBox:=TCheckBox.Create(Self);
@ -3804,7 +3815,6 @@ begin
Caption:=dlgVisibleGutter;
Checked:=EditorOpts.VisibleGutter;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
ShowLineNumbersCheckBox:=TCheckBox.Create(Self);
@ -3818,7 +3828,6 @@ begin
Caption:=dlgShowLineNumbers ;
Checked:=EditorOpts.ShowLineNumbers;
OnClick:=@GeneralCheckBoxOnClick;
Show;
end;
RightMarginComboBox:=TComboBox.Create(Self);
@ -3837,7 +3846,6 @@ begin
OnChange:=@ComboBoxOnChange;
OnKeyDown:=@ComboBoxOnKeyDown;
OnExit:=@ComboBoxOnExit;
Show;
end;
RightMarginLabel:=TLabel.Create(Self);
@ -3848,7 +3856,6 @@ begin
Left:=RightMarginComboBox.Left+2;
Width:=150;
Caption:=dlgRightMargin ;
Show;
end;
RightMarginColorButton:=TColorButton.Create(Self);
@ -3862,7 +3869,6 @@ begin
BorderWidth:=2;
ButtonColor:=EditorOpts.RightMarginColor;
OnColorChanged:=@ColorButtonColorChanged;
Show;
end;
RightMarginColorLabel:=TLabel.Create(Self);
@ -3873,7 +3879,6 @@ begin
Left:=RightMarginComboBox.Left+2;
Width:=150;
Caption:=dlgRightMarginColor ;
Show;
end;
GutterWidthComboBox:=TComboBox.Create(Self);
@ -3895,7 +3900,6 @@ begin
OnChange:=@ComboBoxOnChange;
OnKeyDown:=@ComboBoxOnKeyDown;
OnExit:=@ComboBoxOnExit;
Show;
end;
GutterWidthLabel:=TLabel.Create(Self);
@ -3906,7 +3910,6 @@ begin
Left:=GutterWidthComboBox.Left+2;
Width:=130;
Caption:=dlgGutterWidth ;
Show;
end;
GutterColorButton:=TColorButton.Create(Self);
@ -3920,7 +3923,6 @@ begin
BorderWidth:=2;
ButtonColor:=EditorOpts.GutterColor;
OnColorChanged:=@ColorButtonColorChanged;
Show;
end;
GutterColorLabel:=TLabel.Create(Self);
@ -3931,7 +3933,6 @@ begin
Left:=GutterWidthComboBox.Left+2;
Width:=130;
Caption:=dlgGutterColor ;
Show;
end;
EditorFontGroupBox:=TGroupBox.Create(Self);
@ -3943,7 +3944,6 @@ begin
Width:=MarginAndGutterGroupBox.Width;
Height:=120;
Caption:=dlgDefaultEditorFont;
Show;
end;
EditorFontComboBox:=TComboBox.Create(Self);
@ -3957,7 +3957,6 @@ begin
OnChange:=@ComboBoxOnChange;
OnKeyDown:=@ComboBoxOnKeyDown;
OnExit:=@ComboBoxOnExit;
Show;
end;
EditorFontButton:=TButton.Create(Self);
@ -3970,7 +3969,6 @@ begin
Height:=Width;
Caption:='...';
OnClick:=@EditorFontButtonClick;
Show;
end;
EditorFontLabel:=TLabel.Create(Self);
@ -3981,7 +3979,6 @@ begin
Left:=EditorFontComboBox.Left+2;
Width:=130;
Caption:=dlgEditorFont ;
Show;
end;
EditorFontHeightComboBox:=TComboBox.Create(Self);
@ -4004,7 +4001,6 @@ begin
OnChange:=@ComboBoxOnChange;
OnKeyDown:=@ComboBoxOnKeyDown;
OnExit:=@ComboBoxOnExit;
Show;
end;
EditorFontHeightLabel:=TLabel.Create(Self);
@ -4015,7 +4011,6 @@ begin
Left:=EditorFontHeightComboBox.Left+2;
Width:=150;
Caption:=dlgEditorFontHeight ;
Show;
end;
ExtraLineSpacingComboBox:=TComboBox.Create(Self);
@ -4035,7 +4030,6 @@ begin
OnChange:=@ComboBoxOnChange;
OnKeyDown:=@ComboBoxOnKeyDown;
OnExit:=@ComboBoxOnExit;
Show;
end;
ExtraLineSpacingLabel:=TLabel.Create(Self);
@ -4046,7 +4040,6 @@ begin
Left:=ExtraLineSpacingComboBox.Left+2;
Width:=150;
Caption:=dlgExtraLineSpacing ;
Show;
end;
DisplayPreview:=TPreviewEditor.Create(Self);
@ -4060,7 +4053,6 @@ begin
Height:=MaxY-Top-2;
OnSpecialLineColors:=@Self.OnSpecialLineColors;
ReadOnly:=true;
Show;
end;
end;
@ -5170,7 +5162,6 @@ begin
Left:=Self.Width-Width-10;
Caption:=dlgCancel;
OnClick:=@CancelButtonClick;
Show;
end;
OkButton:=TButton.Create(Self);
@ -5183,7 +5174,6 @@ begin
Left:=CancelButton.Left-10-Width;
Caption:='Ok';
OnClick:=@OkButtonClick;
Show;
end;
end;
@ -5226,6 +5216,8 @@ begin
// general
EditorOpts.ShowTabCloseButtons:=ShowCloseBtnInNoteBookCheckBox.Checked;
EditorOpts.UndoAfterSave:=UndoAfterSaveCheckBox.Checked;
EditorOpts.CopyWordAtCursorOnCopyNone:=
CopyWordAtCursorOnCopyNoneCheckBox.Checked;
EditorOpts.FindTextAtCursor:=FindTextAtCursorCheckBox.Checked;
EditorOpts.UseSyntaxHighlight:=UseSyntaxHighlightCheckBox.Checked;
EditorOpts.CtrlMouseLinks:=MouseLinksCheckBox.Checked;

View File

@ -649,6 +649,7 @@ resourcestring
dlgDoubleClickLine = 'Double click line';
dlgFindTextatCursor = 'Find text at cursor';
dlgUseSyntaxHighlight = 'Use syntax highlight';
dlgCopyWordAtCursorOnCopyNone = 'Copy word on copy none';
dlgBlockIndent = 'Block indent:';
dlgUndoLimit = 'Undo limit:';
dlgTabWidths = 'Tab widths:';