diff options
author | Simon Howard | 2006-06-02 20:14:39 +0000 |
---|---|---|
committer | Simon Howard | 2006-06-02 20:14:39 +0000 |
commit | ef92ce016e328c1270597f2f1627c72bc3490d64 (patch) | |
tree | 0a487dc17f613bd7deeecd7c931d02c19834808f /textscreen/txt_window.c | |
parent | a990e948564aa96f95dc5c692e512a68fd48852e (diff) | |
download | chocolate-doom-ef92ce016e328c1270597f2f1627c72bc3490d64.tar.gz chocolate-doom-ef92ce016e328c1270597f2f1627c72bc3490d64.tar.bz2 chocolate-doom-ef92ce016e328c1270597f2f1627c72bc3490d64.zip |
Make mouse button presses on widgets actually do useful things
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 553
Diffstat (limited to 'textscreen/txt_window.c')
-rw-r--r-- | textscreen/txt_window.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/textscreen/txt_window.c b/textscreen/txt_window.c index 0cc46308..7481ccfa 100644 --- a/textscreen/txt_window.c +++ b/textscreen/txt_window.c @@ -307,7 +307,9 @@ void TXT_SetWindowPosition(txt_window_t *window, static void MouseButtonPress(txt_window_t *window, int b) { int x, y; + int i; txt_widget_t *widgets; + txt_widget_t *widget; // Lay out the window, set positions and sizes of all widgets @@ -326,6 +328,21 @@ static void MouseButtonPress(txt_window_t *window, int b) { TXT_WidgetMousePress(window, x, y, b); } + + // Was one of the action area buttons pressed? + + for (i=0; i<3; ++i) + { + widget = (txt_widget_t *) window->actions[i]; + + if (widget != NULL + && x >= widget->x && x < widget->x + widget->w + && y >= widget->y && y < widget->y + widget->h) + { + TXT_WidgetMousePress(widget, x, y, b); + break; + } + } } void TXT_WindowKeyPress(txt_window_t *window, int c) |