From 920f1f010284d59bad86f78355ed90ac2f3e1d2c Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Mon, 8 Mar 2021 16:46:22 -0500 Subject: mouse movement in raleigh, with colorpicker dragging example --- src/user/raleigh/w/vbox.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/user/raleigh/w/vbox.cpp') diff --git a/src/user/raleigh/w/vbox.cpp b/src/user/raleigh/w/vbox.cpp index 263da2a..77ce592 100644 --- a/src/user/raleigh/w/vbox.cpp +++ b/src/user/raleigh/w/vbox.cpp @@ -63,4 +63,15 @@ namespace raleigh { notify_window_change(); } } + + void vbox::on_mouse_move(coord window_coords) { + for (dllist::node *n = widgets.first; n; n = n->next) + if ((window_coords.x >= n->d.window_offset.x) && + (window_coords.y >= n->d.window_offset.y) && + (window_coords.x < n->d.window_offset.x + n->d.size.x) && + (window_coords.y < n->d.window_offset.y + n->d.size.y)) { + n->d.on_mouse_move(window_coords); + return; + } + } } \ No newline at end of file -- cgit v1.2.3