VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
buttonConfigurationSelectionDialog.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include <vrvUtil/signalslib.h>
12 
17 #include <vlutil/vlString.h>
18 
19 #include <QtWidgets/QWidget>
20 #include <QtWidgets/QDialog>
21 
22 class QLabel;
23 class QTreeWidget;
24 class QPushButton;
25 class QTreeWidgetItem;
26 class QHBoxLayout;
27 
33 
34 namespace makVrv
35 {
36  class DtGameControlInformation;
37  class DtDe;
38 
40  {
41  Q_OBJECT
42 
43  public:
44 
46  DtButtonConfigurationSelectionDialog(DtDe&, QWidget* parent = NULL, const Qt::WindowFlags& flags = Qt::Tool );
47 
50 
51  virtual void setEditing(const std::string& fg, const std::string& function);
52  virtual void setDescription(const std::string&);
53 
54  virtual void setupFromControlInformation(const DtGameControlInformation&);
55 
56  boost::signals2::signal<void (DtGameControlInformation*)> signal_accept;
57 
58  virtual DtGameControlInformation gameControlInformation() const;
59 
60  protected:
61  virtual void accept();
62  virtual void reject();
63  virtual void closeEvent(QCloseEvent*);
64  virtual void addRow(const DtGameControlInformation::GameControlEvent&);
65 
67  virtual QString translateString(const std::string& str) const;
68 
69  protected slots:
70  virtual void onAddGameControl();
71  virtual void onRemoveGameControl();
72  virtual void onButtonControlEdit();
73  virtual void changeIncreaseDecrease();
74  virtual void onControlSelected();
75  virtual void onCycleComboChanged();
76 
77  public:
80  QHBoxLayout* myTopButtonLayout;
84  QHBoxLayout* myBottomButtonLayout;
86 
87  protected:
89  std::string myFunctionGroup;
90  std::string myFunction;
91  bool mySignaled;
92 
93  typedef std::vector<std::vector<QWidget*> > RowWidgets;
95 
96  typedef std::vector<DtGameControlInformation::GameControlEvent> GameControls;
99  };
100 
102 
104  {
105  public:
108 
111 
113  static void registerInstance(DtDe& de, DtButtonConfigurationSelectionDialogCreator* instance);
114 
115  virtual DtButtonConfigurationSelectionDialog* create(QWidget*);
116 
117  protected:
119  };
120 
123  {
124  public:
125  DtButtonChoiceDialog(DtDe&, QWidget* parent = NULL, const Qt::WindowFlags& flags = Qt::Tool);
126 
127  virtual ~DtButtonChoiceDialog();
128 
129  DtGenericControllerEvent* gameControlEvent() const { return myEvent; };
130 
131  virtual void setGameControlEvent(DtGenericControllerEvent*);
132 
133  protected:
134  virtual bool eventFilter(QObject* o, QEvent* evt);
135 
137  virtual bool gameControllerEvent(DtGenericControllerEvent*);
138 
141  virtual void tick(bool sentEvents) {};
142 
144  virtual void gameControllerDeviceRemoved(int) {};
145 
147  virtual void gameControllerDeviceAdded(int) {};
148 
150  virtual bool filterGameControllerEvent(DtGenericControllerEvent*);
151 
153  virtual void noQueuedEvents() {};
154 
155  virtual void showEvent(QShowEvent*);
156 
157  public:
160  QHBoxLayout* myLabelLayout;
163  QHBoxLayout* myButtonLayout;
164 
165  protected:
168  };
169 }
std::vector< std::vector< QWidget * > > RowWidgets
Definition: buttonConfigurationSelectionDialog.h:93
Virtual base class.
Definition: DtVirtualBaseClass.h:22
boost::signals2::signal< void(DtGameControlInformation *)> signal_accept
Definition: buttonConfigurationSelectionDialog.h:56
Definition: buttonConfigurationSelectionDialog.h:39
bool mySignaled
Definition: buttonConfigurationSelectionDialog.h:91
Factory constructor for this dialog.
Definition: buttonConfigurationSelectionDialog.h:103
QLabel * myControlLabel
Definition: buttonConfigurationSelectionDialog.h:158
GameControls myGameControls
Definition: buttonConfigurationSelectionDialog.h:97
Handler that you insert into the manager to be made aware of game controller events.
Definition: joystickManager.h:42
DtDe & myDe
Definition: buttonConfigurationSelectionDialog.h:88
QTreeWidget * myControls
Definition: buttonConfigurationSelectionDialog.h:81
QPushButton * myCancelButton
Definition: buttonConfigurationSelectionDialog.h:83
virtual void gameControllerDeviceRemoved(int)
Called when a game controller device is removed.
Definition: buttonConfigurationSelectionDialog.h:144
DtGameControlInformation::GameControlEvents myUnsupportedEvents
Definition: buttonConfigurationSelectionDialog.h:98
QHBoxLayout * myButtonLayout
Definition: buttonConfigurationSelectionDialog.h:163
std::vector< DtGameControlInformation::GameControlEvent > GameControls
Definition: buttonConfigurationSelectionDialog.h:96
Definition: gameControllerEvents.h:33
QHBoxLayout * myTopButtonLayout
Definition: buttonConfigurationSelectionDialog.h:80
QLabel * myControl
Definition: buttonConfigurationSelectionDialog.h:159
#define DT_DLL_JOYSTICKCOREQT
Contains DLL export macros.
Definition: joystickCoreQt.h:25
virtual void noQueuedEvents()
Called when there were events but now there are no longer queued events.
Definition: buttonConfigurationSelectionDialog.h:153
Contains makVrv::DtVirtualBaseClass class.
QPushButton * myOKButton
Definition: buttonConfigurationSelectionDialog.h:82
QHBoxLayout * myBottomButtonLayout
Definition: buttonConfigurationSelectionDialog.h:84
QPushButton * myOKButton
Definition: buttonConfigurationSelectionDialog.h:161
DtGenericControllerEvent * myEvent
Definition: buttonConfigurationSelectionDialog.h:167
Definition: gameControlInformation.h:46
RowWidgets myRowWidgets
Definition: buttonConfigurationSelectionDialog.h:94
DtDe & myDe
Definition: buttonConfigurationSelectionDialog.h:118
QPushButton * myRemoveButton
Definition: buttonConfigurationSelectionDialog.h:79
virtual void tick(bool sentEvents)
Called after game controller events are processed in any given tick.
Definition: buttonConfigurationSelectionDialog.h:141
std::string myFunctionGroup
Definition: buttonConfigurationSelectionDialog.h:89
QPushButton * myCancelButton
Definition: buttonConfigurationSelectionDialog.h:162
virtual void gameControllerDeviceAdded(int)
Called when a game controller device is added.
Definition: buttonConfigurationSelectionDialog.h:147
DtDe & myDe
Definition: buttonConfigurationSelectionDialog.h:166
std::string myFunction
Definition: buttonConfigurationSelectionDialog.h:90
The DtGameControlInformation class contains information about how a function within a function group ...
Definition: gameControlInformation.h:32
Allows for selection of either a button or a key.
Definition: buttonConfigurationSelectionDialog.h:122
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
QHBoxLayout * myLabelLayout
Definition: buttonConfigurationSelectionDialog.h:160
QPushButton * myAddButton
Definition: buttonConfigurationSelectionDialog.h:78
DtGenericControllerEvent * gameControlEvent() const
Definition: buttonConfigurationSelectionDialog.h:129
std::vector< GameControlEvent > GameControlEvents
Definition: gameControlInformation.h:192
QLabel * myDescription
Definition: buttonConfigurationSelectionDialog.h:85

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)