6 #define SHOW_ME_VAPPEND_PRINTF
12 void tabbed_dialog(int num_tabs
, char *tabnames
[]) {
15 StrBufAppendPrintf(WC
->trailing_javascript
,
16 "var previously_selected_tab = '0'; \n"
17 "function tabsel(which_tab) { \n"
18 " if (which_tab == previously_selected_tab) { \n"
21 " $('tabdiv'+previously_selected_tab).style.display = 'none'; \n"
22 " $('tabdiv'+which_tab).style.display = 'block'; \n"
23 " $('tabtd'+previously_selected_tab).className = 'tab_cell_edit'; \n"
24 " $('tabtd'+which_tab).className = 'tab_cell_label'; \n"
25 " previously_selected_tab = which_tab; \n"
29 wprintf("<table id=\"TheTabs\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
30 "<tr align=\"center\" style=\"cursor:pointer\"><td> </td>"
33 for (i
=0; i
<num_tabs
; ++i
) {
34 wprintf("<td id=\"tabtd%d\" class=\"%s\" "
35 "onClick='tabsel(\"%d\");'"
38 ( (i
==0) ? "tab_cell_label" : "tab_cell_edit" ),
41 wprintf("%s", tabnames
[i
]);
44 wprintf("<td> </td>\n");
47 wprintf("</tr></table>\n");
51 * print the tab-header
53 * tabnum: number of the tab to print
54 * num_tabs: total number oftabs to be printed
57 void begin_tab(int tabnum
, int num_tabs
) {
59 if (tabnum
== num_tabs
) {
60 wprintf("<!-- begin tab-common epilogue -->\n");
61 wprintf("<div class=\"tabcontent_submit\">");
65 wprintf("<!-- begin tab %d of %d -->\n", tabnum
, num_tabs
);
66 wprintf("<div id=\"tabdiv%d\" style=\"display:%s\" class=\"tabcontent\" >",
68 ( (tabnum
== 0) ? "block" : "none" )
74 * print the tab-footer
75 * tabnum: number of the tab to print
76 * num_tabs: total number of tabs to be printed
79 void end_tab(int tabnum
, int num_tabs
) {
81 if (tabnum
== num_tabs
) {
82 wprintf("</div> <!-- end of 'tabcontent_submit' div -->\n");
83 wprintf("<!-- end tab-common epilogue -->\n");
88 wprintf("<!-- end tab %d of %d -->\n", tabnum
, num_tabs
);
90 if (tabnum
== num_tabs
-1) {
91 wprintf("<script type=\"text/javascript\">"
92 " Nifty(\"table#TheTabs td\", \"small transparent top\");"
101 * print tabbed dialog
103 void StrTabbedDialog(StrBuf
*Target
, int num_tabs
, StrBuf
*tabnames
[]) {
106 StrBufAppendBufPlain(
109 "<script type=\"text/javascript\"> "
110 "var previously_selected_tab = '0'; "
111 "function tabsel(which_tab) { "
112 " if (which_tab == previously_selected_tab) { "
115 " $('tabdiv'+previously_selected_tab).style.display = 'none'; "
116 " $('tabdiv'+which_tab).style.display = 'block'; "
117 " $('tabtd'+previously_selected_tab).className = 'tab_cell_edit'; "
118 " $('tabtd'+which_tab).className = 'tab_cell_label'; "
119 " previously_selected_tab = which_tab; "
124 StrBufAppendBufPlain(
127 "<table id=\"TheTabs\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
128 "<tr align=\"center\" style=\"cursor:pointer\"><td> </td>"
131 for (i
=0; i
<num_tabs
; ++i
) {
134 "<td id=\"tabtd%d\" class=\"%s\" "
135 "onClick='tabsel(\"%d\");'"
138 ( (i
==0) ? "tab_cell_label" : "tab_cell_edit" ),
141 StrBufAppendBuf(Target
, tabnames
[i
], 0);
142 StrBufAppendBufPlain(
146 "<td> </td>\n"), 0);
149 StrBufAppendBufPlain(
151 HKEY("</tr></table>\n"), 0);
155 * print the tab-header
157 * tabnum: number of the tab to print
158 * num_tabs: total number oftabs to be printed
161 void StrBeginTab(StrBuf
*Target
, int tabnum
, int num_tabs
) {
163 if (tabnum
== num_tabs
) {
164 StrBufAppendBufPlain(
167 "<!-- begin tab-common epilogue -->\n"
168 "<div class=\"tabcontent_submit\">"), 0);
174 "<!-- begin tab %d of %d -->\n"
175 "<div id=\"tabdiv%d\" style=\"display:%s\" class=\"tabcontent\" >",
178 ( (tabnum
== 0) ? "block" : "none" )
184 * print the tab-footer
185 * tabnum: number of the tab to print
186 * num_tabs: total number of tabs to be printed
189 void StrEndTab(StrBuf
*Target
, int tabnum
, int num_tabs
) {
191 if (tabnum
== num_tabs
) {
192 StrBufAppendBufPlain(
196 "<!-- end tab-common epilogue -->\n"), 0);
203 "<!-- end tab %d of %d -->\n", tabnum
, num_tabs
);
205 if (tabnum
== num_tabs
-1) {
206 StrBufAppendBufPlain(
209 "<script type=\"text/javascript\">"
210 " Nifty(\"table#TheTabs td\", \"small transparent top\");"