View Issue Details

IDProjectCategoryView StatusLast Update
0023206LazarusLCLpublic2013-04-29 09:21
ReporterTony Whyman Assigned ToJuha Manninen  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.0.2 
Summary0023206: TDBText always reduces to a 1 x 1 object on Form Designer when Form Opened
DescriptionThis seems to be a resurrection of bug 19021. Although the proposed fix tp bug 19021 is included in 1.0.2, something else seems to have changed in that the Caption property is now no longer initialised when a Form is read back in to the Form Designer, resulting in an empty Caption and with "autosize = true", the control reduces to a 1 x 1 object.
Additional InformationThe proposed fix is to override the Loaded method and initialise the Caption to the Name of the control when the control is loaded at design time. This seems to work well fix the fix to bug 19021 - this fix now only seems to apply when the datasource is activated/deactivated after the Form is loaded.

A proposed patch is attached.
TagsNo tags attached.
Fixed in Revisionr40925
LazTarget-
WidgetsetGTK 2
Attached Files

Relationships

related to 0019021 resolvedJesus Reyes Lazarus TDBText reduces to a 1x1 control once assigned to a database field 
related to 0021967 resolvedJuha Manninen Packages TDBText: paste from clippler. lose size 

Activities

2012-10-24 23:57

 

dbtext.diff (973 bytes)   
diff -urpN lazarus.orig/lcl/dbctrls.pp lazarus/lcl/dbctrls.pp
--- lazarus.orig/lcl/dbctrls.pp	2012-06-07 10:09:52.000000000 +0100
+++ lazarus/lcl/dbctrls.pp	2012-10-24 19:29:14.353521000 +0100
@@ -271,6 +271,7 @@ Type
   protected
     procedure Notification(AComponent: TComponent; Operation: TOperation); override;
     class procedure WSRegisterClass; override;
+    procedure Loaded; override;
   public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
diff -urpN lazarus.orig/lcl/include/dbtext.inc lazarus/lcl/include/dbtext.inc
--- lazarus.orig/lcl/include/dbtext.inc	2012-01-24 14:10:19.000000000 +0000
+++ lazarus/lcl/include/dbtext.inc	2012-10-24 19:29:14.349521000 +0100
@@ -89,6 +89,13 @@ begin
   Done := True;
 end;
 
+procedure TDBText.Loaded;
+begin
+  inherited Loaded;
+  if csDesigning in ComponentState then
+    Caption := Name
+end;
+
 { Public Methods}
 constructor TDBText.Create(AOwner: TComponent);
 begin
dbtext.diff (973 bytes)   

LacaK

2012-10-26 06:51

developer   ~0063461

See also 0021967
(putting Caption:=Name into TDBText constructor + does not store Caption into lfm)

Juha Manninen

2013-04-29 09:21

developer   ~0067246

Applied the patch. Thanks.
Please test.

Issue History

Date Modified Username Field Change
2012-10-24 23:57 Tony Whyman New Issue
2012-10-24 23:57 Tony Whyman File Added: dbtext.diff
2012-10-24 23:57 Tony Whyman Widgetset => GTK 2
2012-10-26 06:51 LacaK Note Added: 0063461
2012-10-26 14:02 Juha Manninen Relationship added related to 0019021
2012-10-26 14:03 Juha Manninen Relationship added related to 0021967
2013-04-29 09:21 Juha Manninen Fixed in Revision => r40925
2013-04-29 09:21 Juha Manninen LazTarget => -
2013-04-29 09:21 Juha Manninen Note Added: 0067246
2013-04-29 09:21 Juha Manninen Status new => resolved
2013-04-29 09:21 Juha Manninen Resolution open => fixed
2013-04-29 09:21 Juha Manninen Assigned To => Juha Manninen