Roger Alcindor
asked on
FMX TGRid DrawColumnCell Problem wil Canvas FillText function
I have a C++ builder code snippet below which I wish to use to display the cell values in a FMX TGrid component
The code gets called but the cell content is not displayed.
I suspect that this may be due to the TFillTextFlags not being initialised ? how do I do this or otherwise get the code to work ?
Also, how would I set the colour of the text being displayed by the fillText function ?
Thanks,
Roger
The code gets called but the cell content is not displayed.
I suspect that this may be due to the TFillTextFlags not being initialised ? how do I do this or otherwise get the code to work ?
Also, how would I set the colour of the text being displayed by the fillText function ?
Thanks,
Roger
void __fastcall TForm1::Grid1DrawColumnCell(TObject *Sender, TCanvas * const Canvas,
TColumn * const Column, const TRectF &Bounds, const int Row,
const TValue &Value, const TGridDrawStates State)
{
TValue v = Value;
UnicodeString u = v.AsString();
TFillTextFlags flags;
Fmx::Types::TTextAlign ATextAlign;
Canvas->Clear(claWhite);
Canvas->FillText(Bounds,u,false,1,flags,Fmx::Types::TTextAlign(0x0));
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
My solution fixed the issue. I took note however of the suggested use of BeginScene() and EndScene() by Sinsa Vuk as a matter of good practice.
ASKER