-
Notifications
You must be signed in to change notification settings - Fork 2
/
Menus.asm
96 lines (67 loc) · 2.84 KB
/
Menus.asm
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
MenusInit PROTO :DWORD ; Initialize Main Menu and submenus
MenusReset PROTO :DWORD ; Reset all menu items on Main Menu back to default state
MenusUpdate PROTO :DWORD, :DWORD ; Update Main Menu and submenus
MenuMainInit PROTO :DWORD ; Initialize main menu, load bitmaps, set initial state
MenuMainUpdate PROTO :DWORD, :DWORD
.CONST
;TlkViewer.mnu
IDM_MENU equ 10000
IDM_FILE_OPEN equ 10003
IDM_FILE_CLOSE equ 10004
IDM_FILE_EXIT equ 10001
IDM_HELP_INFO equ 10005
IDM_HELP_ABOUT equ 10101
; Menu add shortcut key to text add tab \t - &New\tCtrl+N - right align them you use \a instead of \t &New\aCtrl+N
.CODE
;-------------------------------------------------------------------------------------
; MenusInit - Initialize menus
;-------------------------------------------------------------------------------------
MenusInit PROC hWin:DWORD
Invoke MenuMainInit, hWin
ret
MenusInit ENDP
;-------------------------------------------------------------------------------------
; Reset menus when user closes file
;-------------------------------------------------------------------------------------
MenusReset PROC hWin:DWORD
LOCAL hMainMenu:DWORD
LOCAL mi:MENUITEMINFO
mov mi.cbSize, SIZEOF MENUITEMINFO
mov mi.fMask, MIIM_STATE
Invoke GetMenu, hWin
mov hMainMenu, eax
ret
MenusReset ENDP
;-------------------------------------------------------------------------------------
; MenusUpdate - update menus
;-------------------------------------------------------------------------------------
MenusUpdate PROC USES EBX hWin:DWORD, hItem:DWORD
ret
MenusUpdate ENDP
;-------------------------------------------------------------------------------------
; MenuMainInit - Initialize main program menu
;-------------------------------------------------------------------------------------
MenuMainInit PROC hWin:DWORD
LOCAL hMainMenu:DWORD
LOCAL hBitmap:DWORD
LOCAL mi:MENUITEMINFO
mov mi.cbSize, SIZEOF MENUITEMINFO
mov mi.fMask, MIIM_STATE
mov mi.fState, MFS_GRAYED
Invoke GetMenu, hWin
mov hMainMenu, eax
xor eax, eax
ret
MenuMainInit ENDP
;-------------------------------------------------------------------------------------
; Update main menu
;-------------------------------------------------------------------------------------
MenuMainUpdate PROC hWin:DWORD, bInLV:DWORD
LOCAL hMainMenu:DWORD
LOCAL mi:MENUITEMINFO
mov mi.cbSize, SIZEOF MENUITEMINFO
mov mi.fMask, MIIM_STATE
Invoke GetMenu, hWin
mov hMainMenu, eax
ret
MenuMainUpdate ENDP