Recent

Author Topic: TKDBGrid column with HandPoint cursor  (Read 1626 times)

RedOctober

  • Sr. Member
  • ****
  • Posts: 452
TKDBGrid column with HandPoint cursor
« on: January 22, 2019, 03:48:59 am »
Platform: Lazarus 1.8.4, FPC 3.0.4, TK Controls, latest version.

I'm incorporating a TKDBGrid control into my project and I need only one of the columns to display URLs.  I have picked a font color of blue and underlined it so it now looks like a URL.  However, the end user would like to see the cursor change from the default arrow, to a hand point, so they know that URL is clickable.

In Delphi, I did this like so...

Code: Pascal  [Select][+][-]
  1. var lCoord: TGridCoord;
  2. begin
  3.   lCoord := kdbg.MouseCoord(X,Y);
  4.   if (lCoord.X = -1) or (lCoord.Y = -1) then
  5.     begin
  6.       if not (kdbg.Cursor = crDefault) then
  7.         kdbg.Cursor := crDefault;
  8.       Exit;
  9.     end;
  10.  
  11.   if (Pos(';' + UpperCase(dbgkdbg.Columns[lCoord.X].FieldName) + ';', ';MINE;') > 0) then
  12.     begin
  13.       if not (kdbg.Cursor = crHandPoint) then
  14.          kdbg.Cursor := crHandPoint
  15.     end
  16.   else
  17.     begin
  18.       if not (kdbg.Cursor = crDefault) then
  19.         kdbg.Cursor := crDefault;
  20.     end;
  21. end;

However, in a TKDBGrid, there is no kdbg.MouseCoord, and I can't find anything equivalent.  The TK author is not supporting this component set anymore, so I'm relying on the Lazarus community for info on how to accomplish this.  Thanks in advance.

 

TinyPortal © 2005-2018