+void MyFrame::DoEnumerateFamilies(bool fixedWidthOnly)
+{
+ class MyFontEnumerator : public wxFontEnumerator
+ {
+ public:
+ MyFontEnumerator() { m_n = 0; }
+
+ protected:
+ virtual bool OnFontFamily(const wxString& family)
+ {
+ wxLogMessage("Font family %d: %s\n", ++m_n, family.c_str());
+
+ return TRUE;
+ }
+
+ private:
+ size_t m_n;
+ } fontEnumerator;
+
+ wxLogMessage("Enumerating %s font families:",
+ fixedWidthOnly ? "fixed width" : "all");
+ fontEnumerator.EnumerateFamilies(fixedWidthOnly);
+}
+