Components, Cody: localized 'Add Assign method' dialog

git-svn-id: trunk@30637 -
This commit is contained in:
maxim 2011-05-09 16:50:03 +00:00
parent bda3f4cc3f
commit 95913483c2
3 changed files with 121 additions and 88 deletions

View File

@ -12,11 +12,12 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
LCLVersion = '0.9.31'
object ButtonPanel1: TButtonPanel
Left = 6
Height = 35
Top = 443
Height = 34
Top = 444
Width = 557
OKButton.Name = 'OKButton'
OKButton.Caption = '&OK'
OKButton.OnClick = OkButtonClick
HelpButton.Name = 'HelpButton'
HelpButton.Caption = '&Help'
CloseButton.Name = 'CloseButton'
@ -30,23 +31,23 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideTop.Control = InheritedGroupBox
AnchorSideTop.Side = asrBottom
Left = 6
Height = 149
Top = 288
Height = 195
Top = 243
Width = 557
Align = alBottom
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
Caption = 'MembersGroupBox'
ClientHeight = 128
ClientWidth = 549
ClientHeight = 177
ClientWidth = 553
TabOrder = 1
object MembersTreeView: TCodyTreeView
Left = 0
Height = 128
Height = 177
Top = 0
Width = 549
Width = 553
Align = alClient
DefaultItemHeight = 19
DefaultItemHeight = 16
Images = ImageList1
ReadOnly = True
TabOrder = 0
@ -56,24 +57,24 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
end
object InheritedGroupBox: TGroupBox
Left = 6
Height = 144
Top = 138
Height = 120
Top = 117
Width = 557
Align = alTop
AutoSize = True
BorderSpacing.Around = 6
Caption = 'InheritedGroupBox'
ClientHeight = 123
ClientWidth = 549
ClientHeight = 102
ClientWidth = 553
TabOrder = 2
object InheritedLabel: TLabel
AnchorSideLeft.Control = InheritedGroupBox
AnchorSideTop.Control = InheritedEdit
AnchorSideTop.Side = asrCenter
Left = 6
Height = 18
Top = 10
Width = 100
Height = 14
Top = 9
Width = 70
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'InheritedLabel'
@ -85,10 +86,10 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideTop.Control = InheritedGroupBox
AnchorSideRight.Control = InheritedGroupBox
AnchorSideRight.Side = asrBottom
Left = 112
Height = 27
Left = 82
Height = 21
Top = 6
Width = 431
Width = 465
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
@ -101,9 +102,9 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideTop.Control = InheritedEdit
AnchorSideTop.Side = asrBottom
Left = 12
Height = 22
Top = 39
Width = 176
Height = 17
Top = 33
Width = 123
BorderSpacing.Around = 6
Caption = 'InhOverrideCheckBox'
TabOrder = 1
@ -113,9 +114,9 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideTop.Control = InhOverrideCheckBox
AnchorSideTop.Side = asrBottom
Left = 12
Height = 22
Top = 67
Width = 142
Height = 17
Top = 56
Width = 98
BorderSpacing.Around = 6
Caption = 'InhCallCheckBox'
TabOrder = 2
@ -125,9 +126,9 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideTop.Control = InhCallCheckBox
AnchorSideTop.Side = asrBottom
Left = 12
Height = 22
Top = 95
Width = 211
Height = 17
Top = 79
Width = 149
BorderSpacing.Around = 6
Caption = 'InhCallOnlyInElseCheckBox'
TabOrder = 3
@ -135,24 +136,24 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
end
object DeclGroupBox: TGroupBox
Left = 6
Height = 126
Height = 105
Top = 6
Width = 557
Align = alTop
AutoSize = True
BorderSpacing.Around = 6
Caption = 'DeclGroupBox'
ClientHeight = 105
ClientWidth = 549
ClientHeight = 87
ClientWidth = 553
TabOrder = 3
object ParamTypeLabel: TLabel
AnchorSideLeft.Control = ProcNameLabel
AnchorSideTop.Control = ParamTypeEdit
AnchorSideTop.Side = asrCenter
Left = 6
Height = 18
Top = 76
Width = 115
Height = 14
Top = 63
Width = 80
Caption = 'ParamTypeLabel'
ParentColor = False
end
@ -161,9 +162,9 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ParamNameEdit
AnchorSideTop.Side = asrBottom
Left = 127
Height = 27
Top = 72
Left = 92
Height = 21
Top = 60
Width = 141
BorderSpacing.Around = 6
OnChange = ParamTypeEditChange
@ -175,9 +176,9 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ProcNameEdit
AnchorSideTop.Side = asrBottom
Left = 135
Height = 27
Top = 39
Left = 95
Height = 21
Top = 33
Width = 136
BorderSpacing.Around = 6
OnChange = ParamNameEditChange
@ -189,9 +190,9 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideTop.Control = ParamNameEdit
AnchorSideTop.Side = asrCenter
Left = 6
Height = 18
Top = 43
Width = 123
Height = 14
Top = 36
Width = 83
Caption = 'ParamNameLabel'
ParentColor = False
end
@ -199,8 +200,8 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideLeft.Control = ProcNameLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = DeclGroupBox
Left = 122
Height = 27
Left = 86
Height = 21
Top = 6
Width = 147
BorderSpacing.Around = 6
@ -213,9 +214,9 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideTop.Control = ProcNameEdit
AnchorSideTop.Side = asrCenter
Left = 6
Height = 18
Top = 10
Width = 110
Height = 14
Top = 9
Width = 74
BorderSpacing.Left = 6
Caption = 'ProcNameLabel'
ParentColor = False
@ -225,10 +226,10 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ProcNameEdit
AnchorSideTop.Side = asrCenter
Left = 275
Height = 18
Top = 10
Width = 145
Left = 239
Height = 14
Top = 9
Width = 98
Caption = 'ProcNameErrorLabel'
Font.Color = clRed
ParentColor = False
@ -239,10 +240,10 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ParamNameEdit
AnchorSideTop.Side = asrCenter
Left = 277
Height = 18
Top = 43
Width = 158
Left = 237
Height = 14
Top = 36
Width = 107
Caption = 'ParamNameErrorLabel'
Font.Color = clRed
ParentColor = False
@ -253,10 +254,10 @@ object AddAssignMethodDialog: TAddAssignMethodDialog
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ParamTypeEdit
AnchorSideTop.Side = asrCenter
Left = 274
Height = 18
Top = 76
Width = 150
Left = 239
Height = 14
Top = 63
Width = 104
Caption = 'ParamTypeErrorLabel'
Font.Color = clRed
ParentColor = False

View File

@ -139,8 +139,8 @@ procedure ShowAddAssignMethodDialog(Sender: TObject);
procedure ErrorNotInClass;
begin
IDEMessageDialog('Error','Please position the cursor of the source editor'
+' in a pascal class declaration before invoking "Add Assign method".',
IDEMessageDialog(crsCWError,
crsCAMPleasePositionTheCursorOfTheSourceEditorInAPascalC,
mtError,[mbCancel]);
end;
@ -209,7 +209,6 @@ begin
ImgIDVariable := Imagelist1.AddLazarusResource('ce_variable');
ImgIDProperty := Imagelist1.AddLazarusResource('ce_property');
ButtonPanel1.OKButton.OnClick:=@OkButtonClick;
ProcNameEdit.Text:=FProcName;
end;
@ -438,44 +437,46 @@ begin
ButtonPanel1.OKButton.Enabled:=Result and (FMemberNodeExts<>nil)
and (FMemberNodeExts.Count>0);
Caption:='Add Assign method to class '+FClassName;
ButtonPanel1.OKButton.Caption:=crsBTNOK;
ButtonPanel1.CancelButton.Caption:=crsBTNCancel;
Caption:=Format(crsCAMAddAssignMethodToClass, [FClassName]);
DeclGroupBox.Caption:='New method:';
ProcNameLabel.Caption:='Method name:';
DeclGroupBox.Caption:=crsCAMNewMethod;
ProcNameLabel.Caption:=crsCAMMethodName;
if (NewProcName='') or (not IsValidIdent(NewProcName)) then
ProcNameErrorLabel.Caption:='invalid identifier'
ProcNameErrorLabel.Caption:=crsCAMInvalidIdentifier
else if not Result then
ProcNameErrorLabel.Caption:='cursor is not in a pascal class declaration'
ProcNameErrorLabel.Caption:=crsCAMCursorIsNotInAPascalClassDeclaration
else if FAssignDeclNode<>nil then
ProcNameErrorLabel.Caption:='exists already'
ProcNameErrorLabel.Caption:=crsCAMExistsAlready
else
ProcNameErrorLabel.Caption:='';
ParamNameLabel.Caption:='Parameter name:';
ParamNameLabel.Caption:=crsCAMParameterName;
if UseInheritedParam then
ParamNameEdit.Text:=FInheritedParamName;
if (ParamNameEdit.Text='') or not IsValidIdent(ParamNameEdit.Text) then
ParamNameErrorLabel.Caption:='invalid identifier'
ParamNameErrorLabel.Caption:=crsCAMInvalidIdentifier
else
ParamNameErrorLabel.Caption:='';
ParamTypeLabel.Caption:='Parameter type:';
ParamTypeLabel.Caption:=crsCAMParameterType;
if UseInheritedParam then
ParamTypeEdit.Text:=FInheritedParamType;
if (ParamTypeEdit.Text='') or not IsValidIdent(ParamTypeEdit.Text) then
ParamTypeErrorLabel.Caption:='invalid identifier'
ParamTypeErrorLabel.Caption:=crsCAMInvalidIdentifier
else
ParamTypeErrorLabel.Caption:='';
// show some context information about the inherited method
InheritedGroupBox.Caption:='Inherited:';
InhOverrideCheckBox.Caption:='Override';
InhCallCheckBox.Caption:='Call inherited';
InhCallOnlyInElseCheckBox.Caption:='Call inherited only if wrong class';
InheritedGroupBox.Caption:=crsCAMInherited;
InhOverrideCheckBox.Caption:=crsCAMOverride;
InhCallCheckBox.Caption:=crsCAMCallInherited;
InhCallOnlyInElseCheckBox.Caption:=crsCAMCallInheritedOnlyIfWrongClass;
InheritedEdit.ReadOnly:=true;
if FInheritedDeclContext.Node<>nil then begin
InheritedGroupBox.Enabled:=true;
InheritedLabel.Caption:='Method:';
InheritedLabel.Caption:=crsCAMMethod;
InheritedEdit.Text:=FInheritedDeclContext.Tool.ExtractProcHead(
FInheritedDeclContext.Node,
[phpAddClassName,phpWithDefaultValues,phpWithParameterNames]);
@ -486,12 +487,12 @@ begin
InhCallOnlyInElseCheckBox.Checked:=FInheritedIsTPersistent;
end else begin
InheritedGroupBox.Enabled:=false;
InheritedLabel.Caption:='There is no inherited method.';
InheritedLabel.Caption:=crsCAMThereIsNoInheritedMethod;
InheritedEdit.Text:='';
InheritedEdit.Enabled:=false;
end;
MembersGroupBox.Caption:='Select members to assign:';
MembersGroupBox.Caption:=crsCAMSelectMembersToAssign;
MembersTreeView.BeginUpdate;
MembersTreeView.Items.Clear;
if FMemberNodeExts<>nil then begin
@ -515,19 +516,19 @@ begin
else
Item.Selected:=true;
case Item.Visibility of
ctnClassPrivate: s:='private';
ctnClassProtected: s:='protected';
ctnClassPublic: s:='public';
ctnClassPublished: s:='published';
else s:='?visibility?';
ctnClassPrivate: s:=crsCAMPrivate;
ctnClassProtected: s:=crsCAMProtected;
ctnClassPublic: s:=crsCAMPublic;
ctnClassPublished: s:=crsCAMPublished;
else s:=crsCAMVisibility;
end;
if Item.Desc=ctnVarDefinition then
s:=s+' var'
s:=Format(crsCAMVar, [s])
else
s:=s+' property';
s:=Format(crsCAMProperty, [s]);
s:=s+' '+Item.Name;
if Item.WrittenByProperty<>'' then
s:=s+', written by property '+Item.WrittenByProperty;
s:=Format(crsCAMWrittenByProperty, [s, Item.WrittenByProperty]);
FItems.Add(Item);
TVNode:=MembersTreeView.Items.AddObject(nil,s,Item);
TVNode.ImageIndex:=-1;

View File

@ -61,10 +61,41 @@ resourcestring
crsAddAssignMethod = 'Add Assign method';
crsAddAssignMethod2 = 'Add Assign method ...';
crsRemoveWithBlock = 'Remove With block';
crsCWError = 'Error';
crsCWPleasePlaceTheCursorOfTheSourceEditorOnAWithVariab = 'Please place the '
+'cursor of the source editor on a With variable.';
crsCAMPleasePositionTheCursorOfTheSourceEditorInAPascalC = 'Please position '
+'the cursor of the source editor in a pascal class declaration before '
+'invoking "Add Assign method".';
crsCAMAddAssignMethodToClass = 'Add Assign method to class %s';
crsCAMNewMethod = 'New method:';
crsCAMMethodName = 'Method name:';
crsCAMInvalidIdentifier = 'invalid identifier';
crsCAMCursorIsNotInAPascalClassDeclaration = 'cursor is not in a pascal '
+'class declaration';
crsCAMExistsAlready = 'exists already';
crsCAMParameterName = 'Parameter name:';
crsCAMParameterType = 'Parameter type:';
crsCAMInherited = 'Inherited:';
crsCAMOverride = 'Override';
crsCAMCallInherited = 'Call inherited';
crsCAMCallInheritedOnlyIfWrongClass = 'Call inherited only if wrong class';
crsCAMMethod = 'Method:';
crsCAMThereIsNoInheritedMethod = 'There is no inherited method.';
crsCAMSelectMembersToAssign = 'Select members to assign:';
crsCAMPrivate = 'private';
crsCAMProtected = 'protected';
crsCAMPublic = 'public';
crsCAMPublished = 'published';
crsCAMVisibility = '?visibility?';
crsCAMVar = '%s var';
crsCAMProperty = '%s property';
crsCAMWrittenByProperty = '%s, written by property %s';
crsBTNOK = '&OK';
crsBTNCancel = 'Cancel';
implementation
end.