-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
mouse_action_map_label.hpp
62 lines (47 loc) · 1.63 KB
/
mouse_action_map_label.hpp
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
/*
Copyright (C) 2008 - 2017 by Fabian Mueller <fabianmueller5@gmx.de>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
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.
See the COPYING file for more details.
*/
#pragma once
#include "mouse_action.hpp"
#include "editor/palette/empty_palette.hpp"
class CKey;
namespace editor {
/**
* Set map label action.
*/
class mouse_action_map_label : public mouse_action
{
public:
mouse_action_map_label(const CKey& key, empty_palette& palette)
: mouse_action(palette, key), click_(false), clicked_on_(), last_draged_()
{
}
editor_action* click_left(editor_display& disp, int x, int y);
/**
* Drag operation. A click should have occurred earlier. Defaults to no action.
*/
editor_action* drag_left(editor_display& disp, int x, int y, bool& partial, editor_action* last_undo);
/**
* Left click displays a dialog that is used for entering the label string.
*/
editor_action* up_left(editor_display& disp, int x, int y);
editor_action* click_right(editor_display& disp, int x, int y);
/**
* Right click erases the label under the mouse.
*/
editor_action* up_right(editor_display& disp, int x, int y);
virtual void set_mouse_overlay(editor_display& disp);
private:
bool click_;
map_location clicked_on_;
map_location last_draged_;
};
} //end namespace editor