Control.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00029 #ifndef _GG_Control_h_
00030 #define _GG_Control_h_
00031
00032 #include <GG/Wnd.h>
00033
00034
00035 namespace GG {
00036
00048 class GG_API Control : public Wnd
00049 {
00050 public:
00052 virtual void DropsAcceptable(DropsAcceptableIter first,
00053 DropsAcceptableIter last,
00054 const Pt& pt) const;
00055
00056 Clr Color() const;
00057 bool Disabled() const;
00058
00059
00061 virtual void AcceptDrops(const std::vector<Wnd*>& wnds, const Pt& pt);
00062 virtual void Render() = 0;
00063
00064 virtual void SetColor(Clr c);
00065 virtual void Disable(bool b = true);
00066
00067 virtual void DefineAttributes(WndEditor* editor);
00069
00070 protected:
00072 Control();
00073 Control(X x, Y y, X w, Y h, Flags<WndFlag> flags = INTERACTIVE);
00074
00075
00076 virtual void MouseWheel(const Pt& pt, int move, Flags<ModKey> mod_keys);
00077 virtual void KeyPress(Key key, boost::uint32_t key_code_point, Flags<ModKey> mod_keys);
00078 virtual void KeyRelease(Key key, boost::uint32_t key_code_point, Flags<ModKey> mod_keys);
00079
00080 Clr m_color;
00081 bool m_disabled;
00082
00083 private:
00084 friend class boost::serialization::access;
00085 template <class Archive>
00086 void serialize(Archive& ar, const unsigned int version);
00087 };
00088
00089 }
00090
00091
00092 template <class Archive>
00093 void GG::Control::serialize(Archive& ar, const unsigned int version)
00094 {
00095 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Wnd)
00096 & BOOST_SERIALIZATION_NVP(m_color)
00097 & BOOST_SERIALIZATION_NVP(m_disabled);
00098 }
00099
00100 #endif // _GG_Control_h_