Jump to content


Photo

About TColumnDisplay


  • Please log in to reply
1 reply to this topic

#1 qi130

qi130
  • Members
  • 23 posts

Posted 05 May 2023 - 06:07 PM

Hello boki,

 

I can see that each TNxCustomColumn have a public "Display" property

property Display: TColumnDisplay read FDisplay;

Looking at TColumnDisplay, i see:

TColumnDisplay = class(TVirtualColElement)
...
   procedure DrawHintMark; virtual;

where TVirtualColElement have a public Canvas property

And this procedure ...

procedure TColumnDisplay.DrawHintMark;
begin
  with Canvas do
  begin
    Pen.Color := clRed;
    Brush.Color := clRed;
 	  Polygon([Point(ClientRect.Right - 5, ClientRect.Top),
    	Point(ClientRect.Right - 1, ClientRect.Top),
      Point(ClientRect.Right - 1, ClientRect.Top + 4)]);
  end;
end;

... is what I ask in a previous topic

 

I try to call it from my app at the end of Formcreate

NxCol_Colonne.Display.DrawHintMark;

giving an access violation.

 

I try in debug mode and I see that NxCol_Colonne.Display.canvas value is nil :wacko:

 

Is there a way to fix it?
 

 



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,212 posts
  • Gender:Male

Posted 05 May 2023 - 07:51 PM

Hello,

 

You can first set Canvas property to the same canvas as the grid have. You will also need to set ClientRect property too. If not set already, you can set it to GetCellRect result.

 

Or, eventually you can copy/paste this procedure and add Canvas and TRect as parameters.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users