View Issue Details

IDProjectCategoryView StatusLast Update
0002709JEDI VCL00 JVCL Componentspublic2005-03-17 00:13
ReportercarloswAssigned Tojfudickar 
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.00 BETA 2 
Target VersionFixed in Version3.00 
Summary0002709: Some tweaks for JvDynControlEngineDB
Description1. Use TField.DisplayWidth instead of TField.Size to calculate the width of an edit control.

2. Set ParentColor=True for an edit control with Readonly fields or Dataset
Additional InformationFix:
1.
function TJvDynControlEngineDB.CreateControlsFromDataSourceOnControl(ADataSource: TDataSource;
  AControl: TWinControl; AOptions: TJvCreateDBFieldsOnControlOptions): Boolean;
...
...
          if FieldDefaultWidth > 0 then
            Control.Width := FieldDefaultWidth
          else
          begin
-- if ADataSource.DataSet.Fields[I].Size > 0 then
-- Control.Width :=
-- TAccessCustomControl(AControl).Canvas.TextWidth('X') * ADataSource.DataSet.Fields[I].Size;
++ if ADataSource.DataSet.Fields[I].DisplayWidth > 0 then
++ Control.Width :=
++ TAccessCustomControl(AControl).Canvas.TextWidth('X') * ADataSource.DataSet.Fields[I].DisplayWidth;
...

2.
function TJvDynControlEngineDB.CreateControlsFromDataSourceOnControl(ADataSource: TDataSource;
  AControl: TWinControl; AOptions: TJvCreateDBFieldsOnControlOptions): Boolean;
...
...
          if FieldDefaultWidth > 0 then
            Control.Width := FieldDefaultWidth
          else
          begin
...
...
          end;

          // Use ParentColor when the field is ReadOnly
++ if ADataSource.DataSet.ReadOnly or ADataSource.DataSet.Fields[I].ReadOnly then
++ if isPublishedProp(Control, 'ParentColor') then
++ SetOrdProp(Control, 'ParentColor', Ord(True));

          LabelControl := GetDynControlEngine.CreateLabelControlPanel(AControl, AControl,
...
...
TagsNo tags attached.

Activities

carlosw

2005-03-03 08:58

reporter   ~0006638

Fix for 2. should be:
          // Use ParentColor when the field is ReadOnly
          if (isPublishedProp(ADataSource.DataSet, 'ReadOnly') and
            (GetOrdProp(ADataSource.DataSet, 'ReadOnly') > 0)) or
            ADataSource.DataSEt.Fields[I].ReadOnly then
            if isPublishedProp(Control, 'ParentColor') then
              SetOrdProp(Control, 'ParentColor', Ord(True));

jfudickar

2005-03-13 14:12

developer   ~0006699

Both added.

There are now two new options in the TJvCreateDBFieldsOnControlOptions Type for the control of the behaviours.

Issue History

Date Modified Username Field Change
2005-03-03 08:28 carlosw New Issue
2005-03-03 08:58 carlosw Note Added: 0006638
2005-03-04 04:12 jfudickar Status new => assigned
2005-03-04 04:12 jfudickar Assigned To => jfudickar
2005-03-13 14:12 jfudickar Note Added: 0006699
2005-03-13 14:12 jfudickar Status assigned => feedback
2005-03-17 00:13 jfudickar Status feedback => resolved
2005-03-17 00:13 jfudickar Fixed in Version => 3.00
2005-03-17 00:13 jfudickar Resolution open => fixed