Home | Trees | Indices | Help |
|
---|
|
1 # Date Time Example 2 # Copyright (C) 2009 Yit Choong (http://code.google.com/u/yitchoong/) 3 # Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> 4 5 from pyjamas.ui.Hyperlink import Hyperlink 6 from pyjamas import Factory 7 from pyjamas.ui.Image import Image 8 from pyjamas import DOM 9 from pyjamas.ui import Event 10 from pyjamas.ui import MouseListener 11 1238 39 Factory.registerClass('pyjamas.ui.HyperlinkImage', 'HyperlinkImage', HyperlinkImage) 4015 self.mouseListeners = [] 16 if not kwargs.has_key('StyleName'): 17 kwargs['StyleName'] = 'gwt-HyperlinkImage' 18 Hyperlink.__init__(self, **kwargs) 19 DOM.appendChild(DOM.getFirstChild(self.getElement()), img.getElement()) 20 img.unsinkEvents(Event.ONCLICK | Event.MOUSEEVENTS) 21 self.sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS)2224 self.mouseListeners.append(listener)2527 self.mouseListeners.remove(listener)2830 type = DOM.eventGetType(event) 31 if type == 'mousedown' or type == 'mouseup' or type == 'mousemove' or type == 'mouseover' or type == 'mouseout': 32 MouseListener.fireMouseEvent(self.mouseListeners, self, event) 33 # stop event falling through esp. for drag on image 34 DOM.eventPreventDefault(event) 35 36 else: 37 Hyperlink.onBrowserEvent(self, event)
Home | Trees | Indices | Help |
|
---|
http://epydoc.sourceforge.net |