本文整理汇总了Python中pyjamas.ui.ScrollPanel.ScrollPanel类的典型用法代码示例。如果您正苦于以下问题:Python ScrollPanel类的具体用法?Python ScrollPanel怎么用?Python ScrollPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ScrollPanel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: panel
def panel ( ui ):
""" Creates a panel-based user interface for a specified UI object.
"""
# Bind the context values to the 'info' object:
ui.info.bind_context()
# Get the content that will be displayed in the user interface:
content = ui._groups
nr_groups = len(content)
if nr_groups == 0:
panel = None
if nr_groups == 1:
panel = _GroupPanel(content[0], ui).control
elif nr_groups > 1:
panel = TabPanel()
_fill_panel(panel, content, ui)
panel.ui = ui
# If the UI is scrollable then wrap the panel in a scroll area.
if ui.scrollable and panel is not None:
sp = ScrollPanel()
sp.add(panel)
panel = sp
return panel
开发者ID:rwl,项目名称:traitsbackendpyjamas,代码行数:26,代码来源:ui_panel.py
示例2: HTMLDialog
class HTMLDialog(DialogBox):
def __init__(self, name, html):
DialogBox.__init__(self)
self.setText(name)
closeButton = Button("Close", self)
htp = HTMLPanel(html)
self.sp = ScrollPanel(htp)
dock = DockPanel()
dock.setSpacing(4)
dock.add(closeButton, DockPanel.SOUTH)
dock.add(self.sp, DockPanel.CENTER)
dock.setCellHorizontalAlignment(closeButton, HasAlignment.ALIGN_RIGHT)
dock.setCellWidth(self.sp, "100%")
dock.setWidth("100%")
self.setWidget(dock)
def setWidth(self, width):
DialogBox.setWidth(self, "%dpx" % width)
self.sp.setWidth("%dpx" % (width-20))
def setHeight(self, height):
DialogBox.setHeight(self, "%dpx" % height)
self.sp.setHeight("%dpx" % (height-65))
def onClick(self, sender):
self.hide()
开发者ID:Afey,项目名称:pyjs,代码行数:31,代码来源:HTMLDialog.py
示例3: HorizontalCollapsePanel
class HorizontalCollapsePanel(FlowPanel):
def __init__(self, *args, **kwargs):
# set defaults
if not 'StyleName' in kwargs:
kwargs['StyleName'] = "rjw-HorizontalCollapsePanel"
FlowPanel.__init__(self, *args, **kwargs)
self._containers = [
ScrollPanel(StyleName = self.getStylePrimaryName() + '-left'),
ScrollPanel(StyleName = self.getStylePrimaryName() + '-right'),
]
self._collapse_widget = ScrollPanel(StyleName = self.getStylePrimaryName() + '-collapse')
collapse_button = ToggleButton(StyleName = self.getStylePrimaryName() + '-collapse-button')
collapse_button.addClickListener(self._sync_collapse)
self._collapse_widget.add(collapse_button)
FlowPanel.add(self, self._containers[0])
FlowPanel.add(self, self._collapse_widget)
FlowPanel.add(self, self._containers[1])
self._sync_collapse()
def _sync_collapse(self, w=None):
collapse_button = self._collapse_widget.getWidget(0)
if collapse_button.isDown():
self.addStyleName(self.getStylePrimaryName() + '-collapsed')
else:
self.removeStyleName(self.getStylePrimaryName() + '-collapsed')
def getWidget(self, index):
if index >= 0 and index < len(self._containers):
return self._containers[index].getWidget()
console.error('HorizontalCollapsePanel.getWidget passed invalid index: ' + str(index))
raise IndexError('Index out of range')
def setWidget(self, index, widget):
if index >= 0 and index < len(self._containers):
return self._containers[index].setWidget(widget)
console.error('HorizontalCollapsePanel.setWidget passed invalid index: ' + str(index))
raise IndexError('Index out of range')
# Adds a widget to a pane
def add(self, widget):
if self.getWidget(0) == None:
self.setWidget(0, widget)
elif self.getWidget(1) == None:
self.setWidget(1, widget)
else:
console.error("HorizontalCollapsePanel can only contain two child widgets.")
# Removes a child widget.
def remove(self, widget):
if self.getWidget(0) == widget:
self._containers[0].remove(widget)
elif self.getWidget(1) == widget:
self._containers[1].remove(widget)
else:
AbsolutePanel.remove(self, widget)
开发者ID:rjw57,项目名称:foldbeam,代码行数:59,代码来源:HorizontalCollapsePanel.py
示例4: __init__
def __init__(self,onClick):
ScrollPanel.__init__(self, Size=("630px", "500px"))
self.checkbox_list = []
self.hpanel_list = []
self.image_list = []
self.pok = VerticalPanel()
self.add(self.pok)
self.onclick=onClick
开发者ID:vizafogo123,项目名称:pokpok,代码行数:9,代码来源:FormulaListPanel.py
示例5: __init__
def __init__(self, panel):
ScrollPanel.__init__(self)
self.setHeight("100%")
self.setStyleName("SuperScrollPanelOuter")
self.inner = SimplePanel(Height="100%")
self.add(self.inner)
self.inner.setStyleName("SuperScrollPanelInner")
self.inner.add(panel)
开发者ID:Afey,项目名称:pyjs,代码行数:9,代码来源:scrollPanel.py
示例6: MailDetail
class MailDetail(Composite):
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", " ")
def setItem(self, item):
self.scroller.setScrollPosition(0)
self.scroller.setHorizontalScrollPosition(0)
self.subject.setHTML(item.subject)
self.sender.setHTML("<b>From:</b> " + item.sender)
self.recipient.setHTML("<b>To:</b> [email protected]")
self.body.setHTML(item.body)
def adjustSize(self, windowWidth, windowHeight):
scrollWidth = windowWidth - self.scroller.getAbsoluteLeft() - 9
if (scrollWidth < 1):
scrollWidth = 1
scrollHeight = windowHeight - self.scroller.getAbsoluteTop() - 9
if (scrollHeight < 1):
scrollHeight = 1
self.scroller.setSize("%dpx" % scrollWidth, "%dpx" % scrollHeight)
开发者ID:Afey,项目名称:pyjs,代码行数:56,代码来源:MailDetail.py
示例7: onModuleLoad
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)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:50,代码来源:InfoDirectory.py
示例8: __init__
def __init__(self):
HorizontalPanel.__init__(self, Spacing=4)
self.add(Label("Queued:", StyleName="section"))
s = ScrollPanel()
self.add(s)
v = VerticalPanel()
s.add(v)
self.queued = Grid(StyleName="users")
v.add(self.queued)
self.button = Button("Refresh", self, StyleName="refresh")
self.add(self.button)
self.err = Label()
self.add(self.err)
self.update()
开发者ID:jdunck,项目名称:Tickery,代码行数:14,代码来源:queued.py
示例9: AdinfoIFACE
class AdinfoIFACE(PanelIFACE):
def __init__(self, parent = None):
PanelIFACE.__init__(self, parent)
self.panel = ScrollPanel()
adinfo = HTML("", Size=("100%", parent.getHeight()))
self.panel.setSize("100%", parent.getHeight())
self.panel.add(adinfo)
self.adInfo = parent.adInfo = adinfo
Window.addWindowResizeListener(self)
return
def onTreeItemSelected(self, item):
pathdict = self.pathdict
filename = item.getText()
#check if already in
if filename in pathdict:
if pathdict[filename]["filetype"] == "fileEntry":
url = "adinfo?filename=%s" % self.pathdict[item.getText()]["path"]
HTTPRequest().asyncGet(url,
ADInfoLoader(self),
)
else:
self.adInfo.setHTML("""
<b style="font-size:200%%">%s</b>""" % pathdict[filename]["filetype"])
def scroll(self, where):
self.panel.setScrollPosition(where)
def onWindowResized(self, width, height):
self.panel.setSize("100%", self.parent.getHeight())
self.adInfo.setSize("100%", self.parent.getHeight())
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:34,代码来源:DataDictTree.py
示例10: __init__
def __init__(self, vertical=False, **kwargs):
# set defaults
if not 'StyleName' in kwargs:
if vertical: # vertical split panel
kwargs['StyleName'] = "gwt-VerticalSplitPanel"
else:
kwargs['StyleName'] = "gwt-HorizontalSplitPanel"
# splitter drag state vars
self._drag_start = None
self._pos = "50%"
# orientation
self._vertical = vertical
# now init the bases
AbsolutePanel.__init__(self, **kwargs)
MouseHandler.__init__(self)
# add our event support?
self.addListenedEvent("Resize")
# create the top/left widget container
self._container1 = ScrollPanel()
# create the bottom/right widget container
self._container2 = ScrollPanel()
# create the splitter
self._splitter = SplitPanelSplitter(self)
# add splitter handling
self._splitter.addMouseListener(self)
# add mouse event handling
self.addMouseListener(self)
# add the parts
AbsolutePanel.add(self, self._container1, 0, 0)
AbsolutePanel.add(self, self._splitter, 0, 0)
AbsolutePanel.add(self, self._container2, 0, 0)
# set the layout
if vertical: # vertical split panel
self._splitter.setStyleName("vsplitter")
self._splitter.setWidth("100%")
self._container1.setWidth("100%")
self._container2.setWidth("100%")
# set drag cursor
DOM.setStyleAttribute(self._splitter.getElement(),
"cursor", "n-resize")
else: # horizontal split panel
self._splitter.setStyleName("hsplitter")
self._splitter.setHeight("100%")
self._container1.setHeight("100%")
self._container2.setHeight("100%")
# set drag cursor
DOM.setStyleAttribute(self._splitter.getElement(),
"cursor", "e-resize")
开发者ID:,项目名称:,代码行数:49,代码来源:
示例11: __init__
def __init__(self):
SimplePanel.__init__(self)
panel = ScrollPanel(Size=("300px", "100px"))
contents = HTML("<b>Tao Te Ching, Chapter One</b><p>" +
"The Way that can be told of is not an unvarying " +
"way;<p>The names that can be named are not " +
"unvarying names.<p>It was from the Nameless that " +
"Heaven and Earth sprang;<p>The named is but the " +
"mother that rears the ten thousand creatures, " +
"each after its kind.")
panel.add(contents)
self.add(panel)
开发者ID:anandology,项目名称:pyjamas,代码行数:15,代码来源:scrollPanel.py
示例12: __init__
def __init__(self, after):
ScrollPanel.__init__(self, Size=("630px", "500px"))
self.after = after
self.pok = VerticalPanel()
self.add(self.pok)
self.images = list()
def onItemSelected():
item = self.list2.getItemText(self.list2.getSelectedIndex())
self.refresh_theorems(item)
self.list2 = ListBox()
self.list2.setVisibleItemCount(1)
for f in Theorem.get_all_folders():
self.list2.addItem(f)
self.pok.add(self.list2)
self.list2.addChangeListener(onItemSelected)
self.refresh_theorems(self.list2.getItemText(self.list2.getSelectedIndex()))
开发者ID:vizafogo123,项目名称:pokpok,代码行数:19,代码来源:TheoremPanel.py
示例13: SinkList
class SinkList(Composite):
def __init__(self):
Composite.__init__(self)
self.vp_list=VerticalPanel()
self.sinks=[]
self.selectedSink=-1
self.sp = ScrollPanel(self.vp_list)
self.sp.setWidth("14em")
self.initWidget(self.sp)
self.setStyleName("ks-List")
self.resize(Window.getClientWidth(), Window.getClientHeight())
def resize(self, width, height):
self.sp.setHeight("%dpx" % (height - 70))
def addSink(self, info):
name = info.getName()
link = Hyperlink(name, False, TargetHistoryToken=name)
link.setStyleName("ks-SinkItem")
self.vp_list.add(link)
self.sinks.append(info)
def find(self, sinkName):
for info in self.sinks:
if info.getName()==sinkName:
return info
return None
def setSinkSelection(self, name):
if self.selectedSink <> -1:
self.vp_list.getWidget(self.selectedSink).removeStyleName("ks-SinkItem-selected")
for i in range(len(self.sinks)):
info = self.sinks[i]
if (info.getName()==name):
self.selectedSink = i
widget=self.vp_list.getWidget(self.selectedSink)
widget.addStyleName("ks-SinkItem-selected")
return
开发者ID:Afey,项目名称:pyjs,代码行数:43,代码来源:SinkList.py
示例14: __init__
def __init__(self, parent = None):
PanelIFACE.__init__(self, parent)
self.panel = ScrollPanel()
adinfo = HTML("", Size=("100%", parent.getHeight()))
self.panel.setSize("100%", parent.getHeight())
self.panel.add(adinfo)
self.adInfo = parent.adInfo = adinfo
Window.addWindowResizeListener(self)
return
开发者ID:pyrrho314,项目名称:recipesystem,代码行数:11,代码来源:DataDictTree.py
示例15: __init__
def __init__(self):
self.artist =''
self.start_date = ''
self.end_date = ''
self.period_search =''
self.search_option = 1
#declare the general interface widgets
self.panel = DockPanel(StyleName = 'background')
self.ret_area = TextArea()
self.ret_area.setWidth("350px")
self.ret_area.setHeight("90px")
self.options = ListBox()
self.search_button = Button("Search", getattr(self, "get_result"), StyleName = 'button')
#set up the date search panel; it has different text boxes for
#to and from search dates
self.date_search_panel = VerticalPanel()
self.date_search_start = TextBox()
self.date_search_start.addInputListener(self)
self.date_search_end = TextBox()
self.date_search_end.addInputListener(self)
self.date_search_panel.add(HTML("Enter as month/day/year", True, StyleName = 'text'))
self.date_search_panel.add(HTML("From:", True, StyleName = 'text'))
self.date_search_panel.add(self.date_search_start)
self.date_search_panel.add(HTML("To:", True, StyleName = 'text'))
self.date_search_panel.add(self.date_search_end)
#set up the artist search panel
self.artist_search = TextBox()
self.artist_search.addInputListener(self)
self.artist_search_panel = VerticalPanel()
self.artist_search_panel.add(HTML("Enter artist's name:",True,
StyleName = 'text'))
self.artist_search_panel.add(self.artist_search)
#Put together the list timespan search options
self.period_search_panel = VerticalPanel()
self.period_search_panel.add(HTML("Select a seach period:",True,
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()
开发者ID:jiangl,项目名称:WQHS-Web-Crawler,代码行数:53,代码来源:Widget.py
示例16: onModuleLoad
def onModuleLoad(self):
# build image display
img = Image("babykatie_small.jpg", width="300px", height="300px")
img.element.setAttribute("usemap", "#themap")
img.element.setAttribute("ismap", "1")
imagepanel = ScrollPanel()
imagepanel.add(img)
# build message display
msgpanel = VerticalPanel()
msgpanel.add(Label("move mouse over baby katie's eyes, nose and mouth."))
msgarea1 = Label("movement messages")
msgpanel.add(msgarea1)
msgarea2 = Label("click messages")
msgpanel.add(msgarea2)
imageClickHandler = MapClickHandler(msgarea1, msgarea2)
# build imagemap
map = ImageMap("themap", width="300px", height="300px")
areas = [ \
NamedMapArea("right eye", "circle", "73, 97, 7"),
NamedMapArea("left eye", "circle", "116, 88, 5"),
NamedMapArea("nose", "rect", "88, 97, 115, 115", href="http://lkcl.net"),
NamedMapArea("mouth", "polygon", "82, 129, 102, 124, 119, 119, 121, 125, 103, 132, 79, 133"),
]
for nma in areas:
nma.addMouseListener(imageClickHandler)
nma.addClickListener(imageClickHandler)
map.add(nma)
# layout page
hpanel = HorizontalPanel()
hpanel.add(map)
hpanel.add(imagepanel)
hpanel.add(msgpanel)
RootPanel().add(hpanel)
开发者ID:certik,项目名称:pyjamas,代码行数:38,代码来源:MapAreaDemo.py
示例17: __init__
def __init__(self):
Composite.__init__(self)
self.vp_list=VerticalPanel()
self.sinks=[]
self.selectedSink=-1
self.sp = ScrollPanel(self.vp_list)
self.sp.setWidth("14em")
self.initWidget(self.sp)
self.setStyleName("ks-List")
self.resize(Window.getClientWidth(), Window.getClientHeight())
开发者ID:Afey,项目名称:pyjs,代码行数:14,代码来源:SinkList.py
示例18: loadChapters
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)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:47,代码来源:Bookreader.py
示例19: __init__
def __init__(self, name, html):
DialogBox.__init__(self)
self.setText(name)
closeButton = Button("Close", self)
htp = HTMLPanel(html)
self.sp = ScrollPanel(htp)
dock = DockPanel()
dock.setSpacing(4)
dock.add(closeButton, DockPanel.SOUTH)
dock.add(self.sp, DockPanel.CENTER)
dock.setCellHorizontalAlignment(closeButton, HasAlignment.ALIGN_RIGHT)
dock.setCellWidth(self.sp, "100%")
dock.setWidth("100%")
self.setWidget(dock)
开发者ID:Afey,项目名称:pyjs,代码行数:19,代码来源:HTMLDialog.py
示例20: __init__
def __init__(self, *args, **kwargs):
# set defaults
if not 'StyleName' in kwargs:
kwargs['StyleName'] = "rjw-HorizontalCollapsePanel"
FlowPanel.__init__(self, *args, **kwargs)
self._containers = [
ScrollPanel(StyleName = self.getStylePrimaryName() + '-left'),
ScrollPanel(StyleName = self.getStylePrimaryName() + '-right'),
]
self._collapse_widget = ScrollPanel(StyleName = self.getStylePrimaryName() + '-collapse')
collapse_button = ToggleButton(StyleName = self.getStylePrimaryName() + '-collapse-button')
collapse_button.addClickListener(self._sync_collapse)
self._collapse_widget.add(collapse_button)
FlowPanel.add(self, self._containers[0])
FlowPanel.add(self, self._collapse_widget)
FlowPanel.add(self, self._containers[1])
self._sync_collapse()
开发者ID:rjw57,项目名称:foldbeam,代码行数:21,代码来源:HorizontalCollapsePanel.py
注:本文中的pyjamas.ui.ScrollPanel.ScrollPanel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论