VR-Forces 5.0.1 Developer's Guide
 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 
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 class QToolButton;
28 
34 
35 namespace makVrv
36 {
37  class DtGameControlInformation;
38  class DtDe;
39 
41  {
42  Q_OBJECT
43 
44  public:
45 
47  DtButtonConfigurationSelectionDialog(DtDe&, QWidget* parent = NULL, const Qt::WindowFlags& flags = Qt::Tool );
48 
51 
52  virtual void setEditing(const std::string& fg, const std::string& function);
53  virtual void setDescription(const std::string&);
54 
55  virtual void setupFromControlInformation(const DtGameControlInformation&);
56 
57  boost::signals2::signal<void (DtGameControlInformation*)> signal_accept;
58 
59  virtual DtGameControlInformation gameControlInformation() const;
60 
61  protected:
62  virtual void accept();
63  virtual void reject();
64  virtual void closeEvent(QCloseEvent*);
65  virtual void addRow(const DtGameControlInformation::GameControlEvent&);
66 
68  virtual QString translateString(const std::string& str) const;
69 
70  protected slots:
71  virtual void onAddGameControl();
72  virtual void onRemoveGameControl();
73  virtual void onButtonControlEdit();
74  virtual void changeIncreaseDecrease();
75  virtual void onControlSelected();
76  virtual void onCycleComboChanged();
77 
78  public:
81  QHBoxLayout* myTopButtonLayout;
85  QHBoxLayout* myBottomButtonLayout;
87 
88  protected:
90  std::string myFunctionGroup;
91  std::string myFunction;
92  bool mySignaled;
93 
94  typedef std::vector<std::vector<QWidget*> > RowWidgets;
96 
97  typedef std::vector<DtGameControlInformation::GameControlEvent> GameControls;
100  };
101 
103 
105  {
106  public:
109 
112 
114  static void registerInstance(DtDe& de, DtButtonConfigurationSelectionDialogCreator* instance);
115 
116  virtual DtButtonConfigurationSelectionDialog* create(QWidget*);
117 
118  protected:
120  };
121 
124  {
125  Q_OBJECT
126  public:
127  DtButtonChoiceDialog(DtDe&, QWidget* parent = NULL, const Qt::WindowFlags& flags = Qt::Tool);
128 
129  virtual ~DtButtonChoiceDialog();
130 
131  DtGenericControllerEvent* gameControlEvent() const { return myEvent; };
132 
133  virtual void setGameControlEvent(DtGenericControllerEvent*);
134 
135  protected:
136  virtual bool eventFilter(QObject* o, QEvent* evt);
137 
139  virtual bool gameControllerEvent(DtGenericControllerEvent*);
140 
143  virtual void tick(bool sentEvents) {};
144 
146  virtual void gameControllerDeviceRemoved(int) {};
147 
149  virtual void gameControllerDeviceAdded(int) {};
150 
152  virtual bool filterGameControllerEvent(DtGenericControllerEvent*);
153 
155  virtual void noQueuedEvents() {};
156 
157  virtual void showEvent(QShowEvent*);
158 
159  public:
162  QHBoxLayout* myLabelLayout;
165  QHBoxLayout* myButtonLayout;
166 
167  protected:
170  };
171 }
std::vector< std::vector< QWidget * > > RowWidgets
Definition: buttonConfigurationSelectionDialog.h:94
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
boost::signals2::signal< void(DtGameControlInformation *)> signal_accept
Definition: buttonConfigurationSelectionDialog.h:57
Definition: buttonConfigurationSelectionDialog.h:40
bool mySignaled
Definition: buttonConfigurationSelectionDialog.h:92
Factory constructor for this dialog.
Definition: buttonConfigurationSelectionDialog.h:104
QLabel * myControlLabel
Definition: buttonConfigurationSelectionDialog.h:160
GameControls myGameControls
Definition: buttonConfigurationSelectionDialog.h:98
Handler that you insert into the manager to be made aware of game controller events. A subclass of this handler can be added to the joystick manager to be made aware of any joystick/keyboard event.
Definition: joystickManager.h:42
DtDe & myDe
Definition: buttonConfigurationSelectionDialog.h:89
QTreeWidget * myControls
Definition: buttonConfigurationSelectionDialog.h:82
QPushButton * myCancelButton
Definition: buttonConfigurationSelectionDialog.h:84
virtual void gameControllerDeviceRemoved(int)
Called when a game controller device is removed.
Definition: buttonConfigurationSelectionDialog.h:146
DtGameControlInformation::GameControlEvents myUnsupportedEvents
Definition: buttonConfigurationSelectionDialog.h:99
QHBoxLayout * myButtonLayout
Definition: buttonConfigurationSelectionDialog.h:165
std::vector< DtGameControlInformation::GameControlEvent > GameControls
Definition: buttonConfigurationSelectionDialog.h:97
Definition: gameControllerEvents.h:33
QHBoxLayout * myTopButtonLayout
Definition: buttonConfigurationSelectionDialog.h:81
QLabel * myControl
Definition: buttonConfigurationSelectionDialog.h:161
#define DT_DLL_JOYSTICKCOREQT
Contains DLL export macros.
Definition: joystickCoreQt.h:27
virtual void noQueuedEvents()
Called when there were events but now there are no longer queued events.
Definition: buttonConfigurationSelectionDialog.h:155
Contains makVrv::DtVirtualBaseClass class.
QPushButton * myOKButton
Definition: buttonConfigurationSelectionDialog.h:83
QHBoxLayout * myBottomButtonLayout
Definition: buttonConfigurationSelectionDialog.h:85
QPushButton * myOKButton
Definition: buttonConfigurationSelectionDialog.h:163
DtGenericControllerEvent * myEvent
Definition: buttonConfigurationSelectionDialog.h:169
Definition: gameControlInformation.h:46
RowWidgets myRowWidgets
Definition: buttonConfigurationSelectionDialog.h:95
QToolButton * myAddButton
Definition: buttonConfigurationSelectionDialog.h:79
DtDe & myDe
Definition: buttonConfigurationSelectionDialog.h:119
virtual void tick(bool sentEvents)
Called after game controller events are processed in any given tick. If sentEvents is true some game ...
Definition: buttonConfigurationSelectionDialog.h:143
std::string myFunctionGroup
Definition: buttonConfigurationSelectionDialog.h:90
QPushButton * myCancelButton
Definition: buttonConfigurationSelectionDialog.h:164
virtual void gameControllerDeviceAdded(int)
Called when a game controller device is added.
Definition: buttonConfigurationSelectionDialog.h:149
DtDe & myDe
Definition: buttonConfigurationSelectionDialog.h:168
std::string myFunction
Definition: buttonConfigurationSelectionDialog.h:91
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:123
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:70
QToolButton * myRemoveButton
Definition: buttonConfigurationSelectionDialog.h:80
QHBoxLayout * myLabelLayout
Definition: buttonConfigurationSelectionDialog.h:162
DtGenericControllerEvent * gameControlEvent() const
Definition: buttonConfigurationSelectionDialog.h:131
std::vector< GameControlEvent > GameControlEvents
Definition: gameControlInformation.h:192
QLabel * myDescription
Definition: buttonConfigurationSelectionDialog.h:86

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)