GG: Control.h Source File

GG

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

Control.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /* GG is a GUI for SDL and OpenGL.
3 Copyright (C) 2003-2008 T. Zachary Laine
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License
7 as published by the Free Software Foundation; either version 2.1
8 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA
19
20 If you do not wish to comply with the terms of the LGPL please
21 contact the author as other terms are available for a fee.
22
23 Zach Laine
24 whatwasthataddress@gmail.com */
25
29 #ifndef _GG_Control_h_
30 #define _GG_Control_h_
31
32 #include <GG/Wnd.h>
33
34
35 namespace GG {
36
48 class GG_API Control : public Wnd
49 {
50 public:
52 virtual void DropsAcceptable(DropsAcceptableIter first,
53 DropsAcceptableIter last,
54 const Pt& pt) const;
55
56 Clr Color() const;
57 bool Disabled() const;
58
59
61 virtual void AcceptDrops(const std::vector<Wnd*>& wnds, const Pt& pt);
62 virtual void Render() = 0;
63
64 virtual void SetColor(Clr c);
65 virtual void Disable(bool b = true);
66
67
68 protected:
70 Control();
71 Control(X x, Y y, X w, Y h, Flags<WndFlag> flags = INTERACTIVE);
72
73
74 virtual void MouseWheel(const Pt& pt, int move, Flags<ModKey> mod_keys);
75 virtual void KeyPress(Key key, boost::uint32_t key_code_point, Flags<ModKey> mod_keys);
76 virtual void KeyRelease(Key key, boost::uint32_t key_code_point, Flags<ModKey> mod_keys);
77
78 Clr m_color;
79 bool m_disabled;
80 };
81
82 } // namespace GG
83
84 #endif