View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006169 | JEDI VCL | 00 JVCL Components | public | 2013-07-16 14:50 | 2014-09-03 11:29 |
Reporter | altaveron | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Product Version | 3.47 | ||||
Target Version | Fixed in Version | ||||
Summary | 0006169: Incorrect position of a hint window with ShowCellHint = True | ||||
Description | 1. Set the following properties of a TJvDBGrid instance: ShowCellHint := True; CellHintPosition := gchpDefault; ShowHint := True; Hint := 'Bla-bla-bla'; 2. (optional step!) Use the following class of a hint window to make its font the same as on the a cell of the grid: type TGridHintWindow = class(THintWindow) constructor Create(AOwner: TComponent); override; end; constructor TGridHintWindow.Create(AOwner: TComponent); begin inherited; Canvas.Font.Name := 'MS Sans Serif'; end; procedure TForm1.ApplicationEventsShowHint( var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo); begin if HintInfo.HintControl is TJvDBGrid then begin // ???????? ??? ?????? HintInfo.HintWindowClass := TGridHintWindow; end; end; 3. Move mouse to the cell and wait for a hint. The hint window will appear on incorrect position. You will be sure that it's an issue with step 2. The hint window should be at the correct position. The right one is: HintPos := Point(HintPos.X - 1, HintPos.Y - 1); | ||||
Additional Information | The following code on the end of method CMHintShow() on JvDBGrid.pas: if not AtCursorPosition and HintWindowClass.ClassNameIs('THintWindow') then HintPos := ClientToScreen(CursorRect.TopLeft) else HintPos := InitialMousePos; Should be replaced to the following code to fix the issue: if not AtCursorPosition and HintWindowClass.ClassNameIs('THintWindow') then begin HintPos := ClientToScreen(CursorRect.TopLeft); HintPos := Point(HintPos.X - 1, HintPos.Y - 1); end else HintPos := InitialMousePos; | ||||
Tags | No tags attached. | ||||
|
UPDATE: Code "Hint := 'Bla-bla-bla';" on step 1 is unnecessary. |
|
Please try with the latest JVCL version in GIT (or daily zip) and then send us a zipped file containing the sources of an application showing the issue. |
|
The correct code on step 2 (on Windows 7, Delphi XE2): type TGridHintWindow = class(THintWindow) constructor Create(AOwner: TComponent); override; end; constructor TGridHintWindow.Create(AOwner: TComponent); begin inherited; Canvas.Font.Name := 'Tahoma'; Canvas.Font.Size := 8; end; procedure TForm1.ApplicationEvents1ShowHint( var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo); begin if HintInfo.HintControl is TJvDBGrid then HintInfo.HintWindowClass := TGridHintWindow; end; |
2014-03-02 12:09
|
0006169.zip (782,334 bytes) |
2014-03-02 12:09
|
|
2014-03-02 12:09
|
|
|
Steps to reproduce: 1. Run the demo project. 2. Move mouse cursor to a cell and wait for a hint. Actual result: Hint will be shown on the incorrect position (see the screenshot). Should be: Hint should be shown on the correct position (see the screenshot). Issue fix on the JVCL sources is located on "Additional Information" of the issue. |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-07-16 14:50 | altaveron | New Issue | |
2013-07-16 15:49 | altaveron | Note Added: 0020574 | |
2013-12-13 10:58 | obones | Note Added: 0020734 | |
2013-12-13 10:58 | obones | Status | new => feedback |
2014-03-02 12:08 | altaveron | Note Added: 0020914 | |
2014-03-02 12:09 | altaveron | File Added: 0006169.zip | |
2014-03-02 12:09 | altaveron | File Added: Actual Result.png | |
2014-03-02 12:09 | altaveron | File Added: Should Be.png | |
2014-03-02 12:12 | altaveron | Note Added: 0020915 | |
2014-09-03 11:29 | obones | Status | feedback => acknowledged |