X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aec18ff785687e1d0830da8cd287903128a994c6..23a9a87c85d4e08cd96ab6ab95db64efe46a972f:/samples/html/virtual/virtual.cpp?ds=sidebyside diff --git a/samples/html/virtual/virtual.cpp b/samples/html/virtual/virtual.cpp index 86e9fcb9b4..c22ce0ccfb 100644 --- a/samples/html/virtual/virtual.cpp +++ b/samples/html/virtual/virtual.cpp @@ -1,14 +1,14 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: virtua;.cpp -// Purpose: wxHtml testing example -// demonstrates virtual file systems feature +// Name: virtual.cpp +// Purpose: wxHtml sample: demonstrates virtual file systems feature +// Author: ? +// Modified by: +// Created: ? +// RCS-ID: $Id$ +// Copyright: (c) wxWidgets team +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ - #pragma implementation "test.cpp" - #pragma interface "test.cpp" -#endif - // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -17,14 +17,16 @@ #endif // for all others, include the necessary headers (this file is usually all you -// need because it includes almost all "standard" wxWindows headers +// need because it includes almost all "standard" wxWidgets headers #ifndef WX_PRECOMP #include "wx/wx.h" #endif - #include "wx/html/htmlwin.h" +#ifndef __WXMSW__ + #include "../../sample.xpm" +#endif // new handler class: @@ -32,6 +34,9 @@ #include "wx/mstream.h" +// ---------------------------------------------------------------------------- +// MyVFS +// ---------------------------------------------------------------------------- class MyVFS : public wxFileSystemHandler { @@ -42,27 +47,26 @@ public: bool CanOpen(const wxString& location); }; - bool MyVFS::CanOpen(const wxString& location) { - return (GetProtocol(location) == "myVFS"); + return (GetProtocol(location) == wxT("myVFS")); } - - -wxFSFile* MyVFS::OpenFile(wxFileSystem& fs, const wxString& location) +wxFSFile* MyVFS::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location) { wxFSFile *f; wxInputStream *str; static char buf[1024]; + const wxWX2MBbuf loc = location.ToAscii(); sprintf(buf, "
"
- "Where do you want to go?
" - "sub-1", - location.GetData(), location.GetData(), location.GetData(), location.GetData()); + "Where do you want to go?
" - "sub-2
" - "sub-3
" - "
" + "sub-1
" + "sub-2
" + "sub-3
" + "