API Documentation
Loading...
Searching...
No Matches
SectionWidgetTabsScrollArea.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: SectionWidgetTabsScrollArea
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/RibbonArea.h>
35#include <NDEVR/Buffer.h>
36#include <QWidget>
37class QScrollArea;
38class QFrame;
39class QBoxLayout;
40class QSpacerItem;
41namespace NDEVR
42{
43 class SelectionHighlightBar;
44 class ScrollEdge;
45 /**--------------------------------------------------------------------------------------------------
46 \brief Custom scrollable implementation for docked tabs using the NDEVR API Widget Docking system.
47 **/
49 {
50 Q_OBJECT
51 public:
52 SectionWidgetTabsScrollArea(QWidget* parent = nullptr);
54 QSize sizeHint() const override;
55 QSize minimumSizeHint() const override;
56 QWidget* tabsContainer() const { return m_tabs_container_widget; }
57 void removeMainWidget(bool animate);
58 void insertMainWidget(uint04 index, QWidget* widget, bool animate);
59 void insertTabWidget(uint04 index, QWidget* widget);
60 void removeTabWidget(QWidget* widget);
61 bool hasTabWidget(QWidget* widget);
62 void setWidgetSelected(QWidget* widget);
63 void resizeEvent(QResizeEvent* event) override;
64 QScrollArea* scrollArea() { return m_scroll_area; }
65 void setArea(RibbonArea area);
66 RibbonArea area() const { return m_ribbon_area; }
67 uint04 indexOf(QWidget* widget) const;
68 uint04 count() const;
69 QWidget* widget(uint04 index);
70 void swap(uint04 a, uint04 b);
71 void move(uint04 from, uint04 to);
72 bool isAtBottom() const;
73 bool isAtTop() const;
74 bool isVertical() const;
75 bool isRelativeVertical() const;
76 bool isTextVertical() const;
78 void setAutoExpand(bool auto_expand);
79 void paintEvent(QPaintEvent* event) override;
81 void showEvent(QShowEvent*) override;
82 bool event(QEvent* event) override;
83 QWidget* mainWidget() const;
84 signals:
86 protected:
87 QSize scrollSizeHint() const;
88 void setupSeperator(QFrame* line);
89 QBoxLayout* tabsLayout() { return m_tabs_layout; }
95 protected:
96 virtual void wheelEvent(QWheelEvent*) override;
97 QScrollArea* m_scroll_area;
99 QBoxLayout* m_tabs_layout;
104 QSpacerItem* m_spacer_item;
107 QWidget* m_main_widget = nullptr;
111 ScrollEdge* m_top_edge;
112 ScrollEdge* m_bottom_edge;
114 bool m_is_bottom = false;
116 bool m_auto_expand = false;
118 uint04 m_main_widget_location = Constant<uint04>::Invalid;
119 };
120}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Custom scrollable implementation for docked tabs using the NDEVR API Widget Docking system.
Definition SectionWidgetTabsScrollArea.h:49
RibbonArea area() const
Definition SectionWidgetTabsScrollArea.h:66
Buffer< QFrame * > m_seperators
Definition SectionWidgetTabsScrollArea.h:105
QSpacerItem * m_spacer_item
Definition SectionWidgetTabsScrollArea.h:104
QWidget * m_tabs_container_widget
Definition SectionWidgetTabsScrollArea.h:98
QSize minimumSizeHint() const override
bool m_auto_scroll_to_bottom
Definition SectionWidgetTabsScrollArea.h:115
void insertMainWidget(uint04 index, QWidget *widget, bool animate)
QWidget * m_float_widget
Definition SectionWidgetTabsScrollArea.h:102
void swap(uint04 a, uint04 b)
void removeTabWidget(QWidget *widget)
QWidget * widget(uint04 index)
QSize sizeHint() const override
ScrollEdge * m_bottom_edge
Definition SectionWidgetTabsScrollArea.h:112
QBoxLayout * tabsLayout()
Definition SectionWidgetTabsScrollArea.h:89
void removeMainWidget(bool animate)
bool hasTabWidget(QWidget *widget)
SectionWidgetTabsScrollArea(QWidget *parent=nullptr)
QScrollArea * m_scroll_area
Definition SectionWidgetTabsScrollArea.h:97
SelectionHighlightBar * m_highlight_bar
Definition SectionWidgetTabsScrollArea.h:108
bool event(QEvent *event) override
QScrollArea * scrollArea()
Definition SectionWidgetTabsScrollArea.h:64
uint04 m_update_count
Definition SectionWidgetTabsScrollArea.h:117
void setArea(RibbonArea area)
QWidget * tabsContainer() const
Definition SectionWidgetTabsScrollArea.h:56
void showEvent(QShowEvent *) override
void resizeEvent(QResizeEvent *event) override
virtual void wheelEvent(QWheelEvent *) override
QBoxLayout * m_tabs_layout
Definition SectionWidgetTabsScrollArea.h:99
RibbonArea m_ribbon_area
Definition SectionWidgetTabsScrollArea.h:109
void paintEvent(QPaintEvent *event) override
void insertTabWidget(uint04 index, QWidget *widget)
QWidget * m_inner_scroll
Definition SectionWidgetTabsScrollArea.h:100
QTimer * m_bounds_updater
Definition SectionWidgetTabsScrollArea.h:110
Buffer< QWidget * > m_widgets
Definition SectionWidgetTabsScrollArea.h:106
void move(uint04 from, uint04 to)
QWidget * m_selected_widget
Definition SectionWidgetTabsScrollArea.h:101
bool m_is_shown
Definition SectionWidgetTabsScrollArea.h:113
ScrollEdge * m_top_edge
Definition SectionWidgetTabsScrollArea.h:111
void setAutoExpand(bool auto_expand)
QBoxLayout * m_inner_scroll_layout
Definition SectionWidgetTabsScrollArea.h:103
uint04 indexOf(QWidget *widget) const
void setWidgetSelected(QWidget *widget)
Provides a highlighted animation for selecting docked tabs using the NDEVR API Widget Docking system.
Definition SelectionHighlightBar.h:48
Definition ACIColor.h:37
RibbonArea
Requests a ribbon or tab area to be in a certain location and orientation relative to another widget.
Definition RibbonArea.h:71
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233