Window Column, store pointer to resourcestring

git-svn-id: trunk@36509 -
This commit is contained in:
martin 2012-04-02 00:24:15 +00:00
parent 40fea24746
commit 7ebaadc7bd
9 changed files with 57 additions and 48 deletions

View File

@ -1026,13 +1026,13 @@ initialization
BreakPointDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
BreakPointDlgWindowCreator.OnSetDividerSize := @BreakPointDlgColSizeSetter;
BreakPointDlgWindowCreator.OnGetDividerSize := @BreakPointDlgColSizeGetter;
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakState', COL_BREAK_STATE, drsColWidthState);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakFile', COL_BREAK_FILE, drsBreakPointColWidthFile);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakLine', COL_BREAK_LINE, drsBreakPointColWidthLine);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakCondition', COL_BREAK_CONDITION, drsBreakPointColWidthCondition);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakAction', COL_BREAK_ACTION, drsBreakPointColWidthAction);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakPassCnt', COL_BREAK_PASS, drsBreakPointColWidthPassCount);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakGroup', COL_BREAK_GROUP, drsBreakPointColWidthGroup);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakState', COL_BREAK_STATE, @drsColWidthState);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakFile', COL_BREAK_FILE, @drsBreakPointColWidthFile);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakLine', COL_BREAK_LINE, @drsBreakPointColWidthLine);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakCondition', COL_BREAK_CONDITION, @drsBreakPointColWidthCondition);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakAction', COL_BREAK_ACTION, @drsBreakPointColWidthAction);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakPassCnt', COL_BREAK_PASS, @drsBreakPointColWidthPassCount);
BreakPointDlgWindowCreator.DividerTemplate.Add('ColumnBreakGroup', COL_BREAK_GROUP, @drsBreakPointColWidthGroup);
BreakPointDlgWindowCreator.CreateSimpleLayout;
end.

View File

@ -819,11 +819,11 @@ initialization
CallStackDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
CallStackDlgWindowCreator.OnSetDividerSize := @CallStackDlgColSizeSetter;
CallStackDlgWindowCreator.OnGetDividerSize := @CallStackDlgColSizeGetter;
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackBrkPoint', COL_STACK_BRKPOINT, drsColWidthBrkPointImg);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackIndex', COL_STACK_INDEX, drsColWidthIndex);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackSource', COL_STACK_SOURCE, drsColWidthSource);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackLine', COL_STACK_LINE, drsColWidthLine);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackFunc', COL_STACK_FUNC, drsColWidthFunc);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackBrkPoint', COL_STACK_BRKPOINT, @drsColWidthBrkPointImg);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackIndex', COL_STACK_INDEX, @drsColWidthIndex);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackSource', COL_STACK_SOURCE, @drsColWidthSource);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackLine', COL_STACK_LINE, @drsColWidthLine);
CallStackDlgWindowCreator.DividerTemplate.Add('ColumnCStackFunc', COL_STACK_FUNC, @drsColWidthFunc);
CallStackDlgWindowCreator.CreateSimpleLayout;
DBG_DATA_MONITORS := DebugLogger.FindOrRegisterLogGroup('DBG_DATA_MONITORS' {$IFDEF DBG_DATA_MONITORS} , True {$ENDIF} );

View File

@ -370,9 +370,9 @@ initialization
HistoryDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
HistoryDlgWindowCreator.OnSetDividerSize := @HistoryDlgColSizeSetter;
HistoryDlgWindowCreator.OnGetDividerSize := @HistoryDlgColSizeGetter;
HistoryDlgWindowCreator.DividerTemplate.Add('HistoryColCur', COL_HISTORY_CUR, drsHistoryColWidthCurrent);
HistoryDlgWindowCreator.DividerTemplate.Add('HistoryColTime', COL_HISTORY_TIME, drsHistoryColWidthTime);
HistoryDlgWindowCreator.DividerTemplate.Add('HistoryColLocation', COL_HISTORY_LOC, drsHistoryColWidthLocation);
HistoryDlgWindowCreator.DividerTemplate.Add('HistoryColCur', COL_HISTORY_CUR, @drsHistoryColWidthCurrent);
HistoryDlgWindowCreator.DividerTemplate.Add('HistoryColTime', COL_HISTORY_TIME, @drsHistoryColWidthTime);
HistoryDlgWindowCreator.DividerTemplate.Add('HistoryColLocation', COL_HISTORY_LOC, @drsHistoryColWidthLocation);
HistoryDlgWindowCreator.CreateSimpleLayout;
end.

View File

@ -569,14 +569,14 @@ initialization
InspectDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
InspectDlgWindowCreator.OnSetDividerSize := @InspectDlgColSizeSetter;
InspectDlgWindowCreator.OnGetDividerSize := @InspectDlgColSizeGetter;
InspectDlgWindowCreator.DividerTemplate.Add('InspectDataName', COL_INSPECT_DNAME, drsInspectColWidthDataName);
InspectDlgWindowCreator.DividerTemplate.Add('InspectDataType', COL_INSPECT_DTYPE, drsInspectColWidthDataType);
InspectDlgWindowCreator.DividerTemplate.Add('InspectDataValue', COL_INSPECT_DVALUE, drsInspectColWidthDataValue);
InspectDlgWindowCreator.DividerTemplate.Add('InspectDataName', COL_INSPECT_DNAME, @drsInspectColWidthDataName);
InspectDlgWindowCreator.DividerTemplate.Add('InspectDataType', COL_INSPECT_DTYPE, @drsInspectColWidthDataType);
InspectDlgWindowCreator.DividerTemplate.Add('InspectDataValue', COL_INSPECT_DVALUE, @drsInspectColWidthDataValue);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethName', COL_INSPECT_MNAME, drsInspectColWidthMethName);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethType', COL_INSPECT_MTYPE, drsInspectColWidthMethType);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethReturns', COL_INSPECT_MRETURNS, drsInspectColWidthMethReturns);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethAddress', COL_INSPECT_MADDRESS, drsInspectColWidthMethAddress);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethName', COL_INSPECT_MNAME, @drsInspectColWidthMethName);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethType', COL_INSPECT_MTYPE, @drsInspectColWidthMethType);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethReturns', COL_INSPECT_MRETURNS, @drsInspectColWidthMethReturns);
InspectDlgWindowCreator.DividerTemplate.Add('InspectMethAddress', COL_INSPECT_MADDRESS, @drsInspectColWidthMethAddress);
InspectDlgWindowCreator.CreateSimpleLayout;
end.

View File

@ -364,8 +364,8 @@ initialization
LocalsDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
LocalsDlgWindowCreator.OnSetDividerSize := @LocalsDlgColSizeSetter;
LocalsDlgWindowCreator.OnGetDividerSize := @LocalsDlgColSizeGetter;
LocalsDlgWindowCreator.DividerTemplate.Add('LocalsName', COL_LOCALS_NAME, drsColWidthName);
LocalsDlgWindowCreator.DividerTemplate.Add('LocalsValue', COL_LOCALS_VALUE, drsColWidthValue);
LocalsDlgWindowCreator.DividerTemplate.Add('LocalsName', COL_LOCALS_NAME, @drsColWidthName);
LocalsDlgWindowCreator.DividerTemplate.Add('LocalsValue', COL_LOCALS_VALUE, @drsColWidthValue);
LocalsDlgWindowCreator.CreateSimpleLayout;
DBG_DATA_MONITORS := DebugLogger.FindOrRegisterLogGroup('DBG_DATA_MONITORS' {$IFDEF DBG_DATA_MONITORS} , True {$ENDIF} );

View File

@ -379,8 +379,8 @@ initialization
RegisterDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
RegisterDlgWindowCreator.OnSetDividerSize := @RegisterDlgColSizeSetter;
RegisterDlgWindowCreator.OnGetDividerSize := @RegisterDlgColSizeGetter;
RegisterDlgWindowCreator.DividerTemplate.Add('RegisterName', COL_REGISTER_NAME, drsColWidthName);
RegisterDlgWindowCreator.DividerTemplate.Add('RegisterValue', COL_REGISTER_VALUE, drsColWidthValue);
RegisterDlgWindowCreator.DividerTemplate.Add('RegisterName', COL_REGISTER_NAME, @drsColWidthName);
RegisterDlgWindowCreator.DividerTemplate.Add('RegisterValue', COL_REGISTER_VALUE, @drsColWidthValue);
RegisterDlgWindowCreator.CreateSimpleLayout;
end.

View File

@ -263,13 +263,13 @@ initialization
ThreadDlgWindowCreator.OnCreateFormProc := @CreateDebugDialog;
ThreadDlgWindowCreator.OnSetDividerSize := @ThreadsDlgColSizeSetter;
ThreadDlgWindowCreator.OnGetDividerSize := @ThreadsDlgColSizeGetter;
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadBrkPoint', COL_THREAD_BRKPOINT, drsColWidthBrkPointImg);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadIndex', COL_THREAD_INDEX, drsColWidthIndex);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadName', COL_THREAD_NAME, drsColWidthName);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadState', COL_THREAD_STATE, drsColWidthState);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadSource', COL_THREAD_SOURCE, drsColWidthSource);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadLine', COL_THREAD_LINE, drsColWidthLine);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadFunc', COL_THREAD_FUNC, drsColWidthFunc);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadBrkPoint', COL_THREAD_BRKPOINT, @drsColWidthBrkPointImg);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadIndex', COL_THREAD_INDEX, @drsColWidthIndex);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadName', COL_THREAD_NAME, @drsColWidthName);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadState', COL_THREAD_STATE, @drsColWidthState);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadSource', COL_THREAD_SOURCE, @drsColWidthSource);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadLine', COL_THREAD_LINE, @drsColWidthLine);
ThreadDlgWindowCreator.DividerTemplate.Add('ColumnThreadFunc', COL_THREAD_FUNC, @drsColWidthFunc);
ThreadDlgWindowCreator.CreateSimpleLayout;
DBG_DATA_MONITORS := DebugLogger.FindOrRegisterLogGroup('DBG_DATA_MONITORS' {$IFDEF DBG_DATA_MONITORS} , True {$ENDIF} );

View File

@ -777,8 +777,8 @@ initialization
WatchWindowCreator.OnCreateFormProc := @CreateDebugDialog;
WatchWindowCreator.OnSetDividerSize := @WatchesDlgColSizeSetter;
WatchWindowCreator.OnGetDividerSize := @WatchesDlgColSizeGetter;
WatchWindowCreator.DividerTemplate.Add('ColumnWatchExpr', COL_WATCH_EXPR, drsColWidthExpression);
WatchWindowCreator.DividerTemplate.Add('ColumnWatchValue', COL_WATCH_VALUE, drsColWidthValue);
WatchWindowCreator.DividerTemplate.Add('ColumnWatchExpr', COL_WATCH_EXPR, @drsColWidthExpression);
WatchWindowCreator.DividerTemplate.Add('ColumnWatchValue', COL_WATCH_VALUE, @drsColWidthValue);
WatchWindowCreator.CreateSimpleLayout;
DBG_DATA_MONITORS := DebugLogger.FindOrRegisterLogGroup('DBG_DATA_MONITORS' {$IFDEF DBG_DATA_MONITORS} , True {$ENDIF} );

View File

@ -141,24 +141,25 @@ type
TSimpleWindowLayoutDividerPos = class
private
FDefaultSize: integer;
FDisplayName: String;
FDisplayName: PString;
FId: Integer;
FIdString: String;
FPlacement: TSimpleWindowLayoutDividerPosPlacement;
FSize: integer;
function GetDisplayName: String;
protected
procedure SetDisplayName(ADisplayName: String);
procedure SetDisplayName(ADisplayName: PString);
procedure SetId(AnId: Integer);
public
constructor Create(AnIdString: String);
constructor Create(AnIdString: String; AnId: Integer; ADisplayName: String);
constructor Create(AnIdString: String; AnId: Integer; ADisplayName: PString);
procedure Assign(ADividerPos: TSimpleWindowLayoutDividerPos); reintroduce;
procedure LoadFromConfig(Config: TConfigStorage; const Path: string);
function SaveToConfig(Config: TConfigStorage; const Path: string) : Boolean;
procedure Clear;
property IdString: String read FIdString;
property Id: Integer read FId;
property DisplayName: String read FDisplayName;
property DisplayName: String read GetDisplayName;
property Placement: TSimpleWindowLayoutDividerPosPlacement read FPlacement write FPlacement;
property Size: integer read FSize write FSize;
property DefaultSize: integer read FDefaultSize write FDefaultSize;
@ -181,7 +182,7 @@ type
procedure SaveToConfig(Config: TConfigStorage; const Path: string);
procedure Clear;
procedure ClearItems;
function Add(AnIdString: String; AnId: Integer; ADisplayName: String): TSimpleWindowLayoutDividerPos;
function Add(AnIdString: String; AnId: Integer; ADisplayName: PString): TSimpleWindowLayoutDividerPos;
function Add(AnIdString: String): TSimpleWindowLayoutDividerPos;
function Count: Integer;
function NamedCount: Integer;
@ -561,7 +562,7 @@ begin
if AnItem.Id < 0 then
AnItem.SetId(old.Id);
if AnItem.DisplayName = '' then
AnItem.SetDisplayName(old.DisplayName);
AnItem.SetDisplayName(old.FDisplayName);
if AnItem.DefaultSize < 0 then
AnItem.DefaultSize := old.DefaultSize;
@ -639,7 +640,7 @@ begin
end;
function TSimpleWindowLayoutDividerPosList.Add(AnIdString: String;
AnId: Integer; ADisplayName: String): TSimpleWindowLayoutDividerPos;
AnId: Integer; ADisplayName: PString): TSimpleWindowLayoutDividerPos;
var
i: Integer;
begin
@ -651,14 +652,14 @@ begin
end
else begin
Result := Items[i];
if ADisplayName = '' then
if ADisplayName = nil then
Result.SetDisplayName(ADisplayName);
end
end;
function TSimpleWindowLayoutDividerPosList.Add(AnIdString: String): TSimpleWindowLayoutDividerPos;
begin
Result := Add(AnIdString, -1, '');
Result := Add(AnIdString, -1, nil);
end;
function TSimpleWindowLayoutDividerPosList.Count: Integer;
@ -725,7 +726,15 @@ end;
{ TSimpleWindowLayoutDividerPos }
procedure TSimpleWindowLayoutDividerPos.SetDisplayName(ADisplayName: String);
function TSimpleWindowLayoutDividerPos.GetDisplayName: String;
begin
if FDisplayName = nil then
Result := ''
else
Result := FDisplayName^;
end;
procedure TSimpleWindowLayoutDividerPos.SetDisplayName(ADisplayName: PString);
begin
FDisplayName := ADisplayName;
end;
@ -737,11 +746,11 @@ end;
constructor TSimpleWindowLayoutDividerPos.Create(AnIdString: String);
begin
Create(AnIdString, -1, '');
Create(AnIdString, -1, nil);
end;
constructor TSimpleWindowLayoutDividerPos.Create(AnIdString: String;
AnId: Integer; ADisplayName: String);
constructor TSimpleWindowLayoutDividerPos.Create(AnIdString: String; AnId: Integer;
ADisplayName: PString);
begin
FDefaultSize := -1;
Clear;