mirror of
https://github.com/reactos/reactos.git
synced 2024-08-08 12:18:13 +00:00
small changes
svn path=/trunk/; revision=5799
This commit is contained in:
parent
274ac97525
commit
05831e8a00
|
@ -3380,13 +3380,16 @@ static void EDIT_WM_Command(EDITSTATE *es, INT code, INT id, HWND control)
|
||||||
*/
|
*/
|
||||||
static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)
|
static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)
|
||||||
{
|
{
|
||||||
HMENU menu = LoadMenuA(GetModuleHandleA("USER32"), "EDITMENU");
|
UINT start, end;
|
||||||
HMENU popup = GetSubMenu(menu, 0);
|
HMENU popup;
|
||||||
UINT start = es->selection_start;
|
|
||||||
UINT end = es->selection_end;
|
start = es->selection_start;
|
||||||
|
end = es->selection_end;
|
||||||
|
|
||||||
ORDER_UINT(start, end);
|
ORDER_UINT(start, end);
|
||||||
|
|
||||||
|
popup = LoadMenuW(GetModuleHandleW(L"USER32"), L"EDITMENU");
|
||||||
|
|
||||||
/* undo */
|
/* undo */
|
||||||
EnableMenuItem(popup, 0, MF_BYPOSITION | (EDIT_EM_CanUndo(es) && !(es->style & ES_READONLY) ? MF_ENABLED : MF_GRAYED));
|
EnableMenuItem(popup, 0, MF_BYPOSITION | (EDIT_EM_CanUndo(es) && !(es->style & ES_READONLY) ? MF_ENABLED : MF_GRAYED));
|
||||||
/* cut */
|
/* cut */
|
||||||
|
@ -3401,7 +3404,7 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)
|
||||||
EnableMenuItem(popup, 7, MF_BYPOSITION | (start || (end != strlenW(es->text)) ? MF_ENABLED : MF_GRAYED));
|
EnableMenuItem(popup, 7, MF_BYPOSITION | (start || (end != strlenW(es->text)) ? MF_ENABLED : MF_GRAYED));
|
||||||
|
|
||||||
TrackPopupMenu(popup, TPM_LEFTALIGN | TPM_RIGHTBUTTON, x, y, 0, es->hwndSelf, NULL);
|
TrackPopupMenu(popup, TPM_LEFTALIGN | TPM_RIGHTBUTTON, x, y, 0, es->hwndSelf, NULL);
|
||||||
DestroyMenu(menu);
|
DestroyMenu(popup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -123,17 +123,14 @@ END
|
||||||
|
|
||||||
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
|
EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
|
||||||
{
|
{
|
||||||
POPUP ""
|
MENUITEM "&Undo", EM_UNDO
|
||||||
BEGIN
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Undo", EM_UNDO
|
MENUITEM "Cu&t", WM_CUT
|
||||||
MENUITEM SEPARATOR
|
MENUITEM "&Copy", WM_COPY
|
||||||
MENUITEM "Cu&t", WM_CUT
|
MENUITEM "&Paste", WM_PASTE
|
||||||
MENUITEM "&Copy", WM_COPY
|
MENUITEM "&Delete", WM_CLEAR
|
||||||
MENUITEM "&Paste", WM_PASTE
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Delete", WM_CLEAR
|
MENUITEM "Select &All", EM_SETSEL
|
||||||
MENUITEM SEPARATOR
|
|
||||||
MENUITEM "Select &All", EM_SETSEL
|
|
||||||
END
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: menu.c,v 1.28 2003/08/22 16:01:01 weiden Exp $
|
/* $Id: menu.c,v 1.29 2003/08/23 17:06:07 weiden Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
* FILE: lib/user32/windows/menu.c
|
* FILE: lib/user32/windows/menu.c
|
||||||
|
@ -192,7 +192,7 @@ static LPCSTR MENUEX_ParseResource( LPCSTR res, HMENU hMenu)
|
||||||
*
|
*
|
||||||
* NOTE: flags is equivalent to the mtOption field
|
* NOTE: flags is equivalent to the mtOption field
|
||||||
*/
|
*/
|
||||||
static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL TopLevel, BOOL unicode )
|
static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL unicode )
|
||||||
{
|
{
|
||||||
WORD flags, id = 0;
|
WORD flags, id = 0;
|
||||||
HMENU hSubMenu;
|
HMENU hSubMenu;
|
||||||
|
@ -201,7 +201,6 @@ static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL TopLevel, BOOL u
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
hSubMenu = (HMENU)0;
|
|
||||||
flags = GET_WORD(res);
|
flags = GET_WORD(res);
|
||||||
|
|
||||||
/* remove MF_END flag before passing it to AppendMenu()! */
|
/* remove MF_END flag before passing it to AppendMenu()! */
|
||||||
|
@ -221,22 +220,14 @@ static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL TopLevel, BOOL u
|
||||||
res += (strlenW((LPCWSTR)str) + 1) * sizeof(WCHAR);
|
res += (strlenW((LPCWSTR)str) + 1) * sizeof(WCHAR);
|
||||||
if (flags & MF_POPUP)
|
if (flags & MF_POPUP)
|
||||||
{
|
{
|
||||||
if(!TopLevel)
|
hSubMenu = CreatePopupMenu();
|
||||||
{
|
if(!hSubMenu) return NULL;
|
||||||
hSubMenu = CreatePopupMenu();
|
if(!(res = MENU_ParseResource(res, hSubMenu, unicode)))
|
||||||
if(!hSubMenu) return NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
hSubMenu = hMenu;
|
|
||||||
if(!(res = MENU_ParseResource(res, hSubMenu, FALSE, unicode)))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
if(!TopLevel)
|
if(!unicode)
|
||||||
{
|
AppendMenuA(hMenu, flags, (UINT)hSubMenu, str);
|
||||||
if(!unicode)
|
else
|
||||||
AppendMenuA(hMenu, flags, (UINT)hSubMenu, str);
|
AppendMenuW(hMenu, flags, (UINT)hSubMenu, (LPCWSTR)str);
|
||||||
else
|
|
||||||
AppendMenuW(hMenu, flags, (UINT)hSubMenu, (LPCWSTR)str);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else /* Not a popup */
|
else /* Not a popup */
|
||||||
{
|
{
|
||||||
|
@ -257,7 +248,7 @@ User32LoadSysMenuTemplateForKernel(PVOID Arguments, ULONG ArgumentLength)
|
||||||
{
|
{
|
||||||
LRESULT Result;
|
LRESULT Result;
|
||||||
HMODULE hUser32;
|
HMODULE hUser32;
|
||||||
hUser32 = GetModuleHandleW(L"user32.dll");
|
hUser32 = GetModuleHandleW(L"USER32");
|
||||||
Result = (LRESULT)LoadMenuW(hUser32, L"SYSMENU");
|
Result = (LRESULT)LoadMenuW(hUser32, L"SYSMENU");
|
||||||
return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
|
return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
|
||||||
}
|
}
|
||||||
|
@ -976,7 +967,7 @@ LoadMenuIndirectW(CONST MENUTEMPLATE *lpMenuTemplate)
|
||||||
offset = GET_WORD(p);
|
offset = GET_WORD(p);
|
||||||
p += sizeof(WORD) + offset;
|
p += sizeof(WORD) + offset;
|
||||||
if (!(hMenu = CreateMenu())) return 0;
|
if (!(hMenu = CreateMenu())) return 0;
|
||||||
if (!MENU_ParseResource(p, hMenu, TRUE, TRUE))
|
if (!MENU_ParseResource(p, hMenu, TRUE))
|
||||||
{
|
{
|
||||||
DestroyMenu(hMenu);
|
DestroyMenu(hMenu);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue