Last change
on this file since 3308 was
2737,
checked in by bensch, 20 years ago
|
orxonox/trunk/gui: key now able to be set.
|
File size:
1.1 KB
|
Line | |
---|
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" |
---|
10 | #include <gdk/gdkkeysyms.h> |
---|
11 | |
---|
12 | /** |
---|
13 | * defines the Possible Player Keys |
---|
14 | */ |
---|
15 | enum KEYS { UP, DOWN, LEFT, RIGHT, SHOOT }; |
---|
16 | |
---|
17 | //! Class to hold infos about a Player |
---|
18 | class Player |
---|
19 | { |
---|
20 | private: |
---|
21 | Window* keyWindow; |
---|
22 | bool windowIsOpen; |
---|
23 | Button* openButton; |
---|
24 | |
---|
25 | |
---|
26 | Box* keysBox; |
---|
27 | |
---|
28 | Box* keyBox[10]; |
---|
29 | Button* keyButton[10]; |
---|
30 | Label* keyLabel[10]; |
---|
31 | |
---|
32 | |
---|
33 | public: |
---|
34 | Player(char* player); |
---|
35 | |
---|
36 | Widget* addKey (KEYS key, char* name); |
---|
37 | |
---|
38 | Button* getOpenButton(); |
---|
39 | |
---|
40 | void openWindow (); |
---|
41 | |
---|
42 | static gint openWindowEvent(GtkWidget* widget, GdkEvent* event, void* player); |
---|
43 | static gint key_cb(GtkWidget* w, GdkEventKey* event, void* widget); |
---|
44 | void setkey(KEYS key); |
---|
45 | |
---|
46 | }; |
---|
47 | |
---|
48 | //! Class that creates the Keys-Options. |
---|
49 | class OrxonoxGuiKeys |
---|
50 | { |
---|
51 | private: |
---|
52 | Frame* keysFrame; |
---|
53 | Box* keysBox; |
---|
54 | Player* player1; |
---|
55 | Player* player2; |
---|
56 | Button* misc; |
---|
57 | |
---|
58 | public: |
---|
59 | OrxonoxGuiKeys (); |
---|
60 | ~OrxonoxGuiKeys (); |
---|
61 | |
---|
62 | Widget* getWidget (); |
---|
63 | }; |
---|
64 | |
---|
65 | |
---|
66 | |
---|
67 | |
---|
68 | #endif /* _ORXONOX_GUI_KEYS_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.