summaryrefslogtreecommitdiff
path: root/src/window_gui.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-17 23:11:06 +0000
committerrubidium <rubidium@openttd.org>2008-05-17 23:11:06 +0000
commitf5681547efc060ab0cc47c36316c4f2aa1217948 (patch)
treecdbaf12f7c5a7666ecc23983c51dca268e3b58e2 /src/window_gui.h
parentc1713c9ab7438386dbda32b4c33e95995882f702 (diff)
downloadopenttd-f5681547efc060ab0cc47c36316c4f2aa1217948.tar.xz
(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
Diffstat (limited to 'src/window_gui.h')
-rw-r--r--src/window_gui.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/window_gui.h b/src/window_gui.h
index 70c6d0e86..3b8e792b6 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -266,6 +266,11 @@ struct ViewportData : ViewPort {
* Data structure for an opened window
*/
struct Window : ZeroedMemoryAllocator {
+ enum EventState {
+ ES_HANDLED,
+ ES_NOT_HANDLED,
+ };
+
private:
WindowProc *wndproc; ///< Event handler function for the window. Do not use directly, call HandleWindowEvent() instead.
void HandleWindowEvent(WindowEvent *e);
@@ -345,17 +350,17 @@ public:
* A key has been pressed.
* @param key the Unicode value of the key.
* @param keycode the untranslated key code including shift state.
- * @return true if the key press has been handled and no other
+ * @return ES_HANDLED if the key press has been handled and no other
* window should receive the event.
*/
- virtual bool OnKeyPress(uint16 key, uint16 keycode);
+ virtual EventState OnKeyPress(uint16 key, uint16 keycode);
/**
* The state of the control key has changed
- * @return true if the change has been handled and no other
+ * @return ES_HANDLED if the change has been handled and no other
* window should receive the event.
*/
- virtual bool OnCTRLStateChange();
+ virtual EventState OnCTRLStateChange();
/**