MCPcopy
hub / github.com/g3n/engine / onMouse

Method onMouse

gui/window.go:138–156  ·  view source on GitHub ↗

onMouse process subscribed mouse events over the window

(evname string, ev interface{})

Source from the content-addressed store, hash-verified

136
137// onMouse process subscribed mouse events over the window
138func (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
159func (w *Window) onCursor(evname string, ev interface{}) {

Callers

nothing calls this directly

Calls 5

ManagerFunction · 0.85
SetTopChildMethod · 0.80
SetCursorFocusMethod · 0.80
GetPanelMethod · 0.65
ParentMethod · 0.65

Tested by

no test coverage detected