1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-01 16:19:43 +02:00

TranslatableString for tooltips and status bar messages

This commit is contained in:
Paul Licameli 2019-12-08 16:24:20 -05:00
parent 2007346551
commit 49cab86fc1
45 changed files with 156 additions and 165 deletions

View File

@ -626,7 +626,7 @@ protected:
static wxCursor cursor{ wxCURSOR_SIZEWE }; static wxCursor cursor{ wxCURSOR_SIZEWE };
return { return {
_( "Click and drag to adjust, double-click to reset" ), XO( "Click and drag to adjust, double-click to reset" ),
&cursor, &cursor,
XO( "Record/Play head" ) XO( "Record/Play head" )
}; };
@ -1501,7 +1501,7 @@ auto AdornedRulerPanel::ScrubbingHandle::Preview
auto message = ScrubbingMessage(scrubber, mClicked == Button::Left); auto message = ScrubbingMessage(scrubber, mClicked == Button::Left);
return { return {
message.Translation(), message,
{}, {},
// Tooltip is same as status message, or blank // Tooltip is same as status message, or blank
((mParent && mParent->mTimelineToolTip) ? message : TranslatableString{}), ((mParent && mParent->mTimelineToolTip) ? message : TranslatableString{}),
@ -1543,7 +1543,7 @@ auto AdornedRulerPanel::QPHandle::Preview
state.state.m_x, mParent->mOldPlayRegion.GetEnd()); state.state.m_x, mParent->mOldPlayRegion.GetEnd());
return { return {
message.Translation(), message,
showArrows ? &cursorSizeWE : &cursorHand, showArrows ? &cursorSizeWE : &cursorHand,
tooltip, tooltip,
}; };
@ -2307,7 +2307,7 @@ void AdornedRulerPanel::ProcessUIHandleResult
DrawBothOverlays(); DrawBothOverlays();
} }
void AdornedRulerPanel::UpdateStatusMessage( const wxString &message ) void AdornedRulerPanel::UpdateStatusMessage( const TranslatableString &message )
{ {
ProjectStatus::Get( *GetProject() ).Set(message); ProjectStatus::Get( *GetProject() ).Set(message);
} }

View File

@ -200,7 +200,7 @@ private:
(TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell, (TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell,
unsigned refreshResult) override; unsigned refreshResult) override;
void UpdateStatusMessage( const wxString & ) override; void UpdateStatusMessage( const TranslatableString & ) override;
void CreateOverlays(); void CreateOverlays();

View File

@ -271,8 +271,7 @@ void CellularPanel::HandleMotion
auto oldCell = state.mLastCell.lock(); auto oldCell = state.mLastCell.lock();
auto oldHandle = Target(); auto oldHandle = Target();
wxString status{}; TranslatableString status, tooltip;
TranslatableString tooltip{};
wxCursor *pCursor{}; wxCursor *pCursor{};
unsigned refreshCode = 0; unsigned refreshCode = 0;
@ -386,7 +385,7 @@ void CellularPanel::HandleMotion
} }
else if ( oldCell || oldHandle ) else if ( oldCell || oldHandle )
// Leaving a cell or hit test target with no replacement // Leaving a cell or hit test target with no replacement
UpdateStatusMessage( wxString{} ); UpdateStatusMessage( {} );
if (newCell) if (newCell)
ProcessUIHandleResult(newCell.get(), newCell.get(), refreshCode); ProcessUIHandleResult(newCell.get(), newCell.get(), refreshCode);

View File

@ -22,6 +22,7 @@ class TrackPanelGroup;
class TrackPanelNode; class TrackPanelNode;
struct TrackPanelMouseEvent; struct TrackPanelMouseEvent;
struct TrackPanelMouseState; struct TrackPanelMouseState;
class TranslatableString;
class UIHandle; class UIHandle;
using UIHandlePtr = std::shared_ptr<UIHandle>; using UIHandlePtr = std::shared_ptr<UIHandle>;
@ -55,7 +56,7 @@ public:
(TrackPanelCell *pClickedCell, TrackPanelCell *pLatestCell, (TrackPanelCell *pClickedCell, TrackPanelCell *pLatestCell,
unsigned refreshResult) = 0; unsigned refreshResult) = 0;
virtual void UpdateStatusMessage( const wxString & ) = 0; virtual void UpdateStatusMessage( const TranslatableString & ) = 0;
public: public:
// Structure and functions for generalized visitation of the subdivision // Structure and functions for generalized visitation of the subdivision

View File

@ -21,12 +21,12 @@ struct HitTestPreview
HitTestPreview() HitTestPreview()
{} {}
HitTestPreview(const wxString &message_, wxCursor *cursor_, HitTestPreview(const TranslatableString &message_, wxCursor *cursor_,
const TranslatableString &tooltip_ = {}) const TranslatableString &tooltip_ = {})
: message(message_), cursor(cursor_), tooltip{ tooltip_ } : message{ message_ }, cursor{ cursor_ }, tooltip{ tooltip_ }
{} {}
wxString message {}; TranslatableString message {};
wxCursor *cursor {}; wxCursor *cursor {};
TranslatableString tooltip{}; TranslatableString tooltip{};
}; };

View File

@ -73,10 +73,10 @@ ProjectAudioManager::ProjectAudioManager( AudacityProject &project )
ProjectAudioManager::~ProjectAudioManager() = default; ProjectAudioManager::~ProjectAudioManager() = default;
static wxString FormatRate( int rate ) static TranslatableString FormatRate( int rate )
{ {
if (rate > 0) { if (rate > 0) {
return wxString::Format(_("Actual Rate: %d"), rate); return XO("Actual Rate: %d").Format( rate );
} }
else else
// clear the status field // clear the status field
@ -804,7 +804,7 @@ void ProjectAudioManager::OnAudioIORate(int rate)
mDisplayedRate = rate; mDisplayedRate = rate;
wxString display = FormatRate( rate ); auto display = FormatRate( rate );
ProjectStatus::Get( project ).Set( display, rateStatusBarField ); ProjectStatus::Get( project ).Set( display, rateStatusBarField );
} }

View File

@ -153,7 +153,7 @@ private:
bool mStopping{ false }; bool mStopping{ false };
int mDisplayedRate{ 0 }; int mDisplayedRate{ 0 };
static std::pair< std::vector< wxString >, unsigned > static std::pair< TranslatableStrings, unsigned >
StatusWidthFunction( StatusWidthFunction(
const AudacityProject &project, StatusBarField field); const AudacityProject &project, StatusBarField field);
}; };

View File

@ -612,8 +612,7 @@ bool ProjectFileManager::DoSave (const bool fromSaveAs,
// cancel the cleanup: // cancel the cleanup:
safetyFileName = wxT(""); safetyFileName = wxT("");
ProjectStatus::Get( proj ).Set( ProjectStatus::Get( proj ).Set( XO("Saved %s").Format( fileName ) );
wxString::Format(_("Saved %s"), fileName) );
return true; return true;
} }

View File

@ -1020,7 +1020,7 @@ void ProjectManager::OnStatusChange( wxCommandEvent &evt )
auto field = static_cast<StatusBarField>( evt.GetInt() ); auto field = static_cast<StatusBarField>( evt.GetInt() );
const auto &msg = ProjectStatus::Get( project ).Get( field ); const auto &msg = ProjectStatus::Get( project ).Get( field );
window.GetStatusBar()->SetStatusText(msg, field); window.GetStatusBar()->SetStatusText(msg.Translation(), field);
if ( field == mainStatusBarField ) if ( field == mainStatusBarField )
// When recording, let the NEW status message stay at least as long as // When recording, let the NEW status message stay at least as long as

View File

@ -57,16 +57,16 @@ auto ProjectStatus::GetStatusWidthFunctions() -> const StatusWidthFunctions &
return statusWidthFunctions(); return statusWidthFunctions();
} }
const wxString &ProjectStatus::Get( StatusBarField field ) const const TranslatableString &ProjectStatus::Get( StatusBarField field ) const
{ {
return mLastStatusMessages[ field - 1 ]; return mLastStatusMessages[ field - 1 ];
} }
void ProjectStatus::Set(const wxString &msg, StatusBarField field ) void ProjectStatus::Set(const TranslatableString &msg, StatusBarField field )
{ {
auto &project = mProject; auto &project = mProject;
wxString &lastMessage = mLastStatusMessages[ field - 1 ]; auto &lastMessage = mLastStatusMessages[ field - 1 ];
if ( msg != lastMessage ) { if ( msg.Translation() != lastMessage.Translation() ) {
lastMessage = msg; lastMessage = msg;
wxCommandEvent evt{ EVT_PROJECT_STATUS_UPDATE }; wxCommandEvent evt{ EVT_PROJECT_STATUS_UPDATE };
evt.SetInt( field ); evt.SetInt( field );

View File

@ -46,10 +46,10 @@ public:
ProjectStatus &operator= ( const ProjectStatus & ) = delete; ProjectStatus &operator= ( const ProjectStatus & ) = delete;
~ProjectStatus() override; ~ProjectStatus() override;
// Type of a function to report translated strings, and also report an extra // Type of a function to report translatable strings, and also report an extra
// margin, to request that the corresponding field of the status bar should // margin, to request that the corresponding field of the status bar should
// be wide enough to contain any of those strings plus the margin. // be wide enough to contain any of those strings plus the margin.
using StatusWidthResult = std::pair< std::vector<wxString>, unsigned >; using StatusWidthResult = std::pair< std::vector<TranslatableString>, unsigned >;
using StatusWidthFunction = std::function< using StatusWidthFunction = std::function<
StatusWidthResult( const AudacityProject &, StatusBarField ) StatusWidthResult( const AudacityProject &, StatusBarField )
>; >;
@ -64,11 +64,11 @@ public:
static const StatusWidthFunctions &GetStatusWidthFunctions(); static const StatusWidthFunctions &GetStatusWidthFunctions();
const wxString &Get( StatusBarField field = mainStatusBarField ) const; const TranslatableString &Get( StatusBarField field = mainStatusBarField ) const;
void Set(const wxString &msg, void Set(const TranslatableString &msg,
StatusBarField field = mainStatusBarField); StatusBarField field = mainStatusBarField);
private: private:
AudacityProject &mProject; AudacityProject &mProject;
wxString mLastStatusMessages[ nStatusBarFields ]; TranslatableString mLastStatusMessages[ nStatusBarFields ];
}; };

View File

@ -1224,7 +1224,7 @@ void ProjectWindow::UpdateStatusWidths()
function( mProject, static_cast< StatusBarField >( ii ) ); function( mProject, static_cast< StatusBarField >( ii ) );
for ( const auto &string : results.first ) { for ( const auto &string : results.first ) {
int w; int w;
statusBar->GetTextExtent(string, &w, nullptr); statusBar->GetTextExtent(string.Translation(), &w, nullptr);
width = std::max<int>( width, w + results.second ); width = std::max<int>( width, w + results.second );
} }
} }

View File

@ -650,12 +650,12 @@ bool TrackPanel::IsAudioActive()
return ProjectAudioIO::Get( *p ).IsAudioActive(); return ProjectAudioIO::Get( *p ).IsAudioActive();
} }
void TrackPanel::UpdateStatusMessage( const wxString &st ) void TrackPanel::UpdateStatusMessage( const TranslatableString &st )
{ {
auto status = st; auto status = st;
if (HasEscape()) if (HasEscape())
/* i18n-hint Esc is a key on the keyboard */ /* i18n-hint Esc is a key on the keyboard */
status += wxT(" "), status += _("(Esc to cancel)"); status.Join( XO("(Esc to cancel)"), " " );
ProjectStatus::Get( *GetProject() ).Set( status ); ProjectStatus::Get( *GetProject() ).Set( status );
} }
@ -693,7 +693,7 @@ void TrackPanel::UpdateViewIfNoTracks()
mListener->TP_HandleResize(); mListener->TP_HandleResize();
//STM: Clear message if all tracks are removed //STM: Clear message if all tracks are removed
ProjectStatus::Get( *GetProject() ).Set(wxT("")); ProjectStatus::Get( *GetProject() ).Set({});
} }
} }

View File

@ -225,7 +225,7 @@ protected:
(TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell, (TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell,
unsigned refreshResult) override; unsigned refreshResult) override;
void UpdateStatusMessage( const wxString &status ) override; void UpdateStatusMessage( const TranslatableString &status ) override;
}; };
// A predicate class // A predicate class

View File

@ -35,13 +35,13 @@ HitTestPreview TrackPanelResizeHandle::HitPreview(bool bLinked)
// is shorter when it is between stereo tracks). // is shorter when it is between stereo tracks).
return { return {
_("Click and drag to adjust relative size of stereo tracks."), XO("Click and drag to adjust relative size of stereo tracks."),
&resizeCursor &resizeCursor
}; };
} }
else { else {
return { return {
_("Click and drag to resize the track."), XO("Click and drag to resize the track."),
&resizeCursor &resizeCursor
}; };
} }

View File

@ -1169,7 +1169,7 @@ void OnTrackClose(const CommandContext &context)
if (isAudioActive) if (isAudioActive)
{ {
ProjectStatus::Get( project ).Set( ProjectStatus::Get( project ).Set(
_("Can't delete track with active audio")); XO("Can't delete track with active audio"));
wxBell(); wxBell();
return; return;
} }

View File

@ -44,7 +44,8 @@ class ODComputeSummaryTask final : public ODTask
///Return the task name ///Return the task name
const char* GetTaskName() override { return "ODComputeSummaryTask"; } const char* GetTaskName() override { return "ODComputeSummaryTask"; }
const wxChar* GetTip() override { return _("Import complete. Calculating waveform"); } TranslatableString GetTip() override
{ return XO("Import complete. Calculating waveform"); }
bool UsesCustomWorkUntilPercentage() override { return true; } bool UsesCustomWorkUntilPercentage() override { return true; }
float ComputeNextWorkUntilPercentageComplete() override; float ComputeNextWorkUntilPercentageComplete() override;

View File

@ -53,7 +53,7 @@ class ODDecodeTask /* not final */ : public ODTask
///Return the task name ///Return the task name
const char* GetTaskName() override { return "ODDecodeTask"; } const char* GetTaskName() override { return "ODDecodeTask"; }
const wxChar* GetTip() override { return _("Decoding Waveform"); } TranslatableString GetTip() override { return XO("Decoding Waveform"); }
///Subclasses should override to return respective type. ///Subclasses should override to return respective type.
unsigned int GetODType() override { return eODNone; } unsigned int GetODType() override { return eODNone; }

View File

@ -622,7 +622,7 @@ bool ODManager::HasLoadedODFlag()
} }
///fills in the status bar message for a given track ///fills in the status bar message for a given track
void ODManager::FillTipForWaveTrack( const WaveTrack * t, wxString &tip ) void ODManager::FillTipForWaveTrack( const WaveTrack * t, TranslatableString &tip )
{ {
mQueuesMutex.Lock(); mQueuesMutex.Lock();
for(unsigned int i=0;i<mQueues.size();i++) for(unsigned int i=0;i<mQueues.size();i++)

View File

@ -37,6 +37,7 @@ wxDECLARE_EXPORTED_EVENT(AUDACITY_DLL_API,
int CompareNoCaseFileName(const wxString& first, const wxString& second); int CompareNoCaseFileName(const wxString& first, const wxString& second);
/// A singleton that manages currently running Tasks on an arbitrary /// A singleton that manages currently running Tasks on an arbitrary
/// number of threads. /// number of threads.
class TranslatableString;
class Track; class Track;
class WaveTrack; class WaveTrack;
class ODWaveTrackTaskQueue; class ODWaveTrackTaskQueue;
@ -100,7 +101,7 @@ class ODManager final
static bool IsInstanceCreated(); static bool IsInstanceCreated();
///fills in the status bar message for a given track ///fills in the status bar message for a given track
void FillTipForWaveTrack( const WaveTrack * t, wxString &tip ); void FillTipForWaveTrack( const WaveTrack * t, TranslatableString &tip );
///Gets the total percent complete for all tasks combined. ///Gets the total percent complete for all tasks combined.
float GetOverallPercentComplete(); float GetOverallPercentComplete();

View File

@ -117,7 +117,7 @@ class ODTask /* not final */
bool GetNeedsODUpdate(); bool GetNeedsODUpdate();
void ResetNeedsODUpdate(); void ResetNeedsODUpdate();
virtual const wxChar* GetTip()=0; virtual TranslatableString GetTip()=0;
///returns true if the task is associated with the project. ///returns true if the task is associated with the project.
virtual bool IsTaskAssociatedWithProject(AudacityProject* proj); virtual bool IsTaskAssociatedWithProject(AudacityProject* proj);

View File

@ -304,15 +304,20 @@ ODTask* ODWaveTrackTaskQueue::GetFrontTask()
} }
///fills in the status bar message for a given track ///fills in the status bar message for a given track
void ODWaveTrackTaskQueue::FillTipForWaveTrack( const WaveTrack * t, wxString &tip ) void ODWaveTrackTaskQueue::FillTipForWaveTrack(
const WaveTrack * t, TranslatableString &tip )
{ {
if(ContainsWaveTrack(t) && GetNumTasks()) if(ContainsWaveTrack(t) && GetNumTasks())
{ {
// if(GetNumTasks()==1) // if(GetNumTasks()==1)
mTipMsg.Printf(_("%s %2.0f%% complete. Click to change task focal point."), GetFrontTask()->GetTip(), GetFrontTask()->PercentComplete()*100.0 ); mTipMsg = XO("%s %2.0f%% complete. Click to change task focal point.")
.Format(
GetFrontTask()->GetTip(),
GetFrontTask()->PercentComplete()*100.0 );
// else // else
// msg.Printf(_("%s %d additional tasks remaining."), GetFrontTask()->GetTip(), GetNumTasks()); // msg = XO("%s %d additional tasks remaining.")
// .Format( GetFrontTask()->GetTip(), GetNumTasks());
tip = mTipMsg; tip = mTipMsg;

View File

@ -24,6 +24,7 @@ tasks associated with a WaveTrack.
#include <vector> #include <vector>
#include "ODTaskThread.h" #include "ODTaskThread.h"
#include "../Internat.h" // for TranslatableString
class Track; class Track;
class WaveTrack; class WaveTrack;
class ODTask; class ODTask;
@ -87,7 +88,7 @@ class ODWaveTrackTaskQueue final
ODTask* GetTask(size_t x); ODTask* GetTask(size_t x);
///fills in the status bar message for a given track ///fills in the status bar message for a given track
void FillTipForWaveTrack( const WaveTrack * t, wxString &tip ); void FillTipForWaveTrack( const WaveTrack * t, TranslatableString &tip );
protected: protected:
@ -95,7 +96,7 @@ class ODWaveTrackTaskQueue final
void Compress(); void Compress();
//because we need to save this around for the tool tip. //because we need to save this around for the tool tip.
wxString mTipMsg; TranslatableString mTipMsg;
///the list of tracks associated with this queue. ///the list of tracks associated with this queue.

View File

@ -96,7 +96,6 @@ static const TranslatableString
sStatePlay = XO("Playing") sStatePlay = XO("Playing")
, sStateStop = XO("Stopped") , sStateStop = XO("Stopped")
, sStateRecord = XO("Recording") , sStateRecord = XO("Recording")
, sStatePause = XO("Paused")
; ;
//Standard constructor //Standard constructor
@ -687,14 +686,12 @@ registeredStatusWidthFunction{
-> ProjectStatus::StatusWidthResult -> ProjectStatus::StatusWidthResult
{ {
if ( field == stateStatusBarField ) { if ( field == stateStatusBarField ) {
const auto pauseString = wxT(" ") + sStatePause.Translation(); TranslatableStrings strings;
std::vector<wxString> strings;
for ( auto pString : for ( auto pString :
{ &sStatePlay, &sStateStop, &sStateRecord } ) { &sStatePlay, &sStateStop, &sStateRecord } )
{ {
strings.push_back( strings.push_back(
pString->Translation() + pauseString + wxT(".") ); XO("%s Paused.").Format(*pString) );
} }
// added constant needed because xMax isn't large enough for some reason, plus some space. // added constant needed because xMax isn't large enough for some reason, plus some space.
@ -704,9 +701,9 @@ registeredStatusWidthFunction{
} }
}; };
wxString ControlToolBar::StateForStatusBar() TranslatableString ControlToolBar::StateForStatusBar()
{ {
wxString state; TranslatableString state;
auto &projectAudioManager = ProjectAudioManager::Get( mProject ); auto &projectAudioManager = ProjectAudioManager::Get( mProject );
auto pProject = &mProject; auto pProject = &mProject;
@ -714,23 +711,16 @@ wxString ControlToolBar::StateForStatusBar()
? Scrubber::Get( *pProject ).GetUntranslatedStateString() ? Scrubber::Get( *pProject ).GetUntranslatedStateString()
: TranslatableString{}; : TranslatableString{};
if (!scrubState.empty()) if (!scrubState.empty())
state = scrubState.Translation(); state = scrubState;
else if (mPlay->IsDown()) else if (mPlay->IsDown())
state = sStatePlay.Translation(); state = sStatePlay;
else if (projectAudioManager.Recording()) else if (projectAudioManager.Recording())
state = sStateRecord.Translation(); state = sStateRecord;
else else
state = sStateStop.Translation(); state = sStateStop;
if (mPause->IsDown()) return ((mPause->IsDown()) ? XO("%s Paused.") : XO("%s."))
{ .Format( state );
state.Append(wxT(" "));
state.Append(sStatePause.Translation());
}
state.Append(wxT("."));
return state;
} }
void ControlToolBar::UpdateStatusBar() void ControlToolBar::UpdateStatusBar()

View File

@ -97,7 +97,7 @@ class ControlToolBar final : public ToolBar {
teBmps eDisabled); teBmps eDisabled);
void ArrangeButtons(); void ArrangeButtons();
wxString StateForStatusBar(); TranslatableString StateForStatusBar();
enum enum
{ {

View File

@ -293,25 +293,21 @@ void MixerToolBar::AdjustInputGain(int adj)
void MixerToolBar::SetToolTips() void MixerToolBar::SetToolTips()
{ {
if (mInputSlider->IsEnabled()) { if (mInputSlider->IsEnabled()) {
mInputSlider->SetToolTipTemplate(_("Recording Volume: %.2f")); mInputSlider->SetToolTipTemplate(XO("Recording Volume: %.2f"));
} }
else { else {
mInputSlider->SetToolTipTemplate(_("Recording Volume (Unavailable; use system mixer.)")); mInputSlider->SetToolTipTemplate(XO("Recording Volume (Unavailable; use system mixer.)"));
} }
if (mOutputSlider->IsEnabled()) { if (mOutputSlider->IsEnabled()) {
wxString format; auto format = (AudioIO::Get()->OutputMixerEmulated()
auto gAudioIO = AudioIO::Get(); ? XO("Playback Volume: %.2f (emulated)")
if (gAudioIO->OutputMixerEmulated()) : XO("Playback Volume: %.2f"));
format = _("Playback Volume: %s (emulated)");
else
format = _("Playback Volume: %s");
mOutputSlider->SetToolTipTemplate( mOutputSlider->SetToolTipTemplate( format );
wxString::Format( format, "%.2f" ) );
} }
else { else {
mOutputSlider->SetToolTipTemplate(_("Playback Volume (Unavailable; use system mixer.)")); mOutputSlider->SetToolTipTemplate(XO("Playback Volume (Unavailable; use system mixer.)"));
} }
} }

View File

@ -87,8 +87,8 @@ HitTestPreview LabelGlyphHandle::HitPreview(bool hitCenter)
static wxCursor arrowCursor{ wxCURSOR_ARROW }; static wxCursor arrowCursor{ wxCURSOR_ARROW };
return { return {
(hitCenter (hitCenter
? _("Drag one or more label boundaries.") ? XO("Drag one or more label boundaries.")
: _("Drag label boundary.")), : XO("Drag label boundary.")),
&arrowCursor &arrowCursor
}; };
} }

View File

@ -45,7 +45,7 @@ HitTestPreview LabelTextHandle::HitPreview()
static auto ibeamCursor = static auto ibeamCursor =
::MakeCursor(wxCURSOR_IBEAM, IBeamCursorXpm, 17, 16); ::MakeCursor(wxCURSOR_IBEAM, IBeamCursorXpm, 17, 16);
return { return {
_("Click to edit label text"), XO("Click to edit label text"),
ibeamCursor.get() ibeamCursor.get()
}; };
} }

View File

@ -78,8 +78,8 @@ HitTestPreview NoteTrackVZoomHandle::HitPreview(const wxMouseState &state)
gPrefs->Read(wxT("/GUI/VerticalZooming"), &bVZoom, false); gPrefs->Read(wxT("/GUI/VerticalZooming"), &bVZoom, false);
bVZoom &= !state.RightIsDown(); bVZoom &= !state.RightIsDown();
const auto message = bVZoom ? const auto message = bVZoom ?
_("Click to vertically zoom in. Shift-click to zoom out. Drag to specify a zoom region.") : XO("Click to vertically zoom in. Shift-click to zoom out. Drag to specify a zoom region.") :
_("Right-click for menu."); XO("Right-click for menu.");
return { return {
message, message,

View File

@ -44,7 +44,7 @@ HitTestPreview StretchHandle::HitPreview( StretchEnum stretchMode, bool unsafe )
::MakeCursor(wxCURSOR_BULLSEYE, StretchCursorXpm, 16, 16); ::MakeCursor(wxCURSOR_BULLSEYE, StretchCursorXpm, 16, 16);
if (unsafe) { if (unsafe) {
return { wxT(""), &*disabledCursor }; return { {}, &*disabledCursor };
} }
else { else {
wxCursor *pCursor = NULL; wxCursor *pCursor = NULL;
@ -59,7 +59,7 @@ HitTestPreview StretchHandle::HitPreview( StretchEnum stretchMode, bool unsafe )
pCursor = &*stretchRightCursor; break; pCursor = &*stretchRightCursor; break;
} }
return { return {
_("Click and drag to stretch selected region."), XO("Click and drag to stretch selected region."),
pCursor pCursor
}; };
} }

View File

@ -45,8 +45,8 @@ HitTestPreview CutlineHandle::HitPreview(bool cutline, bool unsafe)
static wxCursor arrowCursor{ wxCURSOR_ARROW }; static wxCursor arrowCursor{ wxCURSOR_ARROW };
return { return {
(cutline (cutline
? _("Left-Click to expand, Right-Click to remove") ? XO("Left-Click to expand, Right-Click to remove")
: _("Left-Click to merge clips")), : XO("Left-Click to merge clips")),
(unsafe (unsafe
? &*disabledCursor ? &*disabledCursor
: &arrowCursor) : &arrowCursor)

View File

@ -59,7 +59,7 @@ HitTestPreview SampleHandle::HitPreview
// TODO: message should also mention the brush. Describing the modifier key // TODO: message should also mention the brush. Describing the modifier key
// (alt, or other) varies with operating system. // (alt, or other) varies with operating system.
auto message = _("Click and drag to edit the samples"); auto message = XO("Click and drag to edit the samples");
return { return {
message, message,

View File

@ -65,8 +65,8 @@ HitTestPreview WaveTrackVZoomHandle::HitPreview(const wxMouseState &state)
gPrefs->Read(wxT("/GUI/VerticalZooming"), &bVZoom, false); gPrefs->Read(wxT("/GUI/VerticalZooming"), &bVZoom, false);
bVZoom &= !state.RightIsDown(); bVZoom &= !state.RightIsDown();
const auto message = bVZoom ? const auto message = bVZoom ?
_("Click to vertically zoom in. Shift-click to zoom out. Drag to specify a zoom region.") : XO("Click to vertically zoom in. Shift-click to zoom out. Drag to specify a zoom region.") :
_("Right-click for menu."); XO("Right-click for menu.");
return { return {
message, message,

View File

@ -323,7 +323,7 @@ public:
{ {
static wxCursor resizeCursor{ wxCURSOR_SIZENS }; static wxCursor resizeCursor{ wxCURSOR_SIZENS };
return { return {
_("Click and drag to adjust sizes of sub-views."), XO("Click and drag to adjust sizes of sub-views."),
&resizeCursor &resizeCursor
}; };
} }

View File

@ -75,7 +75,7 @@ HitTestPreview ButtonHandle::Preview
{ {
// No special cursor // No special cursor
auto message = Tip(st.state); auto message = Tip(st.state);
return { message.Translation(), {}, message }; return { message, {}, message };
} }
UIHandle::Result ButtonHandle::Release UIHandle::Result ButtonHandle::Release

View File

@ -256,11 +256,9 @@ HitTestPreview EnvelopeHandle::Preview
static auto envelopeCursor = static auto envelopeCursor =
::MakeCursor(wxCURSOR_ARROW, EnvCursorXpm, 16, 16); ::MakeCursor(wxCURSOR_ARROW, EnvCursorXpm, 16, 16);
wxString message; auto message = mTimeTrack
if (mTimeTrack) ? XO("Click and drag to warp playback time")
message = _("Click and drag to warp playback time"); : XO("Click and drag to edit the amplitude envelope");
else
message = _("Click and drag to edit the amplitude envelope");
return { return {
message, message,

View File

@ -997,15 +997,12 @@ registeredStatusWidthFunction{
-> ProjectStatus::StatusWidthResult -> ProjectStatus::StatusWidthResult
{ {
if ( field == stateStatusBarField ) { if ( field == stateStatusBarField ) {
std::vector< wxString > strings; TranslatableStrings strings;
// Note that Scrubbing + Paused is not allowed. // Note that Scrubbing + Paused is not allowed.
for (const auto &item : menuItems) for (const auto &item : menuItems)
strings.push_back( item.GetStatus().Translation() ); strings.push_back( item.GetStatus() );
strings.push_back( strings.push_back(
sPlayAtSpeedStatus.Translation() + XO("%s Paused.").Format( sPlayAtSpeedStatus )
wxT(" ") +
XO("Paused").Translation() +
wxT(".")
); );
// added constant needed because xMax isn't large enough for some reason, plus some space. // added constant needed because xMax isn't large enough for some reason, plus some space.
return { std::move( strings ), 30 }; return { std::move( strings ), 30 };

View File

@ -65,7 +65,7 @@ bool SelectHandle::IsClicked() const
namespace namespace
{ {
// If we're in OnDemand mode, we may change the tip. // If we're in OnDemand mode, we may change the tip.
void MaySetOnDemandTip(const Track * t, wxString &tip) void MaySetOnDemandTip(const Track * t, TranslatableString &tip)
{ {
wxASSERT(t); wxASSERT(t);
//For OD regions, we need to override and display the percent complete for this task. //For OD regions, we need to override and display the percent complete for this task.
@ -312,7 +312,7 @@ namespace
void SetTipAndCursorForBoundary void SetTipAndCursorForBoundary
(SelectionBoundary boundary, bool frequencySnapping, (SelectionBoundary boundary, bool frequencySnapping,
wxString &tip, wxCursor *&pCursor) TranslatableString &tip, wxCursor *&pCursor)
{ {
static wxCursor adjustLeftSelectionCursor{ wxCURSOR_POINT_LEFT }; static wxCursor adjustLeftSelectionCursor{ wxCURSOR_POINT_LEFT };
static wxCursor adjustRightSelectionCursor{ wxCURSOR_POINT_RIGHT }; static wxCursor adjustRightSelectionCursor{ wxCURSOR_POINT_RIGHT };
@ -329,20 +329,20 @@ namespace
pCursor = SelectCursor(); pCursor = SelectCursor();
break; break;
case SBLeft: case SBLeft:
tip = _("Click and drag to move left selection boundary."); tip = XO("Click and drag to move left selection boundary.");
pCursor = &adjustLeftSelectionCursor; pCursor = &adjustLeftSelectionCursor;
break; break;
case SBRight: case SBRight:
tip = _("Click and drag to move right selection boundary."); tip = XO("Click and drag to move right selection boundary.");
pCursor = &adjustRightSelectionCursor; pCursor = &adjustRightSelectionCursor;
break; break;
#ifdef EXPERIMENTAL_SPECTRAL_EDITING #ifdef EXPERIMENTAL_SPECTRAL_EDITING
case SBBottom: case SBBottom:
tip = _("Click and drag to move bottom selection frequency."); tip = XO("Click and drag to move bottom selection frequency.");
pCursor = &*bottomFrequencyCursor; pCursor = &*bottomFrequencyCursor;
break; break;
case SBTop: case SBTop:
tip = _("Click and drag to move top selection frequency."); tip = XO("Click and drag to move top selection frequency.");
pCursor = &*topFrequencyCursor; pCursor = &*topFrequencyCursor;
break; break;
case SBCenter: case SBCenter:
@ -350,8 +350,8 @@ namespace
#ifndef SPECTRAL_EDITING_ESC_KEY #ifndef SPECTRAL_EDITING_ESC_KEY
tip = tip =
frequencySnapping ? frequencySnapping ?
_("Click and drag to move center selection frequency to a spectral peak.") : XO("Click and drag to move center selection frequency to a spectral peak.") :
_("Click and drag to move center selection frequency."); XO("Click and drag to move center selection frequency.");
#else #else
shiftDown; shiftDown;
@ -365,7 +365,7 @@ namespace
} }
break; break;
case SBWidth: case SBWidth:
tip = _("Click and drag to adjust frequency bandwidth."); tip = XO("Click and drag to adjust frequency bandwidth.");
pCursor = &*bandWidthCursor; pCursor = &*bandWidthCursor;
break; break;
#endif #endif
@ -909,7 +909,7 @@ HitTestPreview SelectHandle::Preview
if (!pTrack) if (!pTrack)
return {}; return {};
wxString tip; TranslatableString tip;
wxCursor *pCursor = SelectCursor(); wxCursor *pCursor = SelectCursor();
if ( IsClicked() ) if ( IsClicked() )
// Use same cursor as at the clck // Use same cursor as at the clck
@ -942,9 +942,8 @@ HitTestPreview SelectHandle::Preview
keyStr = _("Edit, Preferences..."); keyStr = _("Edit, Preferences...");
/* i18n-hint: %s is usually replaced by "Ctrl+P" for Windows/Linux, "Command+," for Mac */ /* i18n-hint: %s is usually replaced by "Ctrl+P" for Windows/Linux, "Command+," for Mac */
tip = wxString::Format( tip = XO("Multi-Tool Mode: %s for Mouse and Keyboard Preferences.")
_("Multi-Tool Mode: %s for Mouse and Keyboard Preferences."), .Format( keyStr );
keyStr);
// Later in this function we may point to some other string instead. // Later in this function we may point to some other string instead.
if (!pTrack->GetSelected() || if (!pTrack->GetSelected() ||
!viewInfo.bAdjustSelectionEdges) !viewInfo.bAdjustSelectionEdges)
@ -974,7 +973,7 @@ HitTestPreview SelectHandle::Preview
if ((mFreqSelMode == FREQ_SEL_SNAPPING_CENTER) && if ((mFreqSelMode == FREQ_SEL_SNAPPING_CENTER) &&
isSpectralSelectionView(pView)) { isSpectralSelectionView(pView)) {
// Not shift-down, but center frequency snapping toggle is on // Not shift-down, but center frequency snapping toggle is on
tip = _("Click and drag to set frequency bandwidth."); tip = XO("Click and drag to set frequency bandwidth.");
pCursor = &*envelopeCursor; pCursor = &*envelopeCursor;
return {}; return {};
} }
@ -997,12 +996,13 @@ HitTestPreview SelectHandle::Preview
MaySetOnDemandTip(pTrack.get(), tip); MaySetOnDemandTip(pTrack.get(), tip);
} }
if (tip.empty()) { if (tip.empty()) {
tip = _("Click and drag to select audio"); tip = XO("Click and drag to select audio");
} }
if (HasEscape() && mUseSnap) { if (HasEscape() && mUseSnap) {
tip += wxT(" ") + tip.Join(
/* i18n-hint: "Snapping" means automatic alignment of selection edges to any nearby label or clip boundaries */ /* i18n-hint: "Snapping" means automatic alignment of selection edges to any nearby label or clip boundaries */
_("(snapping)"); XO("(snapping)"), wxT(" ")
);
} }
return { tip, pCursor }; return { tip, pCursor };
} }

View File

@ -54,7 +54,7 @@ HitTestPreview TimeShiftHandle::HitPreview
// TODO: Should it say "track or clip" ? Non-wave tracks can move, or clips in a wave track. // TODO: Should it say "track or clip" ? Non-wave tracks can move, or clips in a wave track.
// TODO: mention effects of shift (move all clips of selected wave track) and ctrl (move vertically only) ? // TODO: mention effects of shift (move all clips of selected wave track) and ctrl (move vertically only) ?
// -- but not all of that is available in multi tool. // -- but not all of that is available in multi tool.
auto message = _("Click and drag to move a track in time"); auto message = XO("Click and drag to move a track in time");
return { return {
message, message,

View File

@ -156,7 +156,7 @@ HitTestPreview TrackSelectHandle::Preview
const bool unsafe = const bool unsafe =
ProjectAudioIO::Get( *GetActiveProject() ).IsAudioActive(); ProjectAudioIO::Get( *GetActiveProject() ).IsAudioActive();
return { return {
message.Translation(), message,
(unsafe (unsafe
? &*disabledCursor ? &*disabledCursor
: &*rearrangeCursor) : &*rearrangeCursor)
@ -168,7 +168,7 @@ HitTestPreview TrackSelectHandle::Preview
// Don't test safety, because the click to change selection is allowed // Don't test safety, because the click to change selection is allowed
static wxCursor arrowCursor{ wxCURSOR_ARROW }; static wxCursor arrowCursor{ wxCURSOR_ARROW };
return { return {
message.Translation(), message,
&arrowCursor, &arrowCursor,
message message
}; };

View File

@ -46,14 +46,14 @@ HitTestPreview ZoomHandle::HitPreview
::MakeCursor(wxCURSOR_MAGNIFIER, ZoomInCursorXpm, 19, 15); ::MakeCursor(wxCURSOR_MAGNIFIER, ZoomInCursorXpm, 19, 15);
static auto zoomOutCursor = static auto zoomOutCursor =
::MakeCursor(wxCURSOR_MAGNIFIER, ZoomOutCursorXpm, 19, 15); ::MakeCursor(wxCURSOR_MAGNIFIER, ZoomOutCursorXpm, 19, 15);
wxString message; TranslatableString message;
// TODO: Why not mention middle click to zoom normal on Windows too? // TODO: Why not mention middle click to zoom normal on Windows too?
#if defined( __WXMAC__ ) #if defined( __WXMAC__ )
message = _("Click to Zoom In, Shift-Click to Zoom Out"); message = XO("Click to Zoom In, Shift-Click to Zoom Out");
#elif defined( __WXMSW__ ) #elif defined( __WXMSW__ )
message = _("Drag to Zoom Into Region, Right-Click to Zoom Out"); message = XO("Drag to Zoom Into Region, Right-Click to Zoom Out");
#elif defined( __WXGTK__ ) #elif defined( __WXGTK__ )
message = _("Left=Zoom In, Right=Zoom Out, Middle=Normal"); message = XO("Left=Zoom In, Right=Zoom Out, Middle=Normal");
#endif #endif
return { return {
message, message,

View File

@ -497,7 +497,7 @@ void AButton::OnMouseEvent(wxMouseEvent & event)
if (mCursorIsInWindow) if (mCursorIsInWindow)
UpdateStatus(); UpdateStatus();
else { else {
ProjectStatus::Get( *GetActiveProject() ).Set(wxT("")); ProjectStatus::Get( *GetActiveProject() ).Set({});
} }
} }
else else
@ -511,9 +511,9 @@ void AButton::UpdateStatus()
// Display the tooltip in the status bar // Display the tooltip in the status bar
wxToolTip * pTip = this->GetToolTip(); wxToolTip * pTip = this->GetToolTip();
if( pTip ) { if( pTip ) {
wxString tipText = pTip->GetTip(); auto tipText = Verbatim( pTip->GetTip() );
if (!mEnabled) if (!mEnabled)
tipText += _(" (disabled)"); tipText.Join( XO("(disabled)"), " " );
ProjectStatus::Get( *GetActiveProject() ).Set(tipText); ProjectStatus::Get( *GetActiveProject() ).Set(tipText);
} }
#endif #endif

View File

@ -156,12 +156,12 @@ class wxArrayString;
class TipWindow final : public wxFrame class TipWindow final : public wxFrame
{ {
public: public:
TipWindow(wxWindow *parent, const wxArrayString & labels); TipWindow(wxWindow *parent, const TranslatableStrings & labels);
virtual ~TipWindow() {} virtual ~TipWindow() {}
wxSize GetSize() const; wxSize GetSize() const;
void SetPos(const wxPoint & pos); void SetPos(const wxPoint & pos);
void SetLabel(const wxString & label); void SetLabel(const TranslatableString & label);
private: private:
void OnPaint(wxPaintEvent & event); void OnPaint(wxPaintEvent & event);
@ -170,7 +170,7 @@ private:
#endif #endif
private: private:
wxString mLabel; TranslatableString mLabel;
int mWidth; int mWidth;
int mHeight; int mHeight;
@ -184,7 +184,7 @@ BEGIN_EVENT_TABLE(TipWindow, wxFrame)
#endif #endif
END_EVENT_TABLE() END_EVENT_TABLE()
TipWindow::TipWindow(wxWindow *parent, const wxArrayString & labels) TipWindow::TipWindow(wxWindow *parent, const TranslatableStrings & labels)
: wxFrame(parent, wxID_ANY, wxString{}, wxDefaultPosition, wxDefaultSize, : wxFrame(parent, wxID_ANY, wxString{}, wxDefaultPosition, wxDefaultSize,
wxFRAME_SHAPED | wxFRAME_FLOAT_ON_PARENT) wxFRAME_SHAPED | wxFRAME_FLOAT_ON_PARENT)
{ {
@ -194,7 +194,7 @@ TipWindow::TipWindow(wxWindow *parent, const wxArrayString & labels)
mWidth = mHeight = 0; mWidth = mHeight = 0;
for ( const auto &label : labels ) { for ( const auto &label : labels ) {
int width, height; int width, height;
GetTextExtent(label, &width, &height, NULL, NULL, &labelFont); GetTextExtent(label.Translation(), &width, &height, NULL, NULL, &labelFont);
mWidth = std::max( mWidth, width ); mWidth = std::max( mWidth, width );
mHeight = std::max( mHeight, height ); mHeight = std::max( mHeight, height );
} }
@ -223,7 +223,7 @@ void TipWindow::SetPos(const wxPoint & pos)
#endif #endif
} }
void TipWindow::SetLabel(const wxString & label) void TipWindow::SetLabel(const TranslatableString & label)
{ {
mLabel = label; mLabel = label;
} }
@ -240,8 +240,9 @@ void TipWindow::OnPaint(wxPaintEvent & WXUNUSED(event))
dc.SetTextForeground(AColor::tooltipPen.GetColour()); dc.SetTextForeground(AColor::tooltipPen.GetColour());
int textWidth, textHeight; int textWidth, textHeight;
dc.GetTextExtent(mLabel, &textWidth, &textHeight); const auto visibleLabel = mLabel.Translation();
dc.DrawText(mLabel, (mWidth - textWidth) / 2, (mHeight - textHeight) / 2); dc.GetTextExtent(visibleLabel, &textWidth, &textHeight);
dc.DrawText(visibleLabel, (mWidth - textWidth) / 2, (mHeight - textHeight) / 2);
} }
#if defined(__WXGTK__) #if defined(__WXGTK__)
@ -858,7 +859,7 @@ void LWSlider::DrawToBitmap(wxDC & paintDC)
mBitmap->SetMask(safenew wxMask(*mBitmap, backgroundColour)); mBitmap->SetMask(safenew wxMask(*mBitmap, backgroundColour));
} }
void LWSlider::SetToolTipTemplate(const wxString & tip) void LWSlider::SetToolTipTemplate(const TranslatableString & tip)
{ {
mTipTemplate = tip; mTipTemplate = tip;
} }
@ -930,72 +931,74 @@ void LWSlider::FormatPopWin()
mTipPanel->Refresh(); mTipPanel->Refresh();
} }
wxString LWSlider::GetTip(float value) const TranslatableString LWSlider::GetTip(float value) const
{ {
wxString label; TranslatableString label;
if (mTipTemplate.empty()) if (mTipTemplate.empty())
{ {
wxString val; TranslatableString val;
switch(mStyle) switch(mStyle)
{ {
case FRAC_SLIDER: case FRAC_SLIDER:
val.Printf( wxT("%.2f"), value ); Verbatim("%.2f").Format( value );
break; break;
case DB_SLIDER: case DB_SLIDER:
val.Printf( wxT("%+.1f dB"), value ); /* i18n-hint dB abbreviates decibels */
XO("%+.1f dB").Format( value );
break; break;
case PAN_SLIDER: case PAN_SLIDER:
if (value == 0.0) if (value == 0.0)
{ {
val = _("Center"); val = XO("Center");
} }
else else
{ {
const auto v = 100.0f * fabsf(value); const auto v = 100.0f * fabsf(value);
if (value < 0.0) if (value < 0.0)
/* i18n-hint: Stereo pan setting */ /* i18n-hint: Stereo pan setting */
val = wxString::Format( _("%.0f%% Left"), v ); val = XO("%.0f%% Left").Format( v );
else else
/* i18n-hint: Stereo pan setting */ /* i18n-hint: Stereo pan setting */
val = wxString::Format( _("%.0f%% Right"), v ); val = XO("%.0f%% Right").Format( v );
} }
break; break;
case SPEED_SLIDER: case SPEED_SLIDER:
/* i18n-hint: "x" suggests a multiplicative factor */ /* i18n-hint: "x" suggests a multiplicative factor */
val.Printf( wxT("%.2fx"), value ); XO("%.2fx").Format( value );
break; break;
#ifdef EXPERIMENTAL_MIDI_OUT #ifdef EXPERIMENTAL_MIDI_OUT
case VEL_SLIDER: case VEL_SLIDER:
if (value > 0.0f) if (value > 0.0f)
// Signed // Signed
val.Printf( wxT("%+d"), (int) value ); Verbatim("%+d").Format( (int) value );
else else
// Zero, or signed negative // Zero, or signed negative
val.Printf( wxT("%d"), (int) value ); Verbatim("%d").Format( (int) value );
break; break;
#endif #endif
} }
/* i18n-hint: An item name followed by a value, with appropriate separating punctuation */ /* i18n-hint: An item name followed by a value, with appropriate separating punctuation */
label = XO("%s: %s").Format( mName, val ).Translation(); label = XO("%s: %s").Format( mName, val );
} }
else else
{ {
label.Printf(mTipTemplate, value); label = mTipTemplate;
label.Format( value );
} }
return label; return label;
} }
wxArrayString LWSlider::GetWidestTips() const TranslatableStrings LWSlider::GetWidestTips() const
{ {
wxArrayString results; TranslatableStrings results;
if (mTipTemplate.empty()) if (mTipTemplate.empty())
{ {
@ -1090,7 +1093,7 @@ void LWSlider::OnMouseEvent(wxMouseEvent & event)
if (event.Entering()) if (event.Entering())
{ {
// Display the tooltip in the status bar // Display the tooltip in the status bar
wxString tip = GetTip(mCurrentValue); auto tip = GetTip(mCurrentValue);
ProjectStatus::Get( *GetActiveProject() ).Set(tip); ProjectStatus::Get( *GetActiveProject() ).Set(tip);
Refresh(); Refresh();
} }
@ -1100,7 +1103,7 @@ void LWSlider::OnMouseEvent(wxMouseEvent & event)
{ {
ShowTip(false); ShowTip(false);
} }
ProjectStatus::Get( *GetActiveProject() ).Set(wxT("")); ProjectStatus::Get( *GetActiveProject() ).Set({});
Refresh(); Refresh();
} }
@ -1663,7 +1666,7 @@ void ASlider::SetScroll(float line, float page)
mLWSlider->SetScroll(line, page); mLWSlider->SetScroll(line, page);
} }
void ASlider::SetToolTipTemplate(const wxString & tip) void ASlider::SetToolTipTemplate(const TranslatableString & tip)
{ {
mLWSlider->SetToolTipTemplate(tip); mLWSlider->SetToolTipTemplate(tip);
} }

View File

@ -116,7 +116,7 @@ class LWSlider
void SetScroll(float line, float page); void SetScroll(float line, float page);
void ShowTip(bool show); void ShowTip(bool show);
void SetToolTipTemplate(const wxString & tip); void SetToolTipTemplate(const TranslatableString & tip);
float Get(bool convert = true); float Get(bool convert = true);
void Set(float value); void Set(float value);
@ -151,8 +151,8 @@ class LWSlider
private: private:
wxString GetTip(float value) const; TranslatableString GetTip(float value) const;
wxArrayString GetWidestTips() const; TranslatableStrings GetWidestTips() const;
void FormatPopWin(); void FormatPopWin();
void SetPopWinPosition(); void SetPopWinPosition();
void CreatePopWin(); void CreatePopWin();
@ -218,7 +218,7 @@ class LWSlider
wxWindowID mID; wxWindowID mID;
std::unique_ptr<TipWindow> mTipPanel; std::unique_ptr<TipWindow> mTipPanel;
wxString mTipTemplate; TranslatableString mTipTemplate;
bool mIsDragging; bool mIsDragging;
@ -273,7 +273,7 @@ class ASlider /* not final */ : public wxPanel
void GetScroll(float & line, float & page); void GetScroll(float & line, float & page);
void SetScroll(float line, float page); void SetScroll(float line, float page);
void SetToolTipTemplate(const wxString & tip); void SetToolTipTemplate(const TranslatableString & tip);
float Get( bool convert = true ); float Get( bool convert = true );
void Set(float value); void Set(float value);

View File

@ -758,13 +758,13 @@ void MeterPanel::OnMouse(wxMouseEvent &evt)
#if wxUSE_TOOLTIPS // Not available in wxX11 #if wxUSE_TOOLTIPS // Not available in wxX11
if (evt.Leaving()){ if (evt.Leaving()){
ProjectStatus::Get( *GetActiveProject() ).Set(wxT("")); ProjectStatus::Get( *GetActiveProject() ).Set({});
} }
else if (evt.Entering()) { else if (evt.Entering()) {
// Display the tooltip in the status bar // Display the tooltip in the status bar
wxToolTip * pTip = this->GetToolTip(); wxToolTip * pTip = this->GetToolTip();
if( pTip ) { if( pTip ) {
wxString tipText = pTip->GetTip(); auto tipText = Verbatim( pTip->GetTip() );
ProjectStatus::Get( *GetActiveProject() ).Set(tipText); ProjectStatus::Get( *GetActiveProject() ).Set(tipText);
} }
} }