From becac1ef57b05ee093e63df6650149e9fd75e500 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 15 Aug 2007 12:57:36 +0000 Subject: [PATCH] added wxToolTip::SetAutoPop() and SetReshow() (patch 1768804) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + docs/latex/wx/tooltip.tex | 21 +++++++++++++++++++-- include/wx/cocoa/tooltip.h | 4 ++++ include/wx/gtk/tooltip.h | 4 ++++ include/wx/gtk1/tooltip.h | 4 ++++ include/wx/mac/carbon/tooltip.h | 4 ++++ include/wx/msw/tooltip.h | 4 ++++ include/wx/os2/tooltip.h | 4 ++++ include/wx/palmos/tooltip.h | 4 ++++ src/gtk/tooltip.cpp | 8 ++++++++ src/gtk1/tooltip.cpp | 8 ++++++++ src/mac/carbon/tooltip.cpp | 8 ++++++++ src/msw/tooltip.cpp | 12 ++++++++++++ src/palmos/tooltip.cpp | 8 ++++++++ 14 files changed, 92 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 91189d5e85..5c131d3689 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -154,6 +154,7 @@ All (GUI): - Show standard options in wxCmdLineParser usage message (Francesco Montorsi). - Added wxRect::operator+ (union) and * (intersection) (bdonner). - Added support for two auxiliary mouse buttons to wxMouseEvent (Chris Weiland). +- Added wxToolTip::SetAutoPop() and SetReshow() (Jan Knepper) - Added wxTaskBarIcon::Destroy() wxGTK: diff --git a/docs/latex/wx/tooltip.tex b/docs/latex/wx/tooltip.tex index 7b35a9aa65..2405dd04ee 100644 --- a/docs/latex/wx/tooltip.tex +++ b/docs/latex/wx/tooltip.tex @@ -3,8 +3,10 @@ This class holds information about a tooltip associated with a window (see \helpref{wxWindow::SetToolTip}{wxwindowsettooltip}). -The two static methods, \helpref{wxToolTip::Enable}{wxtooltipenable} and -\helpref{wxToolTip::SetDelay}{wxtooltipsetdelay} can be used to globally +The four static methods, \helpref{wxToolTip::Enable}{wxtooltipenable}, +\helpref{wxToolTip::SetDelay}{wxtooltipsetdelay} +\helpref(wxToolTip::SetAutoPop)(wxtooltipsetautopop) and +\helpref(wxToolTip::SetReshow)(wxtooltipsetreshow) can be used to globally alter tooltips behaviour. \wxheading{Derived from} @@ -39,6 +41,21 @@ Set the delay after which the tooltip appears. May not be supported on all platforms (eg. wxCocoa). +\membersection{wxToolTip::SetAutoPop}\label{wxtooltipsetautopop} + +\func{static void}{SetAutoPop}{\param{long }{msecs}} + +Set the delay after which the tooltip disappears or how long a +tooltip remains visible. +May not be supported on all platforms (eg. wxCocoa, GTK, Palmos). + +\membersection{wxToolTip::SetReshow}\label{wxtooltipsetreshow} + +\func{static void}{SetReshow}{\param{long }{msecs}} + +Set the delay between subsequent tooltips to appear. +May not be supported on all platforms (eg. wxCocoa, GTK, Palmos). + \membersection{wxToolTip::wxToolTip}\label{wxtooltipwxtooltip} \func{}{wxToolTip}{\param{const wxString\& }{tip}} diff --git a/include/wx/cocoa/tooltip.h b/include/wx/cocoa/tooltip.h index 784718164b..42c9abfc35 100644 --- a/include/wx/cocoa/tooltip.h +++ b/include/wx/cocoa/tooltip.h @@ -36,6 +36,10 @@ public: static void Enable(bool flag); // set the delay after which the tooltip appears static void SetDelay(long milliseconds); + // set the delay after which the tooltip disappears or how long the tooltip remains visible + static void SetAutoPop(long milliseconds); + // set the delay between subsequent tooltips to appear + static void SetReshow(long milliseconds); private: void SetWindow(wxWindow* window); diff --git a/include/wx/gtk/tooltip.h b/include/wx/gtk/tooltip.h index add64f06bc..de97789e55 100644 --- a/include/wx/gtk/tooltip.h +++ b/include/wx/gtk/tooltip.h @@ -33,6 +33,10 @@ public: // globally change the tooltip parameters static void Enable( bool flag ); static void SetDelay( long msecs ); + // set the delay after which the tooltip disappears or how long the tooltip remains visible + static void SetAutoPop(long msecs); + // set the delay between subsequent tooltips to appear + static void SetReshow(long msecs); // get/set the tooltip text void SetTip( const wxString &tip ); diff --git a/include/wx/gtk1/tooltip.h b/include/wx/gtk1/tooltip.h index 8d03757923..08a9755abc 100644 --- a/include/wx/gtk1/tooltip.h +++ b/include/wx/gtk1/tooltip.h @@ -31,6 +31,10 @@ public: // globally change the tooltip parameters static void Enable( bool flag ); static void SetDelay( long msecs ); + // set the delay after which the tooltip disappears or how long the tooltip remains visible + static void SetAutoPop(long msecs); + // set the delay between subsequent tooltips to appear + static void SetReshow(long msecs); wxToolTip( const wxString &tip ); diff --git a/include/wx/mac/carbon/tooltip.h b/include/wx/mac/carbon/tooltip.h index 0599a7b0d5..dfe36d72b6 100644 --- a/include/wx/mac/carbon/tooltip.h +++ b/include/wx/mac/carbon/tooltip.h @@ -36,6 +36,10 @@ public: static void Enable(bool flag); // set the delay after which the tooltip appears static void SetDelay(long milliseconds); + // set the delay after which the tooltip disappears or how long the tooltip remains visible + static void SetAutoPop(long milliseconds); + // set the delay between subsequent tooltips to appear + static void SetReshow(long milliseconds); static void NotifyWindowDelete( WXHWND win ) ; // implementation only from now on diff --git a/include/wx/msw/tooltip.h b/include/wx/msw/tooltip.h index d3cf88fc24..d1b6bba824 100644 --- a/include/wx/msw/tooltip.h +++ b/include/wx/msw/tooltip.h @@ -37,6 +37,10 @@ public: static void Enable(bool flag); // set the delay after which the tooltip appears static void SetDelay(long milliseconds); + // set the delay after which the tooltip disappears or how long the tooltip remains visible + static void SetAutoPop(long milliseconds); + // set the delay between subsequent tooltips to appear + static void SetReshow(long milliseconds); // implementation only from now on // ------------------------------- diff --git a/include/wx/os2/tooltip.h b/include/wx/os2/tooltip.h index 5a85523492..7c4503d537 100644 --- a/include/wx/os2/tooltip.h +++ b/include/wx/os2/tooltip.h @@ -33,6 +33,10 @@ public: static void Enable(bool WXUNUSED(flag)) {} // set the delay after which the tooltip appears static void SetDelay(long WXUNUSED(milliseconds)) {} + // set the delay after which the tooltip disappears or how long the tooltip remains visible + static void SetAutoPop(long WXUNUSED(milliseconds)) {} + // set the delay between subsequent tooltips to appear + static void SetReshow(long WXUNUSED(milliseconds)) {} // // Implementation diff --git a/include/wx/palmos/tooltip.h b/include/wx/palmos/tooltip.h index 3df3d53f10..a7af972c54 100644 --- a/include/wx/palmos/tooltip.h +++ b/include/wx/palmos/tooltip.h @@ -33,6 +33,10 @@ public: static void Enable(bool flag); // set the delay after which the tooltip appears static void SetDelay(long milliseconds); + // set the delay after which the tooltip disappears or how long the tooltip remains visible + static void SetAutoPop(long milliseconds); + // set the delay between subsequent tooltips to appear + static void SetReshow(long milliseconds); // implementation only from now on // ------------------------------- diff --git a/src/gtk/tooltip.cpp b/src/gtk/tooltip.cpp index a02aedd620..08f55c48f4 100644 --- a/src/gtk/tooltip.cpp +++ b/src/gtk/tooltip.cpp @@ -95,4 +95,12 @@ void wxToolTip::SetDelay( long msecs ) gtk_tooltips_set_delay( gs_tooltips, (int)msecs ); } +void wxToolTip::SetAutoPop( long WXUNUSED(msecs) ) +{ +} + +void wxToolTip::SetReshow( long WXUNUSED(msecs) ) +{ +} + #endif // wxUSE_TOOLTIPS diff --git a/src/gtk1/tooltip.cpp b/src/gtk1/tooltip.cpp index 141f3bc17d..28d243f789 100644 --- a/src/gtk1/tooltip.cpp +++ b/src/gtk1/tooltip.cpp @@ -79,4 +79,12 @@ void wxToolTip::SetDelay( long msecs ) gtk_tooltips_set_delay( ss_tooltips, (int)msecs ); } +void wxToolTip::SetAutoPop( long WXUNUSED(msecs) ) +{ +} + +void wxToolTip::SetReshow( long WXUNUSED(msecs) ) +{ +} + #endif diff --git a/src/mac/carbon/tooltip.cpp b/src/mac/carbon/tooltip.cpp index e4eebd1086..18c9ca7ada 100644 --- a/src/mac/carbon/tooltip.cpp +++ b/src/mac/carbon/tooltip.cpp @@ -146,6 +146,14 @@ void wxToolTip::SetDelay( long msecs ) s_ToolTipDelay = msecs ; } +void wxToolTip::SetAutoPop( long WXUNUSED(msecs) ) +{ +} + +void wxToolTip::SetReshow( long WXUNUSED(msecs) ) +{ +} + void wxToolTip::RelayEvent( wxWindow *win , wxMouseEvent &event ) { if ( s_ShowToolTips ) diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index 0e41099317..0b705200f7 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -191,6 +191,18 @@ void wxToolTip::SetDelay(long milliseconds) TTDT_INITIAL, milliseconds); } +void wxToolTip::SetAutoPop(long milliseconds) +{ + SendTooltipMessageToAll(ms_hwndTT, TTM_SETDELAYTIME, + TTDT_AUTOPOP, milliseconds); +} + +void wxToolTip::SetReshow(long milliseconds) +{ + SendTooltipMessageToAll(ms_hwndTT, TTM_SETDELAYTIME, + TTDT_RESHOW, milliseconds); +} + // --------------------------------------------------------------------------- // implementation helpers // --------------------------------------------------------------------------- diff --git a/src/palmos/tooltip.cpp b/src/palmos/tooltip.cpp index 6ea34c8838..36298c1e80 100644 --- a/src/palmos/tooltip.cpp +++ b/src/palmos/tooltip.cpp @@ -99,6 +99,14 @@ void wxToolTip::SetDelay(long milliseconds) { } +void wxToolTip::SetAutoPop( long WXUNUSED(milliseconds) ) +{ +} + +void wxToolTip::SetReshow( long WXUNUSED(milliseconds) ) +{ +} + // --------------------------------------------------------------------------- // implementation helpers // --------------------------------------------------------------------------- -- 2.45.2