Author: jimtabor
Date: Tue Mar 23 03:42:11 2010
New Revision: 46351
URL:
http://svn.reactos.org/svn/reactos?rev=46351&view=rev
Log:
[Win32k|User32]
- Start Menu and Item structure migration.
Modified:
trunk/reactos/dll/win32/user32/windows/menu.c
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/include/menu.h
trunk/reactos/subsystems/win32/win32k/ntuser/menu.c
Modified: trunk/reactos/dll/win32/user32/windows/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] Tue Mar 23 03:42:11 2010
@@ -539,7 +539,7 @@
ItemInfo = Items;
for (i = 0; i < MenuInfo->MenuItemCount; i++, ItemInfo++)
{
- if ((ItemInfo->Text) && NULL != ItemInfo->dwTypeData)
+ if ((ItemInfo->lpstr) && NULL != ItemInfo->dwTypeData)
{
WCHAR *p = (WCHAR *) ItemInfo->dwTypeData - 2;
do
@@ -806,7 +806,7 @@
return;
}
- lpitem->XTab = 0;
+ lpitem->dxTab = 0;
if (lpitem->hbmpItem)
{
@@ -829,12 +829,12 @@
if( !(MenuInfo->dwStyle & MNS_NOCHECK))
lpitem->Rect.right += 2 * check_bitmap_width;
lpitem->Rect.right += 4 + MenuCharSize.cx;
- lpitem->XTab = lpitem->Rect.right;
+ lpitem->dxTab = lpitem->Rect.right;
lpitem->Rect.right += check_bitmap_width;
} else /* hbmpItem & MenuBar */ {
MenuGetBitmapItemSize(lpitem, &size, hwndOwner );
lpitem->Rect.right += size.cx;
- if( lpitem->Text) lpitem->Rect.right += 2;
+ if( lpitem->lpstr) lpitem->Rect.right += 2;
itemheight = size.cy;
/* Special case: Minimize button doesn't have a space behind it. */
@@ -847,12 +847,12 @@
if( !(MenuInfo->dwStyle & MNS_NOCHECK))
lpitem->Rect.right += check_bitmap_width;
lpitem->Rect.right += 4 + MenuCharSize.cx;
- lpitem->XTab = lpitem->Rect.right;
+ lpitem->dxTab = lpitem->Rect.right;
lpitem->Rect.right += check_bitmap_width;
}
/* it must be a text item - unless it's the system menu */
- if (!(lpitem->fType & MF_SYSMENU) && lpitem->Text) {
+ if (!(lpitem->fType & MF_SYSMENU) && lpitem->lpstr) {
HFONT hfontOld = NULL;
RECT rc = lpitem->Rect;
LONG txtheight, txtwidth;
@@ -881,7 +881,7 @@
/* get text size after the tab */
tmpheight = DrawTextW( hdc, p, -1, &tmprc,
DT_SINGLELINE|DT_CALCRECT);
- lpitem->XTab += txtwidth;
+ lpitem->dxTab += txtwidth;
txtheight = max( txtheight, tmpheight);
txtwidth += MenuCharSize.cx + /* space for the tab */
tmprc.right - tmprc.left; /* space for the short cut */
@@ -889,7 +889,7 @@
txtheight = DrawTextW( hdc, lpitem->dwTypeData, -1, &rc,
DT_SINGLELINE|DT_CALCRECT);
txtwidth = rc.right - rc.left;
- lpitem->XTab += txtwidth;
+ lpitem->dxTab += txtwidth;
}
lpitem->Rect.right += 2 + txtwidth;
itemheight = max( itemheight,
@@ -965,10 +965,10 @@
// }
maxX = max(maxX, lpitem.Rect.right);
orgY = lpitem.Rect.bottom;
- if ((lpitem.Text) && lpitem.XTab )
+ if ((lpitem.lpstr) && lpitem.dxTab )
{
- maxTab = max( maxTab, lpitem.XTab );
- maxTabWidth = max(maxTabWidth, lpitem.Rect.right - lpitem.XTab);
+ maxTab = max( maxTab, lpitem.dxTab );
+ maxTabWidth = max(maxTabWidth, lpitem.Rect.right - lpitem.dxTab);
}
}
@@ -979,9 +979,9 @@
if (MenuGetRosMenuItemInfo(MenuInfo->Self, start, &lpitem))
{
lpitem.Rect.right = maxX;
- if ((lpitem.Text) && 0 != lpitem.XTab)
+ if ((lpitem.lpstr) && 0 != lpitem.dxTab)
{
- lpitem.XTab = maxTab;
+ lpitem.dxTab = maxTab;
}
MenuSetRosMenuItemInfo(MenuInfo->Self, start, &lpitem);
}
@@ -1379,7 +1379,7 @@
}
/* process text if present */
- if (lpitem->Text)
+ if (lpitem->lpstr)
{
register int i = 0;
HFONT hfontOld = 0;
@@ -1429,12 +1429,12 @@
{
if (L'\t' == Text[i])
{
- rect.left = lpitem->XTab;
+ rect.left = lpitem->dxTab;
uFormat = DT_LEFT | DT_VCENTER | DT_SINGLELINE;
}
else
{
- rect.right = lpitem->XTab;
+ rect.right = lpitem->dxTab;
uFormat = DT_RIGHT | DT_VCENTER | DT_SINGLELINE;
}
Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Tue Mar 23 03:42:11 2010
@@ -3279,8 +3279,8 @@
HBITMAP hbmpItem;
/* ----------- Extra ----------- */
RECT Rect; /* Item area (relative to menu window) */
- UINT XTab; /* X position of text after Tab */
- LPWSTR Text; /* Copy of the text pointer in MenuItem->Text */
+ UINT dxTab; /* X position of text after Tab */
+ LPWSTR lpstr; /* Copy of the text pointer in MenuItem->Text */
} ROSMENUITEMINFO, *PROSMENUITEMINFO;
BOOL
Modified: trunk/reactos/subsystems/win32/win32k/include/menu.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/menu.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/menu.h [iso-8859-1] Tue Mar 23 03:42:11
2010
@@ -23,7 +23,7 @@
UNICODE_STRING Text;
HBITMAP hbmpItem;
RECTL Rect;
- UINT XTab;
+ UINT dxTab;
} MENU_ITEM, *PMENU_ITEM;
typedef struct _MENU_OBJECT
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] Tue Mar 23 03:42:11
2010
@@ -690,8 +690,8 @@
if (sizeof(ROSMENUITEMINFO) == lpmii->cbSize)
{
lpmii->Rect = MenuItem->Rect;
- lpmii->XTab = MenuItem->XTab;
- lpmii->Text = MenuItem->Text.Buffer;
+ lpmii->dxTab = MenuItem->dxTab;
+ lpmii->lpstr = MenuItem->Text.Buffer; // Use DesktopHeap!
}
return TRUE;
@@ -842,8 +842,8 @@
if (sizeof(ROSMENUITEMINFO) == lpmii->cbSize)
{
MenuItem->Rect = lpmii->Rect;
- MenuItem->XTab = lpmii->XTab;
- lpmii->Text = MenuItem->Text.Buffer; /* Send back new allocated string or
zero */
+ MenuItem->dxTab = lpmii->dxTab;
+ lpmii->lpstr = MenuItem->Text.Buffer; /* Use DesktopHeap! Send back new
allocated string or zero */
}
return TRUE;
@@ -1002,8 +1002,8 @@
mii.hbmpUnchecked = CurItem->hbmpUnchecked;
mii.hSubMenu = CurItem->hSubMenu;
mii.Rect = CurItem->Rect;
- mii.XTab = CurItem->XTab;
- mii.Text = CurItem->Text.Buffer;
+ mii.dxTab = CurItem->dxTab;
+ mii.lpstr = CurItem->Text.Buffer; // Use DesktopHeap!
Status = MmCopyToCaller(Buf, &mii, sizeof(ROSMENUITEMINFO));
if (! NT_SUCCESS(Status))