本文整理汇总了Python中pyjamas.DOM.createDiv方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.createDiv方法的具体用法?Python DOM.createDiv怎么用?Python DOM.createDiv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.DOM
的用法示例。
在下文中一共展示了DOM.createDiv方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, **kwargs):
""" Creates an empty horizontal split panel.
"""
if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-HorizontalSplitPanel"
if kwargs.has_key('Element'):
element = kwargs.pop('Element')
else:
element = DOM.createDiv()
SplitPanel.__init__(self, element,
DOM.createDiv(),
self.preventBoxStyles(DOM.createDiv()),
self.preventBoxStyles(DOM.createDiv()),
**kwargs)
self.container = self.preventBoxStyles(DOM.createDiv())
self.buildDOM()
self.impl = ImplHorizontalSplitPanel(self)
# By default the panel will fill its parent vertically and horizontally.
# The horizontal case is covered by the fact that the top level div is
# block display.
self.setHeight("100%")
self.lastSplitPosition = "50%"
self.initialLeftWidth = 0
self.initialThumbPos = 0
示例2: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, **kwargs):
""" Creates an empty vertical split panel.
"""
if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-VerticalSplitPanel"
if kwargs.has_key('Element'):
element = kwargs.pop('Element')
else:
element = DOM.createDiv()
SplitPanel.__init__(self, element,
DOM.createDiv(),
self.preventBoxStyles(DOM.createDiv()),
self.preventBoxStyles(DOM.createDiv()),
**kwargs)
self.container = self.preventBoxStyles(DOM.createDiv())
self.buildDOM()
self.impl = ImplVerticalSplitPanel(self)
self.setSplitPosition("50%")
# Captures the height of the top container when drag resizing starts.
self.initialTopHeight = 0
# Captures the offset of a user's mouse pointer during drag resizing.
self.initialThumbPos = 0
self.lastSplitPosition = ""
示例3: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, options=None, *args, **kwargs):
element = DOM.createDiv()
if not 'StyleName' in kwargs:
kwargs['StyleName'] = 'leaflet-Map'
FocusWidget.__init__(self, element, *args, **kwargs)
map_element = DOM.createDiv()
DOM.setStyleAttribute(map_element, 'width', '100%')
DOM.setStyleAttribute(map_element, 'height', '100%')
DOM.appendChild(element, map_element)
JS('this._map = new $wnd.L.Map(map_element, pyjslib.toJSObjects(options));')
self._layers = []
示例4: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, width=0, height=0):
Widget.__init__(self)
self.context = None
self.setElement(DOM.createDiv())
canvas = DOM.createElement("canvas")
self.setWidth(width)
self.setHeight(height)
canvas.width=width
canvas.height=height
DOM.appendChild(self.getElement(), canvas)
self.setStyleName("gwt-Canvas")
self.init()
self.context.fillStyle = "black"
self.context.strokeStyle = "black"
self.focusable = None
self.focusable = Focus.createFocusable()
self.focusListeners = []
self.clickListeners = []
self.mouseListeners = []
self.keyboardListeners = []
DOM.appendChild(self.getElement(), self.focusable)
DOM.sinkEvents(canvas, Event.ONCLICK | Event.MOUSEEVENTS | DOM.getEventsSunk(canvas))
DOM.sinkEvents(self.focusable, Event.FOCUSEVENTS | Event.KEYEVENTS)
示例5: setGlassEnabled
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def setGlassEnabled(self, enabled):
if enabled:
if self.glass is None:
self.glass = DOM.createDiv()
self.setGlassStyleName()
elif self.glass is not None:
self.hideGlass()
示例6: setHTML
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def setHTML(self, html):
"""Set the face's contents as html."""
self.face = DOM.createDiv()
UIObject.setStyleName(self.button, self.face, self.STYLENAME_HTML_FACE,
True)
DOM.setInnerHTML(self.face, html)
self.button.updateButtonFace()
示例7: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, vertical=False, **kwargs):
if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-MenuBar"
self.body = None
self.items = []
self.parentMenu = None
self.popup = None
self.selectedItem = None
self.shownChildMenu = None
self.vertical = False
self.autoOpen = False
if kwargs.has_key('Element'):
table = kwargs.pop('Element')
fc = DOM.getFirstChild(table)
if fc:
self.body = fc
else:
self.body = DOM.createTBody()
DOM.appendChild(table, self.body)
else:
table = DOM.createTable()
self.body = DOM.createTBody()
DOM.appendChild(table, self.body)
if not vertical:
tr = DOM.createTR()
DOM.appendChild(self.body, tr)
self.vertical = vertical
outer = DOM.createDiv()
DOM.appendChild(outer, table)
self.setElement(outer)
Widget.__init__(self, **kwargs)
示例8: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, min_value, max_value, start_value=None, step=None,
**kwargs):
if not kwargs.has_key("StyleName"): kwargs['StyleName'] = "gwt-VerticalSlider"
if kwargs.has_key('Element'):
# XXX FIXME: Focus.createFocusable is here for a reason...
element = kwargs.pop('Element')
else:
element = Focus.createFocusable()
DOM.setStyleAttribute(element, "position", "relative")
DOM.setStyleAttribute(element, "overflow", "hidden")
self.handle = DOM.createDiv()
DOM.appendChild(element, self.handle)
DOM.setStyleAttribute(self.handle, "border", "1px")
DOM.setStyleAttribute(self.handle, "width", "100%")
DOM.setStyleAttribute(self.handle, "height", "10px")
DOM.setStyleAttribute(self.handle, "backgroundColor", "#808080")
Control.__init__(self, element, min_value, max_value, start_value, step,
**kwargs)
self.addClickListener(self)
self.addFocusListener(self)
self.addMouseListener(self)
示例9: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, min_value, max_value,
start_value=None, step=None,
**kwargs):
if not kwargs.has_key("StyleName"):
kwargs['StyleName'] = "gwt-VerticalSlider"
if kwargs.has_key('Element'):
# XXX FIXME: Focus.createFocusable is here for a reason...
element = kwargs.pop('Element')
else:
element = Focus.createFocusable()
DOM.setStyleAttribute(element, "position", "relative")
DOM.setStyleAttribute(element, "overflow", "hidden")
self.handle = DOM.createDiv()
DOM.appendChild(element, self.handle)
self.setHandleStyle("1px", "100%", "10px", "#808080")
# must use DoubleControl; otherwise, this init is = Vertical init,
# plus a change in the handle style
# this should be refactored, so that the AreaSlider
# can be built on VerticalSlider
DoubleControl.__init__(self, element, min_value, max_value,
start_value, step,
**kwargs)
self.addClickListener(self)
self.addFocusListener(self)
self.addMouseListener(self)
#Redefine VDS's styles for handle
self.setHandleStyle("1px", "10px", "10px", "#808080")
示例10: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, **kwargs):
if kwargs.has_key('Element'):
element = kwargs.pop('Element')
else:
element = DOM.createDiv()
self.setElement(element)
ComplexPanel.__init__(self, **kwargs)
示例11: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, vertical=False, **kwargs):
self.setVertical(kwargs.pop('Vertical', vertical))
if 'StyleName' not in kwargs or kwargs['StyleName'] == 'gwt-MenuBar':
kwargs['StyleName'] = self.getDefaultStyleName()
self.body = None
self.items = []
self.parentMenu = None
self.popup = None
self.selectedItem = None
self.shownChildMenu = None
self.autoOpen = False
if kwargs.has_key('Element'):
table = kwargs.pop('Element')
fc = DOM.getFirstChild(table)
if fc:
self.body = fc
else:
self.body = DOM.createTBody()
DOM.appendChild(table, self.body)
else:
table = DOM.createTable()
self.body = DOM.createTBody()
DOM.appendChild(table, self.body)
outer = DOM.createDiv()
DOM.appendChild(outer, table)
self.setElement(outer)
Widget.__init__(self, **kwargs)
示例12: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, autoHide=False, modal=True, rootpanel=None, glass=False,
**kwargs):
self.popupListeners = []
self.showing = False
self.autoHide = autoHide
kwargs['Modal'] = kwargs.get('Modal', modal)
if rootpanel is None:
rootpanel = RootPanel()
self.rootpanel = rootpanel
self.glass = glass
if self.glass:
self.glass = DOM.createDiv()
if not 'GlassStyleName' in kwargs:
kwargs['GlassStyleName'] = "gwt-PopupPanelGlass"
if kwargs.has_key('Element'):
element = kwargs.pop('Element')
else:
element = self.createElement()
DOM.setStyleAttribute(element, "position", "absolute")
SimplePanel.__init__(self, element, **kwargs)
if glass:
self.setGlassEnabled(True)
if 'GlassStyleName' in kwargs:
self.setGlassStyleName(kwargs.pop('GlassStyleName'))
示例13: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, **kwargs):
element = DOM.createDiv()
self.setElement(element)
self.object_id = 'FlashObject'
""" id of the object-tag. Default: FlashObject """
self.object_class = None
""" The class-name of the object-tag. Default: None"""
self.object_width = None
""" The width-parameter of the object-tag. Default: None"""
self.object_height = None
""" The height-parameter of the object-tag. Default: None"""
self.flash_url = None
""" The Flash-Movie url. Default: None"""
self.wmode = None #'window'
""" The flashmovie wmode parameter. Default: None"""
self.quality = 'high'
""" The flashmovie quality parameter. Default: high"""
self.menu = None # 'false'
""" The flashmovie wmode parameter. Default: None"""
self.allowScriptAccess = 'always'
""" The flashmovie allowscriptaccess parameter. Default: always"""
self.allowFullscreen = 'false'
""" The flashmovie allowfullscreen parameter. Default: False"""
self.bgColor = '#FFFFFF'
""" The flashmovie bgcolor parameter. Default: #FFFFFF (white)"""
self.flashvars = ''
self.browser = browser()
#log.debug('FlashPanel loaded on %s' % self.browser)
Panel.__init__(self, **kwargs)
示例14: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, **ka):
ka['StyleName'] = ka.get('StyleName', "gwt-Tree")
self.root = None
self.childWidgets = Set()
self.curSelection = None
self.focusable = None
self.focusListeners = []
self.mouseListeners = []
self.imageBase = pygwt.getModuleBaseURL()
self.keyboardListeners = []
self.listeners = []
self.lastEventType = ""
element = ka.pop('Element', None) or DOM.createDiv()
self.setElement(element)
DOM.setStyleAttribute(self.getElement(), "position", "relative")
self.focusable = Focus.createFocusable()
# Hide focus outline in Mozilla/Webkit/Opera
DOM.setStyleAttribute(self.focusable, "outline", "0px")
# Hide focus outline in IE 6/7
DOM.setElemAttribute(self.focusable, "hideFocus", "true");
DOM.setStyleAttribute(self.focusable, "fontSize", "0")
DOM.setStyleAttribute(self.focusable, "position", "absolute")
DOM.setIntStyleAttribute(self.focusable, "zIndex", -1)
DOM.appendChild(self.getElement(), self.focusable)
self.root = RootTreeItem()
self.root.setTree(self)
Widget.__init__(self, **ka)
self.sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS)
DOM.sinkEvents(self.focusable, Event.FOCUSEVENTS)
示例15: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createDiv [as 别名]
def __init__(self, **kwargs):
self.visibleWidget = None
if kwargs.has_key("Element"):
element = kwargs.pop("Element")
else:
element = DOM.createDiv()
self.setElement(element)
ComplexPanel.__init__(self, **kwargs)