]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/fs_mem.h
Add test for absence of events from wxSpinCtrlDouble ctor.
[wxWidgets.git] / interface / wx / fs_mem.h
index bef7f52f8da4fe9566662f546947319ef9cae4be..a083bbc0c679f5f648b6af6518eda832f2612b18 100644 (file)
@@ -2,19 +2,17 @@
 // Name:        fs_mem.h
 // Purpose:     interface of wxMemoryFSHandler
 // Author:      wxWidgets team
 // Name:        fs_mem.h
 // Purpose:     interface of wxMemoryFSHandler
 // Author:      wxWidgets team
-// RCS-ID:      $Id$
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 /**
     @class wxMemoryFSHandler
 /////////////////////////////////////////////////////////////////////////////
 
 /**
     @class wxMemoryFSHandler
-    @wxheader{fs_mem.h}
 
     This wxFileSystem handler can store arbitrary data in memory stream and make
     them accessible via an URL.
 
     It is particularly suitable for storing bitmaps from resources or included XPM
 
     This wxFileSystem handler can store arbitrary data in memory stream and make
     them accessible via an URL.
 
     It is particularly suitable for storing bitmaps from resources or included XPM
-    files so that they can be used with wxHTML.
+    files so that they can be used with wxHTML or wxWebView.
 
     Filenames are prefixed with @c "memory:", e.g. @c "memory:myfile.html".
 
 
     Filenames are prefixed with @c "memory:", e.g. @c "memory:myfile.html".
 
 
     void MyFrame::OnAbout(wxCommandEvent&)
     {
 
     void MyFrame::OnAbout(wxCommandEvent&)
     {
-        wxBusyCursor bcur;
         wxFileSystem::AddHandler(new wxMemoryFSHandler);
         wxFileSystem::AddHandler(new wxMemoryFSHandler);
-        wxMemoryFSHandler::AddFile("logo.pcx", wxBITMAP(logo), wxBITMAP_TYPE_PCX);
+        wxMemoryFSHandler::AddFile("logo.png", wxBITMAP(logo), wxBITMAP_TYPE_PNG);
         wxMemoryFSHandler::AddFile("about.htm",
                                 "<html><body>About: "
         wxMemoryFSHandler::AddFile("about.htm",
                                 "<html><body>About: "
-                                "<img src=\"memory:logo.pcx\"></body></html>");
+                                "<img src=\"memory:logo.png\"></body></html>");
 
         wxDialog dlg(this, -1, wxString(_("About")));
         wxBoxSizer *topsizer;
 
         wxDialog dlg(this, -1, wxString(_("About")));
         wxBoxSizer *topsizer;
-        wxHtmlWindow *html;
         topsizer = new wxBoxSizer(wxVERTICAL);
         topsizer = new wxBoxSizer(wxVERTICAL);
-        html = new wxHtmlWindow(&dlg, -1, wxDefaultPosition,
-                                wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
-        html->SetBorders(0);
-        html->LoadPage("memory:about.htm");
-        html->SetSize(html->GetInternalRepresentation()->GetWidth(),
-                    html->GetInternalRepresentation()->GetHeight());
-        topsizer->Add(html, 1, wxALL, 10);
+    #ifdef USE_WEBVIEW
+        wxWebView* browser = wxWebView::New(&dlg, wxID_ANY, wxWebViewDefaultURLStr,
+                                 wxDefaultPosition, wxSize(380, 160));
+        browser->RegisterHandler(wxSharedPtr<wxWebViewHandler>(new wxWebViewFSHandler("memory")));
+        browser->LoadURL("memory:about.htm");
+    #else // Use wxHtml
+        wxHtmlWindow *browser;
+        browser = new wxHtmlWindow(&dlg, -1, wxDefaultPosition,
+                                   wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
+        browser->SetBorders(0);
+        browser->LoadPage("memory:about.htm");
+        browser->SetSize(browser->GetInternalRepresentation()->GetWidth(),
+                    browser->GetInternalRepresentation()->GetHeight());
+    #endif
+        topsizer->Add(browser, 1, wxALL, 10);
         topsizer->Add(new wxStaticLine(&dlg, -1), 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
         topsizer->Add(new wxButton(&dlg, wxID_OK, "Ok"),
                     0, wxALL | wxALIGN_RIGHT, 15);
         topsizer->Add(new wxStaticLine(&dlg, -1), 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
         topsizer->Add(new wxButton(&dlg, wxID_OK, "Ok"),
                     0, wxALL | wxALIGN_RIGHT, 15);
@@ -54,7 +58,7 @@
         dlg.Centre();
         dlg.ShowModal();
 
         dlg.Centre();
         dlg.ShowModal();
 
-        wxMemoryFSHandler::RemoveFile("logo.pcx");
+        wxMemoryFSHandler::RemoveFile("logo.png");
         wxMemoryFSHandler::RemoveFile("about.htm");
     }
     @endcode
         wxMemoryFSHandler::RemoveFile("about.htm");
     }
     @endcode