summaryrefslogtreecommitdiff
path: root/debugFlags.go
blob: 322d2a290d8328c5f14576f944f1a2cb0bb4b984 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package gui

// Let's you toggle on and off the various types of debugging output
// These checkboxes should be in the same order as the are printed
func (n *Node) DebugFlags(makeWindow bool) {
	var w, g *Node

	// Either:
	// make a new window
	// make a new tab in the existing window
	if (makeWindow) {
		Config.Title = "Debug Flags"
		Config.Width = 300
		Config.Height = 400
		w = NewWindow()
		w.Custom = w.StandardClose
	} else {
		w = n.NewTab("Flags")
	}

	g = w.NewGroup("Show")

	g.NewButton("Dump Flags", func () {
		ShowDebugValues()
	})

	g.NewButton("All On", func () {
		SetDebug(true)
	})

	g.NewButton("All Off", func () {
		SetDebug(false)
	})

	g = w.NewGroup("List")
	// generally useful debugging
	cb1 := g.NewCheckbox("debug Gui (like verbose=1)")
	cb1.Custom = func() {
		debugGui = cb1.widget.B
		log(debugGui, "Custom() n.widget =", cb1.widget.Name, cb1.widget.B)
	}

	// errors. by default these always output somewhere
	cbE := g.NewCheckbox("debug Error (bad things. default=true)")
	cbE.Custom = func() {
		SetFlag("Error",  cbE.widget.B)
	}

	// debugging that will show you things like mouse clicks, user inputing text, etc
	// also set toolkit.DebugChange
	cb2 := g.NewCheckbox("debug Change (keyboard and mouse events)")
	cb2.Custom = func() {
		SetFlag("Change", cb2.widget.B)
	}

	// supposed to tell if you are going to dump full variable output
	cb3 := g.NewCheckbox("debug Dump (show lots of output)")
	cb3.Custom = func() {
		SetFlag("Dump",  cbE.widget.B)
	}

	cb4 := g.NewCheckbox("debug Tabs (tabs and windows)")
	cb4.Custom = func() {
		SetFlag("Tabs",  cb4.widget.B)
	}

	cb6 := g.NewCheckbox("debug Node (the binary tree)")
	cb6.Custom = func() {
		SetFlag("Plugin",  cb6.widget.B)
	}

	// should show you when things go into or come back from the plugin
	cb5 := g.NewCheckbox("debug Plugin (plugin interaction)")
	cb5.Custom = func() {
		SetFlag("Plugin",  cb5.widget.B)
	}

	// turns on debugging inside the plugin toolkit
	cb7 := g.NewCheckbox("debug Toolkit (the plugin internals)")
	cb7.Custom = func() {
		// SetDebugToolkit(cb7.widget.B)
		SetFlag("Toolkit", cb7.widget.B)
	}
}