From 9f0736a6a8988fc41f3b9f0a39e8ea042b94d651 Mon Sep 17 00:00:00 2001 From: Alexandre Quessy Date: Fri, 15 Nov 2013 02:29:19 +0100 Subject: [PATCH] fill when mouse leaves --- prototypes/wx-polyline/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/prototypes/wx-polyline/main.cpp b/prototypes/wx-polyline/main.cpp index 88a5e4d..449855a 100644 --- a/prototypes/wx-polyline/main.cpp +++ b/prototypes/wx-polyline/main.cpp @@ -260,7 +260,6 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event) { manager.addPolyLine(point); should_render = true; - manager.setStyle(POLYGON); } else { @@ -268,6 +267,17 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event) manager.addPoint(point); should_render = true; } + if (event.Leaving()) + { + manager.setStyle(POLYGON); + should_render = true; + } + else if (event.Entering()) + { + manager.setStyle(LINES); + should_render = true; + } + if (should_render) Render(); }