mshtml: Added element blur, focus, paste and drag event implementation.

This commit is contained in:
Jacek Caban 2008-10-10 15:49:09 -05:00 committed by Alexandre Julliard
parent bf61a2619f
commit d6f07e0bf8
3 changed files with 54 additions and 17 deletions

View File

@ -29,6 +29,7 @@
#include "wine/unicode.h"
#include "mshtml_private.h"
#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@ -150,15 +151,19 @@ static HRESULT WINAPI HTMLElement2_get_onscroll(IHTMLElement2 *iface, VARIANT *p
static HRESULT WINAPI HTMLElement2_put_ondrag(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_node_event(&This->node, EVENTID_DRAG, &v);
}
static HRESULT WINAPI HTMLElement2_get_ondrag(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_node_event(&This->node, EVENTID_DRAG, p);
}
static HRESULT WINAPI HTMLElement2_put_ondragend(IHTMLElement2 *iface, VARIANT v)
@ -304,15 +309,19 @@ static HRESULT WINAPI HTMLElement2_get_onbeforepaste(IHTMLElement2 *iface, VARIA
static HRESULT WINAPI HTMLElement2_put_onpaste(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_node_event(&This->node, EVENTID_PASTE, &v);
}
static HRESULT WINAPI HTMLElement2_get_onpaste(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_node_event(&This->node, EVENTID_PASTE, p);
}
static HRESULT WINAPI HTMLElement2_get_currentStyle(IHTMLElement2 *iface, IHTMLCurrentStyle **p)
@ -468,29 +477,37 @@ static HRESULT WINAPI HTMLElement2_get_accessKey(IHTMLElement2 *iface, BSTR *p)
static HRESULT WINAPI HTMLElement2_put_onblur(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_node_event(&This->node, EVENTID_BLUR, &v);
}
static HRESULT WINAPI HTMLElement2_get_onblur(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_node_event(&This->node, EVENTID_BLUR, p);
}
static HRESULT WINAPI HTMLElement2_put_onfocus(IHTMLElement2 *iface, VARIANT v)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->()\n", This);
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return set_node_event(&This->node, EVENTID_FOCUS, &v);
}
static HRESULT WINAPI HTMLElement2_get_onfocus(IHTMLElement2 *iface, VARIANT *p)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_node_event(&This->node, EVENTID_FOCUS, p);
}
static HRESULT WINAPI HTMLElement2_put_onresize(IHTMLElement2 *iface, VARIANT v)

View File

@ -36,12 +36,21 @@ struct event_target_t {
IDispatch *event_table[EVENTID_LAST];
};
static const WCHAR blurW[] = {'b','l','u','r',0};
static const WCHAR onblurW[] = {'o','n','b','l','u','r',0};
static const WCHAR changeW[] = {'c','h','a','n','g','e',0};
static const WCHAR onchangeW[] = {'o','n','c','h','a','n','g','e',0};
static const WCHAR clickW[] = {'c','l','i','c','k',0};
static const WCHAR onclickW[] = {'o','n','c','l','i','c','k',0};
static const WCHAR dragW[] = {'d','r','a','g',0};
static const WCHAR ondragW[] = {'o','n','d','r','a','g',0};
static const WCHAR focusW[] = {'f','o','c','u','s',0};
static const WCHAR onfocusW[] = {'o','n','f','o','c','u','s',0};
static const WCHAR keyupW[] = {'k','e','y','u','p',0};
static const WCHAR onkeyupW[] = {'o','n','k','e','y','u','p',0};
@ -51,6 +60,9 @@ static const WCHAR onloadW[] = {'o','n','l','o','a','d',0};
static const WCHAR mouseoverW[] = {'m','o','u','s','e','o','v','e','r',0};
static const WCHAR onmouseoverW[] = {'o','n','m','o','u','s','e','o','v','e','r',0};
static const WCHAR pasteW[] = {'p','a','s','t','e',0};
static const WCHAR onpasteW[] = {'o','n','p','a','s','t','e',0};
typedef struct {
LPCWSTR name;
LPCWSTR attr_name;
@ -61,11 +73,15 @@ typedef struct {
#define EVENT_BUBBLE 0x0002
static const event_info_t event_info[] = {
{blurW, onblurW, EVENT_DEFAULTLISTENER},
{changeW, onchangeW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{clickW, onclickW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{dragW, ondragW, 0},
{focusW, onfocusW, EVENT_DEFAULTLISTENER},
{keyupW, onkeyupW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{loadW, onloadW, 0},
{mouseoverW, onmouseoverW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE}
{mouseoverW, onmouseoverW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{pasteW, onpasteW, 0}
};
eventid_t str_to_eid(LPCWSTR str)

View File

@ -17,11 +17,15 @@
*/
typedef enum {
EVENTID_BLUR,
EVENTID_CHANGE,
EVENTID_CLICK,
EVENTID_DRAG,
EVENTID_FOCUS,
EVENTID_KEYUP,
EVENTID_LOAD,
EVENTID_MOUSEOVER,
EVENTID_PASTE,
EVENTID_LAST
} eventid_t;