VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
colorEntryWidget.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 #include <vrfutil/rwColor.h>
16 #include <boost/signals2.hpp>
17 
18 class QLabel;
19 class QHBoxLayout;
20 class QColorDialog;
21 
22 namespace makVrv
23 {
24  class DtColorPushButton;
25 }
26 
27 namespace makVrf
28 {
31  {
32  Q_OBJECT
33 
34  Q_PROPERTY(bool showAlphaChannel READ showAlphaChannel WRITE setShowAlphaChannel)
35  Q_PROPERTY(bool showColorWidget READ showColorWidget WRITE setShowColorWidget)
36  Q_PROPERTY(bool blackIsOne READ blackIsOne WRITE setBlackIsOne)
37 
38  public:
39  DtColorEntryWidget(makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0, const CreationFlags& cflags = NormalMode);
40 
41  //DTOR
42  virtual ~DtColorEntryWidget();
43 
45  virtual void setLabel(const QString&);
46  virtual QString label() const;
47 
49  virtual void setRange(double bottom, double top);
50 
52  virtual void setDefaultValue(const std::string&);
53 
55  virtual void setVariableData(const QString&);
56 
58  virtual DtReaderWriter* createBoundVariable(const std::string& variableName);
59 
61  virtual void setupFromBoundVariable(const DtReaderWriter* variableName);
62 
64  virtual void setColor(const DtRwColor&);
65  virtual DtRwColor color() const;
66 
67  static makVrv::DtUnicode codeVariableType()
68  {
69  return makVrv::DtUnicode::tr("Color: rgba");
70  }
71 
74  virtual void setBlackIsOne(bool);
75  virtual bool blackIsOne() const;
76 
78  boost::signals2::signal<void ()> signal_changed;
80  boost::signals2::signal<void()> signal_accepted;
82  boost::signals2::signal<void()> signal_done;
83 
84  virtual DtTaskSetVariableWidgetExtensionInterface* parameterContents(QWidget* parent, const Qt::WindowFlags& flags = 0) const;
85 
87  virtual void setShowColorWidget(bool);
88  bool showColorWidget() const { return myColorWidgetShown; }
89 
91  virtual void setShowAlphaChannel(bool);
92  bool showAlphaChannel() const { return myShowAlphaChannel; };
93 
94  static std::string designerGroup()
95  {
96  return tr("VR-Forces Data Entry").toUtf8().constData();
97  }
98 
99  static std::string headerFile()
100  {
101  return tr("<vrfGuiDataEntryWidgets/colorEntryWidget.h>").toUtf8().constData();
102  }
103 
104  static std::string variableName()
105  {
106  return tr("color").toUtf8().constData();
107  }
108 
109  protected:
110  virtual std::string variableDataFromUiDesigner(const QDomElement& element, const DtScriptedTaskVariableLayoutConverter& converter) const;
111 
112  protected slots:
113  virtual void onColorChanged();
114  virtual void onColorAccepted();
115  virtual void onColorRejected();
116 
117 
118  public:
121  QHBoxLayout* myContentLayout;
123 
124  protected:
128  };
129 
131 
134  {
135  Q_OBJECT
136 
137  public:
138  DtColorVariableWidgetExtension(makVrv::DtDe&, QWidget* w, const Qt::WindowFlags& f = 0);
140  };
141 }
bool myBlackIsOne
Definition: colorEntryWidget.h:127
QLabel * myColorLabel
Definition: colorEntryWidget.h:119
QHBoxLayout * myContentLayout
Definition: colorEntryWidget.h:121
DtTaskSetVariableWidgetCreator< DtColorEntryWidget > DtColorEntryWidgetCreator
Definition: colorEntryWidget.h:130
boost::signals2::signal< void()> signal_accepted
Signal sent when color change is accepted.
Definition: colorEntryWidget.h:80
CreationFlags
Definition: taskSetVariableWidget.h:119
A push-button that displays a current color and pops up a color picker dialog when pressed...
Definition: DtColorPushButton.h:26
bool showAlphaChannel() const
Definition: colorEntryWidget.h:92
This class will parse the UI file for known scripted task variable types and pull out specified scrip...
Definition: scriptedTaskVariableLayoutConverter.h:32
bool showColorWidget() const
Definition: colorEntryWidget.h:88
Definition: readerWriter.h:85
static std::string variableName()
Definition: colorEntryWidget.h:104
Simple string variable widget extension. Hides top/bottom items as they are not needed.
Definition: colorEntryWidget.h:133
boost::signals2::signal< void()> signal_changed
Signal sent when anything about the color has changed.
Definition: colorEntryWidget.h:78
Widget that allows for the selection of a color value.
Definition: colorEntryWidget.h:30
Basic implementation that has a label at the top.
Definition: taskSetVariableWidget.h:233
Reader-Writer color specified by red, green, blue components.
Definition: rwColor.h:19
static DtUnicode tr(const char *ascii)
Ascii translation function, used to be compatible with Qt&#39;s translation tools. This will simply call ...
Definition: DtUnicode.h:92
Definition: taskSetVariableWidget.h:426
#define DT_DLL_VRFGUIDATAENTRYWIDGETS
Definition: vrfGuiDataEntryWidgets.h:22
static std::string designerGroup()
Definition: colorEntryWidget.h:94
boost::signals2::signal< void()> signal_done
Signal sent when color change is rejected/cancelled.
Definition: colorEntryWidget.h:82
QColorDialog * myColorDialog
Definition: colorEntryWidget.h:122
bool myShowAlphaChannel
Definition: colorEntryWidget.h:125
static std::string headerFile()
Definition: colorEntryWidget.h:99
makVrv::DtColorPushButton * myColor
Definition: colorEntryWidget.h:120
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
Simple general extension widget that provides a default value and range. Subclasses can supply additi...
Definition: simpleVariableWidget.h:186
Extension interface for contents for definition of variables in the scripted task meta data variable ...
Definition: taskSetVariableWidget.h:84
bool myColorWidgetShown
Definition: colorEntryWidget.h:126

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)