View Issue Details

IDProjectCategoryView StatusLast Update
0019021LazarusLCLpublic2011-10-02 16:51
ReporterTony WhymanAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0019021: TDBText reduces to a 1x1 control once assigned to a database field
DescriptionThe 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;
TagsNo tags attached.
Fixed in Revision
LazTarget0.99.0
WidgetsetGTK 2
Attached Files

Relationships

related to 0023206 resolvedJuha Manninen TDBText always reduces to a 1 x 1 object on Form Designer when Form Opened 

Activities

Felipe Monteiro de Carvalho

2011-10-02 16:51

developer   ~0052362

I commited a fix in rev32618. I do like you propose, but only for csDesigning. Please test and close if ok.

Issue History

Date Modified Username Field Change
2011-03-29 16:08 Tony Whyman New Issue
2011-03-29 16:08 Tony Whyman Widgetset => GTK 2
2011-03-30 22:01 Vincent Snijders LazTarget => 0.99.0
2011-03-30 22:01 Vincent Snijders Assigned To => Jesus Reyes
2011-03-30 22:01 Vincent Snijders Status new => assigned
2011-03-30 22:01 Vincent Snijders Target Version => 0.99.0
2011-10-02 16:51 Felipe Monteiro de Carvalho Status assigned => resolved
2011-10-02 16:51 Felipe Monteiro de Carvalho Fixed in Version => 0.9.31 (SVN)
2011-10-02 16:51 Felipe Monteiro de Carvalho Resolution open => fixed
2011-10-02 16:51 Felipe Monteiro de Carvalho Note Added: 0052362
2012-10-26 14:02 Juha Manninen Relationship added related to 0023206