X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e54c96f187f46c06bd36be8cd52b35c19884aa2b..78f541fa5b328e5be73b1afaa7cb25849d6211a6:/interface/fs_mem.h diff --git a/interface/fs_mem.h b/interface/fs_mem.h index f58f101ee4..bef7f52f8d 100644 --- a/interface/fs_mem.h +++ b/interface/fs_mem.h @@ -10,12 +10,13 @@ @class wxMemoryFSHandler @wxheader{fs_mem.h} - This wxFileSystem handler can store arbitrary - data in memory stream and make them accessible via URL. It is particularly - suitable for storing bitmaps from resources or included XPM files so that - they can be used with wxHTML. + This wxFileSystem handler can store arbitrary data in memory stream and make + them accessible via an URL. - Filenames are prefixed with "memory:", e.g. "memory:myfile.html". + It is particularly suitable for storing bitmaps from resources or included XPM + files so that they can be used with wxHTML. + + Filenames are prefixed with @c "memory:", e.g. @c "memory:myfile.html". Example: @@ -30,26 +31,26 @@ wxFileSystem::AddHandler(new wxMemoryFSHandler); wxMemoryFSHandler::AddFile("logo.pcx", wxBITMAP(logo), wxBITMAP_TYPE_PCX); wxMemoryFSHandler::AddFile("about.htm", - "htmlbodyAbout: " - "img src=\"memory:logo.pcx\"/body/html"); + "About: " + ""); wxDialog dlg(this, -1, wxString(_("About"))); wxBoxSizer *topsizer; wxHtmlWindow *html; topsizer = new wxBoxSizer(wxVERTICAL); - html = new wxHtmlWindow(, -1, wxDefaultPosition, + 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); - topsizer-Add(new wxStaticLine(, -1), 0, wxEXPAND | wxLEFT | wxRIGHT, 10); - topsizer-Add(new wxButton(, wxID_OK, "Ok"), - 0, wxALL | wxALIGN_RIGHT, 15); - dlg.SetAutoLayout(@true); + html->SetBorders(0); + html->LoadPage("memory:about.htm"); + html->SetSize(html->GetInternalRepresentation()->GetWidth(), + html->GetInternalRepresentation()->GetHeight()); + topsizer->Add(html, 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); + dlg.SetAutoLayout(true); dlg.SetSizer(topsizer); - topsizer-Fit(); + topsizer->Fit(&dlg); dlg.Centre(); dlg.ShowModal(); @@ -59,7 +60,7 @@ @endcode @library{wxbase} - @category{FIXME} + @category{vfs} @see wxMemoryFSHandler::AddFileWithMimeType */ @@ -73,32 +74,29 @@ public: //@{ /** - Add file to list of files stored in memory. Stored - data (bitmap, text or raw data) - will be copied into private memory stream and available under - name "memory:" + @e filename. - The @a type argument is one of @c wxBITMAP_TYPE_XXX constants. - Note that you must use a @a type value (aka image format) - that wxWidgets can save (e.g. JPG, PNG, see wxImage - documentation())! - + Adds a file to the list of the files stored in memory. + + Stored data (bitmap, text or raw data) will be copied into private memory + stream and available under name @c "memory:" + @e filename. + + @note you must use a @a type value (aka image format) that wxWidgets + can save (e.g. JPG, PNG, see wxImage documentation)! + @see AddFileWithMimeType() */ - static void AddFile(const wxString& filename, wxImage& image, - long type); - static void AddFile(const wxString& filename, - const wxBitmap& bitmap, - long type); + static void AddFile(const wxString& filename, wxImage& image, wxBitmapType type); + static void AddFile(const wxString& filename, const wxBitmap& bitmap, wxBitmapType type); //@} //@{ /** - Like AddFile(), but lets you explicitly - specify added file's MIME type. This version should be used whenever you know - the MIME type, because it makes accessing the files faster. - - @wxsince{2.8.5} - + Like AddFile(), but lets you explicitly specify added file's MIME type. + + This version should be used whenever you know the MIME type, because it + makes accessing the files faster. + + @since 2.8.5 + @see AddFile() */ static void AddFileWithMimeType(const wxString& filename, @@ -111,7 +109,7 @@ public: //@} /** - Remove file from memory FS and free occupied memory. + Removes a file from memory FS and frees the occupied memory. */ static void RemoveFile(const wxString& filename); };