本文整理汇总了Python中pyjamas.ui.VerticalPanel.VerticalPanel.setPadding方法的典型用法代码示例。如果您正苦于以下问题:Python VerticalPanel.setPadding方法的具体用法?Python VerticalPanel.setPadding怎么用?Python VerticalPanel.setPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.VerticalPanel.VerticalPanel
的用法示例。
在下文中一共展示了VerticalPanel.setPadding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Calendar
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setPadding [as 别名]
#.........这里部分代码省略.........
# check to see if we have drawn the full widget before
if self.defaultGrid is None:
self.drawFull(month, year)
else:
# ok means we are re-drawing, but first check if it is the same
# as the defaultGrid, if yes, just use it
if not hasChangeMonth and month == self.todayMonth and \
year == self.todayYear:
self.middlePanel.setWidget(self.defaultGrid)
self.currentMonth = self.todayMonth
self.currentYear = self.todayYear
else:
# we have to redraw the grid -- bah
g = self.drawGrid(month, year)
if hasChangeMonth:
# reset the default grid as we have changed months
self.defaultGrid = grid
#
# what about the title panel?
#
txt = "<b>"
txt += self.getMonthsOfYear()[month-1] + " " + str(year)
txt += "</b>"
self.titlePanel.setWidget(HTML(txt))
self.setVisible(True)
def drawFull(self, month, year):
# should be called only once when we draw the calendar for
# the first time
self.vp = VerticalPanel()
self.vp.setSpacing(0)
self.vp.setPadding(0)
self.vp.addStyleName("calendarbox calendar-module calendar")
self.setWidget(self.vp)
self.setVisible(False)
#
mth = int(month)
yr = int(year)
tp = HorizontalPanel(Width="100%")
tp.addStyleName("calendar-top-panel")
tp.setSpacing(0)
tp.setPadding(0)
self.h1 = None
self.h2 = None
self.h4 = None
self.h5 = None
if self.backyear:
self.h1 = self.bkls(self.backyear, StyleName="calendar-arrows")
self.h1.addClickListener(getattr(self, 'onPreviousYear'))
tp.add(self.h1)
tp.setCellHorizontalAlignment(self.h1, "left")
if self.backmonth:
self.h2 = self.bkls(self.backmonth, StyleName="calendar-arrows")
self.h2.addClickListener(getattr(self, 'onPreviousMonth'))
tp.add(self.h2)
tp.setCellHorizontalAlignment(self.h2, "left")
# titlePanel can be changed, whenever we draw, so keep the reference
txt = "<b>"
txt += self.getMonthsOfYear()[mth-1] + " " + str(yr)
txt += "</b>"
self.titlePanel = SimplePanel()