Lines Matching refs:st

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