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_action.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_action.c')
-rw-r--r-- | textscreen/txt_window_action.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/textscreen/txt_window_action.c b/textscreen/txt_window_action.c index 727e9b56..a70d0002 100644 --- a/textscreen/txt_window_action.c +++ b/textscreen/txt_window_action.c @@ -58,12 +58,26 @@ static int TXT_WindowActionKeyPress(TXT_UNCAST_ARG(action), int key) return 0; } +static void TXT_WindowActionMousePress(TXT_UNCAST_ARG(action), + int x, int y, int b) +{ + TXT_CAST_ARG(txt_window_action_t, action); + + // Simulate a press of the key + + if (b == TXT_MOUSE_LEFT) + { + TXT_WindowActionKeyPress(action, action->key); + } +} + txt_widget_class_t txt_window_action_class = { TXT_WindowActionSizeCalc, TXT_WindowActionDrawer, TXT_WindowActionKeyPress, TXT_WindowActionDestructor, + TXT_WindowActionMousePress, }; txt_window_action_t *TXT_NewWindowAction(int key, char *label) |