API Documentation
Loading...
Searching...
No Matches
RibbonGroup.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: NDEVR
28File: RibbonGroup
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/RibbonLayoutMode.h>
35#include <NDEVR/Buffer.h>
36#include <NDEVR/String.h>
37#include <NDEVR/Dictionary.h>
38#include <QWidget>
39#include <QBoxLayout>
40class QFrame;
41namespace NDEVR
42{
43 class QCustomLabel;
44 class RibbonSubGroup;
45 class TranslatedString;
46 /**--------------------------------------------------------------------------------------------------
47 \brief Represents the "Tab" of a widget. For example sections such as Home, View, Edit, Measurements
48 would all be RibbonGroups and children of a Ribbon object.
49 **/
50 class NDEVR_WIDGETS_API RibbonGroup : public QWidget
51 {
52 Q_OBJECT
53 public:
54 RibbonGroup(QWidget* parent = nullptr);
56 void addSubGroup(QWidget* sub_group);
58 QSize minimumSizeHint() const override;
59 bool hasSubGroup(const TranslatedString& sub_group) const;
62 int marginThickness() const;
63 bool event(QEvent* ev) override;
64 int largeButtonWidth() const;
65 int mediumButtonWidth() const;
67 void setupSeperator(QFrame* seperator) const;
69 void setNumberOfRows(uint04 number_of_rows);
70 void ribbonResizeEvent(int primary, int secondary);
71 void resizeEvent(QResizeEvent* resize_event) override;
72 void updateLayout(QSize size);
73 void setVertical(bool is_vertical);
75 void adjustButtonsToFit(int primary, int secondary);
76 void setFixedNumOfRows(uint01 fixed_num_of_rows);
77 public slots:
79 public:
88 QBoxLayout* m_layout;
89 };
90
91}
#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
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Represents the "Tab" of a widget. For example sections such as Home, View, Edit, Measurements would a...
Definition RibbonGroup.h:51
Buffer< QFrame * > m_seperators
Definition RibbonGroup.h:81
QSize minimumSizeHint() const override
int currentSecondaryDimension() const
int marginThickness() const
RibbonSubGroup * addSubGroup(const TranslatedString &sub_group_name)
void setupSeperator(QFrame *seperator) const
RibbonGroup(QWidget *parent=nullptr)
bool hasSubGroup(const TranslatedString &sub_group) const
Vector< 2, int > minSize() const
bool m_is_vertical
Definition RibbonGroup.h:85
int currentPrimaryDimension() const
int m_last_width
Definition RibbonGroup.h:86
int largeButtonWidth() const
void updateLayout(QSize size)
uint04 maxNumOfColumns() const
Dictionary< String, RibbonSubGroup * > m_sub_group_lookup
Definition RibbonGroup.h:82
RibbonSubGroup & operator[](const TranslatedString &location)
void adjustButtonsToFit(int primary, int secondary)
Buffer< QWidget * > m_sub_groups
Definition RibbonGroup.h:80
bool event(QEvent *ev) override
RibbonLayoutMode m_layout_mode
Definition RibbonGroup.h:84
uint01 m_fixed_num_of_rows
Definition RibbonGroup.h:87
uint04 m_row_num
Definition RibbonGroup.h:83
void setNumberOfRows(uint04 number_of_rows)
void setVertical(bool is_vertical)
void resizeEvent(QResizeEvent *resize_event) override
void ribbonResizeEvent(int primary, int secondary)
void setFixedNumOfRows(uint01 fixed_num_of_rows)
void addSubGroup(QWidget *sub_group)
QBoxLayout * m_layout
Definition RibbonGroup.h:88
int mediumButtonWidth() const
Represents a sub-section of "Tab" of a ribbon represting a grouping of buttons or widgets within a ta...
Definition RibbonSubGroup.h:47
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Definition ACIColor.h:37
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
RibbonLayoutMode
The orientations a ribbon can take on.
Definition RibbonLayoutMode.hpp:39
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96