TDBText reduces to a 1x1 control once assigned to a database field
Original Reporter info from Mantis: TWhyman
-
Reporter name: Tony Whyman
Original Reporter info from Mantis: TWhyman
- Reporter name: Tony Whyman
Description:
The problem is in the DataChange method. Note that if a Field is assigned but the database is closed, the Caption shown is empty. With Autosize set, the component effectively vanishes to a 1x1 control. This state is common in the IDE when the component is assigned to a closed dataset.
procedure TDBText.DataChange(Sender: TObject);
begin
if FDataLink.Field <> nil then
Caption := FDataLink.Field.DisplayText
else
Caption := '';
end;
The fix seems simple enough - see below
procedure TDBText.DataChange(Sender: TObject);
begin
if FDataLink.Field <> nil then
Caption := FDataLink.Field.DisplayText
else
Caption := Name;
end;
Mantis conversion info:
- Mantis ID: 19021
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.31 (SVN)
- Monitored by: » JimBeam (JimBeam)
- Target version: 0.99.0