Link to home
Start Free TrialLog in
Avatar of Roger Alcindor
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

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));
}

Open in new window

Avatar of Roger Alcindor
Roger Alcindor

ASKER

I forgot to mention that this is targeted for an arm Android application.
SOLUTION
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.