Thursday, August 27, 2020

WideCanvasTextRect

WideCanvasTextRect
Example: WideCanvasTextRect(g->Canvas, Rect,Rect.Left+1,Rect.Top+5,wstring); WideCanvasTextRect(g->Canvas, Rect,
Rect.Left+1,Rect.Top+(Rect.Bottom-Rect.Top-g->Canvas->TextHeight(wstring))/2,wstring); 

void __fastcall TSOForm::gridDrawCell(TObject *Sender, int ACol, int ARow,
      TRect &Rect, TGridDrawState State)
{   
  TStringGrid *g=(TStringGrid*)Sender;;
	// save the unicode using UTF8Decode       
  WideString wstring=UTF8Decode(g->Cells[ACol][ARow]);
  WideCanvasTextRect(g->Canvas, Rect, Rect.Left+1, 
  Rect.Top+(Rect.Bottom-Rect.Top
  -g->Canvas->TextHeight(wstring))/2,wstring);         
}