-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.go
108 lines (98 loc) · 2.22 KB
/
menu.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// Copyright 2010 The win Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package win
// Constants for MENUITEMINFO.fMask
const (
MIIM_STATE = 1
MIIM_ID = 2
MIIM_SUBMENU = 4
MIIM_CHECKMARKS = 8
MIIM_TYPE = 16
MIIM_DATA = 32
MIIM_STRING = 64
MIIM_BITMAP = 128
MIIM_FTYPE = 256
)
// Constants for MENUITEMINFO.fType
const (
MFT_BITMAP = 4
MFT_MENUBARBREAK = 32
MFT_MENUBREAK = 64
MFT_OWNERDRAW = 256
MFT_RADIOCHECK = 512
MFT_RIGHTJUSTIFY = 0x4000
MFT_SEPARATOR = 0x800
MFT_RIGHTORDER = 0x2000
MFT_STRING = 0
)
// Constants for MENUITEMINFO.fState
const (
MFS_CHECKED = 8
MFS_DEFAULT = 4096
MFS_DISABLED = 3
MFS_ENABLED = 0
MFS_GRAYED = 3
MFS_HILITE = 128
MFS_UNCHECKED = 0
MFS_UNHILITE = 0
)
// Constants for MENUITEMINFO.hbmp*
const (
HBMMENU_CALLBACK = -1
HBMMENU_SYSTEM = 1
HBMMENU_MBAR_RESTORE = 2
HBMMENU_MBAR_MINIMIZE = 3
HBMMENU_MBAR_CLOSE = 5
HBMMENU_MBAR_CLOSE_D = 6
HBMMENU_MBAR_MINIMIZE_D = 7
HBMMENU_POPUP_CLOSE = 8
HBMMENU_POPUP_RESTORE = 9
HBMMENU_POPUP_MAXIMIZE = 10
HBMMENU_POPUP_MINIMIZE = 11
)
// MENUINFO mask constants
const (
MIM_APPLYTOSUBMENUS = 0x80000000
MIM_BACKGROUND = 0x00000002
MIM_HELPID = 0x00000004
MIM_MAXHEIGHT = 0x00000001
MIM_MENUDATA = 0x00000008
MIM_STYLE = 0x00000010
)
// MENUINFO style constants
const (
MNS_AUTODISMISS = 0x10000000
MNS_CHECKORBMP = 0x04000000
MNS_DRAGDROP = 0x20000000
MNS_MODELESS = 0x40000000
MNS_NOCHECK = 0x80000000
MNS_NOTIFYBYPOS = 0x08000000
)
const (
MF_BYCOMMAND = 0x00000000
MF_BYPOSITION = 0x00000400
)
type MENUITEMINFO struct {
CbSize uint32
FMask uint32
FType uint32
FState uint32
WID uint32
HSubMenu HMENU
HbmpChecked HBITMAP
HbmpUnchecked HBITMAP
DwItemData uintptr
DwTypeData *uint16
Cch uint32
HbmpItem HBITMAP
}
type MENUINFO struct {
CbSize uint32
FMask uint32
DwStyle uint32
CyMax uint32
HbrBack HBRUSH
DwContextHelpID uint32
DwMenuData uintptr
}