|
Last change
on this file since 5695 was
5690,
checked in by bensch, 20 years ago
|
|
orxonox/trunk: parameters of Executor are const void* instead of const char*
|
|
File size:
2.0 KB
|
| Line | |
|---|
| 1 | /*! |
|---|
| 2 | * @file glgui_widget.h |
|---|
| 3 | * The gl_widget of the openglGUI |
|---|
| 4 | */ |
|---|
| 5 | |
|---|
| 6 | #ifndef _GLGUI_WIDGET_H |
|---|
| 7 | #define _GLGUI_WIDGET_H |
|---|
| 8 | |
|---|
| 9 | #include "element_2d.h" |
|---|
| 10 | #include "event.h" |
|---|
| 11 | |
|---|
| 12 | #include "glincl.h" |
|---|
| 13 | #include "executor/executor.h" |
|---|
| 14 | |
|---|
| 15 | // FORWARD DECLARATION |
|---|
| 16 | class Material; |
|---|
| 17 | |
|---|
| 18 | typedef enum |
|---|
| 19 | { |
|---|
| 20 | GLGuiSignal_click = 0, |
|---|
| 21 | GLGuiSignal_release = 1, |
|---|
| 22 | GLGuiSignal_rollOn = 2, |
|---|
| 23 | GLGuiSignal_rollOff = 3, |
|---|
| 24 | GLGuiSignal_open = 4, |
|---|
| 25 | GLGuiSignal_close = 5, |
|---|
| 26 | GLGuiSignal_destroy = 6, |
|---|
| 27 | |
|---|
| 28 | GLGuiSignalCount = 7, |
|---|
| 29 | } GLGuiSignalType; |
|---|
| 30 | |
|---|
| 31 | //! if the Element should be visible by default. |
|---|
| 32 | #define GLGUI_WIDGET_DEFAULT_VISIBLE false |
|---|
| 33 | |
|---|
| 34 | //! This is widget part of the openglGUI class |
|---|
| 35 | /** |
|---|
| 36 | * A widget is the main class of all the elements of th GUI. |
|---|
| 37 | */ |
|---|
| 38 | class GLGuiWidget : public Element2D { |
|---|
| 39 | public: |
|---|
| 40 | GLGuiWidget(); |
|---|
| 41 | virtual ~GLGuiWidget(); |
|---|
| 42 | |
|---|
| 43 | void init(); |
|---|
| 44 | /** @returns a new char-array containing a string with the options. Delete with delete[]; */ |
|---|
| 45 | virtual char* save() {}; |
|---|
| 46 | /** loads options of the Widget. @param loadString a string containing the Options */ |
|---|
| 47 | virtual void load(const char* loadString) {}; |
|---|
| 48 | |
|---|
| 49 | void show(); |
|---|
| 50 | void hide() {}; |
|---|
| 51 | |
|---|
| 52 | void connectSignal(GLGuiSignalType signalType, const Executor& signal); |
|---|
| 53 | void disconnectSignal(GLGuiSignalType signalType); |
|---|
| 54 | bool focusOverWidget(float x, float y); |
|---|
| 55 | |
|---|
| 56 | // if something was clickt on the GUI-widget. |
|---|
| 57 | virtual void click(const Event& event) {}; |
|---|
| 58 | virtual void release(const Event& event) {}; |
|---|
| 59 | |
|---|
| 60 | virtual void receiveFocus() {}; |
|---|
| 61 | virtual void removeFocus() {}; |
|---|
| 62 | |
|---|
| 63 | virtual void update() = 0; |
|---|
| 64 | virtual void draw() const = 0; |
|---|
| 65 | |
|---|
| 66 | protected: |
|---|
| 67 | Material* backMat; |
|---|
| 68 | GLuint backModel; |
|---|
| 69 | |
|---|
| 70 | Material* frontMat; |
|---|
| 71 | GLuint frontModel; |
|---|
| 72 | |
|---|
| 73 | private: |
|---|
| 74 | Executor* widgetSignals[GLGuiSignalCount]; |
|---|
| 75 | |
|---|
| 76 | bool focusable; //!< If this widget can receive focus. |
|---|
| 77 | bool clickable; //!< if this widget can be clicked upon. |
|---|
| 78 | }; |
|---|
| 79 | |
|---|
| 80 | #endif /* _GLGUI_WIDGET_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.