onMouse process subscribed mouse events over the window
(evname string, ev interface{})
| 136 | |
| 137 | // onMouse process subscribed mouse events over the window |
| 138 | func (w *Window) onMouse(evname string, ev interface{}) { |
| 139 | |
| 140 | switch evname { |
| 141 | case OnMouseDown: |
| 142 | // Move the window above everything contained in its parent |
| 143 | parent := w.Parent().(IPanel).GetPanel() |
| 144 | parent.SetTopChild(w) |
| 145 | // If the click happened inside the draggable area, then set drag to true |
| 146 | if w.overTop || w.overRight || w.overBottom || w.overLeft { |
| 147 | w.drag = true |
| 148 | Manager().SetCursorFocus(w) |
| 149 | } |
| 150 | case OnMouseUp: |
| 151 | w.drag = false |
| 152 | Manager().SetCursorFocus(nil) |
| 153 | default: |
| 154 | return |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | // onCursor process subscribed cursor events over the window |
| 159 | func (w *Window) onCursor(evname string, ev interface{}) { |
nothing calls this directly
no test coverage detected