• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/dialog/

Lines Matching refs:dlg

107 myprint_status(DIALOG_MIXEDGAUGE * dlg)
109 WINDOW *win = dlg->dialog;
110 int limit_y = dlg->height;
111 int limit_x = dlg->width;
115 int cells = dlg->len_text - 2;
116 int lm = limit_x - dlg->len_text - 1;
126 for (item = 0; item < dlg->item_no; ++item) {
133 status = status_string(dlg->list[item].text, &freeMe);
139 dlg_print_text(win, dlg->list[item].name, lm, &attr);
215 dlg_update_mixedgauge(DIALOG_MIXEDGAUGE * dlg, int percent)
224 (void) wmove(dlg->dialog, dlg->height - 3, 4);
225 dlg_attrset(dlg->dialog, gauge_attr);
227 for (i = 0; i < (dlg->width - 2 * (3 + MARGIN)); i++)
228 (void) waddch(dlg->dialog, ' ');
230 (void) wmove(dlg->dialog, dlg->height - 3, (dlg->width / 2) - 2);
231 (void) wprintw(dlg->dialog, "%3d%%", percent);
238 x = (percent * (dlg->width - 2 * (3 + MARGIN))) / 100;
240 dlg_attroff(dlg->dialog, A_REVERSE);
242 dlg_attrset(dlg->dialog, A_REVERSE);
244 (void) wmove(dlg->dialog, dlg->height - 3, 4);
246 chtype ch = winch(dlg->dialog);
250 (void) waddch(dlg->dialog, ch);
252 myprint_status(dlg);
253 dlg_trace_win(dlg->dialog);
260 dlg_begin_mixedgauge(DIALOG_MIXEDGAUGE * dlg,
274 memset(dlg, 0, sizeof(*dlg));
275 dlg->title = aTitle;
276 dlg->prompt = clean_copy(aPrompt);
277 dlg->height = dlg->old_height = aHeight;
278 dlg->width = dlg->old_width = aWidth;
279 dlg->item_no = aItemNo;
281 dlg->list = dlg_calloc(DIALOG_LISTITEM, (size_t) aItemNo);
282 assert_ptr(dlg->list, "dialog_mixedgauge");
284 dlg->len_name = 0;
285 dlg->len_text = 15;
289 if (dlg->len_name < thisWidth)
290 dlg->len_name = thisWidth;
291 dlg->list[n].name = ItemName(n);
292 dlg->list[n].text = ItemText(n);
295 dlg->min_height = MIN_HIGH + aItemNo;
296 dlg->min_width = MIN_WIDE + dlg->len_name + GUTTER + dlg->len_text;
298 if (dlg->prompt != 0 && *(dlg->prompt) != 0)
299 dlg->min_height += (2 * MARGIN);
306 dlg_del_window(dlg->dialog);
307 dlg->height = dlg->old_height;
308 dlg->width = dlg->old_width;
312 dlg_auto_size(dlg->title, dlg->prompt,
313 &(dlg->height),
314 &(dlg->width),
315 dlg->min_height,
316 dlg->min_width);
317 dlg_print_size(dlg->height, dlg->width);
318 dlg_ctl_size(dlg->height, dlg->width);
321 x = dlg_box_x_ordinate(dlg->width);
322 y = dlg_box_y_ordinate(dlg->height);
324 dlg->dialog = dlg_new_window(dlg->height, dlg->width, y, x);
326 (void) werase(dlg->dialog);
327 dlg_draw_box2(dlg->dialog,
329 dlg->height,
330 dlg->width,
333 dlg_draw_title(dlg->dialog, dlg->title);
334 dlg_draw_helpline(dlg->dialog, FALSE);
336 if ((dlg->prompt != 0 && *(dlg->prompt) != 0)
337 && wmove(dlg->dialog, dlg->item_no, 0) != ERR) {
338 dlg->caption = dlg_sub_window(dlg->dialog,
339 dlg->height - dlg->item_no - (2 * MARGIN),
340 dlg->width,
341 y + dlg->item_no + (2 * MARGIN),
343 dlg_attrset(dlg->caption, dialog_attr);
344 dlg_print_autowrap(dlg->caption, dlg->prompt, dlg->height, dlg->width);
347 mydraw_mixed_box(dlg->dialog,
348 dlg->height - 4,
351 dlg->width - 2 * (2 + MARGIN),
362 dlg_finish_mixedgauge(DIALOG_MIXEDGAUGE * dlg, int status)
364 (void) wrefresh(dlg->dialog);
369 dlg_del_window(dlg->dialog);
385 DIALOG_MIXEDGAUGE dlg;
397 dlg_begin_mixedgauge(&dlg, &began, title, cprompt, height,
400 dlg_update_mixedgauge(&dlg, percent);
402 return dlg_finish_mixedgauge(&dlg, DLG_EXIT_OK);