API Documentation
Loading...
Searching...
No Matches
FieldChooser.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: FieldChooser
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/DesignParameter.h>
34#include <NDEVR/TypeInfo.h>
35#include <QWidget>
36namespace Ui
37{
38 class FieldChooserUI;
39}
40namespace NDEVR
41{
42 struct Unit;
43 class FieldChooser : public QWidget
44 {
45 Q_OBJECT
46 public:
47 FieldChooser(QWidget* parent = nullptr);
48
49 void setOptions(const Buffer<DesignParameter>& items);
50
51
52 bool allowInt() const;
53 bool allowDecimal() const;
54 bool allowColor() const;
55 bool allowPolarCoordinates() const;
56 bool allowCartesianCoordinates() const;
57
58 void refreshUI();
59 void setSelected(DesignParameter param, const TypeInfo& type);
61 {
62 return m_ascii_choosen;
63 }
64
66 {
67 return m_type;
68 }
69 void setAllowDefaultValue(bool allow_default);
70 void setAllowCustom(bool allow_custom);
71 void setSpacialUnit(const ConstPointer<Unit> spacial_unit);
72 void setOrientationUnit(const ConstPointer<Unit> spacial_unit);
73 void setClearButtonText(const TranslatedString& text);
74 void setExtraContexMenu(QMenu* menu);
75 protected:
76 void channelChanged();
77 void dimensionsChanged();
78 void typeChanged();
79 void uncheckAll();
80 signals:
81 void accepted();
82 void cleared();
83 void edited();
84 public slots:
85 void onDelete()
86 {
87 emit cleared();
88 }
90 {
91 emit accepted();
92 }
93
94 void clearButtonClicked();
96 {
97 }
98
99 void channelEditedSlot();
101 void typeEditedSlot();
104 protected:
107 Ui::FieldChooserUI* ui;
113 };
114}
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:59
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
Definition DesignParameter.h:42
Definition FieldChooser.h:44
ConstPointer< Unit > m_orientation_unit
Definition FieldChooser.h:112
void setClearButtonText(const TranslatedString &text)
Definition FieldChooser.cpp:139
void defaultValueEditedSlot()
Definition FieldChooser.cpp:373
Buffer< DesignParameter > m_options
Definition FieldChooser.h:110
void setSpacialUnit(const ConstPointer< Unit > spacial_unit)
Definition FieldChooser.cpp:127
void dimensionsChanged()
Definition FieldChooser.cpp:258
DesignParameter m_ascii_choosen
Definition FieldChooser.h:105
void clearButtonClicked()
Definition FieldChooser.cpp:383
TypeInfo getType() const
Definition FieldChooser.h:65
void refreshUI()
Definition FieldChooser.cpp:77
TypeInfo m_type
Definition FieldChooser.h:106
bool allowColor() const
Definition FieldChooser.cpp:62
void dimensionsEditedSlot()
Definition FieldChooser.cpp:325
bool is_valid
Definition FieldChooser.h:108
void uncheckAll()
Definition FieldChooser.cpp:292
void typeEditedSlot()
Definition FieldChooser.cpp:330
void setAllowCustom(bool allow_custom)
Definition FieldChooser.cpp:118
void setOrientationUnit(const ConstPointer< Unit > spacial_unit)
Definition FieldChooser.cpp:133
ConstPointer< Unit > m_spacial_unit
Definition FieldChooser.h:111
void onDelete()
Definition FieldChooser.h:85
bool allowCartesianCoordinates() const
Definition FieldChooser.cpp:72
bool m_allow_custom
Definition FieldChooser.h:109
DesignParameter getOption() const
Definition FieldChooser.h:60
bool allowDecimal() const
Definition FieldChooser.cpp:57
void stopClearSignalTimer()
Definition FieldChooser.h:95
void setExtraContexMenu(QMenu *menu)
Definition FieldChooser.cpp:378
bool allowInt() const
Definition FieldChooser.cpp:52
void channelChanged()
Definition FieldChooser.cpp:143
Ui::FieldChooserUI * ui
Definition FieldChooser.h:107
bool allowPolarCoordinates() const
Definition FieldChooser.cpp:67
void setOptions(const Buffer< DesignParameter > &items)
Definition FieldChooser.cpp:46
void setAllowDefaultValue(bool allow_default)
Definition FieldChooser.cpp:113
void onAccepted()
Definition FieldChooser.h:89
void typeChanged()
Definition FieldChooser.cpp:288
void channelEditedSlot()
Definition FieldChooser.cpp:307
FieldChooser(QWidget *parent=nullptr)
Definition FieldChooser.cpp:7
void dimensionIndexEdited()
Definition FieldChooser.cpp:335
void setSelected(DesignParameter param, const TypeInfo &type)
Definition FieldChooser.cpp:96
Any text displayed to the user should be defined as a TranslatedString which allows the.
Definition TranslatedString.h:13
Stores information about a type, relevant for certain templated functions.
Definition TypeInfo.h:43
Definition ACIColor.h:37
Definition FontEditor.h:6