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 | cb680474c3c1f58772533e257c6acbbf4e13c524 (patch) | |
tree | db20ecb24bd4ed1e1b227ee5c97b97c39bb95656 /src/window_gui.h | |
parent | dbf6e344a419cf453ce8a292a588385b5299c996 (diff) | |
download | openttd-cb680474c3c1f58772533e257c6acbbf4e13c524.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 { |