X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit%2Ftabs.c;h=78d2954ecdd4e5dd0eb439b9877bf752fa73a008;hp=569a7f7633e8ea79d912115b0239e90267bfb535;hb=cfa7d8dcaa2bf3b270f3d7de31373cef2e60ff10;hpb=986f57cd09d256e0cc03131ab8a4369b3568d043 diff --git a/webcit/tabs.c b/webcit/tabs.c index 569a7f763..78d2954ec 100644 --- a/webcit/tabs.c +++ b/webcit/tabs.c @@ -2,7 +2,8 @@ * $Id$ * */ - +#include +#define SHOW_ME_VAPPEND_PRINTF #include "webcit.h" /* @@ -97,3 +98,120 @@ void end_tab(int tabnum, int num_tabs) { } +/* + * 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); + } + } +} + +