本文整理汇总了Python中pyjamas.ui.TextArea.TextArea类的典型用法代码示例。如果您正苦于以下问题:Python TextArea类的具体用法?Python TextArea怎么用?Python TextArea使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TextArea类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: WritePanel
class WritePanel(AbsolutePanel):
def __init__(self, parent):
AbsolutePanel.__init__(self)
self.post_header = Label("Write a Post", StyleName="header_label")
self.post_write_title_label = Label("Title:")
self.post_title = TextBox()
self.post_content = TextArea()
self.post_button = Button("Post")
self.cancel_button = Button("Cancel")
self.error_message_label = Label("", StyleName="error_message_label")
contents = VerticalPanel(StyleName="Contents", Spacing=4)
contents.add(self.post_header)
contents.add(self.post_write_title_label)
contents.add(self.post_title)
contents.add(self.post_content)
contents.add(self.post_button)
contents.add(self.cancel_button)
contents.add(self.error_message_label)
self.dialog = DialogBox(glass=True)
self.dialog.setHTML('<b>Blog Post Form</b>')
self.dialog.setWidget(contents)
left = (Window.getClientWidth() - 900) / 2 + Window.getScrollLeft()
top = (Window.getClientHeight() - 600) / 2 + Window.getScrollTop()
self.dialog.setPopupPosition(left, top)
self.dialog.hide()
def clear_write_panel(self):
self.post_title.setText("")
self.post_content.setText("")
self.error_message_label.setText("")
开发者ID:Afey,项目名称:pyjs,代码行数:31,代码来源:components.py
示例2: EditPanel
class EditPanel(AbsolutePanel):
def __init__(self, key, title, content):
AbsolutePanel.__init__(self)
self.edit_header = Label("Edit a Post", StyleName="header_label")
self.edit_title_label = Label("Title:")
self.edit_title = TextBox()
self.edit_title.setMaxLength(255)
self.edit_content = TextArea()
self.edit_content.setVisibleLines(2)
self.edit_button = Button("Save")
self.edit_cancel_button = Button("Cancel")
self.edit_hidden_key = Hidden()
self.error_message_label = Label("", StyleName="error_message_label")
edit_contents = VerticalPanel(StyleName="Contents", Spacing=4)
edit_contents.add(self.edit_header)
edit_contents.add(self.edit_title_label)
edit_contents.add(self.edit_title)
edit_contents.add(self.edit_content)
edit_contents.add(self.edit_button)
edit_contents.add(self.edit_cancel_button)
edit_contents.add(self.error_message_label)
edit_contents.add(self.edit_hidden_key)
self.edit_dialog = DialogBox(glass=True)
self.edit_dialog.setHTML('<b>Blog Post Form</b>')
self.edit_dialog.setWidget(edit_contents)
left = (Window.getClientWidth() - 900) / 2 + Window.getScrollLeft()
top = (Window.getClientHeight() - 600) / 2 + Window.getScrollTop()
self.edit_dialog.setPopupPosition(left, top)
self.edit_dialog.hide()
def clear_edit_panel(self):
self.edit_title.setText("")
self.edit_content.setText("")
self.error_message_label.setText("")
开发者ID:Afey,项目名称:pyjs,代码行数:35,代码来源:components.py
示例3: __init__
def __init__(self):
SimplePanel.__init__(self)
field = TextArea()
field.setCharacterWidth(20)
field.setVisibleLines(4)
self.add(field)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:7,代码来源:textArea.py
示例4: __init__
def __init__(self, panel, text ='', left=0, top=0, width=0 , height=0,
color = None, background = None, click = None, focus = None):
TextArea.__init__(self)#, text=text)
self.panel = panel
attrs = dict (position = 'absolute', left=dpx(left), top=dpx(top) ,
width=dpx(width) , height=dpx(height),
color = color, background = background)
for key in attrs:
if not attrs[key]: del(attrs[key])
#self.setName(source)
self.setText(text)
self.setStyleAttribute(attrs)
#self.setStyleAttribute({'position':'absolute',
# 'top':'175px','left':'158px'
# ,'color':COLOR['maroon']
# ,'background':COLOR['peachpuff']
# ,'background-color':COLOR['peachpuff']})
#self.setSize(width,height)
#self.setReadonly('readonly')
if click :
self.addClickListener(click)
if focus :
self.addFocusListener(focus)
self.panel.add(self)
开发者ID:labase,项目名称:jeppeto,代码行数:25,代码来源:pyjamas_factory.py
示例5: __init__
def __init__(self):
Sink.__init__(self)
self.fPasswordText = PasswordTextBox()
self.fTextArea = TextArea()
self.fTextBox = TextBox()
panel = VerticalPanel()
panel.setSpacing(8)
panel.add(HTML("Normal text box:"))
panel.add(self.createTextThing(self.fTextBox))
panel.add(HTML("Password text box:"))
panel.add(self.createTextThing(self.fPasswordText))
panel.add(HTML("Text area:"))
panel.add(self.createTextThing(self.fTextArea))
panel.add(HTML("""Textarea below demos oninput event. oninput allows
to detect when the content of an element has changed. This is different
from examples above, where changes are detected only if they are made with
keyboard. oninput occurs when the content is changed through any user
interface(keyboard, mouse, etc.). For example, at first type few chars, but
then paste some text to the text areas above and below by selecting 'Paste'
command from context menu or by dragging&dropping and see the difference.
oninput is similar to onchange event, but onchange event fires only when a
text-entry widget loses focus."""))
vp = VerticalPanel()
self.echo = HTML()
textArea = TextArea()
vp.add(textArea)
vp.add(self.echo)
textArea.addInputListener(self)
panel.add(vp)
self.initWidget(panel)
开发者ID:Afey,项目名称:pyjs,代码行数:33,代码来源:Text.py
示例6: __init__
def __init__(self, worksheet, cell_id, **kwargs):
TextArea.__init__(self, **kwargs)
self._worksheet = worksheet
self._cell_id = cell_id
self.addKeyboardListener(self)
#self.addClickListener(self)
self.addFocusListener(self)
self.set_rows(1)
self.setCharacterWidth(80)
开发者ID:certik,项目名称:sympy_gamma,代码行数:9,代码来源:nb.py
示例7: Email
class Email(Composite):
def __init__(self, **kwargs):
element = None
if kwargs.has_key('Element'):
element = kwargs.pop('Element')
panel = VerticalPanel(Element=element)
Composite.__init__(self, panel, **kwargs)
self.TEXT_WAITING = "Please wait..."
self.TEXT_ERROR = "Server Error"
self.remote_py = EchoServicePython()
self.status=Label()
self.subject = TextBox()
self.subject.setVisibleLength(60)
self.sender = TextBox()
self.sender.setVisibleLength(40)
self.message = TextArea()
self.message.setCharacterWidth(60)
self.message.setVisibleLines(15)
self.button_py = Button("Send", self)
buttons = HorizontalPanel()
buttons.add(self.button_py)
buttons.setSpacing(8)
panel.add(HTML("Subject:"))
panel.add(self.subject)
panel.add(HTML("From:"))
panel.add(self.sender)
panel.add(HTML("Your Message - please keep it to under 1,000 characters"))
panel.add(self.message)
panel.add(buttons)
panel.add(self.status)
def onClick(self, sender):
self.status.setText(self.TEXT_WAITING)
text = self.message.getText()
msg_sender = self.sender.getText()
msg_subject = self.subject.getText()
# demonstrate proxy & callMethod()
if sender == self.button_py:
id = self.remote_py.send(msg_sender, msg_subject, text, self)
if id<0:
self.status.setText(self.TEXT_ERROR)
def onRemoteResponse(self, response, request_info):
self.status.setText(response)
def onRemoteError(self, code, message, request_info):
self.status.setText("Server Error or Invalid Response: ERROR " + \
str(code) + " - " + str(message))
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:57,代码来源:Email.py
示例8: __init__
def __init__(self):
VerticalPanel.__init__(self)
self.setSpacing("10px")
field = TextArea()
field.setCharacterWidth(20)
field.setVisibleLines(4)
self.add(field)
self.add(AutoTextArea(self))
开发者ID:Afey,项目名称:pyjs,代码行数:10,代码来源:textArea.py
示例9: init
def init(self, parent):
""" Finishes initializing the editor by creating the underlying toolkit
widget.
"""
if (self.item.resizable is True) or (self.item.height != -1.0):
control = TextArea()
else:
control = TextBox()
control.setEnabled(False)
# control.setStyleName( element = "color", style = WindowColor )
self.control = control
self.set_tooltip()
开发者ID:rwl,项目名称:traitsbackendpyjamas,代码行数:14,代码来源:editor_factory.py
示例10: onModuleLoad
def onModuleLoad(self):
self.TEXT_WAITING = "Waiting for response..."
self.TEXT_ERROR = "Server Error"
self.METHOD_ECHO = "Echo"
self.METHOD_REVERSE = "Reverse"
self.METHOD_UPPERCASE = "UPPERCASE"
self.METHOD_LOWERCASE = "lowercase"
self.methods = [self.METHOD_ECHO, self.METHOD_REVERSE, self.METHOD_UPPERCASE, self.METHOD_LOWERCASE]
self.remote_php = EchoServicePHP()
self.remote_py = EchoServicePython()
self.status=Label()
self.text_area = TextArea()
self.text_area.setText("""{'Test'} [\"String\"]
\tTest Tab
Test Newline\n
after newline
""" + r"""Literal String:
{'Test'} [\"String\"]
""")
self.text_area.setCharacterWidth(80)
self.text_area.setVisibleLines(8)
self.method_list = ListBox()
self.method_list.setName("hello")
self.method_list.setVisibleItemCount(1)
for method in self.methods:
self.method_list.addItem(method)
self.method_list.setSelectedIndex(0)
method_panel = HorizontalPanel()
method_panel.add(HTML("Remote string method to call: "))
method_panel.add(self.method_list)
method_panel.setSpacing(8)
self.button_php = Button("Send to PHP Service", self)
self.button_py = Button("Send to Python Service", self)
buttons = HorizontalPanel()
buttons.add(self.button_php)
buttons.add(self.button_py)
buttons.setSpacing(8)
info = """<h2>JSON-RPC Example</h2>
<p>This example demonstrates the calling of server services with
<a href="http://json-rpc.org/">JSON-RPC</a>.
</p>
<p>Enter some text below, and press a button to send the text
to an Echo service on your server. An echo service simply sends the exact same text back that it receives.
</p>"""
panel = VerticalPanel()
panel.add(HTML(info))
panel.add(self.text_area)
panel.add(method_panel)
panel.add(buttons)
panel.add(self.status)
RootPanel().add(panel)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:60,代码来源:JSONRPCExample.py
示例11: BulkDirectAdd
class BulkDirectAdd(HorizontalPanel):
def __init__(self):
HorizontalPanel.__init__(self, Spacing=4)
self.add(Label('Directly add in bulk:', StyleName='section'))
self.names = TextArea(VisibleLines=5)
self.add(self.names)
self.update = Button('Add', self)
self.add(self.update)
self.err = HTML()
self.add(self.err)
def onClick(self, sender):
self.err.setHTML('')
names = self.names.getText().strip()
if names == '':
return
else:
self.update.setEnabled(False)
remote = server.AdminService()
id = remote.bulkAddUsers(names, self)
if id < 0:
self.err.setText('oops: could not add')
def onRemoteResponse(self, result, request_info):
self.update.setEnabled(True)
self.err.setText('OK, adding.')
def onRemoteError(self, code, message, request_info):
self.update.setEnabled(True)
self.err.setHTML('Errors:<br/>' +
'<br/>'.join(message['data']['message']))
开发者ID:jdunck,项目名称:Tickery,代码行数:31,代码来源:directadd.py
示例12: onClick
def onClick(self, sender):
global statusbar,boxes
statusbar.setText('Button pressed')
pass
if sender == self.buttonupdate:
self.commobj = AMS.AMS_Comm()
statusbar.setText('Updating data: Press Display list button to refesh')
if sender == self.button:
if AMS.sent > AMS.recv:
statusbar.setText('Press button again: sent '+str(AMS.sent)+' recv '+str(AMS.recv))
if self.commobj.commname == 'No AMS publisher running' or not self.commobj.commname or self.commobj.comm == -1:
if self.textarea: self.panel.remove(self.textarea)
pass
else:
statusbar.setText('Memories for AMS Comm: '+self.commobj.commname)
result = self.commobj.get_memory_list()
if self.textarea: self.panel.remove(self.textarea)
self.textarea = TextArea()
memory = self.commobj.memory_attach("Stack")
size = memory.get_field_info("current size")
functions = memory.get_field_info("functions")
funcs = '\n'.join(functions[4])
self.textarea.setText(str(funcs))
self.textarea.setVisibleLines(size[4])
self.panel.add(self.textarea)
开发者ID:00liujj,项目名称:petsc,代码行数:25,代码来源:AMSSnoopStack.py
示例13: onModuleLoad
def onModuleLoad(self):
try:
setCookie(COOKIE_NAME, "setme", 100000)
except:
pass
self.status = Label()
self.text_area = TextArea()
self.text_area.setText(r"Me eat cookie!")
self.text_area.setCharacterWidth(80)
self.text_area.setVisibleLines(8)
self.button_py_set = Button("Set Cookie", self)
self.button_py_read = Button("Read Cookie ", self)
buttons = HorizontalPanel()
buttons.add(self.button_py_set)
buttons.add(self.button_py_read)
buttons.setSpacing(8)
info = r"This demonstrates setting and reading information using cookies."
panel = VerticalPanel()
panel.add(HTML(info))
panel.add(self.text_area)
panel.add(buttons)
panel.add(self.status)
RootPanel().add(panel)
开发者ID:janjaapbos,项目名称:pyjs,代码行数:26,代码来源:cookiemonster.py
示例14: __init__
def __init__(self, app):
self.app = app
DialogWindow.__init__(
self, modal=False,
minimize=True, maximize=True, close=True,
)
self.closeButton = Button("Close", self)
self.saveButton = Button("Save", self)
self.setText("Sample DialogWindow with embedded image")
self.msg = HTML("", True)
global _editor_id
_editor_id += 1
editor_id = "editor%d" % _editor_id
#self.ht = HTML("", ID=editor_id)
self.txt = TextArea(Text="", VisibleLines=30, CharacterWidth=80,
ID=editor_id)
dock = DockPanel()
dock.setSpacing(4)
hp = HorizontalPanel(Spacing="5")
hp.add(self.saveButton)
hp.add(self.closeButton)
dock.add(hp, DockPanel.SOUTH)
dock.add(self.msg, DockPanel.NORTH)
dock.add(self.txt, DockPanel.CENTER)
dock.setCellHorizontalAlignment(hp, HasAlignment.ALIGN_RIGHT)
dock.setCellWidth(self.txt, "100%")
dock.setWidth("100%")
self.setWidget(dock)
self.editor_id = editor_id
self.editor_created = False
开发者ID:brodybits,项目名称:pyjs,代码行数:35,代码来源:TinyMCEditor.py
示例15: onModuleLoad
class AMSSnoopStack:
def onModuleLoad(self):
global statusbar
statusbar = Label()
self.button = Button("Display Current Stack Frames", self)
self.buttonupdate = Button("Update data from AMS publisher", self)
buttons = HorizontalPanel()
buttons.add(self.button)
buttons.add(self.buttonupdate)
buttons.setSpacing(8)
info = """<p>This example demonstrates the calling of the Memory Snooper in PETSc with Pyjamas and <a href="http://json-rpc.org/">JSON-RPC</a>.</p>"""
self.panel = VerticalPanel()
self.panel.add(HTML(info))
self.panel.add(buttons)
self.panel.add(statusbar)
RootPanel().add(self.panel)
self.commobj = AMS.AMS_Comm()
self.textarea = None
def onClick(self, sender):
global statusbar,boxes
statusbar.setText('Button pressed')
pass
if sender == self.buttonupdate:
self.commobj = AMS.AMS_Comm()
statusbar.setText('Updating data: Press Display list button to refesh')
if sender == self.button:
if AMS.sent > AMS.recv:
statusbar.setText('Press button again: sent '+str(AMS.sent)+' recv '+str(AMS.recv))
if self.commobj.commname == 'No AMS publisher running' or not self.commobj.commname or self.commobj.comm == -1:
if self.textarea: self.panel.remove(self.textarea)
pass
else:
statusbar.setText('Memories for AMS Comm: '+self.commobj.commname)
result = self.commobj.get_memory_list()
if self.textarea: self.panel.remove(self.textarea)
self.textarea = TextArea()
memory = self.commobj.memory_attach("Stack")
size = memory.get_field_info("current size")
functions = memory.get_field_info("functions")
funcs = '\n'.join(functions[4])
self.textarea.setText(str(funcs))
self.textarea.setVisibleLines(size[4])
self.panel.add(self.textarea)
开发者ID:00liujj,项目名称:petsc,代码行数:47,代码来源:AMSSnoopStack.py
示例16: __init__
def __init__(self,app):
self.app=app
self.form = FormPanel()
self.form.setEncoding("multipart/form-data")
self.form.setMethod("post")
self.msg = HTML("<b>Uploading</b>")
self.table = FlexTable()
self.table.setText(0,0, "Problem")
self.table.setText(1,0, "Language")
self.table.setText(2,0, "Program File")
self.table.setText(3,0, "Program source")
self.problem = ListBox()
self.problem.insertItem("Detect",-1,-1)
self.problem.setName("problem")
self.table.setWidget(0,1,self.problem)
self.lang = ListBox()
self.lang.insertItem("Detect","",-1)
self.lang.insertItem("C/C++","cc",-1)
self.lang.insertItem("Java","Java",-1)
self.lang.insertItem("Python","Python",-1)
self.lang.setName("lang")
self.table.setWidget(1,1,self.lang)
self.cookie = Hidden()
self.cookie.setName("cookie")
self.table.setWidget(5,0,self.cookie)
self.file = FileUpload()
self.file.setName("file");
self.table.setWidget(2,1,self.file)
self.source = TextArea()
self.source.setName("source")
self.source.setWidth("600");
self.source.setHeight("400");
self.source.setText("""//$$problem: 1$$
//$$language: cc$$
#include <unistd.h>
#include <stdio.h>
int main() {
int a,b;
scanf("%d %d",&a,&b);
printf("%d\\n",a+b);
return 0;
}""")
self.source.addChangeListener(self.onChange)
self.table.setWidget(3,1,self.source)
self.button = Button("Submit",self)
self.table.setWidget(4,1, self.button)
self.table.setWidget(5,1, self.msg)
self.msg.setVisible(False)
self.form.setWidget(self.table)
self.form.setAction("../upload.py/submit")
self.form.addFormHandler(self)
开发者ID:antialize,项目名称:djudge,代码行数:58,代码来源:main.py
示例17: __init__
def __init__(self):
HorizontalPanel.__init__(self, Spacing=4)
self.add(Label('Directly add in bulk:', StyleName='section'))
self.names = TextArea(VisibleLines=5)
self.add(self.names)
self.update = Button('Add', self)
self.add(self.update)
self.err = HTML()
self.add(self.err)
开发者ID:jdunck,项目名称:Tickery,代码行数:9,代码来源:directadd.py
示例18: htmlElements
def htmlElements(self, addList = None):
if not self._htmlElements:
h = HTML("<h1>Hello from %s</h1>" % location.getHref(), StyleName='font-s07em')
p = HorizontalPanel(HTML('Valid/tested combinations'))
grid = Grid(2,2)
grid.setHTML(0, 0, "app")
grid.setHTML(0, 1, "themes")
grid.setHTML(1, 0, "a")
grid.setHTML(1, 1, "0 - 1 - ff0000 - cms - pypress - wordpress")
t = TextArea()
t.addChangeListener(Index.onTextAreaChange)
self._htmlElements = [['h', h], ['p', p], ['grid', grid], ['t', t]]
for i in range(len(self._htmlElements)):
RootPanel().add(self._htmlElements[i][1])
if addList:
self._htmlElements+=addList
for i in range(len(self._htmlElements)):
RootPanel().add(addList[i][1])
return self._htmlElements
开发者ID:molhokwai,项目名称:a,代码行数:20,代码来源:Index0.py
示例19: __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
示例20: __init__
def __init__(self):
self.remote = DataService()
self.title = Label()
self.h = WikiBox()
self.t = TextArea()
self.t.addKeyboardListener(self)
self.t.addChangeListener(self)
RootPanel().add(self.title)
RootPanel().add(self.h)
RootPanel().add(self.t)
History.addHistoryListener(self)
self.name = None
initToken = History.getToken()
if not (initToken and len(initToken)):
initToken = 'welcomepage'
self.onHistoryChanged(initToken)
开发者ID:brodybits,项目名称:pyjs,代码行数:17,代码来源:Wiki.py
注:本文中的pyjamas.ui.TextArea.TextArea类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论