You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
1.2 KiB

  1. Tabbed Page
  2. ===========
  3. The TabbedPage class defines a simple tabbing system
  4. TabbedPage Class
  5. ----------------
  6. .. class:: TabbedPage(parent, only_labels)
  7. create a new TabbedPage in `parent`. If `only_labels` is set, do not create the page bodies only create
  8. labels
  9. .. attribute:: tabs
  10. A dictionary containing the tab labels. the key is the label name
  11. .. attribute:: cur_tab
  12. A reference to the current tab
  13. .. method:: add_tab(n, onshow)
  14. Will create a new Tab with label n. Call `onshow` when the tab is displayed. The tab has an
  15. element `tab_body` that is the Element in which the content of the tab is added.
  16. The tab can be accessed by `tabs` dictionary
  17. .. method:: disable_tab(n)
  18. Disable tab with label n
  19. .. method:: enable_tab(n)
  20. Enable tab with label n
  21. Example
  22. -------
  23. Example using TabbedPage::
  24. var mytabs = new TabbedPage(parent);
  25. mytabs.add_tab('Tab 1', function() { refresh_list1(); })
  26. mytabs.add_tab('Tab 2', function() { refresh_list1(); })
  27. mytabs.add_tab('Tab 3', function() { refresh_list1(); })
  28. // add pages
  29. mytabs.tabs['Tab 1'].tab_body.innerHTML = "Some content in Tab 1"