ScummVM API documentation
scroll_widget_gump.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef NUVIE_VIEWS_SCROLL_WIDGET_GUMP_H
23#define NUVIE_VIEWS_SCROLL_WIDGET_GUMP_H
24
25#include "ultima/nuvie/misc/call_back.h"
26#include "ultima/nuvie/gui/widgets/gui_widget.h"
27#include "ultima/nuvie/gui/widgets/msg_scroll.h"
28#include "ultima/nuvie/fonts/font.h"
29#include "common/str.h"
30
31namespace Ultima {
32namespace Nuvie {
33
34
35class Configuration;
36class Actor;
37class CallBack;
38
39typedef enum {
40 SCROLL_UP,
41 SCROLL_DOWN,
42 SCROLL_PAGE_UP,
43 SCROLL_PAGE_DOWN,
44 SCROLL_ESCAPE,
45 SCROLL_TO_BEGINNING,
46 SCROLL_TO_END
47} ScrollEventType;
48
49static const int SCROLLWIDGETGUMP_W = 200;
50static const int SCROLLWIDGETGUMP_H = 100;
51
53
54 Font *font_normal;
55 Font *font_garg;
56
57 uint8 font_color;
58 uint8 font_highlight;
59 uint16 position;
60
61 Common::String trailing_whitespace;
62
63 bool show_up_arrow;
64 bool show_down_arrow;
65
66public:
67
69 ~ScrollWidgetGump() override;
70
71 bool parse_token(MsgText *token) override;
72
73 bool can_display_prompt() const override {
74 return false;
75 }
76
77 void Display(bool full_redraw) override;
78
79 void display_prompt() override {}
80 void display_string(const Common::String &s);
81 void display_string(const Common::String &s, Font *f, bool include_on_map_window) override {
82 return MsgScroll::display_string(s, f, include_on_map_window);
83 }
84
85 void set_font(uint8 font_type) override;
86 bool is_garg_font() override;
87
88 bool can_fit_token_on_msgline(MsgLine *msg_line, MsgText *token) override;
89
90 GUI_status KeyDown(const Common::KeyState &key) override;
91 GUI_status MouseDown(int x, int y, Events::MouseButton button) override;
92 GUI_status MouseUp(int x, int y, Events::MouseButton button) override {
93 return GUI_YUM; // otherwise we do Msgscroll::MouseUp
94 }
95 GUI_status MouseWheel(sint32 x, sint32 y) override;
96
97 void move_scroll_down() override {
98 scroll_movement_event(SCROLL_DOWN);
99 }
100 void move_scroll_up() override {
101 scroll_movement_event(SCROLL_UP);
102 }
103
104
105private:
106 const Common::Rect arrow_up_rect;
107 const Common::Rect arrow_down_rect;
108
109 GUI_status scroll_movement_event(ScrollEventType event);
110 void update_arrows();
111};
112
113} // End of namespace Nuvie
114} // End of namespace Ultima
115
116#endif
Definition: str.h:59
Definition: configuration.h:60
Definition: font.h:42
Definition: msg_scroll.h:72
Definition: msg_scroll.h:90
Definition: msg_scroll.h:51
Definition: screen.h:41
Definition: scroll_widget_gump.h:52
Definition: keyboard.h:294
Definition: rect.h:536