X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/010216e3bc0fc54595d59b6fa4ceec220aff3632..9146872cb5243c629dfb0afc51fd5d8d8ca22826:/demos/forty/forty.cpp diff --git a/demos/forty/forty.cpp b/demos/forty/forty.cpp index dc506c2b11..0b4e23f8f3 100644 --- a/demos/forty/forty.cpp +++ b/demos/forty/forty.cpp @@ -33,7 +33,7 @@ #include "scoredg.h" #if wxUSE_HTML -#include "wx/file.h" +#include "wx/textfile.h" #include "wx/html/htmlwin.h" #endif @@ -198,7 +198,9 @@ FortyFrame::FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos SetSizer( topsizer ); topsizer->SetSizeHints( this ); +#if wxUSE_STATUSBAR CreateStatusBar(); +#endif // wxUSE_STATUSBAR } FortyFrame::~FortyFrame() @@ -329,15 +331,13 @@ bool FortyAboutDialog::AddControls(wxWindow* parent) // wxSetWorkingDirectory(wxGetApp().GetAppDir()); // wxString htmlFile(wxGetApp().GetFullAppPath(wxT("about.htm"))); - if (wxFileExists(htmlFile)) + wxTextFile file(htmlFile); + if (file.Exists()) { - wxFile file; - file.Open(htmlFile, wxFile::read); - long len = file.Length(); - wxChar* buf = htmlText.GetWriteBuf(len + 1); - file.Read(buf, len); - buf[len] = 0; - htmlText.UngetWriteBuf(); + file.Open(); + for ( htmlText = file.GetFirstLine(); + !file.Eof(); + htmlText << file.GetNextLine() << _T("\n") ) ; } }