4 * Utility functions for creating tabbed dialogs
9 void tabbed_dialog(int num_tabs, char *tabnames[]) {
12 wprintf("<script type=\"text/javascript\"> "
13 "var previously_selected_tab = '0'; "
14 "function tabsel(which_tab) { "
15 " if (which_tab == previously_selected_tab) { "
18 " $('tabtd'+previously_selected_tab).style.backgroundColor = '#cccccc'; "
19 " $('tabdiv'+previously_selected_tab).style.display = 'none'; "
20 " $('tabtd'+which_tab).style.backgroundColor = '#ffffff'; "
21 " $('tabdiv'+which_tab).style.display = 'block'; "
22 " previously_selected_tab = which_tab; "
27 wprintf("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%%\">"
28 "<tr align=\"center\" style=\"cursor:pointer\"><td> </td>"
31 for (i=0; i<num_tabs; ++i) {
32 wprintf("<td id=\"tabtd%d\" bgcolor=\"#%s\" onClick='tabsel(\"%d\");'>"
33 "<span class=\"tablabel\">",
35 ( (i==0) ? "ffffff" : "cccccc" ),
38 wprintf("%s", tabnames[i]);
41 wprintf("<td> </td>\n");
44 wprintf("</tr></table>\n");
45 wprintf("<table border=\"0\" width=\"100%%\" bgcolor=\"#ffffff\"><tr><td>");
48 void begin_tab(int tabnum, int num_tabs) {
49 wprintf("<div id=\"tabdiv%d\" style=\"display:%s\">",
51 ( (tabnum == 0) ? "block" : "none" )
55 void end_tab(int tabnum, int num_tabs) {
58 if (tabnum == num_tabs-1) {
59 wprintf("</td></tr></table>\n");