X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Ftabs.c;h=69547e2640b9456950ff0cc69d5cd25ee85c878b;hb=c87a13b70c434787bf5d8b4d9745fc260c4d6733;hp=f0c72b06911e5a77305f7538187b3f79507d6599;hpb=8d8c5af38e5026933ea3b9d5eb1b75f276df1d99;p=citadel.git diff --git a/webcit/tabs.c b/webcit/tabs.c index f0c72b069..69547e264 100644 --- a/webcit/tabs.c +++ b/webcit/tabs.c @@ -1,90 +1,216 @@ /* - * $Id: $ + * $Id$ + * */ -/** - * \defgroup TabUtils Utility functions for creating tabbed dialogs - * \ingroup WebcitDisplayItems - */ -/*@{*/ +#include +#define SHOW_ME_VAPPEND_PRINTF #include "webcit.h" -/** - * \brief print tabbed dialog - * \param num_tabs how many tabs do we have? - * \param tabnames the headers of the tables +/* + * print tabbed dialog */ void tabbed_dialog(int num_tabs, char *tabnames[]) { int i; - wprintf(" \n" ); - wprintf("" + wprintf("
" "" ); for (i=0; i" - "", - i, - ( (i==0) ? "ffffff" : "cccccc" ), + ">", i, + ( (i==0) ? "tab_cell_label" : "tab_cell_edit" ), i - ); + ); wprintf("%s", tabnames[i]); - wprintf(""); + wprintf(""); wprintf("\n"); } wprintf("
  
\n"); - wprintf("
"); } -/** - * \brief print the tab-header - * \param tabnum number of the tab to print - * \param num_tabs total number oftabs to be printed +/* + * 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" ) + ); + } } -/** - * \brief print the tab-footer - * \param tabnum number of the tab to print - * \param num_tabs total number oftabs to be printed +/* + * 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"); - wprintf("\n", tabnum, num_tabs); - - if (tabnum == num_tabs-1) { - wprintf("
\n"); - wprintf("" - ); - //" Nifty(\"td#tabtd1\", \"small transparent top\");" + + if (tabnum == num_tabs) { + wprintf("\n"); + wprintf("\n"); + } + + else { + wprintf("\n"); + wprintf("\n", tabnum, num_tabs); + + if (tabnum == num_tabs-1) { + wprintf("" + ); + } + } +} + + +/* + * print tabbed dialog + */ +void StrTabbedDialog(StrBuf *Target, int num_tabs, StrBuf *tabnames[]) { + int i; + + StrBufAppendBufPlain( + Target, + HKEY( + " \n" + ), 0); + + StrBufAppendBufPlain( + Target, + HKEY( + "" + "" + ), 0); + + for (i=0; i", + i, + ( (i==0) ? "tab_cell_label" : "tab_cell_edit" ), + i + ); + StrBufAppendBuf(Target, tabnames[i], 0); + StrBufAppendBufPlain( + Target, + HKEY( + "" + "\n"), 0); + } + + StrBufAppendBufPlain( + Target, + HKEY("
  
\n"), 0); +} + +/* + * print the tab-header + * + * tabnum: number of the tab to print + * num_tabs: total number oftabs to be printed + * + */ +void StrBeginTab(StrBuf *Target, int tabnum, int num_tabs) { + + if (tabnum == num_tabs) { + StrBufAppendBufPlain( + Target, + HKEY( + "\n" + "
"), 0); + } + + else { + StrBufAppendPrintf( + Target, + "\n" + "
", + tabnum, num_tabs, + 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 StrEndTab(StrBuf *Target, int tabnum, int num_tabs) { + + if (tabnum == num_tabs) { + StrBufAppendBufPlain( + Target, + HKEY( + "
\n" + "\n"), 0); + } + + else { + StrBufAppendPrintf( + Target, + "
\n", + "\n", tabnum, num_tabs); + + if (tabnum == num_tabs-1) { + StrBufAppendBufPlain( + Target, + HKEY( + ""), 0); + } } } -/*@}*/