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
e7322e51
Commit
e7322e51
authored
Jan 06, 2006
by
Michael Kaufmann
Committed by
Alexandre Julliard
Jan 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Static control: Support enhanced metafiles.
parent
67dd0002
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
6 deletions
+46
-6
static.c
dlls/user/static.c
+46
-6
No files found.
dlls/user/static.c
View file @
e7322e51
...
...
@@ -31,7 +31,6 @@
* Styles
* - SS_EDITCONTROL
* - SS_ENDELLIPSIS
* - SS_ENHMETAFILE
* - SS_PATHELLIPSIS
* - SS_REALSIZECONTROL
* - SS_REALSIZEIMAGE
...
...
@@ -43,7 +42,7 @@
* - STN_ENABLE
*
* Messages
* - STM_SETIMAGE: IMAGE_CURSOR
, IMAGE_ENHMETAFILE
* - STM_SETIMAGE: IMAGE_CURSOR
*/
#include <stdarg.h>
...
...
@@ -63,6 +62,7 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style );
static
void
STATIC_PaintRectfn
(
HWND
hwnd
,
HDC
hdc
,
DWORD
style
);
static
void
STATIC_PaintIconfn
(
HWND
hwnd
,
HDC
hdc
,
DWORD
style
);
static
void
STATIC_PaintBitmapfn
(
HWND
hwnd
,
HDC
hdc
,
DWORD
style
);
static
void
STATIC_PaintEnhMetafn
(
HWND
hwnd
,
HDC
hdc
,
DWORD
style
);
static
void
STATIC_PaintEtchedfn
(
HWND
hwnd
,
HDC
hdc
,
DWORD
style
);
static
LRESULT
WINAPI
StaticWndProcA
(
HWND
hWnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
static
LRESULT
WINAPI
StaticWndProcW
(
HWND
hWnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
...
...
@@ -93,7 +93,7 @@ static pfPaint staticPaintFunc[SS_TYPEMASK+1] =
STATIC_PaintTextfn
,
/* SS_LEFTNOWORDWRAP */
STATIC_PaintOwnerDrawfn
,
/* SS_OWNERDRAW */
STATIC_PaintBitmapfn
,
/* SS_BITMAP */
NULL
,
/* SS_ENHMETAFILE */
STATIC_PaintEnhMetafn
,
/* SS_ENHMETAFILE */
STATIC_PaintEtchedfn
,
/* SS_ETCHEDHORZ */
STATIC_PaintEtchedfn
,
/* SS_ETCHEDVERT */
STATIC_PaintEtchedfn
,
/* SS_ETCHEDFRAME */
...
...
@@ -127,7 +127,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
if
((
style
&
SS_TYPEMASK
)
!=
SS_ICON
)
return
0
;
if
(
hicon
&&
!
info
)
{
ERR
(
"h
uh? hicon!=0, but info=0???
\n
"
);
ERR
(
"h
icon != 0, but info == 0
\n
"
);
return
0
;
}
prevIcon
=
(
HICON
)
SetWindowLongPtrW
(
hwnd
,
HICON_GWL_OFFSET
,
(
LONG_PTR
)
hicon
);
...
...
@@ -151,7 +151,7 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
if
((
style
&
SS_TYPEMASK
)
!=
SS_BITMAP
)
return
0
;
if
(
hBitmap
&&
GetObjectType
(
hBitmap
)
!=
OBJ_BITMAP
)
{
ERR
(
"h
uh? hBitmap!=0, but not
bitmap
\n
"
);
ERR
(
"h
Bitmap != 0, but it's not a
bitmap
\n
"
);
return
0
;
}
hOldBitmap
=
(
HBITMAP
)
SetWindowLongPtrW
(
hwnd
,
HICON_GWL_OFFSET
,
(
LONG_PTR
)
hBitmap
);
...
...
@@ -166,6 +166,21 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
}
/***********************************************************************
* STATIC_SetEnhMetaFile
*
* Set the enhanced metafile for an SS_ENHMETAFILE control.
*/
static
HENHMETAFILE
STATIC_SetEnhMetaFile
(
HWND
hwnd
,
HENHMETAFILE
hEnhMetaFile
,
DWORD
style
)
{
if
((
style
&
SS_TYPEMASK
)
!=
SS_ENHMETAFILE
)
return
0
;
if
(
hEnhMetaFile
&&
GetObjectType
(
hEnhMetaFile
)
!=
OBJ_ENHMETAFILE
)
{
ERR
(
"hEnhMetaFile != 0, but it's not an enhanced metafile
\n
"
);
return
0
;
}
return
(
HENHMETAFILE
)
SetWindowLongPtrW
(
hwnd
,
HICON_GWL_OFFSET
,
(
LONG_PTR
)
hEnhMetaFile
);
}
/***********************************************************************
* STATIC_LoadIconA
*
* Load the icon for an SS_ICON control.
...
...
@@ -335,6 +350,9 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
STATIC_SetBitmap
(
hwnd
,
hBitmap
,
full_style
);
break
;
}
/* SS_ENHMETAFILE: Despite what MSDN says, Windows does not load
the enhanced metafile that was specified as the window text. */
case
SS_LEFT
:
case
SS_CENTER
:
case
SS_RIGHT
:
...
...
@@ -399,8 +417,12 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
return
0
;
case
STM_GETIMAGE
:
/* FIXME: Return NULL if wParam doesn't match the control's style.
wParam is IMAGE_BITMAP, IMAGE_CURSOR, IMAGE_ENHMETAFILE
or IMAGE_ICON */
case
STM_GETICON16
:
case
STM_GETICON
:
/* FIXME: Return NULL if this control doesn't show an icon */
return
GetWindowLongPtrW
(
hwnd
,
HICON_GWL_OFFSET
);
case
STM_SETIMAGE
:
...
...
@@ -412,7 +434,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
FIXME
(
"STM_SETIMAGE: Unhandled type IMAGE_CURSOR
\n
"
);
break
;
case
IMAGE_ENHMETAFILE
:
FIXME
(
"STM_SETIMAGE: Unhandled type IMAGE_ENHMETAFILE
\n
"
);
lResult
=
(
LRESULT
)
STATIC_SetEnhMetaFile
(
hwnd
,
(
HENHMETAFILE
)
lParam
,
full_style
);
break
;
case
IMAGE_ICON
:
lResult
=
(
LRESULT
)
STATIC_SetIcon
(
hwnd
,
(
HICON
)
lParam
,
full_style
);
...
...
@@ -641,6 +663,24 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
}
static
void
STATIC_PaintEnhMetafn
(
HWND
hwnd
,
HDC
hdc
,
DWORD
style
)
{
HENHMETAFILE
hEnhMetaFile
;
/* message is still sent, even if the returned brush is not used */
SendMessageW
(
GetParent
(
hwnd
),
WM_CTLCOLORSTATIC
,
(
WPARAM
)
hdc
,
(
LPARAM
)
hwnd
);
if
((
hEnhMetaFile
=
(
HENHMETAFILE
)
GetWindowLongPtrW
(
hwnd
,
HICON_GWL_OFFSET
)))
{
RECT
clientRect
;
if
(
GetObjectType
(
hEnhMetaFile
)
!=
OBJ_ENHMETAFILE
)
return
;
GetClientRect
(
hwnd
,
&
clientRect
);
PlayEnhMetaFile
(
hdc
,
hEnhMetaFile
,
&
clientRect
);
}
}
static
void
STATIC_PaintEtchedfn
(
HWND
hwnd
,
HDC
hdc
,
DWORD
style
)
{
RECT
rc
;
...
...
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