6 #define SHOW_ME_VAPPEND_PRINTF
12 void tabbed_dialog(int num_tabs, char *tabnames[]) {
15 wprintf("<script type=\"text/javascript\"> "
16 "var previously_selected_tab = '0'; "
17 "function tabsel(which_tab) { "
18 " if (which_tab == previously_selected_tab) { "
21 " $('tabdiv'+previously_selected_tab).style.display = 'none'; "
22 " $('tabdiv'+which_tab).style.display = 'block'; "
23 " $('tabtd'+previously_selected_tab).className = 'tab_cell_edit'; "
24 " $('tabtd'+which_tab).className = 'tab_cell_label'; "
25 " previously_selected_tab = which_tab; "
30 wprintf("<table id=\"TheTabs\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
31 "<tr align=\"center\" style=\"cursor:pointer\"><td> </td>"
34 for (i=0; i<num_tabs; ++i) {
35 wprintf("<td id=\"tabtd%d\" class=\"%s\" "
36 "onClick='tabsel(\"%d\");'"
39 ( (i==0) ? "tab_cell_label" : "tab_cell_edit" ),
42 wprintf("%s", tabnames[i]);
45 wprintf("<td> </td>\n");
48 wprintf("</tr></table>\n");
52 * print the tab-header
54 * tabnum: number of the tab to print
55 * num_tabs: total number oftabs to be printed
58 void begin_tab(int tabnum, int num_tabs) {
60 if (tabnum == num_tabs) {
61 wprintf("<!-- begin tab-common epilogue -->\n");
62 wprintf("<div class=\"tabcontent_submit\">");
66 wprintf("<!-- begin tab %d of %d -->\n", tabnum, num_tabs);
67 wprintf("<div id=\"tabdiv%d\" style=\"display:%s\" class=\"tabcontent\" >",
69 ( (tabnum == 0) ? "block" : "none" )
75 * print the tab-footer
76 * tabnum: number of the tab to print
77 * num_tabs: total number of tabs to be printed
80 void end_tab(int tabnum, int num_tabs) {
82 if (tabnum == num_tabs) {
84 wprintf("<!-- end tab-common epilogue -->\n");
89 wprintf("<!-- end tab %d of %d -->\n", tabnum, num_tabs);
91 if (tabnum == num_tabs-1) {
92 wprintf("<script type=\"text/javascript\">"
93 " Nifty(\"table#TheTabs td\", \"small transparent top\");"
102 * print tabbed dialog
104 void StrTabbedDialog(StrBuf *Target, int num_tabs, StrBuf *tabnames[]) {
107 StrBufAppendBufPlain(
110 "<script type=\"text/javascript\"> "
111 "var previously_selected_tab = '0'; "
112 "function tabsel(which_tab) { "
113 " if (which_tab == previously_selected_tab) { "
116 " $('tabdiv'+previously_selected_tab).style.display = 'none'; "
117 " $('tabdiv'+which_tab).style.display = 'block'; "
118 " $('tabtd'+previously_selected_tab).className = 'tab_cell_edit'; "
119 " $('tabtd'+which_tab).className = 'tab_cell_label'; "
120 " previously_selected_tab = which_tab; "
125 StrBufAppendBufPlain(
128 "<table id=\"TheTabs\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
129 "<tr align=\"center\" style=\"cursor:pointer\"><td> </td>"
132 for (i=0; i<num_tabs; ++i) {
135 "<td id=\"tabtd%d\" class=\"%s\" "
136 "onClick='tabsel(\"%d\");'"
139 ( (i==0) ? "tab_cell_label" : "tab_cell_edit" ),
142 StrBufAppendBuf(Target, tabnames[i], 0);
143 StrBufAppendBufPlain(
147 "<td> </td>\n"), 0);
150 StrBufAppendBufPlain(
152 HKEY("</tr></table>\n"), 0);
156 * print the tab-header
158 * tabnum: number of the tab to print
159 * num_tabs: total number oftabs to be printed
162 void StrBeginTab(StrBuf *Target, int tabnum, int num_tabs) {
164 if (tabnum == num_tabs) {
165 StrBufAppendBufPlain(
168 "<!-- begin tab-common epilogue -->\n"
169 "<div class=\"tabcontent_submit\">"), 0);
175 "<!-- begin tab %d of %d -->\n"
176 "<div id=\"tabdiv%d\" style=\"display:%s\" class=\"tabcontent\" >",
179 ( (tabnum == 0) ? "block" : "none" )
185 * print the tab-footer
186 * tabnum: number of the tab to print
187 * num_tabs: total number of tabs to be printed
190 void StrEndTab(StrBuf *Target, int tabnum, int num_tabs) {
192 if (tabnum == num_tabs) {
193 StrBufAppendBufPlain(
197 "<!-- end tab-common epilogue -->\n"), 0);
204 "<!-- end tab %d of %d -->\n", tabnum, num_tabs);
206 if (tabnum == num_tabs-1) {
207 StrBufAppendBufPlain(
210 "<script type=\"text/javascript\">"
211 " Nifty(\"table#TheTabs td\", \"small transparent top\");"