1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

TranslatableString in popup menu tables

This commit is contained in:
Paul Licameli
2019-12-16 15:10:35 -05:00
parent 618fee21ec
commit 6b812791a6
13 changed files with 113 additions and 106 deletions

View File

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

View File

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