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 /**--------------------------------------------------------------------------------------------------
44 \brief A Widget for setting up and choosing a Field used for importing and exporting data.
45 **/
46 class FieldChooser : public QWidget
47 {
48 Q_OBJECT
49 public:
50 FieldChooser(QWidget* parent = nullptr);
51
53
54
55 bool allowInt() const;
56 bool allowDecimal() const;
57 bool allowColor() const;
60
61 void refreshUI();
62 void setSelected(DesignParameter param, const TypeInfo& type);
64 {
65 return m_ascii_choosen;
66 }
67
69 {
70 return m_type;
71 }
72 void setAllowDefaultValue(bool allow_default);
73 void setAllowCustom(bool allow_custom);
74 void setSpacialUnit(const ConstPointer<Unit> spacial_unit);
75 void setOrientationUnit(const ConstPointer<Unit> spacial_unit);
77 void setExtraContexMenu(QMenu* menu);
78 protected:
82 void uncheckAll();
83 signals:
84 void accepted();
85 void cleared();
86 void edited();
87 public slots:
88 void onDelete()
89 {
90 emit cleared();
91 }
93 {
94 emit accepted();
95 }
96
99 {
100 }
101
107 protected:
110 Ui::FieldChooserUI* ui;
116 };
117}
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
A definition of data that is logically stored in the Model heirarchy. Data could be a property of a M...
Definition DesignParameter.h:46
A Widget for setting up and choosing a Field used for importing and exporting data.
Definition FieldChooser.h:47
ConstPointer< Unit > m_orientation_unit
Definition FieldChooser.h:115
void setClearButtonText(const TranslatedString &text)
void defaultValueEditedSlot()
Buffer< DesignParameter > m_options
Definition FieldChooser.h:113
void setSpacialUnit(const ConstPointer< Unit > spacial_unit)
DesignParameter m_ascii_choosen
Definition FieldChooser.h:108
TypeInfo getType() const
Definition FieldChooser.h:68
TypeInfo m_type
Definition FieldChooser.h:109
bool allowColor() const
bool is_valid
Definition FieldChooser.h:111
void setAllowCustom(bool allow_custom)
void setOrientationUnit(const ConstPointer< Unit > spacial_unit)
ConstPointer< Unit > m_spacial_unit
Definition FieldChooser.h:114
void onDelete()
Definition FieldChooser.h:88
bool allowCartesianCoordinates() const
bool m_allow_custom
Definition FieldChooser.h:112
DesignParameter getOption() const
Definition FieldChooser.h:63
bool allowDecimal() const
void stopClearSignalTimer()
Definition FieldChooser.h:98
void setExtraContexMenu(QMenu *menu)
bool allowInt() const
Ui::FieldChooserUI * ui
Definition FieldChooser.h:110
bool allowPolarCoordinates() const
void setOptions(const Buffer< DesignParameter > &items)
void setAllowDefaultValue(bool allow_default)
void onAccepted()
Definition FieldChooser.h:92
FieldChooser(QWidget *parent=nullptr)
void setSelected(DesignParameter param, const TypeInfo &type)
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
Stores information about a type, relevant for certain templated functions. To get information about a...
Definition TypeInfo.h:43
Definition ACIColor.h:37
Definition FontEditor.h:6