mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
AButton::SetToolTip takes TranslatableString
This commit is contained in:
@@ -285,6 +285,11 @@ void AButton::UseDisabledAsDownHiliteImage(bool flag)
|
||||
mUseDisabledAsDownHiliteImage = flag;
|
||||
}
|
||||
|
||||
void AButton::SetToolTip( TranslatableString toolTip )
|
||||
{
|
||||
wxWindow::SetToolTip( toolTip.Strip().Translation() );
|
||||
}
|
||||
|
||||
// This compensates for a but in wxWidgets 3.0.2 for mac:
|
||||
// Couldn't set focus from keyboard when AcceptsFocus returns false;
|
||||
// this bypasses that limitation
|
||||
@@ -445,7 +450,7 @@ void AButton::OnMouseEvent(wxMouseEvent & event)
|
||||
// to make it pop up when we want it.
|
||||
auto text = GetToolTipText();
|
||||
UnsetToolTip();
|
||||
SetToolTip(text);
|
||||
wxWindow::SetToolTip(text);
|
||||
mCursorIsInWindow = true;
|
||||
}
|
||||
else if (event.Leaving())
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "ImageRoll.h" // member variable
|
||||
|
||||
class wxImage;
|
||||
class TranslatableString;
|
||||
|
||||
class AButton final : public wxWindow {
|
||||
friend class AButtonAx;
|
||||
@@ -55,6 +56,9 @@ class AButton final : public wxWindow {
|
||||
|
||||
virtual ~ AButton();
|
||||
|
||||
// overload and hide the inherited function that takes naked wxString:
|
||||
void SetToolTip(TranslatableString toolTip);
|
||||
|
||||
bool AcceptsFocus() const override { return s_AcceptsFocus; }
|
||||
bool AcceptsFocusFromKeyboard() const override { return mEnabled; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user