Last change
on this file since 2735 was
2735,
checked in by bensch, 20 years ago
|
orxonox/trunk/gui: added keys, and enabled key_press_event on them
|
File size:
1017 bytes
|
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* keyBox; |
---|
27 | Button* Keys[10]; |
---|
28 | |
---|
29 | |
---|
30 | public: |
---|
31 | Player(char* player); |
---|
32 | |
---|
33 | Button* getOpenButton(); |
---|
34 | |
---|
35 | void openWindow (); |
---|
36 | |
---|
37 | static gint openWindowEvent(GtkWidget* widget, GdkEvent* event, void* player); |
---|
38 | void setkey(KEYS key); |
---|
39 | |
---|
40 | }; |
---|
41 | |
---|
42 | //! Class that creates the Keys-Options. |
---|
43 | class OrxonoxGuiKeys |
---|
44 | { |
---|
45 | private: |
---|
46 | Frame* keysFrame; |
---|
47 | Box* keysBox; |
---|
48 | Player* player1; |
---|
49 | Player* player2; |
---|
50 | Button* misc; |
---|
51 | |
---|
52 | public: |
---|
53 | OrxonoxGuiKeys (); |
---|
54 | ~OrxonoxGuiKeys (); |
---|
55 | |
---|
56 | Widget* getWidget (); |
---|
57 | }; |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | gint key_cb(GtkWidget* w, GdkEventKey* event, void* Widget); |
---|
62 | |
---|
63 | #endif /* _ORXONOX_GUI_KEYS_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.