15#include "../../../HitTestResult.h"
17#include "../../../widgets/PopupMenuTable.h"
19#include "../../../RefreshCode.h"
22#include <wx/fontenum.h>
23#include <wx/listbox.h>
24#include <wx/spinctrl.h>
79 class FontEnumerator :
public wxFontEnumerator
82 explicit FontEnumerator(wxArrayString* fontNames) :
83 mFontNames(fontNames) {}
85 bool OnFacename(
const wxString& font)
override
87 mFontNames->push_back(font);
92 wxArrayString* mFontNames;
95 wxArrayString facenames;
96 FontEnumerator fontEnumerator(&facenames);
97 fontEnumerator.EnumerateFacenames(wxFONTENCODING_SYSTEM,
false);
116 S.StartVerticalLay(
true);
118 S.StartMultiColumn(2, wxEXPAND);
124 S.AddPrompt(
XXO(
"Face name"));
125 lb =
safenew wxListBox(
S.GetParent(), wxID_ANY,
133 .Name(
XO(
"Face name"))
134 .Position( wxALIGN_LEFT | wxEXPAND | wxALL )
138 S.AddPrompt(
XXO(
"Face size"));
139 sc =
safenew wxSpinCtrl(
S.GetParent(), wxID_ANY,
140 wxString::Format(
wxT(
"%ld"), fontsize),
146 .Name(
XO(
"Face size"))
147 .Position( wxALIGN_LEFT | wxALL )
151 S.AddStandardButtons();
157 dlg.CenterOnParent();
158 if (dlg.ShowModal() == wxID_CANCEL)
161 gPrefs->
Write(
wxT(
"/GUI/LabelFontFacename"), lb->GetStringSelection());
178 return std::make_shared<LabelTrackControls>( track.SharedPointer() );
XXO("&Cut/Copy/Paste Toolbar")
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
DEFINE_ATTACHED_VIRTUAL_OVERRIDE(DoGetLabelTrackControls)
AppendItem("Font", OnSetFontID, XXO("&Font..."), POPUP_MENU_FN(OnSetFont))
audacity::BasicSettings * gPrefs
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
virtual std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *) override=0
std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *pProject) override
PopupMenuTable * GetMenuExtension(Track *pTrack) override
A LabelTrack is a Track that holds labels (LabelStruct).
static wxFont GetFont(const wxString &faceName, int size=DefaultFontSize)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Abstract base class for an object holding data associated with points on a time axis.
virtual bool Flush() noexcept=0
virtual bool Write(const wxString &key, bool value)=0
virtual bool Read(const wxString &key, bool *value) const =0
void SetName(const TranslatableString &title)
For defining overrides of the method.