Jacek Caban : mshtml: Added IHTMLButtonElement::disabled implementation.
Alexandre Julliard
julliard at winehq.org
Wed Mar 27 15:40:07 CDT 2013
Module: wine
Branch: master
Commit: add03f99d8ae8464898efcbd074bbf8e1b192bb4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=add03f99d8ae8464898efcbd074bbf8e1b192bb4
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Mar 27 13:12:39 2013 +0100
mshtml: Added IHTMLButtonElement::disabled implementation.
---
dlls/mshtml/htmlinput.c | 44 ++++++++++++++++++++++++++++++++++++++++----
1 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c
index d6bd394..4d304b2 100644
--- a/dlls/mshtml/htmlinput.c
+++ b/dlls/mshtml/htmlinput.c
@@ -1552,15 +1552,35 @@ static HRESULT WINAPI HTMLButtonElement_get_status(IHTMLButtonElement *iface, VA
static HRESULT WINAPI HTMLButtonElement_put_disabled(IHTMLButtonElement *iface, VARIANT_BOOL v)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
- FIXME("(%p)->(%x)\n", This, v);
- return E_NOTIMPL;
+ nsresult nsres;
+
+ TRACE("(%p)->(%x)\n", This, v);
+
+ nsres = nsIDOMHTMLButtonElement_SetDisabled(This->nsbutton, !!v);
+ if(NS_FAILED(nsres)) {
+ ERR("SetDisabled failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ return S_OK;
}
static HRESULT WINAPI HTMLButtonElement_get_disabled(IHTMLButtonElement *iface, VARIANT_BOOL *p)
{
HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ cpp_bool disabled;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ nsres = nsIDOMHTMLButtonElement_GetDisabled(This->nsbutton, &disabled);
+ if(NS_FAILED(nsres)) {
+ ERR("GetDisabled failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ *p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
+ return S_OK;
}
static HRESULT WINAPI HTMLButtonElement_get_form(IHTMLButtonElement *iface, IHTMLFormElement **p)
@@ -1623,6 +1643,18 @@ static HRESULT HTMLButtonElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
return S_OK;
}
+static HRESULT HTMLButtonElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
+{
+ HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
+ return IHTMLButtonElement_put_disabled(&This->IHTMLButtonElement_iface, v);
+}
+
+static HRESULT HTMLButtonElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
+{
+ HTMLButtonElement *This = button_from_HTMLDOMNode(iface);
+ return IHTMLButtonElement_get_disabled(&This->IHTMLButtonElement_iface, p);
+}
+
static const NodeImplVtbl HTMLButtonElementImplVtbl = {
HTMLButtonElement_QI,
HTMLElement_destructor,
@@ -1630,6 +1662,10 @@ static const NodeImplVtbl HTMLButtonElementImplVtbl = {
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
+ NULL,
+ NULL,
+ HTMLButtonElementImpl_put_disabled,
+ HTMLButtonElementImpl_get_disabled
};
static const tid_t HTMLButtonElement_iface_tids[] = {
More information about the wine-cvs
mailing list