summaryrefslogtreecommitdiff
path: root/textscreen/txt_window.c
diff options
context:
space:
mode:
Diffstat (limited to 'textscreen/txt_window.c')
-rw-r--r--textscreen/txt_window.c17
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)