OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
tabbed_panel_bar.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2020 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_GUI_TABBED_PANEL_BAR
20 #define OST_GUI_TABBED_PANEL_BAR
21 
22 
23 #include <ost/gui/module_config.hh>
24 #include <ost/gui/widget_pool.hh>
25 #include <ost/gui/widget.hh>
26 
28 #include "button_box.hh"
29 
30 #include <QHBoxLayout>
31 #include <QWidget>
32 #include <QString>
33 #include <QAction>
34 #include <QTabBar>
35 #include <QTabWidget>
36 #include <QToolBar>
37 namespace ost { namespace gui {
38 
40 class DLLEXPORT_OST_GUI DragTabBar : public QTabBar{
41  Q_OBJECT
42 public:
43  DragTabBar(QTabWidget* parent);
44 
45 protected:
46  void mousePressEvent(QMouseEvent *event);
47  void mouseMoveEvent(QMouseEvent *event);
48 
49 private:
50  QTabWidget* tab_widget_;
51  QPoint drag_start_pos_;
52 
53 };
54 
56 class DLLEXPORT_OST_GUI TabbedDragWidget : public QTabWidget{
57  Q_OBJECT
58 public:
59  TabbedDragWidget(QWidget* parent);
60 };
61 
64  Q_OBJECT
65 public:
66  TabbedPanelBar(PanelBar* parent);
67  ~TabbedPanelBar();
68 
69  virtual bool Save(const QString& prefix);
70  virtual bool Restore(const QString& prefix);
71 
72  void WidgetMoved(Widget* widget, int position);
73  QString GetName();
74 
75 protected:
76  void dragEnterEvent(QDragEnterEvent *event);
77  void dropEvent(QDropEvent *event);
78 
79 private:
80  virtual void ShowWidget(Widget* widget, int pos, bool show);
81  QHBoxLayout* layout_;
82  QTabWidget* tab_widget_;
83  QToolBar* toolbar_;
84 
85 private slots:
86  void CurrentChanged(int index);
87 
88 };
89 
90 }}
91 
92 #endif
Panel Bar which may contain other Widgets A PanelBar might have different ViewModes which are PanelWi...
Definition: panel_bar.hh:53
#define DLLEXPORT_OST_GUI
A PanelWidgetContainer can display various widgets A PanelWidgetContainer is a abstract class which i...
Base class for widgets.
Definition: widget.hh:40
tabbed drag widget