- tabbed_dialog(num_pages, tablabels);
- page = (-1);
-
- it = GetNewHashPos(VS->addrbook, 0);
- for (i=0; i<num_ab; ++i) {
- void *v;
- long hklen;
- const char *key;
- addrbookent *abEnt;
- GetNextHashPos(VS->addrbook, it, &hklen, &key, &v);
- if (v == NULL)
- continue;
- abEnt = (addrbookent *) v;
- if ((i / NAMESPERPAGE) != page) { /* New tab */
- page = (i / NAMESPERPAGE);
- if (page > 0) {
- do_template("vcard_list_section_end");
- end_tab(page-1, num_pages);
- }
- begin_tab(page, num_pages);
- do_template("vcard_list_section_start");
- displayed = 0;
- }
-
- if ((displayed % 4) == 0) {
- if (displayed > 0) {
- do_template("vcard_list_row_end");
- }
- do_template("vcard_list_row_start");
- bg = 1 - bg;
- }
-
-
- StackContext(TP, &SubTP, abEnt->VC, CTX_VCARD, 0, NULL);
-
- DoTemplate(HKEY("vcard_list_entry"), WCC->WBuf, &SubTP);
- UnStackContext(&SubTP);
-
- ++displayed;
- }
- DeleteHashPos(&it);
-
- /* Placeholders for empty columns at end */
- if ((num_ab % 4) != 0) {
- for (i=0; i<(4-(num_ab % 4)); ++i) {
- do_template("vcard_list_cell_end");
- }
- }
-
- do_template("vcard_list_section_end");
- end_tab((num_pages-1), num_pages);
-
- begin_tab(num_pages, num_pages);
- /* FIXME there ought to be something here */
- end_tab(num_pages, num_pages);
-