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
07834655
Commit
07834655
authored
Aug 15, 2005
by
Frank Richter
Committed by
Alexandre Julliard
Aug 15, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Subclass edit control to draw themed border.
parent
37bc5d81
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
138 additions
and
0 deletions
+138
-0
Makefile.in
dlls/comctl32/Makefile.in
+1
-0
theme_edit.c
dlls/comctl32/theme_edit.c
+130
-0
theming.c
dlls/comctl32/theming.c
+7
-0
No files found.
dlls/comctl32/Makefile.in
View file @
07834655
...
...
@@ -36,6 +36,7 @@ C_SRCS = \
syslink.c
\
tab.c
\
theming.c
\
theme_edit.c
\
toolbar.c
\
tooltips.c
\
trackbar.c
\
...
...
dlls/comctl32/theme_edit.c
0 → 100644
View file @
07834655
/*
* Theming - Edit control
*
* Copyright (c) 2005 by Frank Richter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "uxtheme.h"
#include "tmschema.h"
#include "comctl32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
themingedit
);
/* Draw themed border */
static
void
nc_paint
(
HWND
hwnd
,
HRGN
region
)
{
HTHEME
theme
=
GetWindowTheme
(
hwnd
);
HDC
dc
;
RECT
r
;
HRGN
cliprgn
;
int
cxEdge
=
GetSystemMetrics
(
SM_CXEDGE
),
cyEdge
=
GetSystemMetrics
(
SM_CYEDGE
);
int
part
=
EP_EDITTEXT
;
int
state
=
ETS_NORMAL
;
DWORD
dwStyle
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
if
(
!
IsWindowEnabled
(
hwnd
))
state
=
ETS_DISABLED
;
else
if
(
dwStyle
&
ES_READONLY
)
state
=
ETS_READONLY
;
else
if
(
GetFocus
()
==
hwnd
)
state
=
ETS_FOCUSED
;
GetWindowRect
(
hwnd
,
&
r
);
cliprgn
=
CreateRectRgn
(
r
.
left
+
cxEdge
,
r
.
top
+
cyEdge
,
r
.
right
-
cxEdge
,
r
.
bottom
-
cyEdge
);
if
(
region
!=
(
HRGN
)
1
)
CombineRgn
(
cliprgn
,
cliprgn
,
region
,
RGN_AND
);
OffsetRect
(
&
r
,
-
r
.
left
,
-
r
.
top
);
dc
=
GetDCEx
(
hwnd
,
region
,
DCX_WINDOW
|
DCX_INTERSECTRGN
);
OffsetRect
(
&
r
,
-
r
.
left
,
-
r
.
top
);
if
(
IsThemeBackgroundPartiallyTransparent
(
theme
,
part
,
state
))
DrawThemeParentBackground
(
hwnd
,
dc
,
&
r
);
DrawThemeBackground
(
theme
,
dc
,
part
,
state
,
&
r
,
0
);
ReleaseDC
(
hwnd
,
dc
);
/* Call default proc to get the scrollbars etc. painted */
DefWindowProcW
(
hwnd
,
WM_NCPAINT
,
(
WPARAM
)
cliprgn
,
0
);
}
/**********************************************************************
* The edit control subclass window proc.
*/
LRESULT
CALLBACK
THEMING_EditSubclassProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
ULONG_PTR
dwRefData
)
{
const
WCHAR
*
themeClass
=
WC_EDITW
;
HTHEME
theme
;
LRESULT
result
;
switch
(
msg
)
{
case
WM_CREATE
:
result
=
THEMING_CallOriginalClass
(
hwnd
,
msg
,
wParam
,
lParam
);
OpenThemeData
(
hwnd
,
themeClass
);
return
result
;
case
WM_DESTROY
:
theme
=
GetWindowTheme
(
hwnd
);
CloseThemeData
(
theme
);
break
;
case
WM_THEMECHANGED
:
theme
=
GetWindowTheme
(
hwnd
);
CloseThemeData
(
theme
);
OpenThemeData
(
hwnd
,
themeClass
);
break
;
case
WM_SYSCOLORCHANGE
:
theme
=
GetWindowTheme
(
hwnd
);
if
(
!
theme
)
return
THEMING_CallOriginalClass
(
hwnd
,
msg
,
wParam
,
lParam
);
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
* which will do the repaint. */
break
;
case
WM_NCPAINT
:
theme
=
GetWindowTheme
(
hwnd
);
if
(
!
theme
)
return
THEMING_CallOriginalClass
(
hwnd
,
msg
,
wParam
,
lParam
);
nc_paint
(
hwnd
,
(
HRGN
)
wParam
);
break
;
case
WM_ENABLE
:
theme
=
GetWindowTheme
(
hwnd
);
if
(
theme
)
RedrawWindow
(
hwnd
,
NULL
,
NULL
,
RDW_FRAME
|
RDW_INVALIDATE
|
RDW_UPDATENOW
);
return
THEMING_CallOriginalClass
(
hwnd
,
msg
,
wParam
,
lParam
);
default:
/* Call old proc */
return
THEMING_CallOriginalClass
(
hwnd
,
msg
,
wParam
,
lParam
);
}
return
0
;
}
dlls/comctl32/theming.c
View file @
07834655
...
...
@@ -33,12 +33,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(theming);
typedef
LRESULT
(
CALLBACK
*
THEMING_SUBCLASSPROC
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
ULONG_PTR
);
extern
LRESULT
CALLBACK
THEMING_EditSubclassProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
ULONG_PTR
);
static
const
struct
ThemingSubclass
{
const
WCHAR
*
className
;
THEMING_SUBCLASSPROC
subclassProc
;
}
subclasses
[]
=
{
/* Note: list must be sorted by class name */
{
WC_EDITW
,
THEMING_EditSubclassProc
}
};
#define NUM_SUBCLASSES (sizeof(subclasses)/sizeof(subclasses[0]))
...
...
@@ -83,7 +87,10 @@ static LRESULT CALLBACK subclass_stub ## N (HWND wnd, UINT msg, \
return THEMING_SubclassProc (wnd, msg, wParam, lParam); \
}
MAKE_SUBCLASS_STUB
(
0
)
const
static
WNDPROC
subclassStubs
[
NUM_SUBCLASSES
]
=
{
subclass_stub0
};
/***********************************************************************
...
...
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