Basic support for tooltips under OS X Cocoa.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63477 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -145,6 +145,7 @@ public :
|
||||
void SetScrollThumb( wxInt32 value, wxInt32 thumbSize );
|
||||
|
||||
void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
|
||||
void SetToolTip( wxToolTip* tooltip );
|
||||
|
||||
void InstallEventHandler( WXWidget control = NULL );
|
||||
|
||||
|
@@ -269,6 +269,8 @@ public :
|
||||
|
||||
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ) = 0;
|
||||
|
||||
virtual void SetToolTip(wxToolTip* WXUNUSED(tooltip)) { }
|
||||
|
||||
// is the clicked event sent AFTER the state already changed, so no additional
|
||||
// state changing logic is required from the outside
|
||||
virtual bool ButtonClickDidStateChange() = 0;
|
||||
|
@@ -47,6 +47,8 @@ wxToolTip::~wxToolTip()
|
||||
void wxToolTip::SetTip( const wxString &tip )
|
||||
{
|
||||
m_text = tip;
|
||||
if (m_window)
|
||||
m_window->SetToolTip(this);
|
||||
}
|
||||
|
||||
void wxToolTip::SetWindow( wxWindow *win )
|
||||
|
@@ -32,6 +32,10 @@
|
||||
#include "wx/dnd.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
#include "wx/tooltip.h"
|
||||
#endif
|
||||
|
||||
#include <objc/objc-runtime.h>
|
||||
|
||||
// Get the window with the focus
|
||||
@@ -1890,6 +1894,18 @@ void wxWidgetCocoaImpl::SetFont(wxFont const& font, wxColour const&, long, bool)
|
||||
[m_osxView setFont: font.OSXGetNSFont()];
|
||||
}
|
||||
|
||||
void wxWidgetCocoaImpl::SetToolTip(wxToolTip* tooltip)
|
||||
{
|
||||
if (tooltip)
|
||||
{
|
||||
wxCFStringRef cf( tooltip->GetTip() , m_wxPeer->GetFont().GetEncoding() );
|
||||
[m_osxView setToolTip: cf.AsNSString()];
|
||||
}
|
||||
else
|
||||
[m_osxView setToolTip: nil];
|
||||
|
||||
}
|
||||
|
||||
void wxWidgetCocoaImpl::InstallEventHandler( WXWidget control )
|
||||
{
|
||||
WXWidget c = control ? control : (WXWidget) m_osxView;
|
||||
|
@@ -752,6 +752,9 @@ void wxWindowMac::DoSetToolTip(wxToolTip *tooltip)
|
||||
|
||||
if ( m_tooltip )
|
||||
m_tooltip->SetWindow(this);
|
||||
|
||||
if (m_peer)
|
||||
m_peer->SetToolTip(tooltip);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user