1
0
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:
Paul Licameli
2019-12-15 11:49:01 -05:00
parent 681950fc61
commit e875adaa6f
4 changed files with 13 additions and 4 deletions

View File

@@ -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())

View File

@@ -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; }