From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Tool Tip location within scrollable child panels

If I attach a tool tip to a control that is on a scrollable child panel the tool tip location does not update when I scroll the panel. Instead the tool tip is displayed in the location where the control would be if the panel were not scrolled. Is there a fix for this? I am using version 6.
0 Kudos
Message 1 of 2
(2,623 Views)
Hello,

This seems to be aproblem when converting the mouse coordenates. I'll file a report on this to have it corrected in future releases on CVI. In the mean time I went through the code (this is open source), located the problematic function and coded a small modification to take into account the scrolling.

To fix this in your computer follow this steps:
  1. Add to your project "toolbox.c" found at [CVI]\toolslib\toolbox
  2. Open the file and navigate to line 3203
  3. Replace the function there with the following code:

    static int PointConvertToGlobal(int childPanel, Point *point)
    {
    int error = 0, top, left, topScroll, leftScroll;
    int thisParent;

    GetPanelAttribute(childPanel, ATTR_TOP, &top);
    GetPanelAttribut
    e (childPanel, ATTR_VSCROLL_OFFSET, &topScroll);
    GetPanelAttribute(childPanel, ATTR_LEFT, &left);
    GetPanelAttribute (childPanel, ATTR_HSCROLL_OFFSET, &leftScroll);

    point->x += left-leftScroll;
    point->y += top-topScroll;

    errChk( GetPanelAttribute(childPanel, ATTR_PANEL_PARENT, &thisParent));

    if (thisParent)
    return PointConvertToGlobal(thisParent, point);

    Error:
    return error;
    }


The only modification is that I read the offset of the scroll bars and subtracted to the coordenates, this fixes the weird behaviour in panels with scroll bars.

Thanks for your feedback, and let me know if you have any further questions.

Regards,
Juan Carlos
N.I.
Message 2 of 2
(2,623 Views)