mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-24 08:28:04 +02:00
TranslatableString in popup menu tables
This commit is contained in:
parent
618fee21ec
commit
6b812791a6
@ -140,30 +140,22 @@ SpectrogramSettings& SpectrogramSettings::defaults()
|
||||
}
|
||||
|
||||
//static
|
||||
const wxArrayStringEx &SpectrogramSettings::GetScaleNames()
|
||||
const TranslatableStrings &SpectrogramSettings::GetScaleNames()
|
||||
{
|
||||
class ScaleNamesArray final : public TranslatableStringArray
|
||||
{
|
||||
void Populate() override
|
||||
{
|
||||
mContents.insert( mContents.end(), {
|
||||
// Keep in correspondence with enum SpectrogramSettings::ScaleType:
|
||||
_("Linear") ,
|
||||
_("Logarithmic") ,
|
||||
/* i18n-hint: The name of a frequency scale in psychoacoustics */
|
||||
_("Mel") ,
|
||||
/* i18n-hint: The name of a frequency scale in psychoacoustics, named for Heinrich Barkhausen */
|
||||
_("Bark") ,
|
||||
/* i18n-hint: The name of a frequency scale in psychoacoustics, abbreviates Equivalent Rectangular Bandwidth */
|
||||
_("ERB") ,
|
||||
/* i18n-hint: Time units, that is Period = 1 / Frequency */
|
||||
_("Period") ,
|
||||
} );
|
||||
}
|
||||
static const TranslatableStrings result{
|
||||
// Keep in correspondence with enum SpectrogramSettings::ScaleType:
|
||||
XO("Linear") ,
|
||||
XO("Logarithmic") ,
|
||||
/* i18n-hint: The name of a frequency scale in psychoacoustics */
|
||||
XO("Mel") ,
|
||||
/* i18n-hint: The name of a frequency scale in psychoacoustics, named for Heinrich Barkhausen */
|
||||
XO("Bark") ,
|
||||
/* i18n-hint: The name of a frequency scale in psychoacoustics, abbreviates Equivalent Rectangular Bandwidth */
|
||||
XO("ERB") ,
|
||||
/* i18n-hint: Time units, that is Period = 1 / Frequency */
|
||||
XO("Period") ,
|
||||
};
|
||||
|
||||
static ScaleNamesArray theArray;
|
||||
return theArray.Get();
|
||||
return result;
|
||||
}
|
||||
|
||||
//static
|
||||
|
@ -66,7 +66,7 @@ public:
|
||||
stNumScaleTypes,
|
||||
};
|
||||
|
||||
static const wxArrayStringEx &GetScaleNames();
|
||||
static const TranslatableStrings &GetScaleNames();
|
||||
static const wxArrayStringEx &GetAlgorithmNames();
|
||||
|
||||
static SpectrogramSettings &defaults();
|
||||
|
@ -190,7 +190,9 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
S.SetStretchyCol( 1 );
|
||||
S.Id(ID_SCALE).TieChoice(_("S&cale:"),
|
||||
mTempSettings.scaleType,
|
||||
SpectrogramSettings::GetScaleNames());
|
||||
transform_container<wxArrayStringEx>(
|
||||
SpectrogramSettings::GetScaleNames(),
|
||||
std::mem_fn( &TranslatableString::Translation ) ) );
|
||||
mMinFreq =
|
||||
S.Id(ID_MINIMUM).TieNumericTextBox(_("Mi&n Frequency (Hz):"),
|
||||
mTempSettings.minFreq,
|
||||
|
@ -71,7 +71,7 @@ enum
|
||||
|
||||
BEGIN_POPUP_MENU(LabelTrackMenuTable)
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_ITEM(OnSetFontID, _("&Font..."), OnSetFont)
|
||||
POPUP_MENU_ITEM(OnSetFontID, XO("&Font..."), OnSetFont)
|
||||
END_POPUP_MENU()
|
||||
|
||||
void LabelTrackMenuTable::OnSetFont(wxCommandEvent &)
|
||||
|
@ -128,8 +128,8 @@ void NoteTrackMenuTable::OnChangeOctave(wxCommandEvent &event)
|
||||
|
||||
BEGIN_POPUP_MENU(NoteTrackMenuTable)
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_ITEM(OnUpOctaveID, _("Up &Octave"), OnChangeOctave)
|
||||
POPUP_MENU_ITEM(OnDownOctaveID, _("Down Octa&ve"), OnChangeOctave)
|
||||
POPUP_MENU_ITEM(OnUpOctaveID, XO("Up &Octave"), OnChangeOctave)
|
||||
POPUP_MENU_ITEM(OnDownOctaveID, XO("Down Octa&ve"), OnChangeOctave)
|
||||
END_POPUP_MENU()
|
||||
|
||||
PopupMenuTable *NoteTrackControls::GetMenuExtension(Track *)
|
||||
|
@ -252,16 +252,16 @@ void NoteTrackVRulerMenuTable::OnZoom( int iZoomCode ){
|
||||
|
||||
BEGIN_POPUP_MENU(NoteTrackVRulerMenuTable)
|
||||
|
||||
POPUP_MENU_ITEM(OnZoomResetID, _("Zoom Reset\tShift-Right-Click"), OnZoomReset)
|
||||
POPUP_MENU_ITEM(OnZoomMaxID, _("Max Zoom"), OnZoomMax)
|
||||
POPUP_MENU_ITEM(OnZoomResetID, XO("Zoom Reset\tShift-Right-Click"), OnZoomReset)
|
||||
POPUP_MENU_ITEM(OnZoomMaxID, XO("Max Zoom"), OnZoomMax)
|
||||
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_ITEM(OnZoomInVerticalID, _("Zoom In\tLeft-Click/Left-Drag"), OnZoomInVertical)
|
||||
POPUP_MENU_ITEM(OnZoomOutVerticalID, _("Zoom Out\tShift-Left-Click"), OnZoomOutVertical)
|
||||
POPUP_MENU_ITEM(OnZoomInVerticalID, XO("Zoom In\tLeft-Click/Left-Drag"), OnZoomInVertical)
|
||||
POPUP_MENU_ITEM(OnZoomOutVerticalID, XO("Zoom Out\tShift-Left-Click"), OnZoomOutVertical)
|
||||
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_ITEM(OnUpOctaveID, _("Up &Octave"), OnUpOctave)
|
||||
POPUP_MENU_ITEM(OnDownOctaveID, _("Down Octa&ve"), OnDownOctave)
|
||||
POPUP_MENU_ITEM(OnUpOctaveID, XO("Up &Octave"), OnUpOctave)
|
||||
POPUP_MENU_ITEM(OnDownOctaveID, XO("Down Octa&ve"), OnDownOctave)
|
||||
|
||||
END_POPUP_MENU()
|
||||
|
||||
|
@ -285,10 +285,10 @@ BEGIN_POPUP_MENU(SpectrumVRulerMenuTable)
|
||||
}
|
||||
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_ITEM(OnZoomResetID, _("Zoom Reset"), OnZoomReset)
|
||||
POPUP_MENU_ITEM(OnZoomFitVerticalID, _("Zoom to Fit\tShift-Right-Click"), OnZoomFitVertical)
|
||||
POPUP_MENU_ITEM(OnZoomInVerticalID, _("Zoom In\tLeft-Click/Left-Drag"), OnZoomInVertical)
|
||||
POPUP_MENU_ITEM(OnZoomOutVerticalID, _("Zoom Out\tShift-Left-Click"), OnZoomOutVertical)
|
||||
POPUP_MENU_ITEM(OnZoomResetID, XO("Zoom Reset"), OnZoomReset)
|
||||
POPUP_MENU_ITEM(OnZoomFitVerticalID, XO("Zoom to Fit\tShift-Right-Click"), OnZoomFitVertical)
|
||||
POPUP_MENU_ITEM(OnZoomInVerticalID, XO("Zoom In\tLeft-Click/Left-Drag"), OnZoomInVertical)
|
||||
POPUP_MENU_ITEM(OnZoomOutVerticalID, XO("Zoom Out\tShift-Left-Click"), OnZoomOutVertical)
|
||||
END_POPUP_MENU()
|
||||
|
||||
#include "../../../../Project.h" // for GetActiveProject
|
||||
|
@ -196,13 +196,13 @@ const TranslatableString GetWaveColorStr(int colorIndex)
|
||||
|
||||
BEGIN_POPUP_MENU(WaveColorMenuTable)
|
||||
POPUP_MENU_RADIO_ITEM(OnInstrument1ID,
|
||||
GetWaveColorStr(0).Translation(), OnWaveColorChange)
|
||||
GetWaveColorStr(0), OnWaveColorChange)
|
||||
POPUP_MENU_RADIO_ITEM(OnInstrument2ID,
|
||||
GetWaveColorStr(1).Translation(), OnWaveColorChange)
|
||||
GetWaveColorStr(1), OnWaveColorChange)
|
||||
POPUP_MENU_RADIO_ITEM(OnInstrument3ID,
|
||||
GetWaveColorStr(2).Translation(), OnWaveColorChange)
|
||||
GetWaveColorStr(2), OnWaveColorChange)
|
||||
POPUP_MENU_RADIO_ITEM(OnInstrument4ID,
|
||||
GetWaveColorStr(3).Translation(), OnWaveColorChange)
|
||||
GetWaveColorStr(3), OnWaveColorChange)
|
||||
END_POPUP_MENU()
|
||||
|
||||
/// Converts a WaveColor enumeration to a wxWidgets menu item Id.
|
||||
@ -283,11 +283,11 @@ void FormatMenuTable::InitMenu(Menu *pMenu, void *pUserData)
|
||||
|
||||
BEGIN_POPUP_MENU(FormatMenuTable)
|
||||
POPUP_MENU_RADIO_ITEM(On16BitID,
|
||||
GetSampleFormatStr(int16Sample).Translation(), OnFormatChange)
|
||||
GetSampleFormatStr(int16Sample), OnFormatChange)
|
||||
POPUP_MENU_RADIO_ITEM(On24BitID,
|
||||
GetSampleFormatStr(int24Sample).Translation(), OnFormatChange)
|
||||
GetSampleFormatStr(int24Sample), OnFormatChange)
|
||||
POPUP_MENU_RADIO_ITEM(OnFloatID,
|
||||
GetSampleFormatStr(floatSample).Translation(), OnFormatChange)
|
||||
GetSampleFormatStr(floatSample), OnFormatChange)
|
||||
END_POPUP_MENU()
|
||||
|
||||
/// Converts a format enumeration to a wxWidgets menu item Id.
|
||||
@ -403,19 +403,19 @@ void RateMenuTable::InitMenu(Menu *pMenu, void *pUserData)
|
||||
// If we did, we'd get no message when clicking on Other...
|
||||
// when it is already selected.
|
||||
BEGIN_POPUP_MENU(RateMenuTable)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate8ID, _("8000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate11ID, _("11025 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate16ID, _("16000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate22ID, _("22050 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate44ID, _("44100 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate48ID, _("48000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate88ID, _("88200 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate96ID, _("96000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate176ID, _("176400 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate192ID, _("192000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate352ID, _("352800 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate384ID, _("384000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRateOtherID, _("&Other..."), OnRateOther)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate8ID, XO("8000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate11ID, XO("11025 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate16ID, XO("16000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate22ID, XO("22050 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate44ID, XO("44100 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate48ID, XO("48000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate88ID, XO("88200 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate96ID, XO("96000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate176ID, XO("176400 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate192ID, XO("192000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate352ID, XO("352800 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRate384ID, XO("384000 Hz"), OnRateChange)
|
||||
POPUP_MENU_CHECK_ITEM(OnRateOtherID, XO("&Other..."), OnRateOther)
|
||||
END_POPUP_MENU()
|
||||
|
||||
const int nRates = 12;
|
||||
@ -692,23 +692,23 @@ BEGIN_POPUP_MENU(WaveTrackMenuTable)
|
||||
// exclusive, but the view may be in a state with either of those, and also
|
||||
// spectrogram, after a mouse drag. Clicking any of these three makes that
|
||||
// view take up all the height.
|
||||
POPUP_MENU_CHECK_ITEM(OnWaveformID, _("Wa&veform"), OnSetDisplay)
|
||||
POPUP_MENU_CHECK_ITEM(OnWaveformDBID, _("&Waveform (dB)"), OnSetDisplay)
|
||||
POPUP_MENU_CHECK_ITEM(OnSpectrumID, _("&Spectrogram"), OnSetDisplay)
|
||||
POPUP_MENU_CHECK_ITEM(OnWaveformID, XO("Wa&veform"), OnSetDisplay)
|
||||
POPUP_MENU_CHECK_ITEM(OnWaveformDBID, XO("&Waveform (dB)"), OnSetDisplay)
|
||||
POPUP_MENU_CHECK_ITEM(OnSpectrumID, XO("&Spectrogram"), OnSetDisplay)
|
||||
|
||||
POPUP_MENU_ITEM(OnSpectrogramSettingsID, _("S&pectrogram Settings..."), OnSpectrogramSettings)
|
||||
POPUP_MENU_ITEM(OnSpectrogramSettingsID, XO("S&pectrogram Settings..."), OnSpectrogramSettings)
|
||||
POPUP_MENU_SEPARATOR()
|
||||
|
||||
// POPUP_MENU_RADIO_ITEM(OnChannelMonoID, _("&Mono"), OnChannelChange)
|
||||
// POPUP_MENU_RADIO_ITEM(OnChannelLeftID, _("&Left Channel"), OnChannelChange)
|
||||
// POPUP_MENU_RADIO_ITEM(OnChannelRightID, _("R&ight Channel"), OnChannelChange)
|
||||
POPUP_MENU_ITEM(OnMergeStereoID, _("Ma&ke Stereo Track"), OnMergeStereo)
|
||||
// POPUP_MENU_RADIO_ITEM(OnChannelMonoID, XO("&Mono"), OnChannelChange)
|
||||
// POPUP_MENU_RADIO_ITEM(OnChannelLeftID, XO("&Left Channel"), OnChannelChange)
|
||||
// POPUP_MENU_RADIO_ITEM(OnChannelRightID, XO("R&ight Channel"), OnChannelChange)
|
||||
POPUP_MENU_ITEM(OnMergeStereoID, XO("Ma&ke Stereo Track"), OnMergeStereo)
|
||||
|
||||
POPUP_MENU_ITEM(OnSwapChannelsID, _("Swap Stereo &Channels"), OnSwapChannels)
|
||||
POPUP_MENU_ITEM(OnSplitStereoID, _("Spl&it Stereo Track"), OnSplitStereo)
|
||||
POPUP_MENU_ITEM(OnSwapChannelsID, XO("Swap Stereo &Channels"), OnSwapChannels)
|
||||
POPUP_MENU_ITEM(OnSplitStereoID, XO("Spl&it Stereo Track"), OnSplitStereo)
|
||||
// DA: Uses split stereo track and then drag pan sliders for split-stereo-to-mono
|
||||
#ifndef EXPERIMENTAL_DA
|
||||
POPUP_MENU_ITEM(OnSplitStereoMonoID, _("Split Stereo to Mo&no"), OnSplitStereoMono)
|
||||
POPUP_MENU_ITEM(OnSplitStereoMonoID, XO("Split Stereo to Mo&no"), OnSplitStereoMono)
|
||||
#endif
|
||||
|
||||
WaveTrack *const pTrack = static_cast<WaveTrack*>(mpTrack);
|
||||
@ -719,14 +719,14 @@ BEGIN_POPUP_MENU(WaveTrackMenuTable)
|
||||
.contains( WaveTrackViewConstants::Waveform );
|
||||
if( hasWaveform ){
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_SUB_MENU(OnWaveColorID, _("&Wave Color"), WaveColorMenuTable)
|
||||
POPUP_MENU_SUB_MENU(OnWaveColorID, XO("&Wave Color"), WaveColorMenuTable)
|
||||
}
|
||||
}
|
||||
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_SUB_MENU(0, _("&Format"), FormatMenuTable)
|
||||
POPUP_MENU_SUB_MENU(0, XO("&Format"), FormatMenuTable)
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_SUB_MENU(0, _("Rat&e"), RateMenuTable)
|
||||
POPUP_MENU_SUB_MENU(0, XO("Rat&e"), RateMenuTable)
|
||||
END_POPUP_MENU()
|
||||
|
||||
|
||||
|
@ -280,17 +280,17 @@ void WaveformVRulerMenuTable::InitMenu(Menu *pMenu, void *pUserData)
|
||||
|
||||
BEGIN_POPUP_MENU(WaveformVRulerMenuTable)
|
||||
|
||||
POPUP_MENU_ITEM(OnZoomFitVerticalID, _("Zoom Reset\tShift-Right-Click"), OnZoomReset)
|
||||
POPUP_MENU_ITEM(OnZoomDiv2ID, _("Zoom x1/2"), OnZoomDiv2Vertical)
|
||||
POPUP_MENU_ITEM(OnZoomTimes2ID, _("Zoom x2"), OnZoomTimes2Vertical)
|
||||
POPUP_MENU_ITEM(OnZoomFitVerticalID, XO("Zoom Reset\tShift-Right-Click"), OnZoomReset)
|
||||
POPUP_MENU_ITEM(OnZoomDiv2ID, XO("Zoom x1/2"), OnZoomDiv2Vertical)
|
||||
POPUP_MENU_ITEM(OnZoomTimes2ID, XO("Zoom x2"), OnZoomTimes2Vertical)
|
||||
|
||||
#ifdef EXPERIMENTAL_HALF_WAVE
|
||||
POPUP_MENU_ITEM(OnZoomHalfWaveID, _("Half Wave"), OnZoomHalfWave)
|
||||
POPUP_MENU_ITEM(OnZoomHalfWaveID, XO("Half Wave"), OnZoomHalfWave)
|
||||
#endif
|
||||
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_ITEM(OnZoomInVerticalID, _("Zoom In\tLeft-Click/Left-Drag"), OnZoomInVertical)
|
||||
POPUP_MENU_ITEM(OnZoomOutVerticalID, _("Zoom Out\tShift-Left-Click"), OnZoomOutVertical)
|
||||
POPUP_MENU_ITEM(OnZoomInVerticalID, XO("Zoom In\tLeft-Click/Left-Drag"), OnZoomInVertical)
|
||||
POPUP_MENU_ITEM(OnZoomOutVerticalID, XO("Zoom Out\tShift-Left-Click"), OnZoomOutVertical)
|
||||
// The log and linear options are already available as waveform db.
|
||||
// So don't repeat them here.
|
||||
#if 0
|
||||
|
@ -157,11 +157,11 @@ void TimeTrackMenuTable::OnTimeTrackLogInt(wxCommandEvent & /*event*/)
|
||||
|
||||
BEGIN_POPUP_MENU(TimeTrackMenuTable)
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_RADIO_ITEM(OnTimeTrackLinID, _("&Linear scale"), OnTimeTrackLin)
|
||||
POPUP_MENU_RADIO_ITEM(OnTimeTrackLogID, _("L&ogarithmic scale"), OnTimeTrackLog)
|
||||
POPUP_MENU_RADIO_ITEM(OnTimeTrackLinID, XO("&Linear scale"), OnTimeTrackLin)
|
||||
POPUP_MENU_RADIO_ITEM(OnTimeTrackLogID, XO("L&ogarithmic scale"), OnTimeTrackLog)
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_ITEM(OnSetTimeTrackRangeID, _("&Range..."), OnSetTimeTrackRange)
|
||||
POPUP_MENU_CHECK_ITEM(OnTimeTrackLogIntID, _("Logarithmic &Interpolation"), OnTimeTrackLogInt)
|
||||
POPUP_MENU_ITEM(OnSetTimeTrackRangeID, XO("&Range..."), OnSetTimeTrackRange)
|
||||
POPUP_MENU_CHECK_ITEM(OnTimeTrackLogIntID, XO("Logarithmic &Interpolation"), OnTimeTrackLogInt)
|
||||
END_POPUP_MENU()
|
||||
|
||||
PopupMenuTable *TimeTrackControls::GetMenuExtension(Track *)
|
||||
|
@ -120,38 +120,50 @@ void TrackMenuTable::InitMenu(Menu *pMenu, void *pUserData)
|
||||
}
|
||||
|
||||
BEGIN_POPUP_MENU(TrackMenuTable)
|
||||
POPUP_MENU_ITEM(OnSetNameID, _("&Name..."), OnSetName)
|
||||
POPUP_MENU_ITEM(OnSetNameID, XO("&Name..."), OnSetName)
|
||||
POPUP_MENU_SEPARATOR()
|
||||
POPUP_MENU_ITEM(
|
||||
// It is not correct to use NormalizedKeyString::Display here --
|
||||
// wxWidgets will apply its equivalent to the key names passed to menu
|
||||
// functions.
|
||||
OnMoveUpID,
|
||||
_("Move Track &Up") + wxT("\t") +
|
||||
(CommandManager::Get( *GetActiveProject() ).
|
||||
// using GET to compose menu item name for wxWidgets
|
||||
GetKeyFromName(wxT("TrackMoveUp")).GET()),
|
||||
XO("Move Track &Up").Join(
|
||||
TranslatableString{
|
||||
CommandManager::Get( *GetActiveProject() ).
|
||||
// using GET to compose menu item name for wxWidgets
|
||||
GetKeyFromName(wxT("TrackMoveUp")).GET() },
|
||||
wxT("\t")
|
||||
),
|
||||
OnMoveTrack)
|
||||
POPUP_MENU_ITEM(
|
||||
OnMoveDownID,
|
||||
_("Move Track &Down") + wxT("\t") +
|
||||
(CommandManager::Get( *GetActiveProject() ).
|
||||
// using GET to compose menu item name for wxWidgets
|
||||
GetKeyFromName(wxT("TrackMoveDown")).GET()),
|
||||
XO("Move Track &Down").Join(
|
||||
TranslatableString{
|
||||
CommandManager::Get( *GetActiveProject() ).
|
||||
// using GET to compose menu item name for wxWidgets
|
||||
GetKeyFromName(wxT("TrackMoveDown")).GET() },
|
||||
wxT("\t")
|
||||
),
|
||||
OnMoveTrack)
|
||||
POPUP_MENU_ITEM(
|
||||
OnMoveTopID,
|
||||
_("Move Track to &Top") + wxT("\t") +
|
||||
(CommandManager::Get( *GetActiveProject() ).
|
||||
// using GET to compose menu item name for wxWidgets
|
||||
GetKeyFromName(wxT("TrackMoveTop")).GET()),
|
||||
XO("Move Track to &Top").Join(
|
||||
TranslatableString{
|
||||
CommandManager::Get( *GetActiveProject() ).
|
||||
// using GET to compose menu item name for wxWidgets
|
||||
GetKeyFromName(wxT("TrackMoveTop")).GET() },
|
||||
wxT("\t")
|
||||
),
|
||||
OnMoveTrack)
|
||||
POPUP_MENU_ITEM(
|
||||
OnMoveBottomID,
|
||||
_("Move Track to &Bottom") + wxT("\t") +
|
||||
(CommandManager::Get( *GetActiveProject() ).
|
||||
// using GET to compose menu item name for wxWidgets
|
||||
GetKeyFromName(wxT("TrackMoveBottom")).GET()),
|
||||
XO("Move Track to &Bottom").Join(
|
||||
TranslatableString{
|
||||
CommandManager::Get( *GetActiveProject() ).
|
||||
// using GET to compose menu item name for wxWidgets
|
||||
GetKeyFromName(wxT("TrackMoveBottom")).GET() },
|
||||
wxT("\t")
|
||||
),
|
||||
OnMoveTrack)
|
||||
END_POPUP_MENU()
|
||||
|
||||
|
@ -31,19 +31,19 @@ void PopupMenuTable::Menu::Extend(PopupMenuTable *pTable)
|
||||
switch (pEntry->type) {
|
||||
case PopupMenuTable::Entry::Item:
|
||||
{
|
||||
this->Append(pEntry->id, pEntry->caption);
|
||||
this->Append(pEntry->id, pEntry->caption.Translation());
|
||||
connect( pEntry );
|
||||
break;
|
||||
}
|
||||
case PopupMenuTable::Entry::RadioItem:
|
||||
{
|
||||
this->AppendRadioItem(pEntry->id, pEntry->caption);
|
||||
this->AppendRadioItem(pEntry->id, pEntry->caption.Translation());
|
||||
connect( pEntry );
|
||||
break;
|
||||
}
|
||||
case PopupMenuTable::Entry::CheckItem:
|
||||
{
|
||||
this->AppendCheckItem(pEntry->id, pEntry->caption);
|
||||
this->AppendCheckItem(pEntry->id, pEntry->caption.Translation());
|
||||
connect( pEntry );
|
||||
break;
|
||||
}
|
||||
@ -54,7 +54,7 @@ void PopupMenuTable::Menu::Extend(PopupMenuTable *pTable)
|
||||
{
|
||||
const auto subTable = pEntry->subTable;
|
||||
auto subMenu = BuildMenu( this->pParent, subTable, pUserData );
|
||||
this->AppendSubMenu( subMenu.release(), pEntry->caption );
|
||||
this->AppendSubMenu( subMenu.release(), pEntry->caption.Translation());
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
@ -24,6 +24,7 @@ class wxString;
|
||||
#include <wx/menu.h> // to inherit wxMenu
|
||||
#include "../MemoryX.h"
|
||||
|
||||
#include "../Internat.h"
|
||||
#include "../TranslatableStringArray.h"
|
||||
|
||||
class PopupMenuTable;
|
||||
@ -34,11 +35,11 @@ struct PopupMenuTableEntry
|
||||
|
||||
Type type;
|
||||
int id;
|
||||
wxString caption;
|
||||
TranslatableString caption;
|
||||
wxCommandEventFunction func;
|
||||
PopupMenuTable *subTable;
|
||||
|
||||
PopupMenuTableEntry(Type type_, int id_, wxString caption_,
|
||||
PopupMenuTableEntry(Type type_, int id_, TranslatableString caption_,
|
||||
wxCommandEventFunction func_, PopupMenuTable *subTable_)
|
||||
: type(type_)
|
||||
, id(id_)
|
||||
@ -183,12 +184,12 @@ void HandlerClass::Populate() { \
|
||||
|
||||
#define POPUP_MENU_SEPARATOR() \
|
||||
POPUP_MENU_APPEND( \
|
||||
Entry::Separator, -1, wxT(""), nullptr, nullptr );
|
||||
Entry::Separator, -1, {}, nullptr, nullptr );
|
||||
|
||||
// ends function
|
||||
#define END_POPUP_MENU() \
|
||||
POPUP_MENU_APPEND( \
|
||||
Entry::Invalid, -1, wxT(""), nullptr, nullptr ) \
|
||||
Entry::Invalid, -1, {}, nullptr, nullptr ) \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user