Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/gui/gui/orxonox_gui_keys.h @ 4046

Last change on this file since 4046 was 4024, checked in by bensch, 19 years ago

orxonox/trunk: gui: more addaptive structure

File size: 2.4 KB
RevLine 
[2613]1/*!
2  \file orxonox_gui_keys.h
3  \brief File that holds the class that creates the Keyboard-Options.
4*/
5
6#ifndef _ORXONOX_GUI_KEYS_H
7#define _ORXONOX_GUI_KEYS_H
8
9#include "orxonox_gui.h"
[4024]10#include "orxonox_gui_element.h"
11
[3165]12#ifdef HAVE_GTK2
[2733]13#include <gdk/gdkkeysyms.h>
[3165]14#endif /* HAVE_GTK2 */
[3187]15
[2613]16/**
[3187]17   \brief defines the Possible Player Keys
18*/
[3423]19enum KEYS {UP, DOWN, LEFT, RIGHT, SHOOT};
[2613]20
[3152]21class Player;
22//! Class that creates the Keys-Options.
[4024]23class OrxonoxGuiKeys : public OrxonoxGuiElement
[3152]24{
25 private:
[3187]26  Frame* keysFrame;      //!< The Frame that holds the keyOptions.
27  Box* keysBox;          //!< The Frame that holds the keyOptions.
28  Player* player1;       //!< The first Player's keys.
29  Player* player2;       //!< The seconds Player's keys.
30  Button* misc;          //!< Other keyboeard options come here. \todo include some like pause, quit and so on.
[3152]31
32 public:
[3423]33  OrxonoxGuiKeys(void);
34  ~OrxonoxGuiKeys(void);
[3152]35};
36
[2735]37//! Class to hold infos about a Player
[3187]38/**
39   \todo split into subclass and superclass ButtonConfigurator
40*/
[2613]41class Player
42{
43 private:
[3187]44  Window* pKeyWindow;     //!< The Window for a new Key-setting.
45  Frame* pKeyFrame;       //!< The Frame for a new Key-setting.
46  Button* openButton;     //!< The OpenButton for this key-settings.
47  Button* closeButton;    //!< The CloseButton for this key-settings.
48  Box* pKeysBox;          //!< The Box that holds the Key-settings.
[2736]49 
[3187]50  //! One KeyOption has one InputKey
[3156]51  struct InputKey
52  {
[3187]53    Box* pKeyBox;           //!< One Box that holds the Keys
54    Button* pKeyButton;     //!< The Button for changing the Key.
55    OptionLabel* pKeyOLabel;//!< The Label for displaying the Key-setting.
[3156]56  };
[2735]57
[3187]58  InputKey* inputKey[10];     //!< Buttons-array. \todo make it dynamic.
[2735]59
[3187]60  static Window* inputWindow; //!< A Window that gets keyboard clicks. Static, because only one needed.
61  static Button* inputButton; //!< A Button that gets keyboard clicks. Static, because only one needed.
62  static long keySignal;      //!< A keySignal that handles keyboard clicks. Static, because only one needed.
[2613]63 public:
64  Player(char* player);
65
[3423]66  Widget* addKey(KEYS key, char* name);
[2736]67
[3423]68  Button* getOpenButton(void);
[2613]69
[3165]70#ifdef HAVE_GTK2
[3156]71  static gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* widget);
72  static gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey);
[3165]73#endif /* HAVE_GTK2 */
[2613]74  void setkey(KEYS key);
75 
76};
77
78
79
80#endif /* _ORXONOX_GUI_KEYS_H */
Note: See TracBrowser for help on using the repository browser.