git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27354
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void OnSelectFont(wxCommandEvent& event);
void OnEnumerateFamiliesForEncoding(wxCommandEvent& event);
void OnEnumerateFamilies(wxCommandEvent& WXUNUSED(event))
void OnSelectFont(wxCommandEvent& event);
void OnEnumerateFamiliesForEncoding(wxCommandEvent& event);
void OnEnumerateFamilies(wxCommandEvent& WXUNUSED(event))
- { DoEnumerateFamilies(FALSE); }
+ { DoEnumerateFamilies(false); }
void OnEnumerateFixedFamilies(wxCommandEvent& WXUNUSED(event))
void OnEnumerateFixedFamilies(wxCommandEvent& WXUNUSED(event))
- { DoEnumerateFamilies(TRUE); }
+ { DoEnumerateFamilies(true); }
void OnEnumerateEncodings(wxCommandEvent& event);
void OnCheckNativeToFromString(wxCommandEvent& event);
void OnEnumerateEncodings(wxCommandEvent& event);
void OnCheckNativeToFromString(wxCommandEvent& event);
protected:
bool DoEnumerateFamilies(bool fixedWidthOnly,
wxFontEncoding encoding = wxFONTENCODING_SYSTEM,
protected:
bool DoEnumerateFamilies(bool fixedWidthOnly,
wxFontEncoding encoding = wxFONTENCODING_SYSTEM,
void DoResizeFont(int diff);
void DoChangeFont(const wxFont& font, const wxColour& col = wxNullColour);
void DoResizeFont(int diff);
void DoChangeFont(const wxFont& font, const wxColour& col = wxNullColour);
wxPoint(50, 50), wxSize(600, 400));
// Show it and tell the application that it's our main window
wxPoint(50, 50), wxSize(600, 400));
// Show it and tell the application that it's our main window
SetTopWindow(frame);
// success: wxApp::OnRun() will be called which will enter the main message
SetTopWindow(frame);
// success: wxApp::OnRun() will be called which will enter the main message
- // loop and the application will run. If we returned FALSE here, the
+ // loop and the application will run. If we returned 'false' here, the
// application would exit immediately.
// application would exit immediately.
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
// frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
// frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
- : wxFrame((wxFrame *)NULL, -1, title, pos, size), m_textctrl(NULL)
+ : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size), m_textctrl(NULL)
menuFont->Append(Font_IncSize, wxT("&Increase font size by 2 points\tCtrl-I"));
menuFont->Append(Font_DecSize, wxT("&Decrease font size by 2 points\tCtrl-D"));
menuFont->AppendSeparator();
menuFont->Append(Font_IncSize, wxT("&Increase font size by 2 points\tCtrl-I"));
menuFont->Append(Font_DecSize, wxT("&Decrease font size by 2 points\tCtrl-D"));
menuFont->AppendSeparator();
- menuFont->Append(Font_Bold, wxT("&Bold\tCtrl-B"), wxT("Toggle bold state"), TRUE);
- menuFont->Append(Font_Italic, wxT("&Oblique\tCtrl-O"), wxT("Toggle italic state"), TRUE);
+ menuFont->Append(Font_Bold, wxT("&Bold\tCtrl-B"), wxT("Toggle bold state"), true);
+ menuFont->Append(Font_Italic, wxT("&Oblique\tCtrl-O"), wxT("Toggle italic state"), true);
menuFont->Append(Font_Underlined, wxT("&Underlined\tCtrl-U"),
menuFont->Append(Font_Underlined, wxT("&Underlined\tCtrl-U"),
- wxT("Toggle underlined state"), TRUE);
+ wxT("Toggle underlined state"), true);
menuFont->AppendSeparator();
menuFont->Append(Font_CheckNativeToFromString,
menuFont->AppendSeparator();
menuFont->Append(Font_CheckNativeToFromString,
wxSplitterWindow *splitter = new wxSplitterWindow(this);
wxSplitterWindow *splitter = new wxSplitterWindow(this);
- m_textctrl = new wxTextCtrl(splitter, -1,
+ m_textctrl = new wxTextCtrl(splitter, wxID_ANY,
wxT("Paste text here to see how it looks\nlike in the given font"),
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE);
wxT("Paste text here to see how it looks\nlike in the given font"),
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE);
text.Printf(wxT("Encoding %d: %s (available in facename '%s')\n"),
++m_n, encoding.c_str(), facename.c_str());
m_text += text;
text.Printf(wxT("Encoding %d: %s (available in facename '%s')\n"),
++m_n, encoding.c_str(), facename.c_str());
m_text += text;
virtual bool OnFacename(const wxString& facename)
{
m_facenames.Add(facename);
virtual bool OnFacename(const wxString& facename)
{
m_facenames.Add(facename);
if ( !facename.IsEmpty() )
{
wxFont font(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
if ( !facename.IsEmpty() )
{
wxFont font(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
- wxFONTWEIGHT_NORMAL, FALSE, facename, encoding);
+ wxFONTWEIGHT_NORMAL, false, facename, encoding);
}
else if ( !silent )
{
wxLogWarning(wxT("No such fonts found."));
}
}
else if ( !silent )
{
wxLogWarning(wxT("No such fonts found."));
}
}
void MyFrame::OnEnumerateFamiliesForEncoding(wxCommandEvent& WXUNUSED(event))
}
void MyFrame::OnEnumerateFamiliesForEncoding(wxCommandEvent& WXUNUSED(event))
- DoEnumerateFamilies(FALSE, encodings[n]);
+ DoEnumerateFamilies(false, encodings[n]);
default : font = wxFont(*wxNORMAL_FONT); break;
}
default : font = wxFont(*wxNORMAL_FONT); break;
}
- GetMenuBar()->Check(Font_Bold, FALSE);
- GetMenuBar()->Check(Font_Italic, FALSE);
- GetMenuBar()->Check(Font_Underlined, FALSE);
+ GetMenuBar()->Check(Font_Bold, false);
+ GetMenuBar()->Check(Font_Italic, false);
+ GetMenuBar()->Check(Font_Underlined, false);
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- // TRUE is to force the frame to close
- Close(TRUE);
+ // true is to force the frame to close
+ Close(true);
}
void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
}
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(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
{
wxFont font(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
- wxFONTWEIGHT_NORMAL, FALSE /* !underlined */,
+ wxFONTWEIGHT_NORMAL, false /* !underlined */,
wxEmptyString /* facename */, fontenc);
if ( font.Ok() )
{
wxEmptyString /* facename */, fontenc);
if ( font.Ok() )
{
END_EVENT_TABLE()
MyCanvas::MyCanvas( wxWindow *parent )
END_EVENT_TABLE()
MyCanvas::MyCanvas( wxWindow *parent )
- : wxWindow( parent, -1 ),
+ : wxWindow( parent, wxID_ANY ),
m_colour(*wxRED), m_font(*wxNORMAL_FONT)
{
}
m_colour(*wxRED), m_font(*wxNORMAL_FONT)
{
}