Fastscript bug
Hi
I'm using FastScript 1.30 and Delphi 7. If I try to create an editbox like the following
edtErrorText := TEdit.Create(frmDealer);
edtErrorText.Name := 'edtErrorText';
edtErrorText.Parent := frmDealer;
edtErrorText.SetBounds(12,76, 358, 21);
edtErrorText.Text := 'This is an error message';
edtErrorText.ReadOnly := True;
then the text appears right-aligned and NOT read-only. If I comment out the readonly line then all appears as it should.
It looks like setting ReadOnly to True sets the align to right aligned instead
Is this a bug?
Cheers
Steve
I'm using FastScript 1.30 and Delphi 7. If I try to create an editbox like the following
edtErrorText := TEdit.Create(frmDealer);
edtErrorText.Name := 'edtErrorText';
edtErrorText.Parent := frmDealer;
edtErrorText.SetBounds(12,76, 358, 21);
edtErrorText.Text := 'This is an error message';
edtErrorText.ReadOnly := True;
then the text appears right-aligned and NOT read-only. If I comment out the readonly line then all appears as it should.
It looks like setting ReadOnly to True sets the align to right aligned instead
Is this a bug?
Cheers
Steve
Comments
procedure TfsPropertyHelper.SetValue(const Value: Variant);
var
p: PPropInfo;
Instance: TObject;
IntVal: Integer;
begin
if IsReadOnly then Exit;
Instance := TObject(Integer(ParentValue));
if FIsPublished then
begin
p := GetPropInfo(Instance.ClassInfo, Name);
if p <> nil then
case p.PropType^.Kind of
tkInteger, tkSet, tkChar, tkWChar, tkEnumeration, tkClass:
begin
if Typ = fvtBool then
if Value = True then
IntVal := 1 else
IntVal := 0
else
IntVal := Integer(Value);
SetOrdProp(Instance, p, IntVal);
end;
tkFloat:
SetFloatProp(Instance, p, Extended(Value));
tkString, tkLString, tkWString:
SetStrProp(Instance, p, String(Value));
tkVariant:
SetVariantProp(Instance, p, Value);
end;
end
else if Assigned(FOnSetValue) then
FOnSetValue(Instance, FClassRef, Uppercase(Name), Value);
end;