VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
newTacticalGraphicEntryWidget.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 
17 #include <matrix/vlVector.h>
18 
20 #include <QtWidgets/QWidget>
21 #include <QtWidgets/QBoxLayout>
22 #include <QtWidgets/QPushButton>
23 #include <QtWidgets/QLabel>
24 #include <QtWidgets/QLineEdit>
25 
26 #include <QtDesigner/QExtensionFactory>
27 #include <QtDesigner/QDesignerTaskMenuExtension>
28 
29 class DtEntityType;
30 
31 namespace makVrf
32 {
33  class DtNewTacticalGraphicEntryWidgetLogic;
34 
36  {
37  Q_OBJECT
38  Q_PROPERTY(QString entityType READ variableData WRITE setVariableData)
39 
40  public:
41 
43  {
46  DtObjectBeingDefined
47  };
48 
51  QWidget* parent, const Qt::WindowFlags& flags = 0, const CreationFlags& cflags = NormalMode);
52 
55 
58  void init();
59 
61  virtual void setObjectDefined(DtObjectDefinitionState state);
62 
64  virtual DtObjectDefinitionState objectDefined() const;
65 
68  virtual DtReaderWriter* createBoundVariable(const std::string& variableName);
69 
71  virtual void setupFromBoundVariable(const DtReaderWriter* variableName);
72 
75  virtual DtTaskSetVariableWidgetExtensionInterface* parameterContents(
76  QWidget* parent, const Qt::WindowFlags& flags = 0) const;
77 
80  bool isValid() const;
81 
83  virtual void setEntityTypeToCreate(const DtEntityType&);
84 
87  virtual const DtEntityType& entityTypeCreated() const;
88 
90  static bool canBeUsedAsWidget()
91  {
92  return true;
93  }
94 
96  {
97  return makVrv::DtUnicode::tr("List of Location3Ds");
98  }
99 
100  static std::string designerGroup()
101  {
102  return tr("VR-Forces Object Creation").toUtf8().constData();
103  }
104 
105  static std::string headerFile()
106  {
107  return tr("<vrfGuiCoreQt/newTacticalGraphicEntryWidget.h>").toUtf8().constData();
108  }
109 
110  static std::string variableName()
111  {
112  return tr("tacticalGraphic").toUtf8().constData();
113  }
114 
116  static void initializeForQtDesignerExtension(makVrv::DtDe&, QDesignerFormEditorInterface*);
117 
120  virtual void setVariableData(const QString&);
121 
122  virtual void setButtonTexts(const std::string& objectDefinedText, const std::string& objectBeingDefinedText, const std::string& objectNotDefinedText);
123  virtual void setStatusTexts(const std::string& objectDefinedText, const std::string& objectBeingDefinedText, const std::string& objectNotDefinedText);
124 
126  boost::signals2::signal<void()> signal_statusChanged;
127 
128  protected:
131  virtual DtNewTacticalGraphicEntryWidgetLogic* createLogic();
132 
134  virtual void setupGui();
135 
137  virtual void setupConnections();
138 
140  virtual void setRange(double top, double bottom);
141 
143  virtual void setDefaultValue(const std::string&);
144 
146  virtual void closeEvent(QCloseEvent* event);
147 
149  virtual void hideEvent(QHideEvent* event);
150 
151  virtual std::string variableDataFromUiDesigner(const QDomElement& element, const DtScriptedTaskVariableLayoutConverter& converter) const;
152 
153  protected slots:
154 
155  virtual void slot_onDefineButtonClicked();
156 
157  public:
158  QWidget* myWidget;
159  QHBoxLayout* myLayout;
162 
163  protected:
167 
171 
174  };
175 
179  {
180  Q_OBJECT
181 
182  public:
183  DtNewTacticalGraphicEntryVariableWidgetExtension(makVrv::DtDe&, QWidget* w, const Qt::WindowFlags& f = 0);
184 
186 
187  virtual int setFrom(const DtScriptedTaskVariable&, QGridLayout* parentLayout, int startRow);
188  virtual void setTo(DtScriptedTaskVariable&) const;
189 
190  virtual void setReadOnly(bool);
191 
192  protected slots:
193  virtual void onSelectEntityType();
194 
195  public:
196  QHBoxLayout* myLayout;
200  };
201 
203  {
204  public:
207 
209  {
210  }
211 
213  makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0, const DtTaskSetVariableWidgetInterface::CreationFlags& cflags = DtTaskSetVariableWidgetInterface::NormalMode)
214  {
216  new DtNewTacticalGraphicEntryWidget(de, parent, flags, cflags);
217  w->init();
218  return w;
219  }
220 
222  virtual bool canBeUsedAsWidget() const
223  {
225  }
226 
228  {
230  }
231 
232  virtual std::string className() const
233  {
234  return DtNewTacticalGraphicEntryWidget::staticMetaObject.className();
235  }
236 
237  virtual std::string designerGroup() const
238  {
240  }
241 
242  virtual std::string headerFile() const
243  {
245  }
246 
247  virtual bool includeInDesigner() const
248  {
249  return true;
250  }
251 
252  virtual std::string variableName() const
253  {
255  }
256 
259  virtual void initializeForQtDesignerExtension(makVrv::DtDe& de, QDesignerFormEditorInterface* core)
260  {
262  }
263  };
264 
267  {
268  Q_OBJECT
269 
270  public:
271  explicit DtNewTacticalGraphicEntryWidgetMenuFactory(makVrv::DtDe&, QExtensionManager *parent = 0);
272 
273  protected:
274  QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
275 
276  protected:
278  };
279 
281  {
282  Q_OBJECT
283  Q_INTERFACES(QDesignerTaskMenuExtension)
284 
285  public:
287 
288  virtual QAction *preferredEditAction() const;
289  virtual QList<QAction *> taskActions() const;
290 
291  protected slots:
292  virtual void editState();
293 
294  protected:
298  };
299 }
DtObjectDefinitionState myObjectDefinitionState
Definition: newTacticalGraphicEntryWidget.h:172
DtNewTacticalGraphicEntryWidgetLogic * myLogic
Definition: newTacticalGraphicEntryWidget.h:173
virtual DtTaskSetVariableWidgetInterface * create(makVrv::DtDe &de, QWidget *parent, const Qt::WindowFlags &flags=0, const DtTaskSetVariableWidgetInterface::CreationFlags &cflags=DtTaskSetVariableWidgetInterface::NormalMode)
Definition: newTacticalGraphicEntryWidget.h:212
A unicode string.
Definition: DtUnicode.h:33
std::string myButtonObjectNotDefinedText
Definition: newTacticalGraphicEntryWidget.h:166
std::string myButtonObjectBeingDefinedText
Definition: newTacticalGraphicEntryWidget.h:165
CreationFlags
Definition: taskSetVariableWidget.h:118
makVrv::DtDe & myDe
Definition: newTacticalGraphicEntryWidget.h:277
virtual makVrv::DtUnicode codeVariableType() const
Definition: newTacticalGraphicEntryWidget.h:227
virtual std::string designerGroup() const
The designer group that this is going into.
Definition: newTacticalGraphicEntryWidget.h:237
#define DT_DLL_VRFGUICOREQT
Definition: vrfGuiCoreQt.h:26
DtObjectDefinitionState
Definition: newTacticalGraphicEntryWidget.h:42
Definition: newTacticalGraphicEntryWidget.h:44
Definition: newTacticalGraphicEntryWidget.h:280
This class will parse the UI file for known scripted task variable types and pull out specified scrip...
Definition: scriptedTaskVariableLayoutConverter.h:32
Definition: taskSetVariableWidget.h:120
Definition: readerWriter.h:85
static makVrv::DtUnicode codeVariableType()
Definition: newTacticalGraphicEntryWidget.h:95
void init()
Creates the object, sets up the GUI, and sets up the signal/slot connections for this widget...
QWidget * myWidget
Definition: newTacticalGraphicEntryWidget.h:158
QPushButton * myEntityTypeEditButton
Definition: newTacticalGraphicEntryWidget.h:199
QHBoxLayout * myLayout
Definition: newTacticalGraphicEntryWidget.h:196
DtNewTacticalGraphicEntryWidgetCreator()
Definition: newTacticalGraphicEntryWidget.h:205
boost::signals2::signal< void()> signal_statusChanged
Signals.
Definition: newTacticalGraphicEntryWidget.h:126
virtual ~DtNewTacticalGraphicEntryWidgetCreator()
Definition: newTacticalGraphicEntryWidget.h:208
QPushButton * myDefineButton
Definition: newTacticalGraphicEntryWidget.h:160
virtual bool canBeUsedAsWidget() const
Whether or not this shows up as a usable variable widget.
Definition: newTacticalGraphicEntryWidget.h:222
static std::string headerFile()
Definition: newTacticalGraphicEntryWidget.h:105
QLineEdit * myEntityType
Definition: newTacticalGraphicEntryWidget.h:198
Basic implementation that has a label at the top.
Definition: taskSetVariableWidget.h:228
std::string myButtonObjectDefinedText
Definition: newTacticalGraphicEntryWidget.h:164
virtual std::string headerFile() const
The header file to include when generating code.
Definition: newTacticalGraphicEntryWidget.h:242
static DtUnicode tr(const char *ascii)
Ascii translation function, used to be compatible with Qt&#39;s translation tools.
Definition: DtUnicode.h:92
static std::string variableName()
Definition: newTacticalGraphicEntryWidget.h:110
static bool canBeUsedAsWidget()
Whether or not this shows up as a usable variable widget.
Definition: newTacticalGraphicEntryWidget.h:90
Definition: newTacticalGraphicEntryWidget.h:45
std::string myStatusObjectNotDefinedText
Definition: newTacticalGraphicEntryWidget.h:170
QLabel * myLabel
Definition: newTacticalGraphicEntryWidget.h:197
Definition: newTacticalGraphicEntryWidget.h:35
This class will define the interface needed for being a task set variable that can be used in task di...
Definition: taskSetVariableWidget.h:115
static std::string designerGroup()
Definition: newTacticalGraphicEntryWidget.h:100
A class for keeping track of meta data for variables of scripted tasks.
Definition: scriptedTaskVariable.h:31
QLabel * myStatusLabel
Definition: newTacticalGraphicEntryWidget.h:161
Private to this class.
Definition: newTacticalGraphicEntryWidgetLogic.h:35
virtual std::string variableName() const
The default variable nameto initially assign to this object.
Definition: newTacticalGraphicEntryWidget.h:252
QAction * myEditStateAction
Definition: newTacticalGraphicEntryWidget.h:295
Definition: newTacticalGraphicEntryWidget.h:202
std::string myStatusObjectBeingDefinedText
Definition: newTacticalGraphicEntryWidget.h:169
QHBoxLayout * myLayout
Definition: newTacticalGraphicEntryWidget.h:159
Qt designer extensions.
Definition: newTacticalGraphicEntryWidget.h:266
makVrv::DtDe & myDe
Definition: newTacticalGraphicEntryWidget.h:297
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
Creator class to be used when creating instances of task/set variables.
Definition: taskSetVariableWidget.h:375
std::string myStatusObjectDefinedText
Definition: newTacticalGraphicEntryWidget.h:168
Definition: translator.h:58
DtNewTacticalGraphicEntryWidget * myWidget
Definition: newTacticalGraphicEntryWidget.h:296
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
virtual bool includeInDesigner() const
Include this class in the designer plugin.
Definition: newTacticalGraphicEntryWidget.h:247
virtual std::string className() const
Definition: newTacticalGraphicEntryWidget.h:232
virtual void initializeForQtDesignerExtension(makVrv::DtDe &de, QDesignerFormEditorInterface *core)
Called when initializing widget for potential Qt Designer plugin usage.
Definition: newTacticalGraphicEntryWidget.h:259
Extension interface for contents for definition of variables in the scripted task meta data variable ...
Definition: taskSetVariableWidget.h:83
Extension widget which allows the entity type of the tactical graphic to be created.
Definition: newTacticalGraphicEntryWidget.h:178
static void initializeForQtDesignerExtension(makVrv::DtDe &, QDesignerFormEditorInterface *)
Add custom menu item to task menu to be able to edit the entity type created by this object...

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)