summaryrefslogtreecommitdiff
path: root/eventMouse.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-09 12:34:53 -0600
committerJeff Carr <[email protected]>2025-02-09 12:34:53 -0600
commit90a9f84f109800b820f5d15bad0b7ba146586edc (patch)
tree6e684cf463bad756e9631e514e5b46b13982b3b7 /eventMouse.go
parentc5cada3dc93ba0f049b50fd7561a2c15347473ee (diff)
more code cleanups
Diffstat (limited to 'eventMouse.go')
-rw-r--r--eventMouse.go82
1 files changed, 0 insertions, 82 deletions
diff --git a/eventMouse.go b/eventMouse.go
index 935f2b5..859ba84 100644
--- a/eventMouse.go
+++ b/eventMouse.go
@@ -10,7 +10,6 @@ import (
"github.com/awesome-gocui/gocui"
"go.wit.com/log"
- "go.wit.com/widget"
)
func mouseUp(g *gocui.Gui, v *gocui.View) error {
@@ -22,7 +21,6 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error {
*/
me.mouse.mouseUp = true
- // me.mouse.globalMouseDown = false
me.mouse.currentDrag = nil
if me.mouse.double && (time.Since(me.mouse.down) < me.mouse.doubletime) {
@@ -46,7 +44,6 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
if time.Since(me.mouse.down) < me.mouse.doubletime {
me.mouse.double = true
}
- // me.mouse.globalMouseDown = true
me.mouse.mouseUp = false
me.mouse.down = time.Now()
w, h := g.MousePosition()
@@ -72,85 +69,6 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
}
win.setAsDragging()
}
- return nil
- }
-
- if time.Since(me.mouse.down) < me.mouse.clicktime {
- log.Info("not yet")
- return nil
- }
-
- w, h := g.MousePosition()
-
- // if the dropdown is active, never do anything else
- if me.dropdown.active {
- log.Info("mouseDown() stopping here. dropdwon menu is in effect")
- for _, tk := range findByXY(w, h) {
- if (tk.node.WidgetType == widget.Flag) && (tk == me.dropdown.tk) {
- // log.Info("SENDING CLICK TO Flag (dropdown)")
- tk.doWidgetClick(w, h)
- me.dropdown.active = false
- return nil
- }
- }
- log.Info("never found dropdown at", w, h)
- return nil
- }
-
- // if the textbox is active, never do anything else
- if me.textbox.active {
- log.Info("mouseDown() stopping here. textbox widget is open")
- for _, tk := range findByXY(w, h) {
- if (tk.node.WidgetType == widget.Flag) && (tk == me.textbox.tk) {
- me.textbox.active = false
- textboxClosed()
- return nil
- }
- }
- log.Info("never found textbox at", w, h)
- return nil
- }
- // figre out what window this is
- win := findWindowUnderMouse()
- if win == nil {
- log.Info("mouseDown() nothing to click on at", w, h)
- return nil
}
return nil
- // me.mouse.currentDrag = tk
-
- /*
- if !tk.isWindowActive() {
- tk.makeWindowActive()
- return nil
- }
-
- // log.Info("SENDING mouseDown() to findWindowUnderMouse()")
- if tk.node.WidgetType == widget.Window {
- // check to see if this is a direct click on a widget
- for _, tk := range tk.findByXYreal(w, h) {
- // tk.dumpWidget("mouseDown()")
- if tk.node.WidgetType == widget.Button {
- // log.Info("SENDING CLICK TO Button")
- tk.doWidgetClick(w, h)
- return nil
- }
- if tk.node.WidgetType == widget.Checkbox {
- // log.Info("SENDING CLICK TO Checkbox")
- tk.doWidgetClick(w, h)
- return nil
- }
- if tk.node.WidgetType == widget.Dropdown {
- // log.Info("SENDING CLICK TO Dropdown")
- tk.doWidgetClick(w, h)
- return nil
- }
- if tk.node.WidgetType == widget.Textbox {
- // log.Info("SENDING CLICK TO Textbox")
- tk.doWidgetClick(w, h)
- return nil
- }
- }
- }
- */
}