From 7ebaadc7bd832e8272d3c71beefb18cb45ee9c0c Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 2 Apr 2012 00:24:15 +0000 Subject: [PATCH] Window Column, store pointer to resourcestring git-svn-id: trunk@36509 - --- debugger/breakpointsdlg.pp | 14 +++++++------- debugger/callstackdlg.pp | 10 +++++----- debugger/historydlg.pp | 6 +++--- debugger/inspectdlg.pas | 14 +++++++------- debugger/localsdlg.pp | 4 ++-- debugger/registersdlg.pp | 4 ++-- debugger/threaddlg.pp | 14 +++++++------- debugger/watchesdlg.pp | 4 ++-- ideintf/idewindowintf.pas | 35 ++++++++++++++++++++++------------- 9 files changed, 57 insertions(+), 48 deletions(-) diff --git a/debugger/breakpointsdlg.pp b/debugger/breakpointsdlg.pp index 3d0c6fef19..fae1a26d91 100644 --- a/debugger/breakpointsdlg.pp +++ b/debugger/breakpointsdlg.pp @@ -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. diff --git a/debugger/callstackdlg.pp b/debugger/callstackdlg.pp index d7fada3b12..9ba4b926ea 100644 --- a/debugger/callstackdlg.pp +++ b/debugger/callstackdlg.pp @@ -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} ); diff --git a/debugger/historydlg.pp b/debugger/historydlg.pp index d3f05a0d78..51364ebf14 100644 --- a/debugger/historydlg.pp +++ b/debugger/historydlg.pp @@ -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. diff --git a/debugger/inspectdlg.pas b/debugger/inspectdlg.pas index 938dcd5b53..6cd80edd1d 100644 --- a/debugger/inspectdlg.pas +++ b/debugger/inspectdlg.pas @@ -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. diff --git a/debugger/localsdlg.pp b/debugger/localsdlg.pp index af60c1c176..ed2d7881d9 100644 --- a/debugger/localsdlg.pp +++ b/debugger/localsdlg.pp @@ -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} ); diff --git a/debugger/registersdlg.pp b/debugger/registersdlg.pp index 0159c0aa97..4360db8822 100644 --- a/debugger/registersdlg.pp +++ b/debugger/registersdlg.pp @@ -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. diff --git a/debugger/threaddlg.pp b/debugger/threaddlg.pp index ec90a29bf0..d80b074561 100644 --- a/debugger/threaddlg.pp +++ b/debugger/threaddlg.pp @@ -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} ); diff --git a/debugger/watchesdlg.pp b/debugger/watchesdlg.pp index 6ee77ecbc1..e14fbe6553 100644 --- a/debugger/watchesdlg.pp +++ b/debugger/watchesdlg.pp @@ -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} ); diff --git a/ideintf/idewindowintf.pas b/ideintf/idewindowintf.pas index 85eee3fc60..193b345ffb 100644 --- a/ideintf/idewindowintf.pas +++ b/ideintf/idewindowintf.pas @@ -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;