5 * \defgroup TabUtils Utility functions for creating tabbed dialogs
11 * \brief print tabbed dialog
12 * \param num_tabs how many tabs do we have?
13 * \param tabnames the headers of the tables
15 void tabbed_dialog(int num_tabs, char *tabnames[]) {
18 wprintf("<script type=\"text/javascript\"> "
19 "var previously_selected_tab = '0'; "
20 "function tabsel(which_tab) { "
21 " if (which_tab == previously_selected_tab) { "
24 " $('tabtd'+previously_selected_tab).style.backgroundColor = '#cccccc'; "
25 " $('tabdiv'+previously_selected_tab).style.display = 'none'; "
26 " $('tabtd'+which_tab).style.backgroundColor = '#ffffff'; "
27 " $('tabdiv'+which_tab).style.display = 'block'; "
28 " previously_selected_tab = which_tab; "
33 wprintf("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%%\">"
34 "<tr align=\"center\" style=\"cursor:pointer\"><td> </td>"
37 for (i=0; i<num_tabs; ++i) {
38 wprintf("<td id=\"tabtd%d\" bgcolor=\"#%s\" onClick='tabsel(\"%d\");'>"
39 "<span class=\"tablabel\">",
41 ( (i==0) ? "ffffff" : "cccccc" ),
44 wprintf("%s", tabnames[i]);
47 wprintf("<td> </td>\n");
50 wprintf("</tr></table>\n");
51 wprintf("<table border=\"0\" width=\"100%%\" bgcolor=\"#ffffff\"><tr><td>");
55 * \brief print the tab-header
56 * \param tabnum number of the tab to print
57 * \param num_tabs total number oftabs to be printed
59 void begin_tab(int tabnum, int num_tabs) {
60 wprintf("<div id=\"tabdiv%d\" style=\"display:%s\">",
62 ( (tabnum == 0) ? "block" : "none" )
67 * \brief print the tab-footer
68 * \param tabnum number of the tab to print
69 * \param num_tabs total number oftabs to be printed
71 void end_tab(int tabnum, int num_tabs) {
74 if (tabnum == num_tabs-1) {
75 wprintf("</td></tr></table>\n");