added support for background bitmap specified in background attribute of the HTML body tag

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-02-13 23:17:12 +00:00
parent 1cffa15b8e
commit 97e490f8b0
4 changed files with 67 additions and 13 deletions

View File

@@ -12,16 +12,18 @@
#include "wx/wxprec.h"
#include "wx/defs.h"
#if wxUSE_HTML && wxUSE_STREAMS
#ifdef __BORLANDC__
#pragma hdrstop
#pragma hdrstop
#endif
#ifndef WXPRECOMP
#endif
#include "wx/image.h"
#include "wx/html/forcelnk.h"
#include "wx/html/m_templ.h"
@@ -330,6 +332,25 @@ TAG_HANDLER_BEGIN(BODY, "BODY")
if (tag.GetParamAsColour(wxT("LINK"), &clr))
m_WParser->SetLinkColor(clr);
if (tag.HasParam(wxT("BACKGROUND")))
{
wxFSFile *fileBgImage = m_WParser->OpenURL
(
wxHTML_URL_IMAGE,
tag.GetParam(wxT("BACKGROUND"))
);
if ( fileBgImage )
{
wxInputStream *is = fileBgImage->GetStream();
if ( is )
{
wxImage image(*is);
if ( image.Ok() )
m_WParser->GetWindow()->SetBackgroundImage(image);
}
}
}
if (tag.GetParamAsColour(wxT("BGCOLOR"), &clr))
{
m_WParser->GetContainer()->InsertCell(
@@ -337,6 +358,7 @@ TAG_HANDLER_BEGIN(BODY, "BODY")
if (m_WParser->GetWindow() != NULL)
m_WParser->GetWindow()->SetBackgroundColour(clr);
}
return false;
}