VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
resourceSelectionEntryWidget.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #if !defined(Q_MOC_RUN)
17 #endif
18 
19 #include <QtDesigner/QExtensionFactory>
20 #include <QtDesigner/QDesignerTaskMenuExtension>
21 
22 class QLabel;
23 class QHBoxLayout;
24 class QComboBox;
26 
27 namespace makVrf
28 {
31  {
32  Q_OBJECT
33 
34  public:
35  DtResourceSelectionEntryWidget(makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0, const CreationFlags& cflags = NormalMode);
36 
37  //DTOR
39 
41  virtual void setLabel(const QString&);
42  virtual QString label() const;
43 
45  virtual void setRange(double bottom, double top);
46 
48  virtual void setDefaultValue(const std::string&);
49 
51  virtual void setVariableData(const QString&);
52 
54  virtual void setupFrom(const std::vector<makVrv::DtSimEntry*>& data);
55 
57  virtual DtReaderWriter* createBoundVariable(const std::string& variableName);
58 
60  virtual void setupFromBoundVariable(const DtReaderWriter* variableName);
61 
63  {
64  return makVrv::DtUnicode::tr("String (resource name)");
65  }
66 
67  static std::string designerGroup()
68  {
69  return tr("VR-Forces Resources").toUtf8().constData();
70  }
71 
72  static std::string headerFile()
73  {
74  return tr("<vrfGuiDataEntryWidgets/resourceSelectionEntryWidget.h>").toUtf8().constData();
75  }
76 
77  static std::string variableName()
78  {
79  return tr("resource").toUtf8().constData();
80  }
81 
83  static void initializeForQtDesignerExtension(makVrv::DtDe&, QDesignerFormEditorInterface*);
84 
85  protected:
90  virtual bool shouldAddResource(const DtResource&) const;
91  virtual bool isResourceType(const DtResource&, const std::string& validResources) const;
92  virtual bool isEntityType(const DtResource&, const std::string& validEntityTypes) const;
93 
94  virtual void addResource(const DtResource&);
95  virtual void resourceUpdated(const DtResource&);
96  virtual void resourcesChanged();
97  virtual void resourceCheckingDisabled();
98  virtual void resourceCheckComplete();
99 
100  virtual DtTaskSetVariableWidgetExtensionInterface* parameterContents(QWidget* parent, const Qt::WindowFlags& flags) const;
101 
102  public:
105  QHBoxLayout* myContentLayout;
106 
107  protected:
108  QString myDefaultValue;
110  };
111 
114  {
115  Q_OBJECT
116 
117  public:
118  DtMunitionResourceSelectionEntryWidget(makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0, const CreationFlags& cflags = NormalMode);
119 
120  //DTOR
122 
124  virtual void setVariableData(const QString&);
125 
126  static std::string designerGroup()
127  {
128  return tr("VR-Forces Resources").toUtf8().constData();
129  }
130 
131  static std::string headerFile()
132  {
133  return tr("<vrfGuiDataEntryWidgets/resourceSelectionEntryWidget.h>").toUtf8().constData();
134  }
135 
136  static std::string variableName()
137  {
138  return tr("munition").toUtf8().constData();
139  }
140  };
141 
144  {
145  Q_OBJECT
146 
147  public:
148  DtBombResourceSelectionEntryWidget(makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0, const CreationFlags& cflags = NormalMode);
149 
150  //DTOR
152 
154  virtual void setVariableData(const QString&);
155 
156  static std::string designerGroup()
157  {
158  return tr("VR-Forces Resources").toUtf8().constData();
159  }
160 
161  static std::string headerFile()
162  {
163  return tr("<vrfGuiDataEntryWidgets/resourceSelectionEntryWidget.h>").toUtf8().constData();
164  }
165 
166  static std::string variableName()
167  {
168  return tr("bomb").toUtf8().constData();
169  }
170 
171  static const std::vector<DtEntityType>& bombMunitionTypes(makVrv::DtDe& de);
172  };
173 
176  {
177  Q_OBJECT
178 
179  public:
180  DtNavalMineResourceSelectionEntryWidget(makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0, const CreationFlags& cflags = NormalMode);
181 
182  //DTOR
184 
186  virtual void setVariableData(const QString&);
187 
188  static std::string designerGroup()
189  {
190  return tr("VR-Forces Resources").toUtf8().constData();
191  }
192 
193  static std::string headerFile()
194  {
195  return tr("<vrfGuiDataEntryWidgets/resourceSelectionEntryWidget.h>").toUtf8().constData();
196  }
197 
198  static std::string variableName()
199  {
200  return tr("navalMine").toUtf8().constData();
201  }
202  };
203 
208 
211  {
212  Q_OBJECT
213 
214  public:
215  explicit DtResourceSelectionEntryWidgetMenuFactory(makVrv::DtDe&, QExtensionManager *parent = 0);
216 
217  protected:
218  QObject *createExtension(QObject *object, const QString &iid, QObject *parent) const;
219 
220  protected:
222  };
223 
225  {
226  Q_OBJECT
227  Q_INTERFACES(QDesignerTaskMenuExtension)
228 
229  public:
231 
232  virtual QAction *preferredEditAction() const;
233  virtual QList<QAction *> taskActions() const;
234 
235  protected slots:
236  virtual void editState();
237 
238  protected:
242  };
243 }
static std::string variableName()
Definition: resourceSelectionEntryWidget.h:166
Widget that only displays anti sub or anti ship mine munition resources.
Definition: resourceSelectionEntryWidget.h:175
Definition: resourceSelectionEntryWidget.h:224
QString myDefaultValue
Definition: resourceSelectionEntryWidget.h:108
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
QComboBox * myResources
Definition: resourceSelectionEntryWidget.h:104
Widget that only displays munition resources.
Definition: resourceSelectionEntryWidget.h:113
Qt designer extensions.
Definition: resourceSelectionEntryWidget.h:210
CreationFlags
Definition: taskSetVariableWidget.h:119
Widget that allows users to select resources for the given entity.
Definition: resourceSelectionEntryWidget.h:30
static std::string variableName()
Definition: resourceSelectionEntryWidget.h:198
static std::string designerGroup()
Definition: resourceSelectionEntryWidget.h:188
static std::string designerGroup()
Definition: resourceSelectionEntryWidget.h:156
static std::string designerGroup()
Definition: resourceSelectionEntryWidget.h:126
Definition: readerWriter.h:85
DtResourceSelectionEntryWidget * myWidget
Definition: resourceSelectionEntryWidget.h:240
static makVrv::DtUnicode codeVariableType()
Definition: resourceSelectionEntryWidget.h:62
DtTaskSetVariableWidgetCreator< DtNavalMineResourceSelectionEntryWidget > DtNavalMineResourceSelectionEntryWidgetCreator
Definition: resourceSelectionEntryWidget.h:207
Common base class that all server responses to a direct client request should subclass from...
Definition: ifServerRequestResponse.h:21
static std::string headerFile()
Definition: resourceSelectionEntryWidget.h:161
makVrv::DtDe & myDe
Definition: resourceSelectionEntryWidget.h:241
static std::string variableName()
Definition: resourceSelectionEntryWidget.h:136
DtTaskSetVariableWidgetCreator< DtBombResourceSelectionEntryWidget > DtBombResourceSelectionEntryWidgetCreator
Definition: resourceSelectionEntryWidget.h:206
static std::string headerFile()
Definition: resourceSelectionEntryWidget.h:193
static std::string headerFile()
Definition: resourceSelectionEntryWidget.h:72
Basic implementation that has a label at the top.
Definition: taskSetVariableWidget.h:233
QHBoxLayout * myContentLayout
Definition: resourceSelectionEntryWidget.h:105
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
static std::string designerGroup()
Definition: resourceSelectionEntryWidget.h:67
#define DT_DLL_VRFGUIDATAENTRYWIDGETS
Definition: vrfGuiDataEntryWidgets.h:22
DtTaskSetVariableWidgetCreator< DtMunitionResourceSelectionEntryWidget > DtMunitionResourceSelectionEntryWidgetCreator
Definition: resourceSelectionEntryWidget.h:205
makVrv::DtDe & myDe
Definition: resourceSelectionEntryWidget.h:221
Widget that only displays munition resources.
Definition: resourceSelectionEntryWidget.h:143
static std::string variableName()
Definition: resourceSelectionEntryWidget.h:77
The class that is the interface between the GUI and the back-end.
Definition: vrfResourceRequestor.h:33
Definition: translator.h:58
QAction * myEditStateAction
Definition: resourceSelectionEntryWidget.h:239
This object will return a block of resources to a request for resources for a particular entity...
Definition: ifEntityResourceResponse.h:34
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
DtTaskSetVariableWidgetCreator< DtResourceSelectionEntryWidget > DtResourceSelectionEntryWidgetCreator
Definition: resourceSelectionEntryWidget.h:204
QLabel * myResourceLabel
Definition: resourceSelectionEntryWidget.h:103
makVrv::DtDe & myDe
Definition: resourceSelectionEntryWidget.h:109
static std::string headerFile()
Definition: resourceSelectionEntryWidget.h:131
Extension interface for contents for definition of variables in the scripted task meta data variable ...
Definition: taskSetVariableWidget.h:84

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)