Lines Matching refs:d
41 static void textupdate(struct dialog *d, struct scroll *s)
44 wattron(d->widget, t.dialog.arrowcolor);
45 mvwprintw(d->widget, d->h - HBUTTONS - BORDER,
46 d->w - 4 - TEXTHMARGIN - BORDER,
47 "%3d%%", 100 * (s->ypad + s->printrows) / s->htextpad);
48 wattroff(d->widget, t.dialog.arrowcolor);
49 wnoutrefresh(d->widget);
51 rtextpad(d, s->ypad, 0, 0, HBUTTONS);
54 static int message_size_position(struct dialog *d, int *htext)
58 if (set_widget_size(d->conf, d->rows, d->cols, &d->h, &d->w) != 0)
60 if (set_widget_autosize(d->conf, d->rows, d->cols, &d->h, &d->w,
61 d->text, (*htext < 0) ? htext : NULL, &d->bs, 0, 0) != 0)
64 if (widget_checksize(d->h, d->w, &d->bs, MIN(*htext, 1), minw) != 0)
66 if (set_widget_position(d->conf, &d->y, &d->x, d->h, d->w) != 0)
72 static int message_draw(struct dialog *d, struct scroll *s)
76 if (d->built) {
77 hide_dialog(d);
80 if (message_size_position(d, &s->htext) != 0)
82 if (draw_dialog(d) != 0)
84 if (d->built)
87 s->printrows = d->h - BORDER - HBUTTONS - BORDER;
89 getmaxyx(d->textpad, s->htextpad, unused);
103 struct dialog d;
105 if (prepare_dialog(conf, text, rows, cols, &d) != 0)
107 set_buttons(&d, true, oklabel, cancellabel);
109 if (message_draw(&d, &s) != 0)
114 textupdate(&d, &s);
121 retval = BUTTONVALUE(d.bs);
125 if (d.conf->key.enable_esc) {
132 d.bs.curr = (d.bs.curr + 1) % d.bs.nbuttons;
133 DRAW_BUTTONS(d);
136 d.bs.curr--;
137 if (d.bs.curr < 0)
138 d.bs.curr = d.bs.nbuttons - 1;
139 DRAW_BUTTONS(d);
168 if (d.conf->key.f1_file == NULL &&
169 d.conf->key.f1_message == NULL)
171 if (f1help_dialog(d.conf) != 0)
173 if (message_draw(&d, &s) != 0)
178 if (message_draw(&d, &s) != 0)
182 if (shortcut_buttons(input, &d.bs)) {
183 DRAW_BUTTONS(d);
185 retval = BUTTONVALUE(d.bs);
191 end_dialog(&d);
216 struct dialog d;
218 if (prepare_dialog(conf, text, rows, cols, &d) != 0)
221 if (message_size_position(&d, &htext) != 0)
223 if (draw_dialog(&d) != 0)
225 TEXTPAD(&d, 0);
228 end_dialog(&d);