Forum > General

Grid Cell Hints Do Not Show When dgAlwaysShowEditor Option Is Used

(1/2) > >>

emhartner:
On my TDBGrid, I have the dgCellHints option checked and also have ShowHints set to True.  When dgAlwaysShowEditor is not checked, all works as expected.  However, when dgAlwaysShowEditor is checked - no cell hints show.  The OnGetCellHint fires, but the hint is not displayed.

Any help would be appreciated.

Thank you,
Eric

dsiders:

--- Quote from: emhartner on April 08, 2024, 05:21:40 pm ---On my TDBGrid, I have the dgCellHints option checked and also have ShowHints set to True.  When dgAlwaysShowEditor is not checked, all works as expected.  However, when dgAlwaysShowEditor is checked - no cell hints show.  The OnGetCellHint fires, but the hint is not displayed.

Any help would be appreciated.

Thank you,
Eric

--- End quote ---

Is dgCellHints also included in TDBGrid.Options?

wp:
In grids.pas (in folder lcl of your Lazarus installation) find procedure TCustomGrid.ShowCellHintWindow. Close to its end you'll see

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  if not EditorMode and not (csDesigning in ComponentState) then begin    Hint := txt;    //set Application.Hint as well (issue #0026957)    Application.Hint := GetLongHint(AppHint);    Application.ActivateHint(APoint, true);  end else    HideCellHintWindow;  
Comment out the words "not EditorMode and", and it should work.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  if {not EditorMode and} not (csDesigning in ComponentState) then begin    Hint := txt;  ...
The fact that EditorMode is checked must have a meaning, but I don't know why. It makes me hesitant to commit this change to the repository. Please work with this change for a while and report back whether you noticed any side-effects.

emhartner:

--- Quote from: wp on April 08, 2024, 06:38:14 pm ---In grids.pas (in folder lcl of your Lazarus installation) find procedure TCustomGrid.ShowCellHintWindow. Close to its end you'll see

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  if not EditorMode and not (csDesigning in ComponentState) then begin    Hint := txt;    //set Application.Hint as well (issue #0026957)    Application.Hint := GetLongHint(AppHint);    Application.ActivateHint(APoint, true);  end else    HideCellHintWindow;  
Comment out the words "not EditorMode and", and it should work.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  if {not EditorMode and} not (csDesigning in ComponentState) then begin    Hint := txt;  ...
The fact that EditorMode is checked must have a meaning, but I don't know why. It makes me hesitant to commit this change to the repository. Please work with this change for a while and report back whether you noticed any side-effects.

--- End quote ---

Thanks wp!  This did the trick.  As you are saying, it was probably added for a reason.  Anyway, I'll work with this for a bit and report back.  Thanks again.

emhartner:
Just following up with wp to let you know that I've not seen any issues so far with this change.

Navigation

[0] Message Index

[#] Next page

Go to full version