Skip to content

Commit 6b68c41

Browse files
committed
refactor/Tostring-to-ToString
1 parent 406c5dd commit 6b68c41

15 files changed

+81
-59
lines changed

Src/IDE/EditServicesNotifier/C4D.Wizard.IDE.EditServicesNotifier.pas

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ procedure TC4DWizardIDEEditServicesNotifier.EditorViewActivated(const EditWindow
8080
procedure TC4DWizardIDEEditServicesNotifier.EditorViewModified(const EditWindow: INTAEditWindow; const EditView: IOTAEditView);
8181
begin
8282
// AddLogInternal('EditorViewModified: ' +
83-
// ' Linha atual: ' + EditView.Buffer.EditPosition.Row.Tostring +
84-
// ' Coluna atual: ' + EditView.Buffer.EditPosition.Column.Tostring +
85-
// ' Ultima linha: ' + EditView.Buffer.EditPosition.LastRow.Tostring);
83+
// ' Linha atual: ' + EditView.Buffer.EditPosition.Row.ToString +
84+
// ' Coluna atual: ' + EditView.Buffer.EditPosition.Column.ToString +
85+
// ' Ultima linha: ' + EditView.Buffer.EditPosition.LastRow.ToString);
8686
end;
8787

8888
procedure TC4DWizardIDEEditServicesNotifier.WindowActivated(const EditWindow: INTAEditWindow);
@@ -92,7 +92,7 @@ procedure TC4DWizardIDEEditServicesNotifier.WindowActivated(const EditWindow: IN
9292

9393
procedure TC4DWizardIDEEditServicesNotifier.WindowCommand(const EditWindow: INTAEditWindow; Command, Param: Integer; var Handled: Boolean);
9494
begin
95-
//AddLogInternal('WindowCommand: Command: ' + Command.Tostring + ' - Param: ' + Param.Tostring);
95+
//AddLogInternal('WindowCommand: Command: ' + Command.ToString + ' - Param: ' + Param.ToString);
9696
//if(Command = 22)then
9797
//begin
9898
// ShowMessage('Você teclou Ctrl + C e essa opção não é permitida');

Src/IDE/MainMenu/C4D.Wizard.IDE.MainMenu.OpenExternal.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function TC4DWizardIDEMainMenuOpenExternal.CreateSubMenu(const AMenuItemParent:
196196
LMenuItem: TMenuItem;
197197
begin
198198
LMenuItem := TMenuItem.Create(AMenuItemParent);
199-
LMenuItem.Name := 'C4DOpenExternalItemMenu' + TC4DWizardUtils.IncInt(FCont).Tostring;
199+
LMenuItem.Name := 'C4DOpenExternalItemMenu' + TC4DWizardUtils.IncInt(FCont).ToString;
200200
LMenuItem.Caption := AC4DWizardOpenExternal.Description;
201201
LMenuItem.OnClick := Self.ItemMenuClick;
202202
LMenuItem.Hint := AC4DWizardOpenExternal.Path + TC4DConsts.OPEN_EXTERNAL_Separator_PARAMETERS + AC4DWizardOpenExternal.Parameters;

Src/IDE/ToolBars/C4D.Wizard.IDE.ToolBars.Utilities.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ procedure TC4DWizardIDEToolBarsUtilities.OpenExternalCreateButton(const AC4DWiza
281281
LNameButton: string;
282282
LToolButton: TToolButton;
283283
begin
284-
LNameButton := 'C4DToolBarsUtilities' + TC4DWizardUtils.IncInt(FCont).Tostring;
284+
LNameButton := 'C4DToolBarsUtilities' + TC4DWizardUtils.IncInt(FCont).ToString;
285285
LToolButton := TToolButton(FToolBarUtilities.FindComponent(LNameButton));
286286
if(LToolButton <> nil)then
287287
LToolButton.Free;

Src/Messages/C4D.Wizard.Messages.Custom.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ function TC4DWizardMessageCustom.AddMsg: IC4DWizardMessageCustom;
284284
LMsg := Self.AddContrastInSubstr(LMsg, FSubstrContrast);
285285

286286
if(not FFileName.IsEmpty)then
287-
LMsg := FFileName + '('+ FLine.Tostring +'): ' + LMsg;
287+
LMsg := FFileName + '('+ FLine.ToString +'): ' + LMsg;
288288

289289
if(not FPrefix.IsEmpty)then
290290
LMsg := '['+ FPrefix +'] ' + LMsg;

Src/OpenExternal/C4D.Wizard.OpenExternal.AddEdit.View.pas

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ procedure TC4DWizardOpenExternalAddEditView.FormDestroy(Sender: TObject);
114114
procedure TC4DWizardOpenExternalAddEditView.FormShow(Sender: TObject);
115115
begin
116116
edtDescription.Text := FC4DWizardOpenExternal.Description;
117-
cBoxKind.ItemIndex := cBoxKind.Items.IndexOf(FC4DWizardOpenExternal.Kind.Tostring);
117+
cBoxKind.ItemIndex := cBoxKind.Items.IndexOf(FC4DWizardOpenExternal.Kind.ToString);
118118
edtPath.Text := FC4DWizardOpenExternal.Path;
119119
edtParameters.Text := FC4DWizardOpenExternal.Parameters;
120-
edtOrder.Text := FC4DWizardOpenExternal.Order.Tostring;
120+
edtOrder.Text := FC4DWizardOpenExternal.Order.ToString;
121121
edtShortcut.HotKey := TextToShortCut(FC4DWizardOpenExternal.Shortcut);
122122
ckVisible.Checked := FC4DWizardOpenExternal.Visible;
123123
ckVisibleInToolBarUtilities.Checked := FC4DWizardOpenExternal.VisibleInToolBarUtilities;
@@ -207,7 +207,7 @@ procedure TC4DWizardOpenExternalAddEditView.btnBathClick(Sender: TObject);
207207
LDefaultPath := edtPath.Text;
208208
if(LDefaultPath.Trim.IsEmpty)then
209209
LDefaultPath := ExtractFilePath(FC4DWizardOpenExternal.Path);
210-
if(cBoxKind.Text = TC4DWizardOpenExternalKind.Folders.Tostring)then
210+
if(cBoxKind.Text = TC4DWizardOpenExternalKind.Folders.ToString)then
211211
edtPath.Text := TC4DWizardUtils.SelectFolder(LDefaultPath)
212212
else
213213
edtPath.Text := TC4DWizardUtils.SelectFile(LDefaultPath);
@@ -262,12 +262,12 @@ procedure TC4DWizardOpenExternalAddEditView.ConfFieldsKind;
262262
edtPath.Enabled := True;
263263
edtParameters.Enabled := True;
264264
edtShortcut.Enabled := True;
265-
btnBath.Enabled := (cBoxKind.Text = TC4DWizardOpenExternalKind.Files.Tostring)
266-
or(cBoxKind.Text = TC4DWizardOpenExternalKind.Folders.Tostring);
265+
btnBath.Enabled := (cBoxKind.Text = TC4DWizardOpenExternalKind.Files.ToString)
266+
or(cBoxKind.Text = TC4DWizardOpenExternalKind.Folders.ToString);
267267
lbParameters.Caption := 'Parameters';
268268
cBoxMenuMaster.Enabled := True;
269269

270-
if(cBoxKind.Text = TC4DWizardOpenExternalKind.Separators.Tostring)then
270+
if(cBoxKind.Text = TC4DWizardOpenExternalKind.Separators.ToString)then
271271
begin
272272
FLastDescription := edtDescription.Text;
273273
edtDescription.Text := '-';
@@ -281,7 +281,7 @@ procedure TC4DWizardOpenExternalAddEditView.ConfFieldsKind;
281281
edtShortcut.HotKey := $0000;
282282
edtShortcut.Enabled := False;
283283
end
284-
else if(cBoxKind.Text = TC4DWizardOpenExternalKind.MenuMasterOnly.Tostring)then
284+
else if(cBoxKind.Text = TC4DWizardOpenExternalKind.MenuMasterOnly.ToString)then
285285
begin
286286
if(edtDescription.Text = '-')and(not FLastDescription.Trim.IsEmpty)then
287287
edtDescription.Text := FLastDescription;
@@ -299,13 +299,13 @@ procedure TC4DWizardOpenExternalAddEditView.ConfFieldsKind;
299299
cBoxMenuMaster.ItemIndex := 0;
300300
cBoxMenuMaster.Enabled := False;
301301
end
302-
else if(cBoxKind.Text = TC4DWizardOpenExternalKind.CMD.Tostring)then
302+
else if(cBoxKind.Text = TC4DWizardOpenExternalKind.CMD.ToString)then
303303
begin
304304
if(edtDescription.Text = '-')and(not FLastDescription.Trim.IsEmpty)then
305305
edtDescription.Text := FLastDescription;
306306

307307
FLastPath := edtPath.Text;
308-
edtPath.Text := TC4DWizardOpenExternalKind.CMD.Tostring;
308+
edtPath.Text := TC4DWizardOpenExternalKind.CMD.ToString;
309309
edtPath.Enabled := False;
310310

311311
if(Trim(edtParameters.Text).IsEmpty)then
@@ -325,7 +325,7 @@ procedure TC4DWizardOpenExternalAddEditView.ConfFieldsKind;
325325
edtParameters.Text := FLastParameters;
326326
end;
327327

328-
if(cBoxKind.Text <> TC4DWizardOpenExternalKind.MenuMasterOnly.Tostring)then
328+
if(cBoxKind.Text <> TC4DWizardOpenExternalKind.MenuMasterOnly.ToString)then
329329
begin
330330
if(cBoxMenuMaster.ItemIndex <= 0)then
331331
cBoxMenuMaster.ItemIndex := FLastItemIndexMenuMaster;

Src/OpenExternal/C4D.Wizard.OpenExternal.Model.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function TC4DWizardOpenExternalModel.WriteInIniFile(AC4DWizardOpenExternal: TC4D
5757
LIniFile.Writestring(AC4DWizardOpenExternal.Guid, TC4DConsts.OPEN_EXTERNAL_INI_Description, AC4DWizardOpenExternal.Description);
5858
LIniFile.Writestring(AC4DWizardOpenExternal.Guid, TC4DConsts.OPEN_EXTERNAL_INI_Path, AC4DWizardOpenExternal.Path);
5959
LIniFile.Writestring(AC4DWizardOpenExternal.Guid, TC4DConsts.OPEN_EXTERNAL_INI_Parameters, AC4DWizardOpenExternal.Parameters);
60-
LIniFile.Writestring(AC4DWizardOpenExternal.Guid, TC4DConsts.OPEN_EXTERNAL_INI_Kind, AC4DWizardOpenExternal.Kind.Tostring);
60+
LIniFile.Writestring(AC4DWizardOpenExternal.Guid, TC4DConsts.OPEN_EXTERNAL_INI_Kind, AC4DWizardOpenExternal.Kind.ToString);
6161
LIniFile.WriteBool(AC4DWizardOpenExternal.Guid, TC4DConsts.OPEN_EXTERNAL_INI_Visible, AC4DWizardOpenExternal.Visible);
6262
LIniFile.WriteBool(AC4DWizardOpenExternal.Guid, TC4DConsts.OPEN_EXTERNAL_INI_VisibleInToolBarUtilities, AC4DWizardOpenExternal.VisibleInToolBarUtilities);
6363
LIniFile.WriteInteger(AC4DWizardOpenExternal.Guid, TC4DConsts.OPEN_EXTERNAL_INI_Order, AC4DWizardOpenExternal.Order);

Src/OpenExternal/C4D.Wizard.OpenExternal.Utils.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class procedure TC4DWizardOpenExternalUtils.ClickFromString(const AStringClick:
4141

4242
LLink := Copy(LStringClick, 1, pos(LSeparator, LStringClick) - 1);
4343
LParameters := Copy(LStringClick, (pos(LSeparator, LStringClick) + LSeparator.Length), LStringClick.Length);
44-
if(LLink = TC4DWizardOpenExternalKind.CMD.Tostring)then
44+
if(LLink = TC4DWizardOpenExternalKind.CMD.ToString)then
4545
TC4DWizardProcessDelphi.RunCommand(TC4DWizardOpenExternalUtils.ProcessTags(LParameters))
4646
else
4747
TC4DWizardUtils.ShellExecuteC4D(TC4DWizardOpenExternalUtils.ProcessTags(LLink),

Src/OpenExternal/C4D.Wizard.OpenExternal.View.pas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ procedure TC4DWizardOpenExternalView.IniFileRead;
202202
LListItem := ListViewHistory.Items.Add;
203203
LListItem.Caption := AC4DWizardOpenExternal.Description;
204204
LListItem.ImageIndex := -1;
205-
LListItem.SubItems.Add(AC4DWizardOpenExternal.Order.Tostring);
205+
LListItem.SubItems.Add(AC4DWizardOpenExternal.Order.ToString);
206206
LListItem.SubItems.Add(AC4DWizardOpenExternal.Shortcut);
207-
LListItem.SubItems.Add(AC4DWizardOpenExternal.Kind.Tostring);
207+
LListItem.SubItems.Add(AC4DWizardOpenExternal.Kind.ToString);
208208
LListItem.SubItems.Add(TC4DWizardUtils.BoolToStrC4D(AC4DWizardOpenExternal.Visible));
209209
LListItem.SubItems.Add(TC4DWizardUtils.BoolToStrC4D(AC4DWizardOpenExternal.VisibleInToolBarUtilities));
210210
LListItem.SubItems.Add(AC4DWizardOpenExternal.Path);
@@ -262,9 +262,9 @@ procedure TC4DWizardOpenExternalView.ConfBtnOpenRun(AItem: TListItem);
262262
Exit;
263263

264264
LKind := ListViewHistory.Items[AItem.Index].SubItems[C_INDEX_SUBITEM_Kind];
265-
if(LKind = TC4DWizardOpenExternalKind.CMD.Tostring)then
265+
if(LKind = TC4DWizardOpenExternalKind.CMD.ToString)then
266266
btnOpenRun.Caption := 'Run command'
267-
else if(LKind = TC4DWizardOpenExternalKind.Separators.Tostring)then
267+
else if(LKind = TC4DWizardOpenExternalKind.Separators.ToString)then
268268
btnOpenRun.Enabled := False;
269269
end;
270270

@@ -367,7 +367,7 @@ procedure TC4DWizardOpenExternalView.btnOpenRunClick(Sender: TObject);
367367

368368
LParameters := LItem.SubItems[C_INDEX_SUBITEM_Parameters];
369369
LKind := LItem.SubItems[C_INDEX_SUBITEM_Kind];
370-
if(LKind = TC4DWizardOpenExternalKind.CMD.Tostring)then
370+
if(LKind = TC4DWizardOpenExternalKind.CMD.ToString)then
371371
TC4DWizardProcessDelphi.RunCommand(TC4DWizardOpenExternalUtils.ProcessTags(LParameters))
372372
else
373373
TC4DWizardUtils.ShellExecuteC4D(TC4DWizardOpenExternalUtils.ProcessTags(LPath),

Src/ReplaceFiles/C4D.Wizard.ReplaceFiles.View.pas

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ procedure TC4DWizardReplaceFilesView.ShowMsgSuccess;
365365
LMsg: string;
366366
begin
367367
LMsg := 'Replace complete: %s' +
368-
FC4DWizardReplaceFilesModel.GetCountReplace.Tostring +' replacement in ' +
369-
FC4DWizardReplaceFilesModel.GetCountArqReplace.Tostring + ' files';
368+
FC4DWizardReplaceFilesModel.GetCountReplace.ToString +' replacement in ' +
369+
FC4DWizardReplaceFilesModel.GetCountArqReplace.ToString + ' files';
370370

371371
if(FC4DWizardReplaceFilesModel.GetCountReplace <= 0)then
372372
begin
@@ -396,8 +396,8 @@ procedure TC4DWizardReplaceFilesView.ProcessMsgCancel;
396396
var
397397
LMsg: string;
398398
begin
399-
LMsg := FC4DWizardReplaceFilesModel.GetCountReplace.Tostring +' replacement in ' +
400-
FC4DWizardReplaceFilesModel.GetCountArqReplace.Tostring + ' files';
399+
LMsg := FC4DWizardReplaceFilesModel.GetCountReplace.ToString +' replacement in ' +
400+
FC4DWizardReplaceFilesModel.GetCountArqReplace.ToString + ' files';
401401
TC4DWizardMessageCustom.GetInstance
402402
.Clear
403403
.GroupName(FC4DWizardReplaceFilesModel.GetGroupNameMsg)

Src/Types/C4D.Wizard.Types.pas

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ TC4DWizardReopenData = record
4646
end;
4747

4848
TC4DWizardOpenExternalKindHelper = record helper for TC4DWizardOpenExternalKind
49-
function Tostring: string;
49+
function ToString: string;
5050
end;
5151

5252
TC4DExtensionsFilesHelper = record helper for TC4DExtensionsFiles
53-
function Tostring: string;
53+
function ToString: string;
54+
function ToStringWithPoint: string;
5455
end;
5556

5657
TC4DExtensionsOfFilesHelper = record helper for TC4DExtensionsOfFiles
@@ -77,7 +78,7 @@ procedure TC4DWizardReopenData.Clear;
7778
end;
7879

7980
{TC4DWizardOpenExternalKindHelper}
80-
function TC4DWizardOpenExternalKindHelper.Tostring: string;
81+
function TC4DWizardOpenExternalKindHelper.ToString: string;
8182
begin
8283
if(Self = TC4DWizardOpenExternalKind.CMD)then
8384
Exit(TC4DConsts.STR_CMD_COMMANDS)
@@ -88,11 +89,16 @@ function TC4DWizardOpenExternalKindHelper.Tostring: string;
8889
end;
8990

9091
{ TC4DExtensionsFilesHelper }
91-
function TC4DExtensionsFilesHelper.Tostring: string;
92+
function TC4DExtensionsFilesHelper.ToString: string;
9293
begin
9394
Result := GetEnumName(TypeInfo(TC4DExtensionsFiles), Integer(Self)).ToLower;
9495
end;
9596

97+
function TC4DExtensionsFilesHelper.ToStringWithPoint: string;
98+
begin
99+
Result := '.' + Self.ToString;
100+
end;
101+
96102
{ TC4DExtensionsOfFilesHelper }
97103
function TC4DExtensionsOfFilesHelper.ContainsStr(const AExtension: string): Boolean;
98104
var

0 commit comments

Comments
 (0)