Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
2757532f
Commit
2757532f
authored
Feb 20, 2006
by
Rein Klazes
Committed by
Alexandre Julliard
Feb 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Menu drawing fixes.
Replace some #defined constants by values calculated from windows metrics.
parent
444a5471
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
24 deletions
+20
-24
menu.c
dlls/user/menu.c
+20
-24
No files found.
dlls/user/menu.c
View file @
2757532f
...
...
@@ -140,15 +140,6 @@ typedef struct
#define TPM_BUTTONDOWN 0x40000000
/* menu was clicked before tracking */
#define TPM_POPUPMENU 0x20000000
/* menu is a popup menu */
/* Space between 2 menu bar items */
#define MENU_BAR_ITEMS_SPACE 12
/* Minimum width of a tab character */
#define MENU_TAB_SPACE 8
/* Height of a separator item */
#define SEPARATOR_HEIGHT 5
/* Space between 2 columns */
#define MENU_COL_SPACE 4
...
...
@@ -960,11 +951,6 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
GetObjectW
(
get_arrow_bitmap
(),
sizeof
(
bm
),
&
bm
);
arrow_bitmap_width
=
bm
.
bmWidth
;
SetRect
(
&
lpitem
->
rect
,
orgX
,
orgY
,
orgX
,
orgY
);
if
(
lpitem
->
fType
&
MF_OWNERDRAW
)
{
MEASUREITEMSTRUCT
mis
;
/* not done in Menu_Init: GetDialogBaseUnits() breaks there */
if
(
!
menucharsize
.
cx
)
{
menucharsize
.
cx
=
GdiGetCharDimensions
(
hdc
,
NULL
,
&
menucharsize
.
cy
);
...
...
@@ -972,6 +958,12 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
* but it is unlikely an application will depend on that */
ODitemheight
=
HIWORD
(
GetDialogBaseUnits
());
}
SetRect
(
&
lpitem
->
rect
,
orgX
,
orgY
,
orgX
,
orgY
);
if
(
lpitem
->
fType
&
MF_OWNERDRAW
)
{
MEASUREITEMSTRUCT
mis
;
mis
.
CtlType
=
ODT_MENU
;
mis
.
CtlID
=
0
;
mis
.
itemID
=
lpitem
->
wID
;
...
...
@@ -998,7 +990,9 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
if
(
lpitem
->
fType
&
MF_SEPARATOR
)
{
lpitem
->
rect
.
bottom
+=
SEPARATOR_HEIGHT
;
lpitem
->
rect
.
bottom
+=
GetSystemMetrics
(
SM_CYMENUSIZE
)
/
2
;
if
(
!
menuBar
)
lpitem
->
rect
.
right
+=
arrow_bitmap_width
+
menucharsize
.
cx
;
return
;
}
...
...
@@ -1046,19 +1040,19 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
if
(
menuBar
)
{
lpitem
->
rect
.
right
+=
MENU_BAR_ITEMS_SPACE
;
lpitem
->
rect
.
right
+=
2
*
menucharsize
.
cx
;
}
else
if
((
p
=
strchrW
(
lpitem
->
text
,
'\t'
))
!=
NULL
)
{
/* Item contains a tab (only meaningful in popup menus) */
GetTextExtentPoint32W
(
hdc
,
lpitem
->
text
,
(
int
)(
p
-
lpitem
->
text
)
,
&
size
);
lpitem
->
xTab
=
check_bitmap_width
+
MENU_TAB_SPACE
+
size
.
cx
;
lpitem
->
rect
.
right
+=
MENU_TAB_SPACE
;
lpitem
->
xTab
=
check_bitmap_width
+
menucharsize
.
cx
+
size
.
cx
;
lpitem
->
rect
.
right
+=
menucharsize
.
cx
;
}
else
{
if
(
strchrW
(
lpitem
->
text
,
'\b'
))
lpitem
->
rect
.
right
+=
MENU_TAB_SPACE
;
lpitem
->
rect
.
right
+=
menucharsize
.
cx
;
lpitem
->
xTab
=
lpitem
->
rect
.
right
-
check_bitmap_width
-
arrow_bitmap_width
;
}
...
...
@@ -1456,7 +1450,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
rc
.
left
++
;
rc
.
right
--
;
rc
.
top
+=
SEPARATOR_HEIGHT
/
2
;
rc
.
top
=
(
rc
.
top
+
rc
.
bottom
)
/
2
;
if
(
flat_menu
)
{
oldPen
=
SelectObject
(
hdc
,
SYSCOLOR_GetPen
(
COLOR_BTNSHADOW
)
);
...
...
@@ -1585,10 +1579,12 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
hfontOld
=
SelectObject
(
hdc
,
get_menu_font
(
TRUE
)
);
}
if
(
menuBar
)
{
rect
.
left
+=
MENU_BAR_ITEMS_SPACE
/
2
;
rect
.
right
-=
MENU_BAR_ITEMS_SPACE
/
2
;
if
(
menuBar
)
{
if
(
lpitem
->
hbmpItem
)
rect
.
left
+=
lpitem
->
bmpsize
.
cx
;
if
(
!
(
lpitem
->
hbmpItem
==
HBMMENU_CALLBACK
))
rect
.
left
+=
menucharsize
.
cx
;
rect
.
right
-=
menucharsize
.
cx
;
}
for
(
i
=
0
;
lpitem
->
text
[
i
];
i
++
)
...
...
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