MCPcopy Create free account
hub / github.com/Entware/Entware / draw_box

Function draw_box

scripts/config/lxdialog/util.c:463–492  ·  view source on GitHub ↗

* Draw a rectangular box with line drawing characters */

Source from the content-addressed store, hash-verified

461 * Draw a rectangular box with line drawing characters
462 */
463void
464draw_box(WINDOW * win, int y, int x, int height, int width,
465 chtype box, chtype border)
466{
467 int i, j;
468
469 wattrset(win, 0);
470 for (i = 0; i < height; i++) {
471 wmove(win, y + i, x);
472 for (j = 0; j < width; j++)
473 if (!i && !j)
474 waddch(win, border | ACS_ULCORNER);
475 else if (i == height - 1 && !j)
476 waddch(win, border | ACS_LLCORNER);
477 else if (!i && j == width - 1)
478 waddch(win, box | ACS_URCORNER);
479 else if (i == height - 1 && j == width - 1)
480 waddch(win, box | ACS_LRCORNER);
481 else if (!i)
482 waddch(win, border | ACS_HLINE);
483 else if (i == height - 1)
484 waddch(win, box | ACS_HLINE);
485 else if (!j)
486 waddch(win, border | ACS_VLINE);
487 else if (j == width - 1)
488 waddch(win, box | ACS_VLINE);
489 else
490 waddch(win, box | ' ');
491 }
492}
493
494/*
495 * Draw shadows along the right and bottom edge to give a more 3D look

Callers 5

dialog_yesnoFunction · 0.85
dialog_textboxFunction · 0.85
dialog_checklistFunction · 0.85
dialog_menuFunction · 0.85
dialog_inputboxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected