Implement wxToolTip::SetDelay() for wxOSX

Set the "NSInitialToolTipDelay" object in NSUserDefaults.

Closes #17322.
This commit is contained in:
David Vanderson 2016-01-08 17:02:19 +01:00 committed by Vadim Zeitlin
parent 13783d8733
commit c5659b19b4
3 changed files with 11 additions and 2 deletions

View File

@ -199,3 +199,4 @@ wxOSX/Cocoa:
- Add wxTE_{RIGHT,CENTER} support for multiline wxTextCtrl (Andreas Falkenhahn).
- Don't leave wxSlider labels shown when the slider itself is hidden.
- Don't generate wxEVT_TEXT_ENTER for controls without wxTE_PROCESS_ENTER.
- Implement wxToolTip::SetDelay() (David Vanderson).

View File

@ -54,7 +54,7 @@ public:
/**
Set the delay after which the tooltip appears.
@note May not be supported on all platforms (eg. wxCocoa).
@note May not be supported on all platforms.
*/
static void SetDelay(long msecs);

View File

@ -23,6 +23,10 @@
#include "wx/geometry.h"
#include "wx/osx/uma.h"
#if wxOSX_USE_COCOA_OR_CARBON
#include <Appkit/Appkit.h>
#endif
// FYI a link to help with implementing: http://www.cocoadev.com/index.pl?LittleYellowBox
@ -59,8 +63,12 @@ void wxToolTip::Enable( bool WXUNUSED(flag) )
{
}
void wxToolTip::SetDelay( long WXUNUSED(msecs) )
void wxToolTip::SetDelay( long msecs )
{
#if wxOSX_USE_COCOA_OR_CARBON
[[NSUserDefaults standardUserDefaults] setObject: [NSNumber numberWithInt: msecs]
forKey: @"NSInitialToolTipDelay"];
#endif
}
void wxToolTip::SetAutoPop( long WXUNUSED(msecs) )