VR-Forces 4.7 Class Documentation
 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 
17 class QLabel;
18 class QHBoxLayout;
19 class QColorDialog;
20 
21 namespace makVrv
22 {
23  class DtColorPushButton;
24 }
25 
26 namespace makVrf
27 {
30  {
31  Q_OBJECT
32 
33  Q_PROPERTY(bool showAlphaChannel READ showAlphaChannel WRITE setShowAlphaChannel)
34  Q_PROPERTY(bool showColorWidget READ showColorWidget WRITE setShowColorWidget)
35  Q_PROPERTY(bool blackIsOne READ blackIsOne WRITE setBlackIsOne)
36 
37  public:
38  DtColorEntryWidget(makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0, const CreationFlags& cflags = NormalMode);
39 
40  //DTOR
41  virtual ~DtColorEntryWidget();
42 
44  virtual void setLabel(const QString&);
45  virtual QString label() const;
46 
48  virtual void setRange(double bottom, double top);
49 
51  virtual void setDefaultValue(const std::string&);
52 
54  virtual void setVariableData(const QString&);
55 
57  virtual DtReaderWriter* createBoundVariable(const std::string& variableName);
58 
60  virtual void setupFromBoundVariable(const DtReaderWriter* variableName);
61 
63  virtual void setColor(const DtRwColor&);
64  virtual DtRwColor color() const;
65 
66  static makVrv::DtUnicode codeVariableType()
67  {
68  return makVrv::DtUnicode::tr("Color: rgba");
69  }
70 
73  virtual void setBlackIsOne(bool);
74  virtual bool blackIsOne() const;
75 
77  boost::signal<void ()> signal_changed;
78 
79  virtual DtTaskSetVariableWidgetExtensionInterface* parameterContents(QWidget* parent, const Qt::WindowFlags& flags = 0) const;
80 
82  virtual void setShowColorWidget(bool);
83  bool showColorWidget() const { return myColorWidgetShown; }
84 
86  virtual void setShowAlphaChannel(bool);
87  bool showAlphaChannel() const { return myShowAlphaChannel; };
88 
89  static std::string designerGroup()
90  {
91  return tr("VR-Forces Data Entry").toUtf8().constData();
92  }
93 
94  static std::string headerFile()
95  {
96  return tr("<vrfGuiCoreQt/colorEntryWidget.h>").toUtf8().constData();
97  }
98 
99  static std::string variableName()
100  {
101  return tr("color").toUtf8().constData();
102  }
103 
104  protected:
105  virtual std::string variableDataFromUiDesigner(const QDomElement& element, const DtScriptedTaskVariableLayoutConverter& converter) const;
106 
107  protected slots:
108  virtual void onColorChanged();
109 
110  public:
113  QHBoxLayout* myContentLayout;
114  QColorDialog* myColorDialog;
115 
116  protected:
120  };
121 
123 
126  {
127  Q_OBJECT
128 
129  public:
130  DtColorVariableWidgetExtension(makVrv::DtDe&, QWidget* w, const Qt::WindowFlags& f = 0);
132  };
133 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)