本文整理汇总了Python中pyjamas.ui.DockPanel.DockPanel.setCellHeight方法的典型用法代码示例。如果您正苦于以下问题:Python DockPanel.setCellHeight方法的具体用法?Python DockPanel.setCellHeight怎么用?Python DockPanel.setCellHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.DockPanel.DockPanel
的用法示例。
在下文中一共展示了DockPanel.setCellHeight方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onModuleLoad
# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setCellHeight [as 别名]
def onModuleLoad(self):
dock = DockPanel(Width="100%")
self.header = HTML(Width="100%", Height="220px")
self.footer = HTML(Width="100%")
self.sidebar = HTML(Width="200px", Height="100%", StyleName="sidebar")
self.fTabs = DecoratedTabPanel(Size=("100%", "100%"), StyleName="tabs")
#dp = DecoratorTitledPanel("Tabs", "bluetitle", "bluetitleicon",
# ["bluetop", "bluetop2", "bluemiddle", "bluebottom"])
#dp.add(self.fTabs)
dock.add(self.header, DockPanel.NORTH)
dock.add(self.footer, DockPanel.SOUTH)
dock.add(self.sidebar, DockPanel.EAST)
dock.add(self.fTabs, DockPanel.CENTER)
dock.setCellVerticalAlignment(self.fTabs, HasAlignment.ALIGN_TOP)
#dock.setCellHorizontalAlignment(self.fTabs, HasAlignment.ALIGN_CENTER)
dock.setCellWidth(self.header, "100%")
dock.setCellHeight(self.header, "220px")
dock.setCellWidth(self.footer, "100%")
dock.setCellWidth(self.sidebar, "200px")
RootPanel().add(dock)
self.dock = dock
self.loadPageList()
Window.addWindowResizeListener(self)
DeferredCommand.add(self)
示例2: __init__
# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setCellHeight [as 别名]
def __init__(self):
SimplePanel.__init__(self)
panel = DockPanel(BorderWidth=1, Padding=8,
HorizontalAlignment=HasAlignment.ALIGN_CENTER,
VerticalAlignment=HasAlignment.ALIGN_MIDDLE)
north = Label("North")
west = Label("West")
center = Label("Center")
east = Label("East")
south = Label("South")
panel.add(north, DockPanel.NORTH)
panel.add(west, DockPanel.WEST)
panel.add(center, DockPanel.CENTER)
panel.add(east, DockPanel.EAST)
panel.add(south, DockPanel.SOUTH)
panel.setCellHeight(center, "200px")
panel.setCellWidth(center, "400px")
self.add(panel)
示例3: __init__
# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setCellHeight [as 别名]
def __init__(self):
Composite.__init__(self)
panel = VerticalPanel()
headerPanel = VerticalPanel()
self.subject = HTML()
self.sender = HTML()
self.recipient = HTML()
self.body = HTML()
self.scroller = ScrollPanel(self.body)
self.body.setWordWrap(True)
headerPanel.add(self.subject)
headerPanel.add(self.sender)
headerPanel.add(self.recipient)
headerPanel.setWidth("100%")
innerPanel = DockPanel()
innerPanel.add(headerPanel, DockPanel.NORTH)
innerPanel.add(self.scroller, DockPanel.CENTER)
innerPanel.setCellHeight(self.scroller, "100%")
panel.add(innerPanel)
innerPanel.setSize("100%", "100%")
self.scroller.setSize("100%", "100%")
self.initWidget(panel)
self.setStyleName("mail-Detail")
headerPanel.setStyleName("mail-DetailHeader")
innerPanel.setStyleName("mail-DetailInner")
self.subject.setStyleName("mail-DetailSubject")
self.sender.setStyleName("mail-DetailSender")
self.recipient.setStyleName("mail-DetailRecipient")
self.body.setStyleName("mail-DetailBody")
Logger("Mail detail", " ")
示例4: onHistoryChanged
# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setCellHeight [as 别名]
class Bookreader:
def onHistoryChanged(self, token):
info = self.sink_list.find(token)
if info:
self.show(info, False)
else:
self.showInfo()
def onModuleLoad(self):
section = Window.getLocation().getSearchVar("section")
if not section:
self.loadChapters()
else:
loadSection(section)
def loadChapters(self):
self.curInfo = ''
self.curSink = None
self.description = HTML()
self.sink_list = SinkList()
self.panel = DockPanel()
self.loadSinks()
self.sinkContainer = DockPanel()
self.sinkContainer.setStyleName("ks-Sink")
#self.nf = NamedFrame("section")
#self.nf.setWidth("100%")
#self.nf.setHeight("10000")
self.sp = ScrollPanel(self.sinkContainer)
#self.sp = VerticalSplitPanel()
self.sp.setWidth("100%")
self.sp.setHeight("100%")
#self.sp.setTopWidget(self.sinkContainer)
#self.sp.setBottomWidget(self.nf)
#self.sp.setSplitPosition(10000) # deliberately high - max out.
vp = VerticalPanel()
vp.setWidth("99%")
vp.setHeight("100%")
vp.add(self.description)
vp.add(self.sp)
authors = [
("2008, 2009", "Kenneth Casson Leighton", "[email protected]")
]
for years, name, email in authors:
authors_html = \
'© %s <a href="mailto:%s">%s</a><br />' %\
(years, email, name)
authors_panel = HTML()
authors_panel.setStyleName("ks-Authors")
authors_panel.setHTML(authors_html[:-6])
left_panel = DockPanel(Height="100%")
left_panel.add(self.sink_list, DockPanel.NORTH)
left_panel.add(authors_panel, DockPanel.SOUTH)
self.description.setStyleName("ks-Intro")
self.panel.add(left_panel, DockPanel.WEST)
self.panel.add(vp, DockPanel.CENTER)
self.panel.setCellVerticalAlignment(self.sink_list,
HasAlignment.ALIGN_TOP)
self.panel.setCellWidth(vp, "100%")
self.panel.setCellHeight(vp, "100%")
Window.addWindowResizeListener(self)
History.addHistoryListener(self)
RootPanel().add(self.panel)
self.onWindowResized(Window.getClientWidth(), Window.getClientHeight())
def onWindowResized(self, width, height):
self.panel.setWidth(width-20)
self.sink_list.resize(width-20, height-130)
self.sp.setHeight("%dpx" % (height-130))
def show(self, info, affectHistory):
if info == self.curInfo:
return
self.curInfo = info
#Logger.write("showing " + info.getName())
if self.curSink is not None:
self.curSink.onHide()
#Logger.write("removing " + self.curSink)
self.sinkContainer.remove(self.curSink)
self.curSink = info.getInstance()
self.sink_list.setSinkSelection(info.getName())
self.sink_list.sp.setScrollPosition(0)
self.sink_list.sp.setHorizontalScrollPosition(0)
self.description.setHTML(info.getDescription())
#.........这里部分代码省略.........
示例5: onHistoryChanged
# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setCellHeight [as 别名]
class KitchenSink:
filexml = None
def onHistoryChanged(self, token):
log.writebr("onHistoryChanged: %s" % token)
info = self.sink_list.find(token)
if info:
self.show(info, False)
else:
self.showInfo()
def onModuleLoad(self):
self.curInfo=''
self.curSink=None
self.description=HTML()
self.sink_list=SinkList()
self.panel=DockPanel()
self.loadSinks()
self.sinkContainer = DockPanel()
self.sinkContainer.setStyleName("ks-Sink")
vp=VerticalPanel()
vp.setWidth("100%")
vp.add(self.description)
vp.add(self.sinkContainer)
self.description.setStyleName("ks-Info")
self.panel.add(self.sink_list, DockPanel.WEST)
self.panel.add(vp, DockPanel.CENTER)
self.panel.setCellVerticalAlignment(self.sink_list, HasAlignment.ALIGN_TOP)
self.panel.setCellWidth(vp, "100%")
History.addHistoryListener(self)
RootPanel().add(self.panel)
RootPanel().add(Logger())
#Show the initial screen.
initToken = History.getToken()
if len(initToken):
self.onHistoryChanged(initToken)
else:
self.showInfo()
def getHeight(self):
return rccutil.getHeight()
def show(self, info, affectHistory):
if info == self.curInfo: return
self.curInfo = info
#Logger.write("showing " + info.getName())
if self.curSink <> None:
self.curSink.onHide()
#Logger.write("removing " + self.curSink)
self.sinkContainer.remove(self.curSink)
self.curSink = info.getInstance()
self.sink_list.setSinkSelection(info.getName())
self.description.setHTML(info.getDescription())
if (affectHistory):
History.newItem(info.getName())
self.sinkContainer.add(self.curSink, DockPanel.CENTER)
self.sinkContainer.setCellWidth(self.curSink, "100%")
self.sinkContainer.setCellHeight(self.curSink, "100%")
self.sinkContainer.setCellVerticalAlignment(self.curSink, HasAlignment.ALIGN_TOP)
self.curSink.onShow()
def loadSinks(self):
#self.sink_list.addSink(DataTree.init())
#self.sink_list.addSink(RecipeSystemIFACE.init())
self.sink_list.addSink(ADViewerIFACE.init())
self.sink_list.addSink(RecipeViewer.init())
self.sink_list.addSink(FITSStoreFACE.init())
self.sink_list.addSink(DisplayIFACE.init())
self.sink_list.addSink(Info.init())
if False:
self.sink_list.addSink(Buttons.init())
self.sink_list.addSink(Menus.init())
self.sink_list.addSink(Images.init())
self.sink_list.addSink(Layouts.init())
self.sink_list.addSink(Lists.init())
self.sink_list.addSink(Popups.init())
self.sink_list.addSink(Tables.init())
self.sink_list.addSink(Text.init())
if False: #preserving originaly order
self.sink_list.addSink(Frames.init())
self.sink_list.addSink(Tabs.init())
def showInfo(self):
self.show(self.sink_list.find("AstroData Viewer"), False)
示例6: onHistoryChanged
# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setCellHeight [as 别名]
class KitchenSink:
def onHistoryChanged(self, token):
log.debug("onHistoryChanged: %s", token)
info = self.sink_list.find(token)
if info is not None:
self.show(info, False)
else:
self.showInfo()
def onModuleLoad(self):
self.curInfo=''
self.curSink=None
self.description=HTML()
self.sink_list=SinkList()
self.panel=DockPanel()
self.loadSinks()
self.sinkContainer = DockPanel()
self.sinkContainer.setStyleName("ks-Sink")
vp=VerticalPanel()
vp.setWidth("100%")
vp.add(self.description)
vp.add(self.sinkContainer)
self.description.setStyleName("ks-Info")
self.panel.add(self.sink_list, DockPanel.WEST)
self.panel.add(vp, DockPanel.CENTER)
self.panel.setCellVerticalAlignment(self.sink_list, HasAlignment.ALIGN_TOP)
self.panel.setCellWidth(vp, "100%")
History.addHistoryListener(self)
RootPanel().add(self.panel)
RootPanel().add(Logger())
#Show the initial screen.
initToken = History.getToken()
if len(initToken):
self.onHistoryChanged(initToken)
else:
self.showInfo()
def show(self, info, affectHistory):
if info == self.curInfo: return
self.curInfo = info
#log.debug("showing " + info.getName())
if self.curSink is not None:
#log.debug("removing " + str(self.curSink))
self.curSink.onHide()
self.sinkContainer.remove(self.curSink)
self.curSink = info.getInstance()
self.sink_list.setSinkSelection(info.getName())
self.description.setHTML(info.getDescription())
if (affectHistory):
History.newItem(info.getName())
self.sinkContainer.add(self.curSink, DockPanel.CENTER)
self.sinkContainer.setCellWidth(self.curSink, "100%")
self.sinkContainer.setCellHeight(self.curSink, "100%")
self.sinkContainer.setCellVerticalAlignment(self.curSink, HasAlignment.ALIGN_TOP)
self.curSink.onShow()
def loadSinks(self):
self.sink_list.add(Info.init())
self.sink_list.add(Buttons.init())
self.sink_list.add(Menus.init())
self.sink_list.add(Images.init())
self.sink_list.add(Layouts.init())
self.sink_list.add(Lists.init())
self.sink_list.add(Popups.init())
self.sink_list.add(Tables.init())
self.sink_list.add(Text.init())
self.sink_list.add(Trees.init())
self.sink_list.add(Frames.init())
self.sink_list.add(Tabs.init())
def showInfo(self):
self.show(self.sink_list.find("Info"), False)
示例7: onHistoryChanged
# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setCellHeight [as 别名]
class Bookreader:
def onHistoryChanged(self, token):
info = self.sink_list.find(token)
if info:
self.show(info, False)
else:
self.showInfo()
def onModuleLoad(self):
section = Window.getLocation().getSearchVar("section")
if not section:
self.loadChapters()
else:
loadSection(section)
def loadChapters(self):
self.curInfo = ''
self.curSink = None
self.description = HTML()
self.sink_list = SinkList()
self.panel = DockPanel()
self.loadSinks()
self.sinkContainer = DockPanel()
self.sinkContainer.setStyleName("ks-Sink")
#self.nf = NamedFrame("section")
#self.nf.setWidth("100%")
#self.nf.setHeight("10000")
height = Window.getClientHeight()
self.sp = ScrollPanel(self.sinkContainer)
#self.sp = VerticalSplitPanel()
self.sp.setWidth("100%")
self.sp.setHeight("%dpx" % (height-110))
#self.sp.setTopWidget(self.sinkContainer)
#self.sp.setBottomWidget(self.nf)
#self.sp.setSplitPosition(10000) # deliberately high - max out.
vp = VerticalPanel()
vp.setWidth("100%")
vp.setHeight("100%")
vp.add(self.description)
vp.add(self.sp)
self.description.setStyleName("ks-Intro")
self.panel.add(self.sink_list, DockPanel.WEST)
self.panel.add(vp, DockPanel.CENTER)
self.panel.setCellVerticalAlignment(self.sink_list,
HasAlignment.ALIGN_TOP)
self.panel.setCellWidth(vp, "100%")
self.panel.setCellHeight(vp, "100%")
Window.addWindowResizeListener(self)
History.addHistoryListener(self)
RootPanel().add(self.panel)
def onWindowResized(self, width, height):
self.sink_list.resize(width, height)
self.sp.setHeight("%dpx" % (height-110))
def show(self, info, affectHistory):
if info == self.curInfo:
return
self.curInfo = info
#Logger.write("showing " + info.getName())
if self.curSink is not None:
self.curSink.onHide()
#Logger.write("removing " + self.curSink)
self.sinkContainer.remove(self.curSink)
self.curSink = info.getInstance()
self.sink_list.setSinkSelection(info.getName())
self.description.setHTML(info.getDescription())
if (affectHistory):
History().newItem(info.getName())
self.sinkContainer.add(self.curSink, DockPanel.CENTER)
self.sinkContainer.setCellWidth(self.curSink, "100%")
self.sinkContainer.setCellHeight(self.curSink, "100%")
self.sinkContainer.setCellVerticalAlignment(self.curSink,
HasAlignment.ALIGN_TOP)
self.curSink.onShow()
def loadSinks(self):
HTTPRequest().asyncGet("contents.txt", ChapterListLoader(self))
def setChapters(self, chapters):
for l in chapters:
name = l[0]
#.........这里部分代码省略.........
示例8: onHistoryChanged
# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setCellHeight [as 别名]
class AddonsGallery:
def onHistoryChanged(self, token):
info = self.sink_list.find(token)
if info:
self.show(info, False)
else:
self.showIntro()
def onModuleLoad(self):
self.curInfo=''
self.curSink=None
self.description=HTML()
self.sink_list=SinkList()
self.panel=DockPanel()
self.loadSinks()
self.sinkContainer = DockPanel()
self.sinkContainer.setStyleName("ks-Sink")
vp=VerticalPanel()
vp.setWidth("100%")
vp.add(self.description)
vp.add(self.sinkContainer)
self.description.setStyleName("ks-Info")
self.panel.add(self.sink_list, DockPanel.WEST)
self.panel.add(vp, DockPanel.CENTER)
self.panel.setCellVerticalAlignment(self.sink_list, HasAlignment.ALIGN_TOP)
self.panel.setCellWidth(vp, "100%")
History.addHistoryListener(self)
RootPanel().add(self.panel)
initToken = History.getToken()
if len(initToken):
self.onHistoryChanged(initToken)
else:
self.showIntro()
def show(self, info, affectHistory=None):
if info == self.curInfo: return
self.curInfo = info
if self.curSink <> None:
self.curSink.onHide()
self.sinkContainer.remove(self.curSink)
self.curSink = info.getInstance()
self.sink_list.setSinkSelection(info.getName())
self.description.setHTML(info.getDescription())
if (affectHistory):
History.newItem(info.getName())
self.sinkContainer.add(self.curSink, DockPanel.CENTER)
self.sinkContainer.setCellWidth(self.curSink, "100%")
self.sinkContainer.setCellHeight(self.curSink, "100%")
self.sinkContainer.setCellVerticalAlignment(self.curSink, HasAlignment.ALIGN_TOP)
self.curSink.onShow()
def loadSinks(self):
self.sink_list.add(IntroTab.init())
self.sink_list.add(TooltipTab.init())
self.sink_list.add(AutoCompleteTab.init())
self.sink_list.add(Canvas2DTab.init())
self.sink_list.add(CanvasTab.init())
def showIntro(self):
self.show(self.sink_list.find("Intro"))
示例9: __init__
# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setCellHeight [as 别名]
#.........这里部分代码省略.........
StyleName = 'text'))
self.period_search = ListBox()
self.period_search.setVisibleItemCount(1)
self.period_search.addItem("last week")
self.period_search.addItem("last month")
self.period_search.addItem("last year")
self.period_search.addItem("all time")
self.period_search_panel.add(self.period_search)
#add the listeners to the appropriate widgets
self.options.addChangeListener(self)
self.period_search.addChangeListener(self)
self.ret_area_scroll = ScrollPanel()
self.search_panel = HorizontalPanel()
self.options_panel = VerticalPanel()
# A change listener for the boxes
def onChange(self, sender):
#switch the list box options
if sender == self.options:
self.search_panel.remove(self.period_search_panel)
self.search_panel.remove(self.date_search_panel)
self.search_panel.remove(self.artist_search_panel)
index = self.options.getSelectedIndex()
if index == 0:
self.search_panel.add(self.artist_search_panel)
self.search_option = 1
elif index == 1:
self.search_panel.add(self.date_search_panel)
self.search_option = 2
elif index == 2:
self.search_panel.add(self.period_search_panel)
self.search_option = 3
elif sender == self.period_search:
index = self.period_search.getSelectedIndex()
if index == 0:
self.period_search = "last week"
elif index == 1:
self.period_search = "last month"
elif index == 2:
self.period_search = "last year"
elif index == 3:
self.period_search = "all time"
#A listener for the text boxes
def onInput(self, sender):
if sender == self.artist_search:
self.artist = sender.getText()
elif sender == self.date_search_end:
self.end_date = sender.getText()
elif sender == self.date_search_start:
self.start_date = sender.getText()
#A listener for the buttons that, when the button is clicked, looks up the results and outputs them
def get_result(self):
return_str = " "
if self.search_option == 1:
return_str = self.artist
elif self.search_option == 2:
return_str = self.start_date
elif self.search_option ==3:
return_str = self.period_search
else:
return_str = "Find the most played artist, album, or song for a time period, or the number of songs played by a certain artist"
self.ret_area.setText(return_str)
def onModuleLoad(self):
#Put together the list of options
self.options.addItem("Artist")
self.options.addItem("Date")
self.options.addItem("Time Span")
self.options.setVisibleItemCount(3)
#put the text area together
self.ret_area_scroll.add(self.ret_area)
self.ret_area.setText("Find the most played artist, album, or song for a time period, or the number of songs played by a certain artist")
#put the search items together
self.search_panel.add(self.artist_search_panel)
#Put together the options panel
self.options_panel.add(HTML("Search By:", True, StyleName = 'text'))
self.options_panel.add(self.options)
#Add everything to the main panel
self.panel.add(HTML("WQHS Song Search",True, StyleName = 'header'),
DockPanel.NORTH)
self.panel.add(self.options_panel, DockPanel.WEST)
self.panel.add(self.ret_area_scroll, DockPanel.SOUTH)
self.panel.setCellHeight(self.ret_area_scroll, "100px")
self.panel.setCellWidth(self.ret_area_scroll, "300px")
self.panel.add(self.search_button, DockPanel.EAST)
self.panel.add(self.search_panel, DockPanel.CENTER)
#Associate panel with the HTML host page
RootPanel().add(self.panel)
示例10: onHistoryChanged
# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setCellHeight [as 别名]
class MLAlgorithms:
def onHistoryChanged(self, token):
log.writebr("onHistoryChanged: %s" % token)
info = self.Algorithm_list.find(token)
if info is not None:
self.show(info, False)
else:
self.showInfo()
def onModuleLoad(self):
self.curInfo=''
self.curAlgorithm=None
self.description=HTML()
self.Algorithm_list=AlgorithmList()
self.panel=DockPanel()
self.loadAlgorithms()
self.AlgorithmContainer = DockPanel()
self.AlgorithmContainer.setStyleName("ks-Algorithm")
vp=VerticalPanel()
vp.setWidth("100%")
vp.add(self.description)
vp.add(self.AlgorithmContainer)
self.description.setStyleName("ks-Info")
self.panel.add(self.Algorithm_list, DockPanel.WEST)
self.panel.add(vp, DockPanel.CENTER)
self.panel.setCellVerticalAlignment(self.Algorithm_list, HasAlignment.ALIGN_TOP)
self.panel.setCellWidth(vp, "100%")
History.addHistoryListener(self)
RootPanel().add(self.panel)
RootPanel().add(Logger())
#Show the initial screen.
initToken = History.getToken()
if len(initToken):
self.onHistoryChanged(initToken)
else:
self.showInfo()
def show(self, info, affectHistory):
if info == self.curInfo: return
self.curInfo = info
log.writebr("showing " + info.getName())
if self.curAlgorithm is not None:
log.writebr("removing " + str(self.curAlgorithm))
self.curAlgorithm.onHide()
self.AlgorithmContainer.remove(self.curAlgorithm)
self.curAlgorithm = info.getInstance()
self.Algorithm_list.setAlgorithmSelection(info.getName())
self.description.setHTML(info.getDescription())
if (affectHistory):
History.newItem(info.getName())
self.AlgorithmContainer.add(self.curAlgorithm, DockPanel.CENTER)
self.AlgorithmContainer.setCellWidth(self.curAlgorithm, "100%")
self.AlgorithmContainer.setCellHeight(self.curAlgorithm, "100%")
self.AlgorithmContainer.setCellVerticalAlignment(self.curAlgorithm, HasAlignment.ALIGN_TOP)
self.curAlgorithm.onShow()
def loadAlgorithms(self):
self.Algorithm_list.addAlgorithm(Info.init())
self.Algorithm_list.addAlgorithm(kMeans.init())
def showInfo(self):
self.show(self.Algorithm_list.find("Info"), False)