Jump to content


Photo

Cell Hint not show at runtime.


  • Please log in to reply
3 replies to this topic

#1 FourWhey

FourWhey
  • Members
  • 165 posts

Posted 19 October 2016 - 11:03 PM

After a row is added, I set the hint.  At runtime, if I mouse over the cell, nothing is shown. The column's ShowTextFitHint is false.

 

Here's how I assign the hint text.

grd.Cell[grd.Columns.ItemBy['InventoryNumber'].Index, grd.LastAddedRow].Hint := 'test';

Is this just not implemented or is something wrong?

 

Almost identical code worked in v5.

 

Thanks.



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 19 October 2016 - 11:07 PM

Hi,

Most probably bug. I will fix it, it's should be easy.
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.

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 19 October 2016 - 11:18 PM

Hi,

Replace next procedure inside NxGridView6.pas file (Sources\Next Grid):

Please tell me if it work.

procedure TNxGridView6.SetHoverCell(const Value: TPoint);
var
  Cell: INxBaseCell;
  GridCell: INxCell;
  CellRect: TRect;
  Location: TPoint;
  TextContent: INxTextContent;
  View: INxColumnView;
begin
  if not IsEqual(FHotCell, Value) then
  begin

    ReleaseCellHint;
    ReleaseTextFitHint;

    if Assigned(FCapturedView) then
    begin
      { Can't capture! }
      if FCapturedView.Captured
        then Exit;

      { Unset Hover }
      FCapturedView.MouseLeave;

      { Release }
      FCapturedView := nil;
    end;

    { Set Value }

    FHotCell := Value;

    if IsSet(FHotCell)
      and Columns[FHotCell.X].Enabled then
    begin

      { IsResponsive Checked inside
        Set & Clone }
      CaptureView(FHotCell);

      if FHotCell.Y = -1 then
      begin
        Cell := Columns[FHotCell.X].InsertValue;
        CellRect := GetCellRect(FHotCell.X);
      end else
      begin
        Cell := Cells[FHotCell.X, FHotCell.Y];
        CellRect := GetCellRect(FHotCell);
      end;

      if Supports(Columns[FHotCell.X], INxTextContent, TextContent) then
        if TextContent.ShowTextFitHint then
        begin
          if not Cell.Visible then Exit;

          View := UpdateCellView(FHotCell.X, FHotCell.Y, CellRect);

          if not View.CanFitText then
          begin
            Location := CellRect.TopLeft;

            ShowCellTextFitHint(Location, Columns[FHotCell.X].GetDisplayText(Cell, FHotCell.X, FHotCell.Y));
          end;

        end;

      { Cell's Hint }
      if Supports(Cell, INxCell, GridCell) then
        if GridCell.Hint <> '' then
        begin
          Location := GetCellRect(FHotCell).TopLeft;
          OffsetPoint(Location, Columns[FHotCell.X].Width, 0);

          ShowCellHint(Location, GridCell.Hint);
        end;

    end
    else Unset(FHotCell);

  end;

end;

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.

#4 FourWhey

FourWhey
  • Members
  • 165 posts

Posted 20 October 2016 - 10:53 PM

This worked.  Thank you.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users