Daniel Hiromy het geskryf:
> Hi. I'm new on tiOPF and OOP. Sorry if it's a dumb question.
> Is that possible to change columns caption of the string grid using
> mediator?
> For example, I have a property called 'TelTypeAsGUI' and want to show as
> 'Telephone Type'.
Yes, definitely possible - I use it all the time.
--------[ comments from the tiBaseMediator unit ]-------------
Extracts the alignment from the AField string which is in the format
fieldname(width,"field caption",a)
where a is the alignment character.
Legal values for the alignment character are:
< - left aligned
> - right aligned
| - centre aligned
eg:
Quantity(25,"Qty",>)
Will return: Qty with a width of 25 and the column will be right-aligned.
Width, Field Caption and alignment are optional.
---------------------[ end ]------------------------
A real-world example:
--------------------
const
cEAdrsGridCols = 'EAddressTypeAsString(90,"%s");Text(90,"%s")';
begin
if not Assigned(FmedEAdrsList) then
begin
FmedEAdrsList := TtiModelMediator.Create(self);
FmedEAdrsList.AddComposite(Format(cEAdrsGridCols, [uiAddressType,
uiText]), fraEAddress.grdName1);
fraEAddress.FormMediator := FmedEAdrsList;
end;
FmedEAdrsList.Subject := Data.EAddressList;
FmedEAdrsList.Active := True;
end;
--------------------
Cheers,
- Graeme -
------------------------------------------------------------------------------
_______________________________________________
tiOPF-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tiopf-talk