2000-02-27 21:07:24 +00:00
|
|
|
%
|
|
|
|
% automatically generated by HelpGen from
|
|
|
|
% /home/vasek/fs\_mem.h at 27/Feb/00 19:23:10
|
|
|
|
%
|
|
|
|
|
|
|
|
\section{\class{wxMemoryFSHandler}}\label{wxmemoryfshandler}
|
|
|
|
|
|
|
|
This \helpref{wxFileSystem}{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.
|
|
|
|
|
|
|
|
Filenames are prefixed with "memory:", e.g. "memory:myfile.html".
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
#ifndef __WXMSW__
|
|
|
|
#include "logo.xpm"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void MyFrame::OnAbout(wxCommandEvent&)
|
|
|
|
{
|
|
|
|
wxBusyCursor bcur;
|
2002-12-04 14:11:26 +00:00
|
|
|
wxFileSystem::AddHandler(new wxMemoryFSHandler);
|
2000-02-27 21:07:24 +00:00
|
|
|
wxMemoryFSHandler::AddFile("logo.pcx", wxBITMAP(logo), wxBITMAP_TYPE_PCX);
|
|
|
|
wxMemoryFSHandler::AddFile("about.htm",
|
|
|
|
"<html><body>About: "
|
|
|
|
"<img src=\"memory:logo.pcx\"></body></html>");
|
|
|
|
|
|
|
|
wxDialog dlg(this, -1, wxString(_("About")));
|
|
|
|
wxBoxSizer *topsizer;
|
|
|
|
wxHtmlWindow *html;
|
|
|
|
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);
|
|
|
|
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(&dlg);
|
|
|
|
dlg.Centre();
|
|
|
|
dlg.ShowModal();
|
|
|
|
|
|
|
|
wxMemoryFSHandler::RemoveFile("logo.pcx");
|
|
|
|
wxMemoryFSHandler::RemoveFile("about.htm");
|
|
|
|
}
|
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxFileSystemHandler}{wxfilesystemhandler}
|
|
|
|
|
|
|
|
\wxheading{Include files}
|
|
|
|
|
2001-05-24 10:39:33 +00:00
|
|
|
<wx/fs\_mem.h>
|
2000-02-27 21:07:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
|
|
|
|
\membersection{wxMemoryFSHandler::wxMemoryFSHandler}\label{wxmemoryfshandlerwxmemoryfshandler}
|
|
|
|
|
|
|
|
\func{}{wxMemoryFSHandler}{\void}
|
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
|
|
|
\membersection{wxMemoryFSHandler::AddFile}\label{wxmemoryfshandleraddfile}
|
|
|
|
|
|
|
|
\func{static void}{AddFile}{\param{const wxString\& }{filename}, \param{wxImage\& }{image}, \param{long }{type}}
|
|
|
|
|
|
|
|
\func{static void}{AddFile}{\param{const wxString\& }{filename}, \param{const wxBitmap\& }{bitmap}, \param{long }{type}}
|
|
|
|
|
|
|
|
\func{static void}{AddFile}{\param{const wxString\& }{filename}, \param{const wxString\& }{textdata}}
|
|
|
|
|
|
|
|
\func{static void}{AddFile}{\param{const wxString\& }{filename}, \param{const void* }{binarydata}, \param{size\_t }{size}}
|
|
|
|
|
|
|
|
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:" + filename.
|
|
|
|
|
2004-05-04 08:27:20 +00:00
|
|
|
Note that when storing image/bitmap, you must use image format that wxWidgets
|
2000-07-15 19:51:35 +00:00
|
|
|
can write (e.g. JPG, PNG, see \helpref{wxImage documentation}{wximage})!
|
2000-02-27 21:07:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
\membersection{wxMemoryFSHandler::RemoveFile}\label{wxmemoryfshandlerremovefile}
|
|
|
|
|
|
|
|
\func{static void}{RemoveFile}{\param{const wxString\& }{filename}}
|
|
|
|
|
|
|
|
Remove file from memory FS and free occupied memory.
|
|
|
|
|