minor aesthetic fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -296,29 +296,44 @@ bool MyFrame::DoEnumerateFamilies(bool fixedWidthOnly,
|
|||||||
|
|
||||||
if ( fontEnumerator.GotAny() )
|
if ( fontEnumerator.GotAny() )
|
||||||
{
|
{
|
||||||
int n, nFacenames = fontEnumerator.GetFacenames().GetCount();
|
int nFacenames = fontEnumerator.GetFacenames().GetCount();
|
||||||
wxLogStatus(this, "Found %d %sfonts",
|
if ( !silent )
|
||||||
nFacenames, fixedWidthOnly ? "fixed width " : "");
|
{
|
||||||
|
wxLogStatus(this, "Found %d %sfonts",
|
||||||
wxString *facenames = new wxString[nFacenames];
|
nFacenames, fixedWidthOnly ? "fixed width " : "");
|
||||||
for ( n = 0; n < nFacenames; n++ )
|
}
|
||||||
facenames[n] = fontEnumerator.GetFacenames().Item(n);
|
|
||||||
|
|
||||||
|
wxString facename;
|
||||||
if ( silent )
|
if ( silent )
|
||||||
n = 0;
|
{
|
||||||
|
// choose the first
|
||||||
|
facename = fontEnumerator.GetFacenames().Item(0);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
// let the user choose
|
||||||
|
wxString *facenames = new wxString[nFacenames];
|
||||||
|
int n;
|
||||||
|
for ( n = 0; n < nFacenames; n++ )
|
||||||
|
facenames[n] = fontEnumerator.GetFacenames().Item(n);
|
||||||
|
|
||||||
n = wxGetSingleChoiceIndex("Choose a facename", "Font demo",
|
n = wxGetSingleChoiceIndex("Choose a facename", "Font demo",
|
||||||
nFacenames, facenames, this);
|
nFacenames, facenames, this);
|
||||||
if ( n != -1 )
|
|
||||||
|
if ( n != -1 )
|
||||||
|
facename = facenames[n];
|
||||||
|
|
||||||
|
delete [] facenames;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !facename.IsEmpty() )
|
||||||
{
|
{
|
||||||
wxFont font(14, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
|
wxFont font(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
|
||||||
wxFONTWEIGHT_NORMAL, FALSE, facenames[n], encoding);
|
wxFONTWEIGHT_NORMAL, FALSE, facename, encoding);
|
||||||
|
|
||||||
DoChangeFont(font);
|
DoChangeFont(font);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] facenames;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if ( !silent )
|
else if ( !silent )
|
||||||
@@ -477,7 +492,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
|
|||||||
// and now create the correct font
|
// and now create the correct font
|
||||||
if ( !DoEnumerateFamilies(FALSE, fontenc, TRUE /* silent */) )
|
if ( !DoEnumerateFamilies(FALSE, fontenc, TRUE /* silent */) )
|
||||||
{
|
{
|
||||||
wxFont font(14, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
|
wxFont font(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
|
||||||
wxFONTWEIGHT_NORMAL, FALSE /* !underlined */,
|
wxFONTWEIGHT_NORMAL, FALSE /* !underlined */,
|
||||||
wxEmptyString /* facename */, fontenc);
|
wxEmptyString /* facename */, fontenc);
|
||||||
if ( font.Ok() )
|
if ( font.Ok() )
|
||||||
|
Reference in New Issue
Block a user