FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
dockarea.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2013 by the FIFE team *
3  * http://www.fifengine.net *
4  * This file is part of FIFE. *
5  * *
6  * FIFE is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU Lesser General Public *
8  * License as published by the Free Software Foundation; either *
9  * version 2.1 of the License, or (at your option) any later version. *
10  * *
11  * This library is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20  ***************************************************************************/
21 
22 #ifndef FIFE_GUI_WIDGETS_DOCKAREA_H
23 #define FIFE_GUI_WIDGETS_DOCKAREA_H
24 
25 // Standard C++ library includes
26 
27 // 3rd party library includes
28 #include <fifechan.hpp>
29 
30 // FIFE includes
31 // These includes are split up in two parts, separated by one empty line
32 // First block: files included from the FIFE root src directory
33 // Second block: files included from the same folder
34 #include "resizablewindow.h"
35 
36 
37 namespace fcn {
38  class DockArea : public ResizableWindow {
39  public:
40  DockArea();
41  DockArea(bool active);
42  virtual ~DockArea();
43 
44  void setActiveDockArea(bool active);
45  bool isActiveDockArea() const;
46 
47  void setTopSide(bool side);
48  bool isTopSide() const;
49  void setRightSide(bool side);
50  bool isRightSide() const;
51  void setBottomSide(bool side);
52  bool isBottomSide() const;
53  void setLeftSide(bool side);
54  bool isLeftSide() const;
55 
56  void dockWidget(Widget* widget);
57  void undockWidget(Widget* widget);
58  void setHighlighted(bool highlighted);
59  bool isHighlighted() const;
60 
67  void setHighlightColor(const Color& color);
68 
75  const Color& getHighlightColor() const;
76 
77  void repositionWidget(Widget* widget);
78 
79 
80  // Inherited from ResizableWindow
81 
82  virtual void add(Widget* widget);
83 
84  virtual void remove(Widget* widget);
85 
86  virtual void resizeToContent(bool recursiv=true);
87 
88  virtual void expandContent(bool recursiv=true);
89 
90 
91  // Inherited from ResizableWindow / MouseListener
92 
93  virtual void mouseEntered(MouseEvent& mouseEvent);
94 
95  virtual void mouseExited(MouseEvent& mouseEvent);
96 
97  virtual void mousePressed(MouseEvent& mouseEvent);
98 
99  virtual void mouseReleased(MouseEvent& mouseEvent);
100 
101  virtual void mouseMoved(MouseEvent& mouseEvent);
102 
103  virtual void mouseDragged(MouseEvent& mouseEvent);
104 
105  protected:
106  void repositionDockAreas();
107  void keepInBounds();
108 
110 
111  bool m_topSide;
115 
117 
120  };
121 }
122 
123 #endif
bool isRightSide() const
Definition: dockarea.cpp:107
virtual void mouseEntered(MouseEvent &mouseEvent)
Definition: dockarea.cpp:398
virtual void mouseExited(MouseEvent &mouseEvent)
Definition: dockarea.cpp:404
void setHighlighted(bool highlighted)
Definition: dockarea.cpp:143
virtual ~DockArea()
Definition: dockarea.cpp:76
Color m_savedColor
Definition: dockarea.h:119
bool isLeftSide() const
Definition: dockarea.cpp:131
void setHighlightColor(const Color &color)
Sets the highlight color of the widget.
Definition: dockarea.cpp:159
void repositionDockAreas()
Definition: dockarea.cpp:228
bool isActiveDockArea() const
Definition: dockarea.cpp:83
void setTopSide(bool side)
Definition: dockarea.cpp:87
virtual void mouseDragged(MouseEvent &mouseEvent)
Definition: dockarea.cpp:431
void setLeftSide(bool side)
Definition: dockarea.cpp:123
virtual void mouseMoved(MouseEvent &mouseEvent)
Definition: dockarea.cpp:425
virtual void add(Widget *widget)
Definition: dockarea.cpp:349
virtual void resizeToContent(bool recursiv=true)
Definition: dockarea.cpp:364
bool m_activeDockArea
Definition: dockarea.h:109
bool m_highlighted
Definition: dockarea.h:116
bool m_leftSide
Definition: dockarea.h:114
virtual void mouseReleased(MouseEvent &mouseEvent)
Definition: dockarea.cpp:416
void setBottomSide(bool side)
Definition: dockarea.cpp:111
void keepInBounds()
Definition: dockarea.cpp:306
bool m_bottomSide
Definition: dockarea.h:113
void undockWidget(Widget *widget)
Definition: dockarea.cpp:139
bool isBottomSide() const
Definition: dockarea.cpp:119
bool isHighlighted() const
Definition: dockarea.cpp:155
void repositionWidget(Widget *widget)
Definition: dockarea.cpp:167
bool m_topSide
Definition: dockarea.h:111
void setRightSide(bool side)
Definition: dockarea.cpp:99
virtual void mousePressed(MouseEvent &mouseEvent)
Definition: dockarea.cpp:410
Color m_highlightColor
Definition: dockarea.h:118
bool isTopSide() const
Definition: dockarea.cpp:95
const Color & getHighlightColor() const
Gets the highlight color.
Definition: dockarea.cpp:163
void setActiveDockArea(bool active)
Definition: dockarea.cpp:79
bool m_rightSide
Definition: dockarea.h:112
virtual void expandContent(bool recursiv=true)
Definition: dockarea.cpp:381
void dockWidget(Widget *widget)
Definition: dockarea.cpp:135