From a9d6026bf93cc34608ecf8582ab1a3252288e80a Mon Sep 17 00:00:00 2001 From: piaip Date: Sat, 19 Sep 2009 10:37:15 +0000 Subject: * refine order song init query ui git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4861 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/visio.h | 2 ++ mbbsd/register.c | 17 +++++++++++------ mbbsd/visio.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 6 deletions(-) diff --git a/include/visio.h b/include/visio.h index 42e32136..f2879ce6 100644 --- a/include/visio.h +++ b/include/visio.h @@ -138,6 +138,8 @@ void vs_header (const char *title, const char *mid, const char *right); // vs_ void vs_hdr (const char *title); // vs_bar, stand_title void vs_footer (const char *caption, const char *prompt); +void vs_rectangle_simple(int l, int t, int r, int b); // draw a single line rectangle, not filling inside interior + // columned output void vs_cols_layout (const VCOL* cols, VCOLW *ws, int n); /// calculate VCOL to fit current screen in ws void vs_cols (const VCOL* cols, const VCOLW *ws, int n, ...); diff --git a/mbbsd/register.c b/mbbsd/register.c index c26d7df0..569ff246 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -659,13 +659,18 @@ new_register(void) newuser.pager = PAGER_ON; strlcpy(newuser.lasthost, fromhost, sizeof(newuser.lasthost)); - // XXX enable this when we complete the user flag of ADBANNER_USONG_FLAG. #ifdef ADBANNER_USONG_FLAG - clear(); - prints( "\n\t在使用 BBS 的過程中,您可能會在畫面上方看到一些動態的活動看板告示,\n" - "\n\t其內容是開放給各使用者申請的,所以包含非商業的活動訊息、各種使用者的\n" - "\n\t心情點播或政治言論;但這些文字與圖像並不代表站方立場。\n"); - if (vans("請問您希望看到此類使用者心情點播嗎? [y/N]: ") == 'y') + vs_hdr("動態看板心情點播顯示設定"); + // draw a box here + outs( + "\n\n\t在使用 BBS 的過程中,您可能會在畫面上方此區看到一些動態的訊息告示," + "\n\n\t其內容是開放給各使用者與公益團體申請的,所以會包含非商業的活動資訊、" + "\n\n\t來自各使用者的心情點播、政治性言論與各種留言。" + "\n\n\n\n" + "\n\n\t" ANSI_COLOR(1) "此類由使用者自行發表的文字與圖像並不代表站方立場。" + ANSI_RESET "\n"); + vs_rectangle_simple(1, 1, 78, MAX_ADBANNER_HEIGHT); + if (vans("請問您希望看到此類來自其它使用者的心情點播與留言嗎? [y/N]: ") == 'y') newuser.uflag |= ADBANNER_USONG_FLAG; #endif diff --git a/mbbsd/visio.c b/mbbsd/visio.c index bbc29ee8..4f6909d8 100644 --- a/mbbsd/visio.c +++ b/mbbsd/visio.c @@ -509,6 +509,40 @@ vbarlr(const char *l, const char *r) outs(ANSI_RESET); } +void +vs_rectangle_simple(int l, int t, int r, int b) +{ + int ol = l; + + assert( l + 4 <= r && + t + 2 <= b); + + // draw top line + move(t++, ol); l = ol+2; + outs("┌"); + while (l < r-2) { outs("─"); l+= 2; } + outs("┐"); + if (l+2 < r) outs(" "); + + while (t < b) + { + move(t++, ol); l = ol+2; + outs("│"); + // while (l < r-2) { outs(" "); l+= 2; } + l += (r-l-1)/2*2; + move_ansi(t-1, l); + outs("│"); + if (l+2 < r) outs(" "); + } + + // draw bottom line + move(t++, ol); l = ol+2; + outs("└"); + while (l < r-2) { outs("─"); l+= 2; } + outs("┘"); + if (l+2 < r) outs(" "); +} + // ---- THEMED FORMATTING OUTPUT ------------------------------------- /** -- cgit v1.2.3