TDE base libraries and programs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.8KB

  1. /***************************************************************************
  2. * Copyright (C) 2003 by Martin Koller *
  3. * m.koller@surfeu.at *
  4. * This file is part of the Trinity Control Center Module for Joysticks *
  5. * *
  6. * This program is free software; you can redistribute it and/or modify *
  7. * it under the terms of the GNU General Public License as published by *
  8. * the Free Software Foundation; either version 2 of the License, or *
  9. * (at your option) any later version. *
  10. * *
  11. * This program is distributed in the hope that it will be useful, *
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  14. * GNU General Public License for more details. *
  15. * *
  16. * You should have received a copy of the GNU General Public License *
  17. * along with this program; if not, write to the *
  18. * Free Software Foundation, Inc., *
  19. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
  20. ***************************************************************************/
  21. #ifndef _JOYWIDGET_H_
  22. #define _JOYWIDGET_H_
  23. #include <tqwidget.h>
  24. class JoyDevice;
  25. class PosWidget;
  26. class TQLabel;
  27. class TQTable;
  28. class TQTimer;
  29. class TQComboBox;
  30. class TQPushButton;
  31. class TQCheckBox;
  32. class TQHBox;
  33. // the widget which displays all buttons, values, etc.
  34. class JoyWidget : public TQWidget
  35. {
  36. Q_OBJECT
  37. public:
  38. JoyWidget(TQWidget *parent = 0, const char *name = 0);
  39. ~JoyWidget();
  40. // initialize list of possible devices and open the first available
  41. void init();
  42. public slots:
  43. // reset calibration values to their value when this KCM was started
  44. void resetCalibration();
  45. private slots:
  46. void checkDevice();
  47. void deviceChanged(const TQString &dev);
  48. void traceChanged(bool);
  49. void calibrateDevice();
  50. private:
  51. void showDeviceProps(JoyDevice *joy); // fill widgets with given device parameters
  52. void restoreCurrDev(); // restores the content of the combobox to reflect the current open device
  53. private:
  54. TQHBox *messageBox;
  55. TQLabel *message; // in case of no device, show here a message rather than in a dialog
  56. TQComboBox *device;
  57. PosWidget *xyPos;
  58. TQTable *buttonTbl;
  59. TQTable *axesTbl;
  60. TQCheckBox *trace;
  61. TQPushButton *calibrate;
  62. TQTimer *idle;
  63. JoyDevice *joydev;
  64. };
  65. #endif