Lines Matching +full:2 +full:d
2 * SPDX-License-Identifier: BSD-2-Clause
11 * 2. Redistributions in binary form must reproduce the above copyright
91 if (mm == 2)
105 dd += mm < 3 ? yy-- : yy - 2;
238 l = 2 + w%2;
240 mvwhline(win, 0, w/2 - l/2, UARROW(conf), l);
241 mvwhline(win, h-1, w/2 - l/2, DARROW(conf), l);
277 y = 2;
282 mvwprintw(win, y, x, "%2d", i);
285 mvwprintw(win, y, x, "%2d", i);
299 calendar_redraw(struct dialog *d, WINDOW *yy_win, WINDOW *mm_win,
304 if (d->built) {
305 hide_dialog(d);
308 if (dialog_size_position(d, MINHCAL, MINWCAL, NULL) != 0)
310 if (draw_dialog(d) != 0)
312 if (d->built)
314 TEXTPAD(d, MINHCAL + HBUTTONS);
316 ycal = d->y + d->h - 15;
317 xcal = d->x + d->w/2 - 17;
318 mvwaddstr(d->widget, d->h - 16, d->w/2 - 17, "Month");
319 update_box(d->conf, mm_win, ycal, xcal, 3, 17, RAISED);
320 mvwaddstr(d->widget, d->h - 16, d->w/2, "Year");
321 update_box(d->conf, yy_win, ycal, xcal + 17, 3, 17, RAISED);
322 update_box(d->conf, dd_win, ycal + 3, xcal, 9, 34, RAISED);
323 wnoutrefresh(d->widget);
336 struct dialog d;
345 if (prepare_dialog(conf, text, rows, cols, &d) != 0)
347 set_buttons(&d, true, OK_LABEL, CANCEL_LABEL);
357 if (calendar_redraw(&d, yy_win, mm_win, dd_win) != 0)
364 drawsquare(conf, yy_win, RAISED, "%15d", yy, sel == 1);
365 print_calendar(conf, dd_win, yy, mm, dd, sel == 2);
374 retval = BUTTONVALUE(d.bs);
386 d.bs.curr++;
387 if (d.bs.curr >= (int)d.bs.nbuttons) {
390 d.bs.curr = conf->button.always_active ?
395 if (sel > 2) {
398 d.bs.curr = 0;
401 DRAW_BUTTONS(d);
406 d.bs.curr++;
407 if (d.bs.curr >= (int)d.bs.nbuttons) {
410 d.bs.curr = conf->button.always_active ?
413 } else if (sel == 2) {
418 DRAW_BUTTONS(d);
423 d.bs.curr--;
424 if (d.bs.curr < 0) {
426 sel = 2;
427 d.bs.curr = conf->button.always_active ?
430 } else if (sel == 2) {
437 d.bs.curr = 0;
439 DRAW_BUTTONS(d);
443 sel = 2;
445 d.bs.curr = conf->button.always_active ? 0 : -1;
446 DRAW_BUTTONS(d);
451 } else { /* sel = 2 */
462 } else { /* sel = 2 */
473 } else { /* sel = 2 */
484 } else { /* sel = 2 */
506 if (calendar_redraw(&d, yy_win, mm_win, dd_win) != 0)
511 if (calendar_redraw(&d, yy_win, mm_win, dd_win) != 0)
515 if (shortcut_buttons(input, &d.bs)) {
516 DRAW_BUTTONS(d);
518 retval = BUTTONVALUE(d.bs);
531 end_dialog(&d);
536 static int datebox_redraw(struct dialog *d, struct dateitem *di)
540 if (d->built) {
541 hide_dialog(d);
544 if (dialog_size_position(d, 3 /*windows*/, MINWDATE, NULL) != 0)
546 if (draw_dialog(d) != 0)
548 if (d->built)
550 TEXTPAD(d, 3 /*windows*/ + HBUTTONS);
552 y = d->y + d->h - 6;
553 x = (d->x + d->w / 2) - 11;
554 update_box(d->conf, di[0].win, y, x, 3, di[0].width, LOWERED);
555 mvwaddch(d->widget, d->h - 5, x - d->x + di[0].width, '/');
557 update_box(d->conf, di[1].win, y, x , 3, di[1].width, LOWERED);
558 mvwaddch(d->widget, d->h - 5, x - d->x + di[1].width, '/');
560 update_box(d->conf, di[2].win, y, x, 3, di[2].width, LOWERED);
561 wnoutrefresh(d->widget);
573 {UP_YEAR, DOWN_YEAR, NULL, 6, "%4d", yy},
575 {LEFT_DAY, RIGHT_DAY, NULL, 4, "%02d", dd},
580 RETURN_FMTERROR("Cannot build WINDOW dateitem[%d]", i);
586 if (format == NULL || wcscmp(wformat, L"d/m/y") == 0) {
587 dt[0] = init[2];
589 dt[2] = init[0];
590 } else if (wcscmp(wformat, L"m/d/y") == 0) {
592 dt[1] = init[2];
593 dt[2] = init[0];
594 } else if (wcscmp(wformat, L"y/m/d") == 0) {
597 dt[2] = init[2];
613 struct dialog d;
622 if (prepare_dialog(conf, text, rows, cols, &d) != 0)
624 set_buttons(&d, true, OK_LABEL, CANCEL_LABEL);
627 if (datebox_redraw(&d, di) != 0)
644 retval = BUTTONVALUE(d.bs);
658 d.bs.curr++;
659 focusbuttons = d.bs.curr < (int)d.bs.nbuttons ?
663 d.bs.curr = conf->button.always_active ?
668 focusbuttons = sel > 2 ? true : false;
670 d.bs.curr = 0;
673 DRAW_BUTTONS(d);
678 d.bs.curr--;
679 focusbuttons = d.bs.curr < 0 ? false : true;
681 sel = 2;
682 d.bs.curr = conf->button.always_active ?
689 d.bs.curr = (int)d.bs.nbuttons - 1;
691 DRAW_BUTTONS(d);
701 d.bs.curr = conf->button.always_active ? 0 : -1;
702 DRAW_BUTTONS(d);
719 if (datebox_redraw(&d, di) != 0)
724 if (datebox_redraw(&d, di) != 0)
728 if (shortcut_buttons(input, &d.bs)) {
729 DRAW_BUTTONS(d);
731 retval = BUTTONVALUE(d.bs);
743 end_dialog(&d);