本文整理汇总了Python中pyjamas.ui.HorizontalPanel.HorizontalPanel.setSize方法的典型用法代码示例。如果您正苦于以下问题:Python HorizontalPanel.setSize方法的具体用法?Python HorizontalPanel.setSize怎么用?Python HorizontalPanel.setSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.HorizontalPanel.HorizontalPanel
的用法示例。
在下文中一共展示了HorizontalPanel.setSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onModuleLoad
# 需要导入模块: from pyjamas.ui.HorizontalPanel import HorizontalPanel [as 别名]
# 或者: from pyjamas.ui.HorizontalPanel.HorizontalPanel import setSize [as 别名]
class InfoDirectory:
def onModuleLoad(self):
self.remote = InfoServicePython()
self.tree_width = 200
self.tp = HorizontalPanel()
self.tp.setWidth("%dpx" % (self.tree_width))
self.treeview = Trees()
self.treeview.fTree.addTreeListener(self)
self.sp = ScrollPanel()
self.tp.add(self.treeview)
self.sp.add(self.tp)
self.sp.setHeight("100%")
self.horzpanel1 = HorizontalPanel()
self.horzpanel1.setSize("100%", "100%")
self.horzpanel1.setBorderWidth(1)
self.horzpanel1.setSpacing("10px")
self.rp = RightPanel()
self.rps = ScrollPanel()
self.rps.add(self.rp)
self.rps.setWidth("100%")
self.rp.setWidth("100%")
self.cp1 = CollapserPanel(self)
self.cp1.setWidget(self.sp)
self.cp1.setHTML(" ")
self.midpanel = MidPanel(self)
self.cp2 = CollapserPanel(self)
self.cp2.setWidget(self.midpanel)
self.cp2.setHTML(" ")
self.horzpanel1.add(self.cp1)
self.horzpanel1.add(self.cp2)
self.horzpanel1.add(self.rps)
self.cp1.setInitialWidth("%dpx" % self.tree_width)
self.cp2.setInitialWidth("200px")
RootPanel().add(self.horzpanel1)
width = Window.getClientWidth()
height = Window.getClientHeight()
self.onWindowResized(width, height)
Window.addWindowResizeListener(self)
def setCollapserWidth(self, widget, width):
self.horzpanel1.setCellWidth(widget, width)
def onWindowResized(self, width, height):
#self.hp.setWidth("%dpx" % (width - self.tree_width))
#self.hp.setHeight("%dpx" % (height - 20))
self.cp1.setHeight("%dpx" % (height - 30))
self.cp2.setHeight("%dpx" % (height - 30))
self.rps.setHeight("%dpx" % (height - 30))
self.horzpanel1.setHeight("%dpx" % (height - 20))
def onTreeItemStateChanged(self, item):
if item.isSelected():
self.onTreeItemSelected(item)
def onTreeItemSelected(self, item):
obj = item.getUserObject()
if len(obj.children) != 0:
self.clear_mid_panel()
return
self.remote.get_midpanel_data(obj.root + "/" + obj.text, self)
self.cp2.setHTML(obj.text)
self.clear_right_panel()
def clear_right_panel(self):
self.horzpanel1.remove(2)
self.horzpanel1.insert(HTML(""), 2)
self.rp.setTitle(" ")
def clear_mid_panel(self):
self.clear_right_panel()
#self.horzpanel2.setLeftWidget(HTML(""))
def set_mid_panel(self, response):
self.midpanel.set_items(response)
self.cp2.setWidget(self.midpanel)
def select_right_grid(self, location, name):
self.horzpanel1.remove(2)
self.horzpanel1.insert(self.rps, 2)
self.rp.setTitle(name)
self.remote.get_rightpanel_datanames(location, self)
#.........这里部分代码省略.........