Lines Matching full:conf

65  * [static] widget_max_height(conf);
66 * [static] widget_max_width(struct bsddialog_conf *conf)
71 * [static] widget_min_height(conf, htext, hnotext, bool buttons);
72 * [static] widget_min_width(conf, wtext, minw, buttons);
83 * f1help_dialog(conf);
84 * draw_borders(conf, win, elev);
85 * update_box(conf, win, y, x, h, w, elev);
311 if (d->conf->button.left1_label != NULL) {
312 d->bs.label[d->bs.nbuttons] = d->conf->button.left1_label;
317 if (d->conf->button.left2_label != NULL) {
318 d->bs.label[d->bs.nbuttons] = d->conf->button.left2_label;
323 if (d->conf->button.left3_label != NULL) {
324 d->bs.label[d->bs.nbuttons] = d->conf->button.left3_label;
329 if (oklabel != NULL && d->conf->button.without_ok == false) {
330 d->bs.label[d->bs.nbuttons] = d->conf->button.ok_label != NULL ?
331 d->conf->button.ok_label : oklabel;
336 if (d->conf->button.with_extra) {
337 d->bs.label[d->bs.nbuttons] = d->conf->button.extra_label != NULL ?
338 d->conf->button.extra_label : "Extra";
343 if (cancellabel != NULL && d->conf->button.without_cancel == false) {
344 d->bs.label[d->bs.nbuttons] = d->conf->button.cancel_label ?
345 d->conf->button.cancel_label : cancellabel;
347 if (d->conf->button.default_cancel)
352 if (d->conf->button.with_help) {
353 d->bs.label[d->bs.nbuttons] = d->conf->button.help_label != NULL ?
354 d->conf->button.help_label : "Help";
359 if (d->conf->button.right1_label != NULL) {
360 d->bs.label[d->bs.nbuttons] = d->conf->button.right1_label;
365 if (d->conf->button.right2_label != NULL) {
366 d->bs.label[d->bs.nbuttons] = d->conf->button.right2_label;
371 if (d->conf->button.right3_label != NULL) {
372 d->bs.label[d->bs.nbuttons] = d->conf->button.right3_label;
388 if (d->conf->button.default_label != NULL) {
390 if (strcmp(d->conf->button.default_label,
422 static int widget_max_height(struct bsddialog_conf *conf)
426 maxheight = conf->shadow ? SCREENLINES - (int)t.shadow.y : SCREENLINES;
430 if (conf->y != BSDDIALOG_CENTER && conf->auto_topmargin > 0)
431 RETURN_ERROR("conf.y > 0 and conf->auto_topmargin > 0");
432 else if (conf->y == BSDDIALOG_CENTER) {
433 maxheight -= conf->auto_topmargin;
437 } else if (conf->y > 0) {
438 maxheight -= conf->y;
444 maxheight -= conf->auto_downmargin;
452 static int widget_max_width(struct bsddialog_conf *conf)
456 maxwidth = conf->shadow ? SCREENCOLS - (int)t.shadow.x : SCREENCOLS;
460 if (conf->x > 0) {
461 maxwidth -= conf->x;
498 text_properties(struct bsddialog_conf *conf, const char *text,
504 tablen = (conf->text.tablen == 0) ? TABSIZE : (int)conf->text.tablen;
524 if (conf->text.escape && is_wtext_attr(wtext + i)) {
593 text_autosize(struct bsddialog_conf *conf, struct textproperties *tp,
598 maxwidth = widget_max_width(conf) - BORDERS - TEXTHMARGINS;
599 tablen = (conf->text.tablen == 0) ? TABSIZE : (int)conf->text.tablen;
604 (int)conf->auto_minwidth - BORDERS - TEXTHMARGINS);
666 if (line >= y * (int)conf->text.cols_per_row && y <= maxrows)
678 text_size(struct bsddialog_conf *conf, int rows, int cols, const char *text,
691 maxhtext = widget_max_height(conf) - BORDERS - rowsnotext;
705 startwtext = widget_max_width(conf) - BORDERS - TEXTHMARGINS;
716 if (text_properties(conf, text, &tp) != 0)
722 if (text_autosize(conf, &tp, maxhtext, startwtext, changewtext, htext,
733 widget_min_height(struct bsddialog_conf *conf, int htext, int hnotext,
751 /* conf.auto_minheight */
752 min = MAX(min, (int)conf->auto_minheight);
758 widget_min_width(struct bsddialog_conf *conf, int wtext, int minwidget,
778 if (conf->title != NULL) {
780 wtitle = strcols(conf->title);
785 if (conf->bottomtitle != NULL) {
786 wbottomtitle = strcols(conf->bottomtitle);
792 /* conf.auto_minwidth */
793 min = MAX(min, (int)conf->auto_minwidth);
799 set_widget_size(struct bsddialog_conf *conf, int rows, int cols, int *h, int *w)
803 if ((maxheight = widget_max_height(conf)) == BSDDIALOG_ERROR)
814 if ((maxwidth = widget_max_width(conf)) == BSDDIALOG_ERROR)
829 set_widget_autosize(struct bsddialog_conf *conf, int rows, int cols, int *h,
837 if (text_size(conf, rows, cols, text, bs, hnotext, minw,
845 *h = widget_min_height(conf, htext, hnotext, bs->nbuttons > 0);
846 *h = MIN(*h, widget_max_height(conf));
850 *w = widget_min_width(conf, wtext, minw, bs);
851 *w = MIN(*w, widget_max_width(conf));
881 set_widget_position(struct bsddialog_conf *conf, int *y, int *x, int h, int w)
883 int hshadow = conf->shadow ? (int)t.shadow.y : 0;
884 int wshadow = conf->shadow ? (int)t.shadow.x : 0;
886 if (conf->y == BSDDIALOG_CENTER) {
888 if (*y < (int)conf->auto_topmargin)
889 *y = conf->auto_topmargin;
890 if (*y + h + hshadow > SCREENLINES - (int)conf->auto_downmargin)
891 *y = SCREENLINES - h - hshadow - conf->auto_downmargin;
893 else if (conf->y < BSDDIALOG_CENTER)
895 else if (conf->y >= SCREENLINES)
898 *y = conf->y;
905 if (conf->x == BSDDIALOG_CENTER)
907 else if (conf->x < BSDDIALOG_CENTER)
909 else if (conf->x >= SCREENCOLS)
912 *x = conf->x;
923 if (set_widget_size(d->conf, d->rows, d->cols, &d->h, &d->w) != 0)
925 if (set_widget_autosize(d->conf, d->rows, d->cols, &d->h, &d->w,
930 if (set_widget_position(d->conf, &d->y, &d->x, d->h, d->w) != 0)
948 if (d->conf->shadow) {
958 int f1help_dialog(struct bsddialog_conf *conf)
967 hconf.ascii_lines = conf->ascii_lines;
968 hconf.no_lines = conf->no_lines;
969 hconf.shadow = conf->shadow;
970 hconf.text.escape = conf->text.escape;
973 if (conf->key.f1_message != NULL)
974 output = bsddialog_msgbox(&hconf, conf->key.f1_message, 0, 0);
976 if (output != BSDDIALOG_ERROR && conf->key.f1_file != NULL)
977 output = bsddialog_textbox(&hconf, conf->key.f1_file, 0, 0);
982 void draw_borders(struct bsddialog_conf *conf, WINDOW *win, enum elevation elev)
989 if (conf->no_lines)
992 if (conf->ascii_lines) {
1027 update_box(struct bsddialog_conf *conf, WINDOW *win, int y, int x, int h, int w,
1033 draw_borders(conf, win, elev);
1051 if (d->conf->sleep > 0)
1052 sleep(d->conf->sleep);
1056 if (d->conf->shadow)
1059 if (d->conf->clear)
1062 if (d->conf->get_height != NULL)
1063 *d->conf->get_height = d->h;
1064 if (d->conf->get_width != NULL)
1065 *d->conf->get_width = d->w;
1184 print_textpad(struct bsddialog_conf *conf, WINDOW *pad, const char *text)
1197 tablen = (conf->text.tablen == 0) ? TABSIZE : (int)conf->text.tablen;
1207 conf->text.escape);
1258 if (d->conf->ascii_lines) {
1268 if (d->conf->shadow) {
1278 draw_borders(d->conf, d->widget, RAISED);
1280 if (d->conf->title != NULL) {
1281 if ((wtitle = strcols(d->conf->title)) < 0)
1283 if (t.dialog.delimtitle && d->conf->no_lines == false) {
1289 mvwaddstr(d->widget, 0, d->w/2 - wtitle/2, d->conf->title);
1291 if (t.dialog.delimtitle && d->conf->no_lines == false) {
1299 if (d->conf->no_lines == false) {
1312 if (d->conf->bottomtitle != NULL) {
1313 if ((wbottomtitle = strcols(d->conf->bottomtitle)) < 0)
1318 waddstr(d->widget, d->conf->bottomtitle);
1329 if (print_textpad(d->conf, d->textpad, d->text) != 0)
1338 prepare_dialog(struct bsddialog_conf *conf, const char *text, int rows,
1341 CHECK_PTR(conf);
1344 d->conf = conf;
1350 if (d->conf->shadow) {