Lines Matching full:st
48 static void updateborders(struct dialog *d, struct scrolltext *st) in updateborders() argument
60 if (st->xpad > 0) { in updateborders()
69 if (st->xpad + d->w - 2 - st->margin < st->wpad) { in updateborders()
78 if (st->hpad > d->h - 4) { in updateborders()
81 "%3d%%", 100 * (st->ypad + d->h - 4) / st->hpad); in updateborders()
86 static int textbox_size_position(struct dialog *d, struct scrolltext *st) in textbox_size_position() argument
93 d->text, NULL, &d->bs, st->hpad, st->wpad + st->margin) != 0) in textbox_size_position()
95 minw = (st->wpad > 0) ? 2 /*multicolumn char*/ + st->margin : 0 ; in textbox_size_position()
96 if (widget_checksize(d->h, d->w, &d->bs, MIN(st->hpad, 1), minw) != 0) in textbox_size_position()
104 static int textbox_draw(struct dialog *d, struct scrolltext *st) in textbox_draw() argument
110 if (textbox_size_position(d, st) != 0) in textbox_draw()
117 st->ys = d->y + 1; in textbox_draw()
118 st->xs = (st->margin == 0) ? d->x + 1 : d->x + 2; in textbox_draw()
119 st->ye = st->ys + d->h - 5; in textbox_draw()
120 st->xe = st->xs + d->w - 3 - st->margin; in textbox_draw()
121 st->ypad = st->xpad = 0; in textbox_draw()
122 st->printrows = d->h-4; in textbox_draw()
138 struct scrolltext st; in bsddialog_textbox() local
153 st.hpad = 1; in bsddialog_textbox()
154 st.wpad = 1; in bsddialog_textbox()
155 st.pad = newpad(st.hpad, st.wpad); in bsddialog_textbox()
156 wbkgd(st.pad, t.dialog.color); in bsddialog_textbox()
157 st.margin = 0; in bsddialog_textbox()
162 if ((int)linecols > st.wpad) { in bsddialog_textbox()
163 st.wpad = linecols; in bsddialog_textbox()
164 wresize(st.pad, st.hpad, st.wpad); in bsddialog_textbox()
166 if (i > st.hpad-1) { in bsddialog_textbox()
167 st.hpad++; in bsddialog_textbox()
168 wresize(st.pad, st.hpad, st.wpad); in bsddialog_textbox()
170 mvwaddstr(st.pad, i, 0, buf); in bsddialog_textbox()
173 st.margin = 2; in bsddialog_textbox()
178 if (textbox_draw(&d, &st) != 0) in bsddialog_textbox()
183 updateborders(&d, &st); in bsddialog_textbox()
191 prefresh(st.pad, st.ypad, st.xpad, st.ys, st.xs, st.ye, st.xe); in bsddialog_textbox()
217 st.ypad = 0; in bsddialog_textbox()
220 st.ypad = MAX(st.hpad - st.printrows, 0); in bsddialog_textbox()
223 st.ypad = MAX(st.ypad - st.printrows, 0); in bsddialog_textbox()
226 st.ypad += st.printrows; in bsddialog_textbox()
227 if (st.ypad + st.printrows > st.hpad) in bsddialog_textbox()
228 st.ypad = st.hpad - st.printrows; in bsddialog_textbox()
231 st.xpad = 0; in bsddialog_textbox()
235 st.xpad = MAX(st.xpad - 1, 0); in bsddialog_textbox()
239 if (st.xpad + d.w - 2 - st.margin < st.wpad) in bsddialog_textbox()
240 st.xpad++; in bsddialog_textbox()
244 st.ypad = MAX(st.ypad - 1, 0); in bsddialog_textbox()
248 if (st.ypad + st.printrows <= st.hpad -1) in bsddialog_textbox()
249 st.ypad++; in bsddialog_textbox()
257 if (textbox_draw(&d, &st) != 0) in bsddialog_textbox()
262 if (textbox_draw(&d, &st) != 0) in bsddialog_textbox()
268 delwin(st.pad); in bsddialog_textbox()