Designer: AskCompNameDialog redo more. Issue #28116, patch from Alexey Torgashin

git-svn-id: trunk@49075 -
This commit is contained in:
juha 2015-05-17 22:50:07 +00:00
parent 569d975af1
commit 979a45947d
2 changed files with 22 additions and 14 deletions

View File

@ -1,12 +1,13 @@
object AskCompNameDialog: TAskCompNameDialog
Left = 299
Height = 135
Height = 125
Top = 177
Width = 366
Width = 389
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'AskCompNameDialog'
ClientHeight = 135
ClientWidth = 366
ClientHeight = 125
ClientWidth = 389
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '1.5'
@ -14,20 +15,20 @@ object AskCompNameDialog: TAskCompNameDialog
Left = 6
Height = 15
Top = 6
Width = 300
Width = 377
Align = alTop
BorderSpacing.Around = 6
Caption = 'Label1'
Constraints.MaxWidth = 300
Constraints.MinWidth = 300
ParentColor = False
WordWrap = True
end
object NameEdit: TEdit
AnchorSideTop.Control = Label1
AnchorSideRight.Side = asrBottom
Left = 6
Height = 23
Top = 27
Width = 354
Width = 377
Align = alTop
BorderSpacing.Around = 6
OnChange = NameEditChange
@ -39,8 +40,8 @@ object AskCompNameDialog: TAskCompNameDialog
object ButtonPanel1: TButtonPanel
Left = 6
Height = 26
Top = 103
Width = 354
Top = 93
Width = 377
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
@ -60,12 +61,17 @@ object AskCompNameDialog: TAskCompNameDialog
AnchorSideRight.Control = NameEdit
AnchorSideRight.Side = asrBottom
Left = 6
Height = 38
Height = 32
Top = 56
Width = 354
Width = 377
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BevelOuter = bvNone
Caption = 'InfoPanel'
Color = clInfoBk
Font.Color = clInfoText
ParentColor = False
ParentFont = False
TabOrder = 1
end
end

View File

@ -88,11 +88,13 @@ end;
procedure TAskCompNameDialog.NameEditChange(Sender: TObject);
var
Ok: boolean;
ErrorMsg: string;
begin
ButtonPanel1.OKButton.Enabled:=IsValidName(NameEdit.Text,ErrorMsg);
Ok:=IsValidName(NameEdit.Text, ErrorMsg);
ButtonPanel1.OKButton.Enabled:=Ok;
InfoPanel.Caption:=ErrorMsg;
InfoPanel.Color:=IfThen(ErrorMsg<>'', clInfoBk, clDefault);
InfoPanel.Visible:=not Ok;
end;
function TAskCompNameDialog.GetNewName: TComponentName;