Subject Re: [IBO] Aesthetics mistake in the IB_Edit control
Author freeadmin
Hi,

Helen Borrie wrote:
> An empty dataset is..well...empty. It contains no data. Therefore, there
> are no data from which to read attributes. IBO does not create persistent
> TField objects to which you can apply attributes. Once the TIB_Column
> objects exist, they acquire the attributes you have defined for them and
> the behaviour of the controls is directed by the data.
>
> If it is an aesthetic problem for you, why don't you test your dataset's
> IsEmpty property and paint the controls accordingly?
>
> Are you writing applications that usually present empty datasets when the
> datasets are opened? If so, it would be good coding economy to write your
> own descendant controls that react to this condition in the way you
> prefer.

You are right, but with the complete of the part of code we could avoid this
aesthetic problem.

Part of IBA_DataLink.IMP:

function TIB_DataLink.GetActiveColor: TColor;
begin
if RowState = rsNone then
Result := IB_Session.PreparedColor
else
if ReadOnly then <========= IMO the code should be completed with IsEmpty
Result := IB_Session.ReadOnlyColor
else
Result := IB_Session.BrowsingColor;
end;

Jason! Please let me know what is your opinion about it.

Regards
Norbert