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
b25fa587
Commit
b25fa587
authored
Jul 05, 2005
by
Frank Richter
Committed by
Alexandre Julliard
Jul 05, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for drawing menus in "flat" style.
parent
17ed5537
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
4 deletions
+45
-4
menu.c
dlls/user/menu.c
+45
-4
No files found.
dlls/user/menu.c
View file @
b25fa587
...
...
@@ -1156,6 +1156,8 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
UINT
height
,
BOOL
menuBar
,
UINT
odaction
)
{
RECT
rect
;
BOOL
flat_menu
=
FALSE
;
int
bkgnd
;
debug_print_menuitem
(
"MENU_DrawMenuItem: "
,
lpitem
,
""
);
...
...
@@ -1166,11 +1168,14 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
return
;
}
SystemParametersInfoW
(
SPI_GETFLATMENU
,
0
,
&
flat_menu
,
0
);
bkgnd
=
(
menuBar
&&
flat_menu
)
?
COLOR_MENUBAR
:
COLOR_MENU
;
/* Setup colors */
if
(
lpitem
->
fState
&
MF_HILITE
)
{
if
(
menuBar
)
{
if
(
menuBar
&&
!
flat_menu
)
{
SetTextColor
(
hdc
,
GetSysColor
(
COLOR_MENUTEXT
));
SetBkColor
(
hdc
,
GetSysColor
(
COLOR_MENU
));
}
else
{
...
...
@@ -1187,7 +1192,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
SetTextColor
(
hdc
,
GetSysColor
(
COLOR_GRAYTEXT
)
);
else
SetTextColor
(
hdc
,
GetSysColor
(
COLOR_MENUTEXT
)
);
SetBkColor
(
hdc
,
GetSysColor
(
COLOR_MENU
)
);
SetBkColor
(
hdc
,
GetSysColor
(
bkgnd
)
);
}
if
(
lpitem
->
fType
&
MF_OWNERDRAW
)
...
...
@@ -1235,25 +1240,45 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
{
if
(
lpitem
->
fState
&
MF_HILITE
)
{
if
(
flat_menu
)
{
InflateRect
(
&
rect
,
-
1
,
-
1
);
FillRect
(
hdc
,
&
rect
,
GetSysColorBrush
(
COLOR_MENUHILIGHT
));
InflateRect
(
&
rect
,
1
,
1
);
FrameRect
(
hdc
,
&
rect
,
GetSysColorBrush
(
COLOR_HIGHLIGHT
));
}
else
{
if
(
menuBar
)
DrawEdge
(
hdc
,
&
rect
,
BDR_SUNKENOUTER
,
BF_RECT
);
else
FillRect
(
hdc
,
&
rect
,
GetSysColorBrush
(
COLOR_HIGHLIGHT
));
}
}
else
FillRect
(
hdc
,
&
rect
,
GetSysColorBrush
(
COLOR_MENU
)
);
FillRect
(
hdc
,
&
rect
,
GetSysColorBrush
(
bkgnd
)
);
}
SetBkMode
(
hdc
,
TRANSPARENT
);
if
(
!
(
lpitem
->
fType
&
MF_OWNERDRAW
))
{
HPEN
oldPen
;
/* vertical separator */
if
(
!
menuBar
&&
(
lpitem
->
fType
&
MF_MENUBARBREAK
))
{
RECT
rc
=
rect
;
rc
.
top
=
3
;
rc
.
bottom
=
height
-
3
;
if
(
flat_menu
)
{
oldPen
=
SelectObject
(
hdc
,
SYSCOLOR_GetPen
(
COLOR_BTNSHADOW
)
);
MoveToEx
(
hdc
,
rc
.
left
,
rc
.
top
,
NULL
);
LineTo
(
hdc
,
rc
.
left
,
rc
.
bottom
);
SelectObject
(
hdc
,
oldPen
);
}
else
DrawEdge
(
hdc
,
&
rc
,
EDGE_ETCHED
,
BF_LEFT
);
}
...
...
@@ -1264,6 +1289,14 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
rc
.
left
++
;
rc
.
right
--
;
rc
.
top
+=
SEPARATOR_HEIGHT
/
2
;
if
(
flat_menu
)
{
oldPen
=
SelectObject
(
hdc
,
SYSCOLOR_GetPen
(
COLOR_BTNSHADOW
)
);
MoveToEx
(
hdc
,
rc
.
left
,
rc
.
top
,
NULL
);
LineTo
(
hdc
,
rc
.
right
,
rc
.
top
);
SelectObject
(
hdc
,
oldPen
);
}
else
DrawEdge
(
hdc
,
&
rc
,
EDGE_ETCHED
,
BF_TOP
);
return
;
}
...
...
@@ -1477,7 +1510,12 @@ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu )
if
(
hPrevPen
)
{
POPUPMENU
*
menu
;
BOOL
flat_menu
=
FALSE
;
SystemParametersInfoW
(
SPI_GETFLATMENU
,
0
,
&
flat_menu
,
0
);
if
(
flat_menu
)
FrameRect
(
hdc
,
&
rect
,
GetSysColorBrush
(
COLOR_BTNSHADOW
));
else
DrawEdge
(
hdc
,
&
rect
,
EDGE_RAISED
,
BF_RECT
);
/* draw menu items */
...
...
@@ -3859,6 +3897,9 @@ DWORD WINAPI DrawMenuBarTemp(HWND hwnd, HDC hDC, LPRECT lprect, HMENU hMenu, HFO
LPPOPUPMENU
lppop
;
UINT
i
,
retvalue
;
HFONT
hfontOld
=
0
;
BOOL
flat_menu
=
FALSE
;
SystemParametersInfoW
(
SPI_GETFLATMENU
,
0
,
&
flat_menu
,
0
);
if
(
!
hMenu
)
hMenu
=
GetMenu
(
hwnd
);
...
...
@@ -3882,7 +3923,7 @@ DWORD WINAPI DrawMenuBarTemp(HWND hwnd, HDC hDC, LPRECT lprect, HMENU hMenu, HFO
lprect
->
bottom
=
lprect
->
top
+
lppop
->
Height
;
FillRect
(
hDC
,
lprect
,
GetSysColorBrush
(
COLOR_MENU
)
);
FillRect
(
hDC
,
lprect
,
GetSysColorBrush
(
flat_menu
?
COLOR_MENUBAR
:
COLOR_MENU
)
);
SelectObject
(
hDC
,
SYSCOLOR_GetPen
(
COLOR_3DFACE
));
MoveToEx
(
hDC
,
lprect
->
left
,
lprect
->
bottom
,
NULL
);
...
...
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