当前位置: 首页>>代码示例>>Python>>正文


Python RootPanel.get方法代码示例

本文整理汇总了Python中pyjamas.ui.RootPanel.RootPanel.get方法的典型用法代码示例。如果您正苦于以下问题:Python RootPanel.get方法的具体用法?Python RootPanel.get怎么用?Python RootPanel.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyjamas.ui.RootPanel.RootPanel的用法示例。


在下文中一共展示了RootPanel.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: newPositioner

# 需要导入模块: from pyjamas.ui.RootPanel import RootPanel [as 别名]
# 或者: from pyjamas.ui.RootPanel.RootPanel import get [as 别名]
 def newPositioner(self, context):
     
     # Use two widgets so that setPixelSize() consistently affects dimensions
     outer = SimplePanel() 
     outer.addStyleName(CSS_DRAGDROP_POSITIONER)
     
     # place off screen for border calculation
     RootPanel.get().add(outer, -500, -500) 
     
     # Ensure IE quirks mode returns valid outer.offsetHeight, and thus valid
     outer.setWidget(self.DUMMY_LABEL_IE_QUIRKS_MODE_OFFSET_HEIGHT)
     width = 0
     height = 0
     if isinstance(self.dropTarget,HorizontalPanel):
         for widget in context.selectedWidgets:
             width += widget.getOffsetWidth()
             height = Math.max(height, widget.getOffsetHeight())
     else:
         for widget in context.selectedWidgets:
             width = Math.max(width, widget.getOffsetWidth())
             height += widget.getOffsetHeight()
     inner = SimplePanel()
     inner.setPixelSize(
         width - DOMUtil.getHorizontalBorders(outer), height - DOMUtil.getVerticalBorders(outer))
     outer.setWidget(inner)
     return outer
开发者ID:pombredanne,项目名称:pyjamas-dnd,代码行数:28,代码来源:IndexedDropController.py

示例2: makePositioner

# 需要导入模块: from pyjamas.ui.RootPanel import RootPanel [as 别名]
# 或者: from pyjamas.ui.RootPanel.RootPanel import get [as 别名]
 def makePositioner(self, reference):
     outer = SimplePanel() # Use two widgets so that setPixelSize() consistently affects dimensions
     outer.addStyleName(CSS_DRAGDROP_POSITIONER)
     outer.getElement().getStyle().setProperty("margin", "0px")
     RootPanel.get().add(outer, -500, -500) # place off screen for border calculation
     outer.setWidget(DUMMY_LABEL_IE_QUIRKS_MODE_OFFSET_HEIGHT) # Ensure IE quirks mode returns valid outer.offsetHeight, and thus valid
     inner = SimplePanel()
     inner.getElement().getStyle().setProperty("margin", "0px")
     inner.getElement().getStyle().setProperty("border", "none")
     offsetWidth = reference.getOffsetWidth() - DOMUtil.getHorizontalBorders(outer)
     offsetHeight = reference.getOffsetHeight() - DOMUtil.getVerticalBorders(outer)
     inner.setPixelSize(offsetWidth, offsetHeight)
     outer.setWidget(inner)
     return outer
开发者ID:pombredanne,项目名称:pyjamas-dnd,代码行数:16,代码来源:AbsolutePositionDropController.py

示例3: newPositioner

# 需要导入模块: from pyjamas.ui.RootPanel import RootPanel [as 别名]
# 或者: from pyjamas.ui.RootPanel.RootPanel import get [as 别名]
 def newPositioner(self, context):
     # Use two widgets so that setPixelSize() consistently affects dimensions
     # excluding positioner border in quirks and strict modes
     SimplePanel outer = SimplePanel()
     outer.addStyleName(CSS_DRAGDROP_POSITIONER)
     
     # place off screen for border calculation
     RootPanel.get().add(outer, -500, -500)
     
     # Ensure IE quirks mode returns valid outer.offsetHeight, and thus valid
     # DOMUtil.getVerticalBorders(outer)
     outer.setWidget(DUMMY_LABEL_IE_QUIRKS_MODE_OFFSET_HEIGHT)
     
     int width = 0
     int height = 0
     if dropTarget instanceof HorizontalPanel:
         for Iterator iterator = context.selectedWidgets.iterator(); iterator.hasNext();:
开发者ID:jaredly,项目名称:pyjamas,代码行数:19,代码来源:IndexedDropController.py

示例4: internalSetWidget

# 需要导入模块: from pyjamas.ui.RootPanel import RootPanel [as 别名]
# 或者: from pyjamas.ui.RootPanel.RootPanel import get [as 别名]
 def internalSetWidget(self, widget):
     # this.widget = widget;
     if widget == None or widget == RootPanel.get():
         self.widgetLeft = 0
         self.widgetTop = 0
     else:
         self.widgetLeft = widget.getAbsoluteLeft() - widget.getElement().getScrollLeft()
         self.widgetTop = widget.getAbsoluteTop() - widget.getElement().getScrollTop()
开发者ID:pombredanne,项目名称:pyjamas-dnd,代码行数:10,代码来源:WidgetLocation.py

示例5: internalSetReference

# 需要导入模块: from pyjamas.ui.RootPanel import RootPanel [as 别名]
# 或者: from pyjamas.ui.RootPanel.RootPanel import get [as 别名]
 def internalSetReference(self, reference):
     # this.reference = reference;
     if reference == None or reference == RootPanel.get():
         self.referenceAdjustLeft = 0
         self.referenceAdjustTop = 0
     else:
         self.referenceAdjustLeft = \
             reference.getAbsoluteLeft() + DOMUtil.getBorderLeft(reference.getElement())
         self.referenceAdjustTop = \
             reference.getAbsoluteTop() + DOMUtil.getBorderTop(reference.getElement())
开发者ID:pombredanne,项目名称:pyjamas-dnd,代码行数:12,代码来源:WidgetLocation.py


注:本文中的pyjamas.ui.RootPanel.RootPanel.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。