tvplanit: Fix duplicate resource error when editing a resource.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8941 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-10-09 16:32:38 +00:00
parent 897e036a0c
commit 7de37ae043
2 changed files with 10 additions and 10 deletions

View File

@ -10,9 +10,9 @@ object ResEditForm: TResEditForm
ClientWidth = 466
Constraints.MinHeight = 250
Constraints.MinWidth = 400
LCLVersion = '3.99.0.0'
OnCreate = FormCreate
OnShow = FormShow
LCLVersion = '2.3.0.0'
object pnlBottom: TPanel
Left = 0
Height = 33
@ -35,9 +35,9 @@ object ResEditForm: TResEditForm
BorderSpacing.Bottom = 4
Caption = 'OK'
Default = True
OnClick = OKBtnClick
TabOrder = 0
TabStop = False
OnClick = OKBtnClick
end
object CancelBtn: TButton
Left = 383
@ -50,9 +50,9 @@ object ResEditForm: TResEditForm
BorderSpacing.Bottom = 4
Cancel = True
Caption = 'Cancel'
OnClick = CancelBtnClick
TabOrder = 1
TabStop = False
OnClick = CancelBtnClick
end
end
object pgResource: TPageControl
@ -144,8 +144,8 @@ object ResEditForm: TResEditForm
BorderSpacing.Top = 16
BorderSpacing.Right = 8
MaxLength = 255
OnChange = Change
TabOrder = 0
OnChange = Change
end
object NotesMemo: TMemo
AnchorSideLeft.Control = tabResource
@ -165,9 +165,9 @@ object ResEditForm: TResEditForm
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
MaxLength = 1024
OnChange = Change
ScrollBars = ssVertical
TabOrder = 1
OnChange = Change
end
end
end

View File

@ -241,10 +241,13 @@ begin
end;
function TResEditForm.ValidData(out AControl: TWinControl; out AMsg: String): Boolean;
var
res: TVpResource;
begin
Result := false;
if FDatastore.FindResource(DescriptionEdit.Text) <> nil then
res := FDataStore.FindResource(DescriptionEdit.Text);
if (res <> nil) and (res <> Resource) then
begin
AControl := DescriptionEdit;
AMsg := RSDuplicateResource;
@ -253,7 +256,6 @@ begin
Result := true;
end;
{=====}
procedure TResEditForm.FormCreate(Sender: TObject);
begin
@ -276,8 +278,6 @@ begin
end;
{=====}
{=====}
procedure TResEditForm.FormShow(Sender: TObject);
begin
DescriptionEdit.SetFocus;