X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Ftabs.c;h=569a7f7633e8ea79d912115b0239e90267bfb535;hb=e8fc80828146ad2bbc4794d61cfec472a3c8939f;hp=92e88ef56a238fc95aaef6d024c4a245a549f05f;hpb=70bfefce791a385c9c4c770be3b058f2de3f0e95;p=citadel.git diff --git a/webcit/tabs.c b/webcit/tabs.c index 92e88ef56..569a7f763 100644 --- a/webcit/tabs.c +++ b/webcit/tabs.c @@ -1,11 +1,13 @@ /* - * $Id: $ + * $Id$ * - * Utility functions for creating tabbed dialogs */ #include "webcit.h" +/* + * print tabbed dialog + */ void tabbed_dialog(int num_tabs, char *tabnames[]) { int i; @@ -15,26 +17,27 @@ void tabbed_dialog(int num_tabs, char *tabnames[]) { " if (which_tab == previously_selected_tab) { " " return; " " } " - " $('tabtd'+previously_selected_tab).style.backgroundColor = '#cccccc'; " " $('tabdiv'+previously_selected_tab).style.display = 'none'; " - " $('tabtd'+which_tab).style.backgroundColor = '#ffffff'; " " $('tabdiv'+which_tab).style.display = 'block'; " + " $('tabtd'+previously_selected_tab).className = 'tab_cell_edit'; " + " $('tabtd'+which_tab).className = 'tab_cell_label'; " " previously_selected_tab = which_tab; " "} " " \n" ); - wprintf("
" ); for (i=0; i | ", i, - ( (i==0) ? "ffffff" : "cccccc" ), + ( (i==0) ? "tab_cell_label" : "tab_cell_edit" ), i - ); + ); wprintf("%s", tabnames[i]); wprintf(" | "); @@ -42,20 +45,55 @@ void tabbed_dialog(int num_tabs, char *tabnames[]) { } wprintf("
");
}
+/*
+ * print the tab-header
+ *
+ * tabnum: number of the tab to print
+ * num_tabs: total number oftabs to be printed
+ *
+ */
void begin_tab(int tabnum, int num_tabs) {
- wprintf(" ",
- tabnum,
- ( (tabnum == 0) ? "block" : "none" )
- );
+
+ if (tabnum == num_tabs) {
+ wprintf("\n");
+ wprintf(" ");
+ }
+
+ else {
+ wprintf("\n", tabnum, num_tabs);
+ wprintf(" ",
+ tabnum,
+ ( (tabnum == 0) ? "block" : "none" )
+ );
+ }
}
+/*
+ * print the tab-footer
+ * tabnum: number of the tab to print
+ * num_tabs: total number of tabs to be printed
+ *
+ */
void end_tab(int tabnum, int num_tabs) {
- wprintf(" \n");
- if (tabnum == num_tabs-1) {
- wprintf(" |