Implement CanSetZoomType correctly for the IE backend.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68265 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton
2011-07-14 11:14:37 +00:00
parent c5f417cb50
commit cd4e467319

View File

@@ -16,6 +16,7 @@
#include "wx/msw/webview_ie.h" #include "wx/msw/webview_ie.h"
#if wxUSE_WEBVIEW_IE #if wxUSE_WEBVIEW_IE
#include <olectl.h> #include <olectl.h>
@@ -23,7 +24,7 @@
#include <exdispid.h> #include <exdispid.h>
#include <exdisp.h> #include <exdisp.h>
#include <mshtml.h> #include <mshtml.h>
#include "wx/msw/registry.h"
// Various definitions are missing from mingw // Various definitions are missing from mingw
#ifdef __MINGW32__ #ifdef __MINGW32__
typedef enum CommandStateChangeConstants { typedef enum CommandStateChangeConstants {
@@ -319,11 +320,19 @@ wxWebViewZoomType wxWebViewIE::GetZoomType() const
return m_zoomType; return m_zoomType;
} }
bool wxWebViewIE::CanSetZoomType(wxWebViewZoomType) const bool wxWebViewIE::CanSetZoomType(wxWebViewZoomType type) const
{ {
// both are supported //IE 6 and below only support text zoom, so check the registry to see what
// TODO: IE6 only supports text zoom, check if it's IE6 first //version we actually have
return true; wxRegKey key(wxRegKey::HKLM, "Software\\Microsoft\\Internet Explorer");
wxString value;
key.QueryValue("Version", value);
long version = wxAtoi(value.Left(1));
if(version <= 6 && type == wxWEB_VIEW_ZOOM_TYPE_LAYOUT)
return false;
else
return true;
} }
void wxWebViewIE::Print() void wxWebViewIE::Print()