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:
Vadim Zeitlin 1999-11-08 15:56:41 +00:00
parent 270c23f7bd
commit ea9144a3bc

View File

@ -296,29 +296,44 @@ bool MyFrame::DoEnumerateFamilies(bool fixedWidthOnly,
if ( fontEnumerator.GotAny() )
{
int n, nFacenames = fontEnumerator.GetFacenames().GetCount();
wxLogStatus(this, "Found %d %sfonts",
nFacenames, fixedWidthOnly ? "fixed width " : "");
wxString *facenames = new wxString[nFacenames];
for ( n = 0; n < nFacenames; n++ )
facenames[n] = fontEnumerator.GetFacenames().Item(n);
int nFacenames = fontEnumerator.GetFacenames().GetCount();
if ( !silent )
{
wxLogStatus(this, "Found %d %sfonts",
nFacenames, fixedWidthOnly ? "fixed width " : "");
}
wxString facename;
if ( silent )
n = 0;
{
// choose the first
facename = fontEnumerator.GetFacenames().Item(0);
}
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",
nFacenames, facenames, this);
if ( n != -1 )
if ( n != -1 )
facename = facenames[n];
delete [] facenames;
}
if ( !facename.IsEmpty() )
{
wxFont font(14, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL, FALSE, facenames[n], encoding);
wxFont font(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL, FALSE, facename, encoding);
DoChangeFont(font);
}
delete [] facenames;
return TRUE;
}
else if ( !silent )
@ -477,7 +492,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
// and now create the correct font
if ( !DoEnumerateFamilies(FALSE, fontenc, TRUE /* silent */) )
{
wxFont font(14, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
wxFont font(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL, FALSE /* !underlined */,
wxEmptyString /* facename */, fontenc);
if ( font.Ok() )