From ba5c0b67b4f9281b20c051403cb877f6e02cdece Mon Sep 17 00:00:00 2001 From: vincents Date: Tue, 11 Dec 2007 11:15:35 +0000 Subject: [PATCH] LCL: resourcestring for confirm delete message (bug #10372) git-svn-id: trunk@13274 - --- lcl/dbctrls.pp | 7 ++++--- lcl/dbgrids.pas | 14 +++++--------- lcl/include/dbcustomnavigator.inc | 3 ++- lcl/lclstrconsts.pas | 3 +++ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lcl/dbctrls.pp b/lcl/dbctrls.pp index 71945a1e87..648538efd2 100644 --- a/lcl/dbctrls.pp +++ b/lcl/dbctrls.pp @@ -36,9 +36,10 @@ unit DbCtrls; interface uses - Classes, SysUtils, DB, LCLProc, LMessages, GraphType, Forms, Controls, - Graphics, Dialogs, StdCtrls, Buttons, MaskEdit, ExtCtrls, Calendar, Chart, - LCLType, LResources; + Classes, SysUtils, DB, + LCLStrConsts, LCLProc, LMessages, LCLType, LResources, GraphType, + Forms, Controls, Graphics, Dialogs, StdCtrls, Buttons, MaskEdit, ExtCtrls, + Calendar, Chart; Type { TFieldDataLink } diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index 5e7ad275ea..5a71b2bce1 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -34,17 +34,12 @@ unit DBGrids; {$mode objfpc}{$H+} -{$IF defined(VER2_0_2) and defined(win32)} -// FPC <= 2.0.2 compatibility code -// WINDOWS define was added after FPC 2.0.2 - {$define WINDOWS} -{$endif} - interface uses - Classes, LCLIntf, LCLProc, Graphics, SysUtils, LCLType, stdctrls, DB, - LMessages, LResources, Grids, Dialogs, Controls, Themes; + Classes, SysUtils, DB, + LCLStrConsts, LCLIntf, LCLProc, LCLType, LMessages, LResources, + Controls, StdCtrls, Graphics, Grids, Dialogs, Themes; type TCustomDbGrid = class; @@ -1804,7 +1799,8 @@ begin doOnKeyDown; if (Key<>0) and (ssCtrl in Shift) and GridCanModify then if not (dgConfirmDelete in Options) or - (MessageDlg('Delete record?',mtConfirmation,mbOKCancel,0)<>mrCancel) + (MessageDlg(rsDeleteRecord, mtConfirmation, mbOKCancel, 0 )<> + mrCancel) then begin doDelete; key := 0; diff --git a/lcl/include/dbcustomnavigator.inc b/lcl/include/dbcustomnavigator.inc index 14a8610e60..b3bcd5978e 100644 --- a/lcl/include/dbcustomnavigator.inc +++ b/lcl/include/dbcustomnavigator.inc @@ -410,7 +410,8 @@ begin nbRefresh: Refresh; nbDelete: if (not ConfirmDelete) - or (MessageDlg('Delete record?',mtConfirmation,mbOKCancel,0)<>mrCancel) + or (MessageDlg(rsDeleteRecord, mtConfirmation, mbOKCancel, 0 )<> + mrCancel) then Delete; end; diff --git a/lcl/lclstrconsts.pas b/lcl/lclstrconsts.pas index c82c031d80..e2f93dcd86 100644 --- a/lcl/lclstrconsts.pas +++ b/lcl/lclstrconsts.pas @@ -78,6 +78,9 @@ ResourceString rsReplace = 'Replace'; rsReplaceAll = 'Replace all'; + // DBGrid + rsDeleteRecord = 'Delete record?'; + // gtk interface rsWarningUnremovedPaintMessages = ' WARNING: There are %s unremoved LM_' +'PAINT/LM_GtkPAINT message links left.';