Recent

Author Topic: Hint not being shown  (Read 235 times)

J-G

  • Hero Member
  • *****
  • Posts: 1055
Hint not being shown
« on: June 07, 2026, 01:55:58 pm »
I have used Hints in the past and am familiar with the fact that there is a delay before they appear but I'm having a problem with the hint on a TStringGrid.

I can 'hover' over any part of the grid and the hint is never shown. On a few occasions when hovering over a column heading it has appeared but once it's gone, further hovering over other parts of the header row does not bring it back.

I'm fairly sure that this is not the intended action so I'd appreciate advice as to how I can correct it.

Is there a timer property somewhere that I haven't found but determines both the delay and duration of the display?

The 'ShowHint' property IS set to True of course.
FPC 3.0.0 - Lazarus 1.6 &
FPC 3.2.2  - Lazarus 2.2.0 
Win 7 Ult 64

LeP

  • Sr. Member
  • ****
  • Posts: 347
Re: Hint not being shown
« Reply #1 on: June 07, 2026, 02:01:40 pm »
If you type in the Editor "Application.H" you will see all Hint properties and methods that you can use.
Un Sistema per domarli, un IDE per trovarli, un codice per ghermirli e nel framework incatenarli.
An operating system to tame them, an IDE to find them, a code to catch them and in the framework chain them.

Lutz Mändle

  • Jr. Member
  • **
  • Posts: 99
Re: Hint not being shown
« Reply #2 on: June 07, 2026, 02:58:51 pm »
Set the property CellHintPriority of the stringgrid to chpAll (its default value is chpAllNoDefault).

From the help file:
Quote
Declaration
Source position: grids.pas line 178

type TCellHintPriority = (
  chpAll,            //Uses all hints (control and cell hints) including short and long display text values.
  chpAllNoDefault,   //Uses all hints except the default hint for the grid control.
  chpTruncOnly       //Uses the truncated cell hint text.
);

Description

A grid control can display three types of hint: the default hint (in the Hint property), individual cell hints (using the OnCellHint event), and hints for truncated cells. TCellHintPriority determines how the hint text is determined when multiple hint text values are available for display.

TCellHintPriority is the type used to implement the CellHintPriority property in TCustomGrid.

Aruna

  • Hero Member
  • *****
  • Posts: 811
Re: Hint not being shown
« Reply #3 on: June 07, 2026, 03:00:06 pm »
I have used Hints in the past and am familiar with the fact that there is a delay before they appear but I'm having a problem with the hint on a TStringGrid.

I can 'hover' over any part of the grid and the hint is never shown. On a few occasions when hovering over a column heading it has appeared but once it's gone, further hovering over other parts of the header row does not bring it back.

I'm fairly sure that this is not the intended action so I'd appreciate advice as to how I can correct it.

Is there a timer property somewhere that I haven't found but determines both the delay and duration of the display?

The 'ShowHint' property IS set to True of course.
The attached ZIP contains everything you need. The screenshot shows the hint working correctly. Please review the source code carefully, it includes both the delay and the display duration settings.

jamie

  • Hero Member
  • *****
  • Posts: 7774
Re: Hint not being shown
« Reply #4 on: June 07, 2026, 03:01:41 pm »
in the Options set the goCellHint

also you need to implement the OnGetCellHint

Jamie
The only true wisdom is knowing you know nothing

Aruna

  • Hero Member
  • *****
  • Posts: 811
Re: Hint not being shown
« Reply #5 on: June 07, 2026, 03:04:22 pm »
I have used Hints in the past and am familiar with the fact that there is a delay before they appear but I'm having a problem with the hint on a TStringGrid.

I can 'hover' over any part of the grid and the hint is never shown. On a few occasions when hovering over a column heading it has appeared but once it's gone, further hovering over other parts of the header row does not bring it back.

I'm fairly sure that this is not the intended action so I'd appreciate advice as to how I can correct it.

Is there a timer property somewhere that I haven't found but determines both the delay and duration of the display?

The 'ShowHint' property IS set to True of course.
This includes another demo that may help you..

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12430
  • Debugger - SynEdit - and more
    • wiki
Re: Hint not being shown
« Reply #6 on: June 07, 2026, 03:10:31 pm »
Is your signature up to date? You may have good reasons, but it may be hard to tell why a version that old doesn't work.

Newer versions should work on Window 7... so maybe worth testing?

FPC 3.0.0 - Lazarus 1.6 &
FPC 3.2.2  - Lazarus 2.2.0
Win 7 Ult 64

J-G

  • Hero Member
  • *****
  • Posts: 1055
Re: Hint not being shown
« Reply #7 on: June 07, 2026, 03:34:25 pm »
Ye Gods !!!   I look away and do some code tidying and all of a sudden I'm inundated with fantastic advice  :D

The Properties for a TStringGrid are vast,  so that is my excuse for not seeing CellHintPriority  :-[

That is now set to chpAll and the hint is appearing as I anticipated; thanks specifically to @Lutz Mändle for that 'tip',  I'll look more closely at @LeP, @jamie & @Aruna's suggestions in a while.

@Martin_fr  -  Yes it is up to date  :o  -  though I can't recall the last time I fired up Laz 1.6  -   I'm an 'If it ain't broke don't fix it' type and I haven't done any programming for about 3 years so what I have is OK (for now  ;D ).  This attitude is  -  to some extent  -  engendered by my last update from Laz 1.6 to 2.2.0 which I recall was fraught with problems - though I did get great advice and assistance from forum members  :D


« Last Edit: June 07, 2026, 03:36:38 pm by J-G »
FPC 3.0.0 - Lazarus 1.6 &
FPC 3.2.2  - Lazarus 2.2.0 
Win 7 Ult 64

 

TinyPortal © 2005-2018