1 /* GemRB - Infinity Engine Emulator
2 * Copyright (C) 2003 The GemRB Project
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * @file WorldMapControl.h
23 * Declares WorldMapControl, widget for displaying world map
27 #ifndef WORLDMAPCONTROL_H
28 #define WORLDMAPCONTROL_H
34 #include "Interface.h"
38 class WorldMapControl
;
40 // !!! Keep these synchronized with GUIDefines.py !!!
41 /** Which label color is set with SetColor() */
42 #define IE_GUI_WMAP_COLOR_NORMAL 0
43 #define IE_GUI_WMAP_COLOR_SELECTED 1
44 #define IE_GUI_WMAP_COLOR_NOTVISITED 2
48 * @class WorldMapControl
49 * Widget displaying "world" map, with particular locations and possibly
50 * allowing travelling between areas.
53 #define IE_GUI_WORLDMAP_ON_PRESS 0x08000000
54 #define IE_GUI_MOUSE_ENTER_WORLDMAP 0x08000002
56 class GEM_EXPORT WorldMapControl
: public Control
{
58 WorldMapControl(const char *fontname
, int direction
);
59 ~WorldMapControl(void);
61 /** Allows modification of the scrolling factor from outside */
62 void AdjustScrolling(short x
, short y
);
63 /** Draws the Control on the Output Display */
64 void Draw(unsigned short x
, unsigned short y
);
65 /** Sets the exit direction (we need this to calculate distances) */
66 void SetDirection(int direction
);
67 /** Sets the Text of the current control */
68 int SetText(const char* /*string*/, int /*pos*/) { return 0; }
69 /** Set color for one type of area labels */
70 void SetColor(int which
, Color color
);
72 unsigned short lastMouseX
, lastMouseY
;
74 /** pointer to last pointed area */
76 /** Set handler for specified event */
77 bool SetEvent(int eventType
, const char *handler
);
79 //font for printing area names
82 unsigned char lastCursor
;
85 /** Label color of a visited area */
87 /** Label color of a currently selected area */
88 Palette
*pal_selected
;
89 /** Label color of a not yet visited area */
90 Palette
*pal_notvisited
;
91 /** guiscript Event when button pressed */
92 EventHandler WorldMapControlOnPress
;
93 /** guiscript Event when mouse is over a reachable area */
94 EventHandler WorldMapControlOnEnter
;
96 /** Mouse Over Event */
97 void OnMouseOver(unsigned short x
, unsigned short y
);
98 /** Mouse Leave Event */
99 void OnMouseLeave(unsigned short x
, unsigned short y
);
100 /** Mouse Button Down */
101 void OnMouseDown(unsigned short x
, unsigned short y
, unsigned short Button
,
103 /** Mouse Button Up */
104 void OnMouseUp(unsigned short x
, unsigned short y
, unsigned short Button
,
106 /** Key Release Event */
107 void OnKeyRelease(unsigned char Key
, unsigned short Mod
);
108 /** Special Key Press */
109 void OnSpecialKeyPress(unsigned char Key
);
110 /** DisplayTooltip */
111 void DisplayTooltip();