FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
panel.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2017 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_PANEL_H
23 #define FIFE_GUI_WIDGETS_PANEL_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 namespace fcn {
37  class DockArea;
38  class Panel : public ResizableWindow {
39  public:
40  Panel();
41  Panel(bool dockable);
42 
43  virtual ~Panel();
44 
48  void setDockable(bool dockable);
49 
53  bool isDockable() const;
54 
58  void setDocked(bool docked);
59 
63  bool isDocked() const;
64 
65  virtual DockArea* findDockArea();
66 
67  // Inherited from ResizableWindow
68 
69  virtual void resizeToContent(bool recursiv=true);
70  virtual void expandContent(bool recursiv=true);
71 
72 
73  // Inherited from ResizableWindow / MouseListener
74 
75  virtual void mouseEntered(MouseEvent& mouseEvent);
76 
77  virtual void mouseExited(MouseEvent& mouseEvent);
78 
79  virtual void mousePressed(MouseEvent& mouseEvent);
80 
81  virtual void mouseReleased(MouseEvent& mouseEvent);
82 
83  virtual void mouseMoved(MouseEvent& mouseEvent);
84 
85  virtual void mouseDragged(MouseEvent& mouseEvent);
86 
87  protected:
89 
90  // is dockable
91  bool m_dockable;
92  // is docked
93  bool m_docked;
94 
95  struct SavedState {
96  Rectangle dimension;
98  bool resizable;
99  bool movable;
100  };
102  };
103 }
104 
105 #endif
virtual void mouseDragged(MouseEvent &mouseEvent)
Definition: panel.cpp:198
bool isDocked() const
Gets if the widget is docked.
Definition: panel.cpp:91
virtual void mouseMoved(MouseEvent &mouseEvent)
Definition: panel.cpp:194
DockArea * getDockedArea()
Definition: panel.cpp:95
virtual void mousePressed(MouseEvent &mouseEvent)
Definition: panel.cpp:167
bool m_dockable
Definition: panel.h:91
virtual void expandContent(bool recursiv=true)
Definition: panel.cpp:155
SavedState m_state
Definition: panel.h:101
bool isDockable() const
Gets if the widget is dockable.
Definition: panel.cpp:57
virtual void resizeToContent(bool recursiv=true)
Definition: panel.cpp:147
virtual DockArea * findDockArea()
Definition: panel.cpp:103
uint32_t innerBorder
Definition: panel.h:97
Rectangle dimension
Definition: panel.h:96
virtual void mouseExited(MouseEvent &mouseEvent)
Definition: panel.cpp:163
virtual void mouseReleased(MouseEvent &mouseEvent)
Definition: panel.cpp:179
bool m_docked
Definition: panel.h:93
virtual ~Panel()
Definition: panel.cpp:49
unsigned int uint32_t
Definition: core.h:40
void setDocked(bool docked)
Sets if the widget is docked.
Definition: panel.cpp:61
virtual void mouseEntered(MouseEvent &mouseEvent)
Definition: panel.cpp:159
void setDockable(bool dockable)
Sets if the widget is dockable.
Definition: panel.cpp:53