- wxT("Western European (ISO-8859-1)"),
- wxT("Central European (ISO-8859-2)"),
- wxT("Cyrillic (ISO-8859-5)"),
- wxT("Greek (ISO-8859-7)"),
- wxT("Western European with Euro (ISO-8859-15)"),
- wxT("KOI8-R"),
- wxT("Windows Central European (CP 1250)"),
- wxT("Windows Cyrillic (CP 1251)"),
- wxT("Windows Western European (CP 1252)"),
- };
-
- int n = wxGetSingleChoiceIndex(wxT("Choose an encoding"), wxT("Font demo"),
- WXSIZEOF(encodingNames),
- encodingNames,
- this);
-
- if ( n != -1 )
+ wxLogError(wxT("Font info string \"%s\" is invalid."),
+ fontInfo.c_str());
+ return;
+ }
+
+ DoChangeFont(font);
+}
+
+void MyFrame::OnSetFaceName(wxCommandEvent& WXUNUSED(event))
+{
+ wxString facename = GetCanvas()->GetTextFont().GetFaceName();
+ wxString newFaceName = wxGetTextFromUser(
+ wxT("Here you can edit current font face name."),
+ wxT("Input font facename"), facename,
+ this);
+ if (newFaceName.IsEmpty())
+ return; // user clicked "Cancel" - do nothing
+
+ wxFont font(GetCanvas()->GetTextFont());
+ if (font.SetFaceName(newFaceName)) // change facename only