-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtoolbar.go
83 lines (77 loc) · 1.55 KB
/
toolbar.go
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
package main
import (
"github.com/lxn/walk"
. "github.com/lxn/walk/declarative"
)
var toolBars *walk.ToolBar
func LinkDelToolBar() {
list := consoleLinkTable.LinkTableSelectList()
if len(list) == 0 {
ErrorBoxAction(MainWindowsCtrl(), "No object selected")
return
}
LinkDelele(list)
consoleLinkTable.LinkTableSelectClean()
}
func LinkStartToolBar() {
list := consoleLinkTable.LinkTableSelectList()
if len(list) == 0 {
ErrorBoxAction(MainWindowsCtrl(), "No object selected")
return
}
LinkStart(list)
consoleLinkTable.LinkTableSelectClean()
}
func LinkStopToolBar() {
list := consoleLinkTable.LinkTableSelectList()
if len(list) == 0 {
ErrorBoxAction(MainWindowsCtrl(), "No object selected")
return
}
LinkStop(list)
consoleLinkTable.LinkTableSelectClean()
}
func ToolBarInit() ToolBar {
return ToolBar{
AssignTo: &toolBars,
ButtonStyle: ToolBarButtonImageOnly,
MinSize: Size{Width: 64, Height: 64},
Items: []MenuItem{
Action{
Text: "Add Link",
Image: ICON_TOOL_ADD,
OnTriggered: func() {
AddToolBar()
},
},
Action{
Text: "Delete Link",
Image: ICON_TOOL_DEL,
OnTriggered: func() {
go LinkDelToolBar()
},
},
Action{
Text: "Link",
Image: ICON_TOOL_LINK,
OnTriggered: func() {
go LinkStartToolBar()
},
},
Action{
Text: "Unlink",
Image: ICON_TOOL_UNLINK,
OnTriggered: func() {
go LinkStopToolBar()
},
},
//Action{
// Text: "Setting",
// Image: ICON_TOOL_SETTING,
// OnTriggered: func() {
// //Setting()
// },
//},
},
}
}