Lines Matching refs:dlg
107 myprint_status(DIALOG_MIXEDGAUGE * dlg) in myprint_status() argument
109 WINDOW *win = dlg->dialog; in myprint_status()
110 int limit_y = dlg->height; in myprint_status()
111 int limit_x = dlg->width; in myprint_status()
114 int cells = dlg->len_text - 2; in myprint_status()
115 int lm = limit_x - dlg->len_text - 1; in myprint_status()
124 for (item = 0; item < dlg->item_no; ++item) { in myprint_status()
132 status = status_string(dlg->list[item].text, &freeMe); in myprint_status()
140 dlg_print_text(win, dlg->list[item].name, lm, &attr); in myprint_status()
216 dlg_update_mixedgauge(DIALOG_MIXEDGAUGE * dlg, int percent) in dlg_update_mixedgauge() argument
225 (void) wmove(dlg->dialog, dlg->height - 3, 4); in dlg_update_mixedgauge()
226 dlg_attrset(dlg->dialog, gauge_attr); in dlg_update_mixedgauge()
228 for (i = 0; i < (dlg->width - 2 * (3 + MARGIN)); i++) in dlg_update_mixedgauge()
229 (void) waddch(dlg->dialog, ' '); in dlg_update_mixedgauge()
231 (void) wmove(dlg->dialog, dlg->height - 3, (dlg->width / 2) - 2); in dlg_update_mixedgauge()
232 (void) wprintw(dlg->dialog, "%3d%%", percent); in dlg_update_mixedgauge()
239 x = (percent * (dlg->width - 2 * (3 + MARGIN))) / 100; in dlg_update_mixedgauge()
241 dlg_attroff(dlg->dialog, A_REVERSE); in dlg_update_mixedgauge()
243 dlg_attrset(dlg->dialog, A_REVERSE); in dlg_update_mixedgauge()
245 (void) wmove(dlg->dialog, dlg->height - 3, 4); in dlg_update_mixedgauge()
247 chtype ch = winch(dlg->dialog); in dlg_update_mixedgauge()
251 (void) waddch(dlg->dialog, ch); in dlg_update_mixedgauge()
253 myprint_status(dlg); in dlg_update_mixedgauge()
254 dlg_trace_win(dlg->dialog); in dlg_update_mixedgauge()
261 dlg_begin_mixedgauge(DIALOG_MIXEDGAUGE * dlg, in dlg_begin_mixedgauge() argument
277 memset(dlg, 0, sizeof(*dlg)); in dlg_begin_mixedgauge()
278 dlg->title = aTitle; in dlg_begin_mixedgauge()
279 dlg->prompt = clean_copy(aPrompt); in dlg_begin_mixedgauge()
280 dlg->height = dlg->old_height = aHeight; in dlg_begin_mixedgauge()
281 dlg->width = dlg->old_width = aWidth; in dlg_begin_mixedgauge()
282 dlg->item_no = aItemNo; in dlg_begin_mixedgauge()
284 dlg->list = dlg_calloc(DIALOG_LISTITEM, (size_t) aItemNo); in dlg_begin_mixedgauge()
285 assert_ptr(dlg->list, "dialog_mixedgauge"); in dlg_begin_mixedgauge()
287 dlg->len_name = 0; in dlg_begin_mixedgauge()
288 dlg->len_text = 15; in dlg_begin_mixedgauge()
292 if (dlg->len_name < thisWidth) in dlg_begin_mixedgauge()
293 dlg->len_name = thisWidth; in dlg_begin_mixedgauge()
294 dlg->list[n].name = ItemName(n); in dlg_begin_mixedgauge()
295 dlg->list[n].text = ItemText(n); in dlg_begin_mixedgauge()
298 dlg->min_height = MIN_HIGH + aItemNo; in dlg_begin_mixedgauge()
299 dlg->min_width = MIN_WIDE + dlg->len_name + GUTTER + dlg->len_text; in dlg_begin_mixedgauge()
301 if (dlg->prompt != 0 && *(dlg->prompt) != 0) in dlg_begin_mixedgauge()
302 dlg->min_height += (2 * MARGIN); in dlg_begin_mixedgauge()
309 dlg_del_window(dlg->dialog); in dlg_begin_mixedgauge()
310 dlg->height = dlg->old_height; in dlg_begin_mixedgauge()
311 dlg->width = dlg->old_width; in dlg_begin_mixedgauge()
315 dlg_auto_size(dlg->title, dlg->prompt, in dlg_begin_mixedgauge()
316 &(dlg->height), in dlg_begin_mixedgauge()
317 &(dlg->width), in dlg_begin_mixedgauge()
318 dlg->min_height, in dlg_begin_mixedgauge()
319 dlg->min_width); in dlg_begin_mixedgauge()
320 dlg_print_size(dlg->height, dlg->width); in dlg_begin_mixedgauge()
321 dlg_ctl_size(dlg->height, dlg->width); in dlg_begin_mixedgauge()
324 x = dlg_box_x_ordinate(dlg->width); in dlg_begin_mixedgauge()
325 y = dlg_box_y_ordinate(dlg->height); in dlg_begin_mixedgauge()
327 dlg->dialog = dlg_new_window(dlg->height, dlg->width, y, x); in dlg_begin_mixedgauge()
329 (void) werase(dlg->dialog); in dlg_begin_mixedgauge()
330 dlg_draw_box2(dlg->dialog, in dlg_begin_mixedgauge()
332 dlg->height, in dlg_begin_mixedgauge()
333 dlg->width, in dlg_begin_mixedgauge()
336 dlg_draw_title(dlg->dialog, dlg->title); in dlg_begin_mixedgauge()
337 dlg_draw_helpline(dlg->dialog, FALSE); in dlg_begin_mixedgauge()
339 if ((dlg->prompt != 0 && *(dlg->prompt) != 0) in dlg_begin_mixedgauge()
340 && wmove(dlg->dialog, dlg->item_no, 0) != ERR) { in dlg_begin_mixedgauge()
341 dlg->caption = dlg_sub_window(dlg->dialog, in dlg_begin_mixedgauge()
342 dlg->height - dlg->item_no - (2 * MARGIN), in dlg_begin_mixedgauge()
343 dlg->width, in dlg_begin_mixedgauge()
344 y + dlg->item_no + (2 * MARGIN), in dlg_begin_mixedgauge()
346 dlg_attrset(dlg->caption, dialog_attr); in dlg_begin_mixedgauge()
347 dlg_print_autowrap(dlg->caption, dlg->prompt, dlg->height, dlg->width); in dlg_begin_mixedgauge()
350 mydraw_mixed_box(dlg->dialog, in dlg_begin_mixedgauge()
351 dlg->height - 4, in dlg_begin_mixedgauge()
354 dlg->width - 2 * (2 + MARGIN), in dlg_begin_mixedgauge()
365 dlg_finish_mixedgauge(DIALOG_MIXEDGAUGE * dlg, int status) in dlg_finish_mixedgauge() argument
367 (void) wrefresh(dlg->dialog); in dlg_finish_mixedgauge()
372 dlg_del_window(dlg->dialog); in dlg_finish_mixedgauge()
373 free(dlg->prompt); in dlg_finish_mixedgauge()
374 free(dlg->list); in dlg_finish_mixedgauge()
390 DIALOG_MIXEDGAUGE dlg; in dialog_mixedgauge() local
402 dlg_begin_mixedgauge(&dlg, &began, title, cprompt, height, in dialog_mixedgauge()
405 dlg_update_mixedgauge(&dlg, percent); in dialog_mixedgauge()
407 return dlg_finish_mixedgauge(&dlg, DLG_EXIT_OK); in dialog_mixedgauge()