Opened 8 years ago

Last modified 4 years ago

#13793 confirmed defect

wxToolTip::SetAutoPop not working properly

Reported by: Tapsa Owned by:
Priority: low Milestone:
Component: wxMSW Version: 2.9.3
Keywords: wxToolTip SetAutoPop simple Cc:
Blocked By: Blocking:
Patch: no

Description

As said in the header, wxToolTip::SetAutoPop does not work as it should.
If the value is too high, all popup tool tips disappear after ~5 seconds.

I have tested with the following values all resulting in ~5 seconds lasting:
wxToolTip::SetAutoPop(40000);
wxToolTip::SetAutoPop(59000);
wxToolTip::SetAutoPop(300000);
wxToolTip::SetAutoPop(2000000000);

wxToolTip::SetAutoPop(30000); seems to work properly.

It looks like it accepts only short integers even though it said it takes long integers.

I don't want tool tips to disappear unless the mouse hovers off.

Change History (2)

comment:1 Changed 8 years ago by vadz

  • Keywords simple added
  • Priority changed from normal to low
  • Status changed from new to confirmed

Yes, MSDN implicitly documents the delay as a WORD (because you need to pass it to MAKELONG() macro when using TTM_SETDELAYTIME). Not sure if we should clamp the values greater than USHRT_MAX to it or do nothing or return an error.

Of course, whatever we do, we must document it too.

comment:2 Changed 4 years ago by oneeyeman

Vadim,
Trying to debug this here are my observations.

1.Start the controls sample.

  1. Select Tooltips->Set Delay
  2. Enter the value.

At this point the code goes to the MyFrame::OnSetTooltipDelay().
Now this function calls wxToolTip::SetDelay() with the parameter "long s_delay".
Now, this function executes this code:

SendTooltipMessageToAll(ms_hwndTT, TTM_SETDELAYTIME, TTDT_INITIAL, milliseconds);

where "milliseconds" parameter passed is the delay time for the tooltip.

The code for the SendTooltipMessageToAll() looks like this:

static inline void
SendTooltipMessageToAll(WXHWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    if ( hwnd )
        ::SendMessage((HWND)hwnd, msg, wParam, lParam);
}

However, according to MSDN:

lParam

    The LOWORD specifies the delay time, in milliseconds. The HIWORD must be zero.

Does "SendMessage()" call miss the "MAKELPARAM()" macro?

Note: See TracTickets for help on using tickets.