diff options
author | rubidium <rubidium@openttd.org> | 2008-05-04 10:05:50 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-04 10:05:50 +0000 |
commit | 0083ce9e1b1af3ef49368af454c861e778472ac2 (patch) | |
tree | db20ecb24bd4ed1e1b227ee5c97b97c39bb95656 /src/window_gui.h | |
parent | 63fea0790b405ee5c48c1b48c51d93dc4639e8d3 (diff) | |
download | openttd-0083ce9e1b1af3ef49368af454c861e778472ac2.tar.xz |
(svn r12941) -Codechange: don't access wndproc directly. Patch by Alberth.
Diffstat (limited to 'src/window_gui.h')
-rw-r--r-- | src/window_gui.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/window_gui.h b/src/window_gui.h index d4bfcc8b4..c0b6d6efa 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -291,6 +291,12 @@ struct WindowMessage { * Data structure for an opened window */ struct Window : ZeroedMemoryAllocator { +private: + WindowProc *wndproc; ///< Event handler function for the window. Do not use directly, call HandleWindowEvent() instead. + +public: + Window(WindowProc *proc) : wndproc(proc) {} + uint16 flags4; ///< Window flags, @see WindowFlags WindowClass window_class; ///< Window class WindowNumber window_number; ///< Window number within the window class @@ -307,7 +313,6 @@ struct Window : ZeroedMemoryAllocator { byte caption_color; ///< Background color of the window caption, contains PlayerID - WindowProc *wndproc; ///< Event handler function for the window ViewPort *viewport; ///< Pointer to viewport, if present const Widget *original_widget; ///< Original widget layout, copied from WindowDesc Widget *widget; ///< Widgets of the window @@ -339,6 +344,8 @@ struct Window : ZeroedMemoryAllocator { void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...); void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...); void InvalidateWidget(byte widget_index) const; + + virtual void HandleWindowEvent(WindowEvent *e); }; struct menu_d { |