PageRenderTime 24ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/examples/mail/Shortcuts.py

http://pyjamas.googlecode.com/
Python | 24 lines | 19 code | 5 blank | 0 comment | 0 complexity | 023d1985edc7c0ef10ff26c7d949663c MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. from ui import Composite, StackPanel, Label
  2. from Tasks import Tasks
  3. from Mailboxes import Mailboxes
  4. from Contacts import Contacts
  5. class Shortcuts(Composite):
  6. def __init__(self):
  7. stackPanel = StackPanel()
  8. stackPanel.add(Mailboxes(), self.createHeaderHTML("mailgroup.gif", "Mail"), True)
  9. stackPanel.add(Tasks(), self.createHeaderHTML("tasksgroup.gif", "Tasks"), True)
  10. stackPanel.add(Contacts(), self.createHeaderHTML("contactsgroup.gif", "Contacts"), True)
  11. stackPanel.showStack(0)
  12. self.initWidget(stackPanel)
  13. def createHeaderHTML(self, imageUrl, caption):
  14. header = "<table align='left'><tr>" + "<td><img src='"
  15. header += "http://code.google.com/webtoolkit/documentation/examples/desktopclone/"
  16. header += imageUrl + "'></td>"
  17. header += "<td style='vertical-align:middle'><b style='white-space:nowrap'>"
  18. header += caption + "</b></td>" + "</tr></table>"
  19. return header