Some fixes by Paul A. Thiessen
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -74,14 +74,14 @@ void wxFontPreviewer::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
if ( font.Ok() )
|
if ( font.Ok() )
|
||||||
{
|
{
|
||||||
dc.SetFont(GetFont());
|
dc.SetFont(font);
|
||||||
// Calculate vertical centre
|
// Calculate vertical centre
|
||||||
long w, h;
|
long w, h;
|
||||||
dc.GetTextExtent( wxT("X"), &w, &h);
|
dc.GetTextExtent( wxT("X"), &w, &h);
|
||||||
dc.SetTextForeground(GetForegroundColour());
|
dc.SetTextForeground(GetForegroundColour());
|
||||||
dc.SetClippingRegion(2, 2, size.x-4, size.y-4);
|
dc.SetClippingRegion(2, 2, size.x-4, size.y-4);
|
||||||
dc.DrawText(_("ABCDEFGabcdefg12345"),
|
dc.DrawText(_("ABCDEFGabcdefg12345"),
|
||||||
10, h/2 + size.y/2);
|
10, size.y/2 - h/2);
|
||||||
dc.DestroyClippingRegion();
|
dc.DestroyClippingRegion();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -191,6 +191,10 @@ bool wxGenericFontDialog::DoCreate(wxWindow *parent)
|
|||||||
InitializeFont();
|
InitializeFont();
|
||||||
CreateWidgets();
|
CreateWidgets();
|
||||||
|
|
||||||
|
// sets initial font in preview area
|
||||||
|
wxCommandEvent dummy;
|
||||||
|
OnChangeFont(dummy);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user