Crazy Eddie's GUI System  0.8.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
widgets/Titlebar.h
1 /***********************************************************************
2  filename: CEGUITitlebar.h
3  created: 25/4/2004
4  author: Paul D Turner
5 
6  purpose: Interface for a Titlebar Widget
7 *************************************************************************/
8 /***************************************************************************
9  * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining
12  * a copy of this software and associated documentation files (the
13  * "Software"), to deal in the Software without restriction, including
14  * without limitation the rights to use, copy, modify, merge, publish,
15  * distribute, sublicense, and/or sell copies of the Software, and to
16  * permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be
20  * included in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  ***************************************************************************/
30 #ifndef _CEGUITitlebar_h_
31 #define _CEGUITitlebar_h_
32 
33 #include "../Window.h"
34 
35 
36 #if defined(_MSC_VER)
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
39 #endif
40 
41 
42 // Start of CEGUI namespace section
43 namespace CEGUI
44 {
45 
51 class CEGUIEXPORT Titlebar : public Window
52 {
53 public:
54  static const String EventNamespace;
55  static const String WidgetTypeName;
56 
64  bool isDraggingEnabled(void) const;
65 
66 
77  void setDraggingEnabled(bool setting);
78 
83  bool isDragged() const;
84 
89  const Vector2f& getDragPoint() const;
90 
91  /*************************************************************************
92  Construction / Destruction
93  *************************************************************************/
98  Titlebar(const String& type, const String& name);
99 
100 
105  virtual ~Titlebar(void);
106 
107 
108 protected:
109  /*************************************************************************
110  Overridden event handler functions
111  *************************************************************************/
112  virtual void onMouseMove(MouseEventArgs& e);
113  virtual void onMouseButtonDown(MouseEventArgs& e);
114  virtual void onMouseButtonUp(MouseEventArgs& e);
115  virtual void onMouseDoubleClicked(MouseEventArgs& e);
116  virtual void onCaptureLost(WindowEventArgs& e);
117  virtual void onFontChanged(WindowEventArgs &e);
118 
119 
120  /*************************************************************************
121  New event handlers for title bar
122  *************************************************************************/
131 
132  /*************************************************************************
133  Implementation Data
134  *************************************************************************/
135  bool d_dragging;
138 
140 
141 private:
142  /*************************************************************************
143  Private methods
144  *************************************************************************/
145  void addTitlebarProperties(void);
146 };
147 
148 } // End of CEGUI namespace section
149 
150 #if defined(_MSC_VER)
151 # pragma warning(pop)
152 #endif
153 
154 #endif // end of guard _CEGUITitlebar_h_