ScummVM API documentation
gui_dialog.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_GUI_GUI_DIALOG_H
23#define NUVIE_GUI_GUI_DIALOG_H
24
25
26
27#include "ultima/nuvie/gui/widgets/gui_widget.h"
28#include "ultima/nuvie/screen/screen.h"
29
30namespace Ultima {
31namespace Nuvie {
32
33#define GUI_DIALOG_MOVABLE true
34#define GUI_DIALOG_UNMOVABLE false
35
36class GUI_Dialog : public GUI_Widget {
37
38 int old_x, old_y;
39 int button_x, button_y;
40 uint8 R, G, B;
41 uint32 bg_color;
42
43 bool drag;
44 Graphics::ManagedSurface *border[8];
45
46 unsigned char *backingstore;
47
48 Common::Rect backingstore_rect;
49public:
50 /* Passed the area, color and shape */
51 GUI_Dialog(int x, int y, int w, int h, uint8 r, uint8 g, uint8 b, bool is_moveable);
52 ~GUI_Dialog() override;
53 /* Map the color to the display */
54 void SetDisplay(Screen *s) override;
55
56 /* Show the widget */
57 void Display(bool full_redraw) override;
58
59 /* events, used for dragging the area. */
60 GUI_status MouseDown(int x, int y, Events::MouseButton button) override;
61 GUI_status MouseUp(int x, int y, Events::MouseButton button) override;
62 GUI_status MouseMotion(int x, int y, uint8 state) override;
63 void MoveRelative(int dx, int dy) override;
64protected:
65 bool can_drag;
66 void loadBorderImages();
67};
68
69} // End of namespace Nuvie
70} // End of namespace Ultima
71
72#endif
Definition: managed_surface.h:51
Definition: gui_dialog.h:36
Definition: gui_widget.h:38
Definition: screen.h:41
Definition: rect.h:536