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


Python SimplePanel.setPixelSize方法代码示例

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


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

示例1: newPositioner

# 需要导入模块: from pyjamas.ui.SimplePanel import SimplePanel [as 别名]
# 或者: from pyjamas.ui.SimplePanel.SimplePanel import setPixelSize [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.SimplePanel import SimplePanel [as 别名]
# 或者: from pyjamas.ui.SimplePanel.SimplePanel import setPixelSize [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: SimplePanel

# 需要导入模块: from pyjamas.ui.SimplePanel import SimplePanel [as 别名]
# 或者: from pyjamas.ui.SimplePanel.SimplePanel import setPixelSize [as 别名]
        # 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();:
                Widget widget = (Widget) iterator.next()
                width += widget.getOffsetWidth()
                height = Math.max(height, widget.getOffsetHeight())
            
         else:
            for Iterator iterator = context.selectedWidgets.iterator(); iterator.hasNext();:
                Widget widget = (Widget) iterator.next()
                width = Math.max(width, widget.getOffsetWidth())
                height += widget.getOffsetHeight()
            
        
        
        SimplePanel inner = SimplePanel()
        inner.setPixelSize(width - DOMUtil.getHorizontalBorders(outer), height
        - DOMUtil.getVerticalBorders(outer))
        
        outer.setWidget(inner)
        
        return outer
    


开发者ID:jaredly,项目名称:pyjamas,代码行数:29,代码来源:IndexedDropController.py

示例4: newDragProxy

# 需要导入模块: from pyjamas.ui.SimplePanel import SimplePanel [as 别名]
# 或者: from pyjamas.ui.SimplePanel.SimplePanel import setPixelSize [as 别名]
 * Called by {@link PickupDragController#dragStart(Widget)} to allow subclasses to
 * provide their own drag proxies.
 *
 * @param context the current drag context
 * @return a drag proxy
 """
 def newDragProxy(self, context):
     AbsolutePanel container = AbsolutePanel()
     DOM.setStyleAttribute(container.getElement(), "overflow", "visible")
     
     WidgetArea draggableArea = WidgetArea(context.draggable, None)
     for Iterator iterator = context.selectedWidgets.iterator(); iterator.hasNext();:
         Widget widget = (Widget) iterator.next()
         WidgetArea widgetArea = WidgetArea(widget, None)
         Widget proxy = SimplePanel()
         proxy.setPixelSize(widget.getOffsetWidth(), widget.getOffsetHeight())
         proxy.addStyleName(PRIVATE_CSS_PROXY)
         container.add(proxy, widgetArea.getLeft() - draggableArea.getLeft(), widgetArea.getTop()
         - draggableArea.getTop())
     
     
     return container
 
 
 """*
 * Restore the selected widgets to their original location.
 * @see #saveSelectedWidgetsLocationAndStyle()
 * @see #restoreSelectedWidgetsStyle()
 """
 def restoreSelectedWidgetsLocation(self):
     for Iterator iterator = context.selectedWidgets.iterator(); iterator.hasNext();:
开发者ID:jaredly,项目名称:pyjamas,代码行数:33,代码来源:PickupDragController.py


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