Jump to content


Photo

Cell.Hint and TextFitHint bugs


  • Please log in to reply
8 replies to this topic

#1 dreel

dreel
  • Members
  • 12 posts

Posted 20 December 2010 - 06:23 PM

Hello, Boki.
I found incorect hint behaviour in NextGrid component on Delphi 7.
1) Cell.Hint have too small width and positioned absolute by cell top right border and placed out of cell. For a very long cell I use to show route over nodes in graph it's not good because right border located farther then screen border. So hint shows sticked to right screen border far from the form rised it.

See it in attchments - nxgrid_cell_hint_bug1.jpg, nxgrid_cell_hint_bug2.jpg

2) TextFitHint sticked to the left top border absolutely, so very long cell scrolled to the middle of the width giv us strnge hint position because the top left cell border hidden from viewpoint window. Hint rises like it's no scroll and a part of cell not hidden, so left top point of hint located out of the component border.

See it in attchments - nxgrid_cellfithint_bug1.jpg (looks normal),
nxgrid_cellfithint_bug2.jpg (left hint border out of component borders)

May be you can give me some instructions how to do custom hint draw?

Attached Files



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 21 December 2010 - 09:03 PM

Hello,

Can you please send me a demo project (and source) to I see what can be done. Thank you - this will help.

Some situations may be fixed, but some will maybe be harder.

Best regards
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 dreel

dreel
  • Members
  • 12 posts

Posted 22 December 2010 - 09:00 AM

QUOTE (Boki (Berg) @ Dec 21 2010, 10:03 PM) <{POST_SNAPBACK}>
Hello,

Can you please send me a demo project (and source) to I see what can be done. Thank you - this will help.

Some situations may be fixed, but some will maybe be harder.

Best regards

Ok. I'll create it for you.

#4 dreel

dreel
  • Members
  • 12 posts

Posted 22 December 2010 - 09:34 AM

QUOTE (Boki (Berg) @ Dec 21 2010, 10:03 PM) <{POST_SNAPBACK}>
Hello,

Can you please send me a demo project (and source) to I see what can be done. Thank you - this will help.

Some situations may be fixed, but some will maybe be harder.

Best regards

Here the example source attached to the message.

Attached Files



#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 22 December 2010 - 09:28 PM

Hello,

For first bug (Cell Hint) modify next procedure in NxCustomGrid.pas:

CODE
procedure TNxCustomGrid.ShowCellHint(ACol, ARow: Integer; HintText: WideString);
var
    HintRect: TRect;
  APoint: TPoint;
  HintLeft: Integer;
begin
  if not ParentFormActive(Self) then Exit;
  if not Application.ShowHint then Exit;

  RecreateHintWnd;

  FHintPosition := hpCellHint;
  HintRect := GetCellRect(ACol, ARow);
  case GridStyle of
    gsReport: HintLeft := HintRect.Left + Columns[ACol].Width;
    else HintLeft := HintRect.Left + Columns[ACol].SlideBounds.Width;
  end;
  if HintLeft > ClientWidth then HintLeft := ClientWidth; // <--------------- new line
  APoint := ClientToScreen(Point(HintLeft, HintRect.Top - 20));
  HintRect := CalcHintRect(FHintWindow, 250, HintText);
  OffsetRect(HintRect, APoint.X, APoint.Y);
  ActivateHint(FHintWindow, HintRect, HintText);
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.

#6 dreel

dreel
  • Members
  • 12 posts

Posted 24 December 2010 - 11:56 AM

In first post top two images showing TextFitHint,
bottom images showing CellHint


#7 dreel

dreel
  • Members
  • 12 posts

Posted 24 December 2010 - 11:58 AM

QUOTE (Boki (Berg) @ Dec 22 2010, 10:28 PM) <{POST_SNAPBACK}>
Hello,

For first bug (Cell Hint) modify next procedure in NxCustomGrid.pas:

CODE
procedure TNxCustomGrid.ShowCellHint(ACol, ARow: Integer; HintText: WideString);
var
    HintRect: TRect;
  APoint: TPoint;
  HintLeft: Integer;
begin
  if not ParentFormActive(Self) then Exit;
  if not Application.ShowHint then Exit;

  RecreateHintWnd;

  FHintPosition := hpCellHint;
  HintRect := GetCellRect(ACol, ARow);
  case GridStyle of
    gsReport: HintLeft := HintRect.Left + Columns[ACol].Width;
    else HintLeft := HintRect.Left + Columns[ACol].SlideBounds.Width;
  end;
  if HintLeft > ClientWidth then HintLeft := ClientWidth; // <--------------- new line
  APoint := ClientToScreen(Point(HintLeft, HintRect.Top - 20));
  HintRect := CalcHintRect(FHintWindow, 250, HintText);
  OffsetRect(HintRect, APoint.X, APoint.Y);
  ActivateHint(FHintWindow, HintRect, HintText);
end;

As i see you don't provide sources for Delphi 7 version. I've only found DCUs.

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 24 December 2010 - 05:05 PM

Hello,

I have attached a DCU file.

Best regards

Attached Files


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.

#9 dreel

dreel
  • Members
  • 12 posts

Posted 17 January 2011 - 12:32 AM

QUOTE (Boki (Berg) @ Dec 24 2010, 05:05 PM) <{POST_SNAPBACK}>
Hello,

I have attached a DCU file.

Best regards

Thanks. it works!

And what about TextFitHint ?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users