mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-22 19:29:31 +01:00
Designer: AskCompNameDialog redo more. Issue #28116, patch from Alexey Torgashin
git-svn-id: trunk@49075 -
This commit is contained in:
parent
569d975af1
commit
979a45947d
@ -1,12 +1,13 @@
|
|||||||
object AskCompNameDialog: TAskCompNameDialog
|
object AskCompNameDialog: TAskCompNameDialog
|
||||||
Left = 299
|
Left = 299
|
||||||
Height = 135
|
Height = 125
|
||||||
Top = 177
|
Top = 177
|
||||||
Width = 366
|
Width = 389
|
||||||
BorderIcons = [biSystemMenu]
|
BorderIcons = [biSystemMenu]
|
||||||
|
BorderStyle = bsDialog
|
||||||
Caption = 'AskCompNameDialog'
|
Caption = 'AskCompNameDialog'
|
||||||
ClientHeight = 135
|
ClientHeight = 125
|
||||||
ClientWidth = 366
|
ClientWidth = 389
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.5'
|
LCLVersion = '1.5'
|
||||||
@ -14,20 +15,20 @@ object AskCompNameDialog: TAskCompNameDialog
|
|||||||
Left = 6
|
Left = 6
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 300
|
Width = 377
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'Label1'
|
Caption = 'Label1'
|
||||||
Constraints.MaxWidth = 300
|
|
||||||
Constraints.MinWidth = 300
|
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
WordWrap = True
|
WordWrap = True
|
||||||
end
|
end
|
||||||
object NameEdit: TEdit
|
object NameEdit: TEdit
|
||||||
|
AnchorSideTop.Control = Label1
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 27
|
Top = 27
|
||||||
Width = 354
|
Width = 377
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
OnChange = NameEditChange
|
OnChange = NameEditChange
|
||||||
@ -39,8 +40,8 @@ object AskCompNameDialog: TAskCompNameDialog
|
|||||||
object ButtonPanel1: TButtonPanel
|
object ButtonPanel1: TButtonPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 103
|
Top = 93
|
||||||
Width = 354
|
Width = 377
|
||||||
OKButton.Name = 'OKButton'
|
OKButton.Name = 'OKButton'
|
||||||
OKButton.DefaultCaption = True
|
OKButton.DefaultCaption = True
|
||||||
HelpButton.Name = 'HelpButton'
|
HelpButton.Name = 'HelpButton'
|
||||||
@ -60,12 +61,17 @@ object AskCompNameDialog: TAskCompNameDialog
|
|||||||
AnchorSideRight.Control = NameEdit
|
AnchorSideRight.Control = NameEdit
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 38
|
Height = 32
|
||||||
Top = 56
|
Top = 56
|
||||||
Width = 354
|
Width = 377
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
|
Caption = 'InfoPanel'
|
||||||
|
Color = clInfoBk
|
||||||
|
Font.Color = clInfoText
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -88,11 +88,13 @@ end;
|
|||||||
|
|
||||||
procedure TAskCompNameDialog.NameEditChange(Sender: TObject);
|
procedure TAskCompNameDialog.NameEditChange(Sender: TObject);
|
||||||
var
|
var
|
||||||
|
Ok: boolean;
|
||||||
ErrorMsg: string;
|
ErrorMsg: string;
|
||||||
begin
|
begin
|
||||||
ButtonPanel1.OKButton.Enabled:=IsValidName(NameEdit.Text,ErrorMsg);
|
Ok:=IsValidName(NameEdit.Text, ErrorMsg);
|
||||||
|
ButtonPanel1.OKButton.Enabled:=Ok;
|
||||||
InfoPanel.Caption:=ErrorMsg;
|
InfoPanel.Caption:=ErrorMsg;
|
||||||
InfoPanel.Color:=IfThen(ErrorMsg<>'', clInfoBk, clDefault);
|
InfoPanel.Visible:=not Ok;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TAskCompNameDialog.GetNewName: TComponentName;
|
function TAskCompNameDialog.GetNewName: TComponentName;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user