Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
55c1073b
Commit
55c1073b
authored
May 13, 2005
by
Kevin Koltzau
Committed by
Alexandre Julliard
May 13, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable/disable menu items based on edit control state.
parent
b5eacf9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
main.c
programs/notepad/main.c
+25
-0
No files found.
programs/notepad/main.c
View file @
55c1073b
...
...
@@ -114,6 +114,27 @@ static VOID NOTEPAD_InitData(VOID)
}
/***********************************************************************
* Enable/disable items on the menu based on control state
*/
static
VOID
NOTEPAD_InitMenuPopup
(
HMENU
menu
,
int
index
)
{
int
enable
;
EnableMenuItem
(
menu
,
CMD_UNDO
,
SendMessage
(
Globals
.
hEdit
,
EM_CANUNDO
,
0
,
0
)
?
MF_ENABLED
:
MF_GRAYED
);
EnableMenuItem
(
menu
,
CMD_PASTE
,
IsClipboardFormatAvailable
(
CF_TEXT
)
?
MF_ENABLED
:
MF_GRAYED
);
enable
=
SendMessage
(
Globals
.
hEdit
,
EM_GETSEL
,
0
,
0
);
enable
=
(
HIWORD
(
enable
)
==
LOWORD
(
enable
))
?
MF_GRAYED
:
MF_ENABLED
;
EnableMenuItem
(
menu
,
CMD_CUT
,
enable
);
EnableMenuItem
(
menu
,
CMD_COPY
,
enable
);
EnableMenuItem
(
menu
,
CMD_DELETE
,
enable
);
EnableMenuItem
(
menu
,
CMD_SELECT_ALL
,
GetWindowTextLength
(
Globals
.
hEdit
)
?
MF_ENABLED
:
MF_GRAYED
);
}
/***********************************************************************
*
* NOTEPAD_WndProc
*/
...
...
@@ -178,6 +199,10 @@ static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam,
DoOpenFile
(
szFileName
);
break
;
}
case
WM_INITMENUPOPUP
:
NOTEPAD_InitMenuPopup
((
HMENU
)
wParam
,
lParam
);
break
;
default:
return
DefWindowProc
(
hWnd
,
msg
,
wParam
,
lParam
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment