-
Notifications
You must be signed in to change notification settings - Fork 17
/
MsgScrollNewUI.h
101 lines (73 loc) · 2.21 KB
/
MsgScrollNewUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef __MsgScrollNewUI_h__
#define __MsgScrollNewUI_h__
/*
* MsgScrollNewUI.h
* Nuvie
*
* Created by Eric Fry on Sun Sep 23 2012.
* Copyright (c) 2012. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#include "CallBack.h"
#include "GUI_widget.h"
#include <stdarg.h>
#include <list>
#include <vector>
#include <string>
using std::list;
class Configuration;
class Font;
class MsgScroll;
class Actor;
class CallBack;
typedef enum {
SCROLL_UP,
SCROLL_DOWN,
SCROLL_ESCAPE
} ScrollEventType;
class MsgScrollNewUI: public MsgScroll
{
CallBack *timer;
Font *font_normal;
Font *font_garg;
bool solid_bg;
uint8 bg_color;
uint8 border_color;
uint16 position;
std::string trailing_whitespace;
public:
MsgScrollNewUI(Configuration *cfg, Screen *s);
~MsgScrollNewUI();
uint16 callback(uint16 msg, CallBack *caller, void *data);
bool can_display_prompt() { return false; }
bool can_fit_token_on_msgline(MsgLine *msg_line, MsgText *token);
void Display(bool full_redraw);
void display_prompt() {}
void display_string(std::string s, Font *f, bool include_on_map_window);
void set_font(uint8 font_type);
bool is_garg_font();
GUI_status KeyDown(SDL_Keysym key);
GUI_status MouseDown(int x, int y, int button);
void move_scroll_down() { scroll_movement_event(SCROLL_DOWN); }
void move_scroll_up() { scroll_movement_event(SCROLL_UP); }
protected:
MsgLine *add_new_line();
private:
GUI_status scroll_movement_event(ScrollEventType event);
uint16 count_empty_lines(std::string s);
};
#endif /* __MsgScrollNewUI_h__ */