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
75b278e9
Commit
75b278e9
authored
Jan 06, 2001
by
François Gouget
Committed by
Alexandre Julliard
Jan 06, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify the look of bitmap menu items to match Win95 and Win98
Fix the sunken edge/bitmap overlap in the Win98 look Introduce an IS_MAGIC_ITEM macro to test if the item is 'magic'
parent
da2b6a9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
15 deletions
+27
-15
menu.c
controls/menu.c
+27
-15
No files found.
controls/menu.c
View file @
75b278e9
...
...
@@ -132,6 +132,7 @@ typedef struct
#define IS_STRING_ITEM(flags) (MENU_ITEM_TYPE ((flags)) == MF_STRING)
#define IS_BITMAP_ITEM(flags) (MENU_ITEM_TYPE ((flags)) == MF_BITMAP)
#define IS_MAGIC_ITEM(text) (LOWORD((int)text)<12)
#define IS_SYSTEM_MENU(menu) \
(!((menu)->wFlags & MF_POPUP) && (menu)->wFlags & MF_SYSMENU)
...
...
@@ -860,7 +861,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
HBITMAP
resBmp
=
0
;
/* Check if there is a magic menu item associated with this item */
if
((
LOWORD
((
int
)
lpitem
->
text
))
<
12
)
if
(
IS_MAGIC_ITEM
(
lpitem
->
text
)
)
{
resBmp
=
MENU_LoadMagicItem
((
int
)
lpitem
->
text
,
(
lpitem
->
fType
&
MF_HILITE
),
lpitem
->
dwItemData
);
...
...
@@ -1203,24 +1204,22 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
{
if
(
TWEAK_WineLook
==
WIN98_LOOK
)
{
if
(
menuBar
)
if
(
menuBar
)
{
SetTextColor
(
hdc
,
GetSysColor
(
COLOR_MENUTEXT
));
else
{
SetBkColor
(
hdc
,
GetSysColor
(
COLOR_MENU
));
}
else
{
if
(
lpitem
->
fState
&
MF_GRAYED
)
SetTextColor
(
hdc
,
GetSysColor
(
COLOR_GRAYTEXT
));
else
SetTextColor
(
hdc
,
GetSysColor
(
COLOR_HIGHLIGHTTEXT
));
SetBkColor
(
hdc
,
GetSysColor
(
COLOR_HIGHLIGHT
));
}
SetBkColor
(
hdc
,
GetSysColor
(
COLOR_HIGHLIGHT
));
}
else
/* Not Win98 Look */
{
SetTextColor
(
hdc
,
GetSysColor
(
COLOR_HIGHLIGHTTEXT
));
if
(
!
IS_BITMAP_ITEM
(
lpitem
->
fType
))
SetBkColor
(
hdc
,
GetSysColor
(
COLOR_HIGHLIGHT
));
else
SetBkColor
(
hdc
,
GetSysColor
(
COLOR_MENU
));
}
}
else
...
...
@@ -1300,7 +1299,9 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
/* Draw the item text or bitmap */
if
(
IS_BITMAP_ITEM
(
lpitem
->
fType
))
{
int
top
;
{
int
left
,
top
,
w
,
h
;
DWORD
rop
;
HBITMAP
resBmp
=
0
;
...
...
@@ -1310,7 +1311,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
* Check if there is a magic menu item associated with this item
* and load the appropriate bitmap
*/
if
((
LOWORD
((
int
)
lpitem
->
text
))
<
12
)
if
(
IS_MAGIC_ITEM
(
lpitem
->
text
)
)
{
resBmp
=
MENU_LoadMagicItem
((
int
)
lpitem
->
text
,
(
lpitem
->
fState
&
MF_HILITE
),
lpitem
->
dwItemData
);
...
...
@@ -1326,12 +1327,23 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
SelectObject
(
hdcMem
,
resBmp
);
/* handle fontsize > bitmap_height */
top
=
((
rect
.
bottom
-
rect
.
top
)
>
bm
.
bmHeight
)
?
rect
.
top
+
(
rect
.
bottom
-
rect
.
top
-
bm
.
bmHeight
)
/
2
:
rect
.
top
;
BitBlt
(
hdc
,
rect
.
left
,
top
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
hdcMem
,
0
,
0
,
((
lpitem
->
fState
&
MF_HILITE
)
&&
!
((
LOWORD
((
DWORD
)
lpitem
->
text
))
<
12
))
?
NOTSRCCOPY
:
SRCCOPY
);
h
=
rect
.
bottom
-
rect
.
top
;
top
=
(
h
>
bm
.
bmHeight
)
?
rect
.
top
+
(
h
-
bm
.
bmHeight
)
/
2
:
rect
.
top
;
w
=
rect
.
right
-
rect
.
left
;
left
=
rect
.
left
;
if
(
TWEAK_WineLook
==
WIN95_LOOK
)
{
rop
=
((
lpitem
->
fState
&
MF_HILITE
)
&&
!
IS_MAGIC_ITEM
(
lpitem
->
text
))
?
NOTSRCCOPY
:
SRCCOPY
;
if
((
lpitem
->
fState
&
MF_HILITE
)
&&
IS_BITMAP_ITEM
(
lpitem
->
fType
))
SetBkColor
(
hdc
,
GetSysColor
(
COLOR_HIGHLIGHT
));
}
else
{
left
++
;
w
-=
2
;
rop
=
((
lpitem
->
fState
&
MF_HILITE
)
&&
!
IS_MAGIC_ITEM
(
lpitem
->
text
)
&&
(
!
menuBar
))
?
MERGEPAINT
:
SRCCOPY
;
}
BitBlt
(
hdc
,
left
,
top
,
w
,
h
,
hdcMem
,
0
,
0
,
rop
);
}
DeleteDC
(
hdcMem
);
...
...
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