]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/windows/window.cpp
Track window positions
[libs/gui.git] / source / graphics / windows / window.cpp
index 2d4d75bead21b6a3f5b6e8208c454379479adcad..b148915d9bc94b6581037a682c3982c0bf78212f 100644 (file)
@@ -180,9 +180,23 @@ bool Window::event(const Event &evnt)
                resizing = false;
                signal_resize.emit(options.width, options.height);
                break;
+       case WM_MOVE:
+               options.x = static_cast<short>(LOWORD(evnt.lparam));
+               options.y = static_cast<short>(HIWORD(evnt.lparam));
+               signal_move.emit(options.x, options.y);
+               break;
        case WM_CLOSE:
                signal_close.emit();
                break;
+       case WM_PAINT:
+               {
+                       RECT update_rect;
+                       GetUpdateRect(priv->window, &update_rect, false);
+                       unsigned width = update_rect.right-update_rect.left;
+                       unsigned height = update_rect.bottom-update_rect.top;
+                       signal_expose.emit(update_rect.left, update_rect.top, width, height, evnt);
+               }
+               break;
        default:
                return false;
        }