]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/m_layout.cpp
fixed handling of the accelerators of menu items added to already attached submenus
[wxWidgets.git] / src / html / m_layout.cpp
index 0809130d4249d6fe9152498c07dd3a6ef8062096..879f95a761418c422707ecb1dae9362db567e682 100644 (file)
 
 #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"
@@ -298,7 +300,7 @@ TAG_HANDLER_BEGIN(TITLE, "TITLE")
                 wxString title = m_WParser->GetSource()->Mid(
                                         tag.GetBeginPos(),
                                         tag.GetEndPos1()-tag.GetBeginPos());
-#if !wxUSE_UNICODE
+#if !wxUSE_UNICODE && wxUSE_WCHAR_T
                 wxCSConv conv(m_WParser->GetInputEncoding());
                 title = wxString(title.wc_str(conv), wxConvLocal);
 #endif
@@ -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;
     }