39 |
39 |
40 static const int g_pageSize = 10; |
40 static const int g_pageSize = 10; |
41 |
41 |
42 // ------------------------------------------------------------------------------------------------- |
42 // ------------------------------------------------------------------------------------------------- |
43 // |
43 // |
44 int Interface::color_pair (Color fg, Color bg) |
44 chtype Interface::color_pair (Color fg, Color bg) |
45 { |
45 { |
46 return COLOR_PAIR (1 + (int (fg) * NUM_COLORS) + int (bg)); |
46 return COLOR_PAIR (1 + (int (fg) * NUM_COLORS) + int (bg)); |
47 } |
47 } |
48 |
48 |
49 // ------------------------------------------------------------------------------------------------- |
49 // ------------------------------------------------------------------------------------------------- |
207 // |
207 // |
208 void Interface::render_titlebar() |
208 void Interface::render_titlebar() |
209 { |
209 { |
210 if (Title.length() <= COLS) |
210 if (Title.length() <= COLS) |
211 { |
211 { |
212 int pair = color_pair (WHITE, BLUE); |
212 chtype pair = color_pair (WHITE, BLUE); |
213 int startx = (COLS - Title.length()) / 2; |
213 int startx = (COLS - Title.length()) / 2; |
214 int endx = startx + Title.length(); |
214 int endx = startx + Title.length(); |
215 attron (pair); |
215 attron (pair); |
216 mvprintw (0, startx, "%s", Title.chars()); |
216 mvprintw (0, startx, "%s", Title.chars()); |
217 mvhline (0, 0, ' ', startx); |
217 mvhline (0, 0, ' ', startx); |
434 |
434 |
435 // ------------------------------------------------------------------------------------------------- |
435 // ------------------------------------------------------------------------------------------------- |
436 // |
436 // |
437 void Interface::render_input() |
437 void Interface::render_input() |
438 { |
438 { |
439 int promptColor = color_pair (WHITE, BLUE); |
439 chtype promptColor = color_pair (WHITE, BLUE); |
440 |
440 |
441 // If we're asking the user if they want to disconnect, we don't render any input strings, |
441 // If we're asking the user if they want to disconnect, we don't render any input strings, |
442 // just the confirmation message. |
442 // just the confirmation message. |
443 if (CurrentInputState == INPUTSTATE_CONFIRM_DISCONNECTION) |
443 if (CurrentInputState == INPUTSTATE_CONFIRM_DISCONNECTION) |
444 { |
444 { |
495 |
495 |
496 // ------------------------------------------------------------------------------------------------- |
496 // ------------------------------------------------------------------------------------------------- |
497 // |
497 // |
498 void Interface::render_statusbar() |
498 void Interface::render_statusbar() |
499 { |
499 { |
500 int color = color_pair (WHITE, BLUE); |
500 chtype color = color_pair (WHITE, BLUE); |
501 int y = LINES - 1; |
501 int y = LINES - 1; |
502 attron (color); |
502 attron (color); |
503 mvhline (y, 0, ' ', COLS); |
503 mvhline (y, 0, ' ', COLS); |
504 mvprintw (y, 0, "%s", StatusBarText.chars()); |
504 mvprintw (y, 0, "%s", StatusBarText.chars()); |
505 attroff (color); |
505 attroff (color); |