本文整理汇总了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
示例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
示例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
示例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();: