| 106 | | EVT_SIZE (GraphicsWindowWX::OnSize ) |
| 107 | | EVT_PAINT (GraphicsWindowWX::OnPaint ) |
| 108 | | EVT_ERASE_BACKGROUND(GraphicsWindowWX::OnEraseBackground) |
| 109 | | EVT_KEY_DOWN (GraphicsWindowWX::OnKeyDown ) |
| 110 | | EVT_KEY_UP (GraphicsWindowWX::OnKeyUp ) |
| 111 | | EVT_MOUSE_EVENTS (GraphicsWindowWX::OnMouse ) |
| | 105 | EVT_SIZE (GraphicsWindowWX::OnSize) |
| | 106 | EVT_PAINT (GraphicsWindowWX::OnPaint) |
| | 107 | EVT_ERASE_BACKGROUND (GraphicsWindowWX::OnEraseBackground) |
| | 108 | |
| | 109 | EVT_CHAR (GraphicsWindowWX::OnChar) |
| | 110 | EVT_KEY_UP (GraphicsWindowWX::OnKeyUp) |
| | 111 | |
| | 112 | EVT_ENTER_WINDOW (GraphicsWindowWX::OnMouseEnter) |
| | 113 | EVT_LEFT_DOWN (GraphicsWindowWX::OnMouseDown) |
| | 114 | EVT_MIDDLE_DOWN (GraphicsWindowWX::OnMouseDown) |
| | 115 | EVT_RIGHT_DOWN (GraphicsWindowWX::OnMouseDown) |
| | 116 | EVT_LEFT_UP (GraphicsWindowWX::OnMouseUp) |
| | 117 | EVT_MIDDLE_UP (GraphicsWindowWX::OnMouseUp) |
| | 118 | EVT_RIGHT_UP (GraphicsWindowWX::OnMouseUp) |
| | 119 | EVT_MOTION (GraphicsWindowWX::OnMouseMotion) |
| 201 | | // propagate event |
| 202 | | event.Skip(); |
| 203 | | } |
| 204 | | |
| 205 | | void GraphicsWindowWX::OnMouse(wxMouseEvent& event) |
| 206 | | { |
| 207 | | if (event.ButtonDown()) { |
| 208 | | int button = event.GetButton(); |
| 209 | | getEventQueue()->mouseButtonPress(event.GetX(), event.GetY(), button); |
| 210 | | } |
| 211 | | else if (event.ButtonUp()) { |
| 212 | | int button = event.GetButton(); |
| 213 | | getEventQueue()->mouseButtonRelease(event.GetX(), event.GetY(), button); |
| 214 | | } |
| 215 | | else if (event.Dragging()) { |
| 216 | | getEventQueue()->mouseMotion(event.GetX(), event.GetY()); |
| 217 | | } |
| 218 | | } |
| | 209 | // If this key event is not processed here, we should call |
| | 210 | // event.Skip() to allow processing to continue. |
| | 211 | } |
| | 212 | |
| | 213 | void GraphicsWindowWX::OnMouseEnter(wxMouseEvent &event) |
| | 214 | { |
| | 215 | // Set focus to ourselves, so keyboard events get directed to us |
| | 216 | SetFocus(); |
| | 217 | } |
| | 218 | |
| | 219 | void GraphicsWindowWX::OnMouseDown(wxMouseEvent &event) |
| | 220 | { |
| | 221 | getEventQueue()->mouseButtonPress(event.GetX(), event.GetY(), |
| | 222 | event.GetButton()); |
| | 223 | } |
| | 224 | |
| | 225 | void GraphicsWindowWX::OnMouseUp(wxMouseEvent &event) |
| | 226 | { |
| | 227 | getEventQueue()->mouseButtonRelease(event.GetX(), event.GetY(), |
| | 228 | event.GetButton()); |
| | 229 | } |
| | 230 | |
| | 231 | void GraphicsWindowWX::OnMouseMotion(wxMouseEvent &event) |
| | 232 | { |
| | 233 | getEventQueue()->mouseMotion(event.GetX(), event.GetY()); |
| | 234 | } |
| | 235 | |