summaryrefslogtreecommitdiff
path: root/uidesigner
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-12-27 23:31:50 +0000
committerGraeme Geldenhuys <graemeg@gmail.com>2013-12-27 23:31:50 +0000
commit10a9b06b41cefc293ffad7600c08de5d821c2a89 (patch)
tree1ea11671c6a6783d0a638203bb30bd2bbd4e5544 /uidesigner
parent9b30ef89654b5a2a91377d4b28b34f5b0035b647 (diff)
downloadfpGUI-10a9b06b41cefc293ffad7600c08de5d821c2a89.tar.xz
uidesigner: More string constants refactored to resource strings.
Diffstat (limited to 'uidesigner')
-rw-r--r--uidesigner/vfd_constants.pas11
-rw-r--r--uidesigner/vfddesigner.pas25
-rw-r--r--uidesigner/vfdformparser.pas6
-rw-r--r--uidesigner/vfdprops.pas11
4 files changed, 34 insertions, 19 deletions
diff --git a/uidesigner/vfd_constants.pas b/uidesigner/vfd_constants.pas
index eb32e308..0621a8c4 100644
--- a/uidesigner/vfd_constants.pas
+++ b/uidesigner/vfd_constants.pas
@@ -43,6 +43,14 @@ resourcestring
rsWrittenBy = 'Written by %s';
rsCompiledOn = 'Compiled on: %s';
rsNewUnnamedForm = 'new';
+ rsDesignerHelp1 = 'F11: switch to Properties';
+ rsDesignerHelp2 = 'TAB, SHIFT+TAB: select next widget';
+ rsDesignerHelp3 = 'F2: edit widget order';
+ rsDesignerQuickHelp = 'Quick Help';
+ rsLeft = 'Left';
+ rsTop = 'Top';
+ rsWidth = 'Width';
+ rsHeight = 'Height';
rsDlgProductInfo = 'Product Information';
rsDlgSetup = 'General Settings';
@@ -50,12 +58,15 @@ resourcestring
rsDlgNewForm = 'New Form';
rsDlgEditFormPosition = 'Form Position';
rsDlgWidgetOrder = 'Widget Order';
+ rsDlgTabOrder = 'Tab Order';
rsErrUnitNotFound = 'The unit <%s> was not found.';
rsErrLoadingForm = 'Error loading form';
rsErrFailedToFindDesignerForm = 'Failed to find Designer Form';
rsErrFormSaveIOError = 'Form save I/O failure in <%s>.';
rsErrNameConflict = 'Name Conflict';
+ rsErrNoStringsProperty = 'Failed to find TStrings type property.';
+ rsErrFailedToParseBoolean = 'Failed to parse Boolean value <%s>';
implementation
diff --git a/uidesigner/vfddesigner.pas b/uidesigner/vfddesigner.pas
index 568ca96c..70757ba4 100644
--- a/uidesigner/vfddesigner.pas
+++ b/uidesigner/vfddesigner.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -142,13 +142,14 @@ type
implementation
uses
+ TypInfo,
vfdmain,
vfdutils,
- TypInfo,
+ vfd_constants,
fpg_tree;
const
- cEditOrder: array[TfpgEditMode] of string = ('Widget Order', 'Tab Order');
+ cEditOrder: array[TfpgEditMode] of string = (rsDlgWidgetOrder, rsDlgTabOrder);
{ TWidgetDesigner }
@@ -739,10 +740,10 @@ begin
end;
keyF1:
- ShowMessage('F11: switch to Properties' + LineEnding +
- 'TAB, SHIFT+TAB: select next widget' + LineEnding +
- 'F2: edit widget order' + LineEnding {+
- 'F4: edit items' + LineEnding}, 'Small help');
+ ShowMessage(rsDesignerHelp1 + LineEnding +
+ rsDesignerHelp2 + LineEnding +
+ rsDesignerHelp3 + LineEnding {+
+ 'F4: edit items' + LineEnding}, rsDesignerQuickHelp);
keyF2:
EditWidgetOrTabOrder(emTabOrder);
@@ -977,22 +978,22 @@ begin
if Sender = frmProperties.btnLeft then
begin
- frm.lbPos.Text := 'Left:';
+ frm.lbPos.Text := rsLeft + ':';
frm.edPos.Text := IntToStr(wg.Left);
end
else if Sender = frmProperties.btnTop then
begin
- frm.lbPos.Text := 'Top:';
+ frm.lbPos.Text := rsTop + ':';
frm.edPos.Text := IntToStr(wg.Top);
end
else if Sender = frmProperties.btnWidth then
begin
- frm.lbPos.Text := 'Width:';
+ frm.lbPos.Text := rsWidth + ':';
frm.edPos.Text := IntToStr(wg.Width);
end
else if Sender = frmProperties.btnHeight then
begin
- frm.lbPos.Text := 'Height:';
+ frm.lbPos.Text := rsHeight + ':';
frm.edPos.Text := IntToStr(wg.Height);
end;
@@ -1469,7 +1470,7 @@ procedure TDesignedForm.AfterCreate;
begin
inherited AfterCreate;
WindowPosition := wpUser;
- WindowTitle := 'New Form';
+ WindowTitle := rsDlgNewForm;
SetPosition(300, 150, 300, 250);
end;
diff --git a/uidesigner/vfdformparser.pas b/uidesigner/vfdformparser.pas
index 831e5083..75681cbe 100644
--- a/uidesigner/vfdformparser.pas
+++ b/uidesigner/vfdformparser.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -65,6 +65,8 @@ function GetColorValue(var s: string): integer;
implementation
+uses
+ vfd_constants;
{ TVFDFormParser }
@@ -152,7 +154,7 @@ begin
else if UpperCase(fs) = 'FALSE' then
Result := False
else
- raise exception.Create('Failed to parse Boolean value <' + s + '>');
+ raise Exception.CreateFmt(rsErrFailedToParseBoolean, [s]);
if Result then
Delete(s, 1, 4)
diff --git a/uidesigner/vfdprops.pas b/uidesigner/vfdprops.pas
index bf1aa209..55fff148 100644
--- a/uidesigner/vfdprops.pas
+++ b/uidesigner/vfdprops.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -176,6 +176,7 @@ uses
TypInfo,
vfdformparser,
vfdeditors,
+ vfd_constants,
fpg_dialogs;
@@ -442,7 +443,7 @@ var
begin
sl := TStringList(GetObjectProp(wg, Name, TStrings));
if not Assigned(sl) then
- raise Exception.Create('Failed to find TStrings type property.');
+ raise Exception.Create(rsErrNoStringsProperty);
Result := '';
@@ -461,7 +462,7 @@ var
begin
sl := TStringList(GetObjectProp(wg, Name, TStrings));
if not Assigned(sl) then
- raise Exception.Create('Failed to find TStrings type property.');
+ raise Exception.Create(rsErrNoStringsProperty);
Result := '[' + IntToStr(sl.Count) + ' lines]';
end;
@@ -471,7 +472,7 @@ var
begin
sl := TStringList(GetObjectProp(wg, Name, TStrings));
if not Assigned(sl) then
- raise Exception.Create('Failed to find TStrings type property.');
+ raise Exception.Create(rsErrNoStringsProperty);
EditStringList(sl);
end;
@@ -500,7 +501,7 @@ begin
begin
sl := TStringList(GetObjectProp(wg, Name, TStrings));
if not Assigned(sl) then
- raise Exception.Create('Failed to find TStrings type property.');
+ raise Exception.Create(rsErrNoStringsProperty);
sl.Add(sval);
end;
end;