+#include "wx/sizer.h"
+#include "wx/fontdlg.h"
+
+//-----------------------------------------------------------------------------
+// helper class - wxFontPreviewer
+//-----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxFontPreviewer : public wxWindow
+{
+public:
+ wxFontPreviewer(wxWindow *parent) : wxWindow(parent, -1) {}
+
+private:
+ void OnPaint(wxPaintEvent& event);
+ DECLARE_EVENT_TABLE()
+};
+
+BEGIN_EVENT_TABLE(wxFontPreviewer, wxWindow)
+ EVT_PAINT(wxFontPreviewer::OnPaint)
+END_EVENT_TABLE()
+
+void wxFontPreviewer::OnPaint(wxPaintEvent& WXUNUSED(event))
+{
+ wxPaintDC dc(this);
+
+ wxSize size = GetSize();
+ wxFont font = GetFont();
+
+ dc.SetPen(*wxBLACK_PEN);
+ dc.SetBrush(*wxWHITE_BRUSH);
+ dc.DrawRectangle(0, 0, size.x, size.y);
+
+ if ( font.Ok() )
+ {
+ dc.SetFont(GetFont());
+ // Calculate vertical centre
+ long w, h;
+ dc.GetTextExtent("X", &w, &h);
+ dc.SetTextForeground(GetForegroundColour());
+ dc.SetClippingRegion(2, 2, size.x-4, size.y-4);
+ dc.DrawText(_("ABCDEFGabcdefg12345"),
+ 10, h/2 + size.y/2);
+ dc.DestroyClippingRegion();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// wxGenericFontDialog
+//-----------------------------------------------------------------------------