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
f02d6df5
Commit
f02d6df5
authored
Aug 19, 2005
by
Frank Richter
Committed by
Alexandre Julliard
Aug 19, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add theming support for dialogs (to support tab page background).
parent
1be54d8b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
1 deletion
+117
-1
Makefile.in
dlls/comctl32/Makefile.in
+1
-0
theme_dialog.c
dlls/comctl32/theme_dialog.c
+109
-0
theming.c
dlls/comctl32/theming.c
+7
-1
No files found.
dlls/comctl32/Makefile.in
View file @
f02d6df5
...
@@ -36,6 +36,7 @@ C_SRCS = \
...
@@ -36,6 +36,7 @@ C_SRCS = \
syslink.c
\
syslink.c
\
tab.c
\
tab.c
\
theme_combo.c
\
theme_combo.c
\
theme_dialog.c
\
theme_edit.c
\
theme_edit.c
\
theme_listbox.c
\
theme_listbox.c
\
theming.c
\
theming.c
\
...
...
dlls/comctl32/theme_dialog.c
0 → 100644
View file @
f02d6df5
/*
* Theming - Dialogs
*
* 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
(
themingdialog
);
/**********************************************************************
* The dialog subclass window proc.
*/
LRESULT
CALLBACK
THEMING_DialogSubclassProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
ULONG_PTR
dwRefData
)
{
HTHEME
theme
=
GetWindowTheme
(
hWnd
);
static
const
WCHAR
themeClass
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
0
};
BOOL
themingActive
=
IsThemeDialogTextureEnabled
(
hWnd
);
BOOL
doTheming
=
themingActive
&&
(
theme
!=
NULL
);
LRESULT
result
;
switch
(
msg
)
{
case
WM_CREATE
:
result
=
THEMING_CallOriginalClass
(
hWnd
,
msg
,
wParam
,
lParam
);
theme
=
OpenThemeData
(
hWnd
,
themeClass
);
return
result
;
case
WM_DESTROY
:
CloseThemeData
(
theme
);
return
THEMING_CallOriginalClass
(
hWnd
,
msg
,
wParam
,
lParam
);
case
WM_THEMECHANGED
:
CloseThemeData
(
theme
);
OpenThemeData
(
hWnd
,
themeClass
);
InvalidateRect
(
hWnd
,
NULL
,
TRUE
);
return
0
;
case
WM_SYSCOLORCHANGE
:
if
(
!
doTheming
)
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_ERASEBKGND
:
if
(
!
doTheming
)
return
THEMING_CallOriginalClass
(
hWnd
,
msg
,
wParam
,
lParam
);
{
RECT
rc
;
DLGPROC
dlgp
=
(
DLGPROC
)
GetWindowLongPtrW
(
hWnd
,
DWLP_DLGPROC
);
if
(
!
dlgp
(
hWnd
,
msg
,
wParam
,
lParam
))
{
/* Draw background*/
GetClientRect
(
hWnd
,
&
rc
);
if
(
IsThemePartDefined
(
theme
,
WP_DIALOG
,
0
))
/* Although there is a theme for the WINDOW class/DIALOG part,
* but I[res] haven't seen Windows using it yet... Even when
* dialog theming is activated, the good ol' BTNFACE
* background seems to be used. */
#if 0
DrawThemeBackground (theme, (HDC)wParam, WP_DIALOG, 0, &rc,
NULL);
#endif
return
THEMING_CallOriginalClass
(
hWnd
,
msg
,
wParam
,
lParam
);
else
/* We might have gotten a TAB theme class, so check if we can
* draw as a tab page. */
if
(
IsThemePartDefined
(
theme
,
TABP_BODY
,
0
))
DrawThemeBackground
(
theme
,
(
HDC
)
wParam
,
TABP_BODY
,
0
,
&
rc
,
NULL
);
else
return
THEMING_CallOriginalClass
(
hWnd
,
msg
,
wParam
,
lParam
);
}
return
1
;
}
default:
/* Call old proc */
return
THEMING_CallOriginalClass
(
hWnd
,
msg
,
wParam
,
lParam
);
}
return
0
;
}
dlls/comctl32/theming.c
View file @
f02d6df5
...
@@ -35,11 +35,14 @@ typedef LRESULT (CALLBACK* THEMING_SUBCLASSPROC)(HWND, UINT, WPARAM, LPARAM,
...
@@ -35,11 +35,14 @@ typedef LRESULT (CALLBACK* THEMING_SUBCLASSPROC)(HWND, UINT, WPARAM, LPARAM,
extern
LRESULT
CALLBACK
THEMING_ComboSubclassProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
extern
LRESULT
CALLBACK
THEMING_ComboSubclassProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
ULONG_PTR
);
ULONG_PTR
);
extern
LRESULT
CALLBACK
THEMING_DialogSubclassProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
ULONG_PTR
);
extern
LRESULT
CALLBACK
THEMING_EditSubclassProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
extern
LRESULT
CALLBACK
THEMING_EditSubclassProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
ULONG_PTR
);
ULONG_PTR
);
extern
LRESULT
CALLBACK
THEMING_ListBoxSubclassProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
extern
LRESULT
CALLBACK
THEMING_ListBoxSubclassProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
ULONG_PTR
);
ULONG_PTR
);
static
const
WCHAR
dialogClass
[]
=
{
'#'
,
'3'
,
'2'
,
'7'
,
'7'
,
'0'
,
0
};
static
const
WCHAR
comboLboxClass
[]
=
{
'C'
,
'o'
,
'm'
,
'b'
,
'o'
,
'L'
,
'b'
,
'o'
,
'x'
,
0
};
static
const
WCHAR
comboLboxClass
[]
=
{
'C'
,
'o'
,
'm'
,
'b'
,
'o'
,
'L'
,
'b'
,
'o'
,
'x'
,
0
};
static
const
struct
ThemingSubclass
static
const
struct
ThemingSubclass
...
@@ -48,6 +51,7 @@ static const struct ThemingSubclass
...
@@ -48,6 +51,7 @@ static const struct ThemingSubclass
THEMING_SUBCLASSPROC
subclassProc
;
THEMING_SUBCLASSPROC
subclassProc
;
}
subclasses
[]
=
{
}
subclasses
[]
=
{
/* Note: list must be sorted by class name */
/* Note: list must be sorted by class name */
{
dialogClass
,
THEMING_DialogSubclassProc
},
{
WC_COMBOBOXW
,
THEMING_ComboSubclassProc
},
{
WC_COMBOBOXW
,
THEMING_ComboSubclassProc
},
{
comboLboxClass
,
THEMING_ListBoxSubclassProc
},
{
comboLboxClass
,
THEMING_ListBoxSubclassProc
},
{
WC_EDITW
,
THEMING_EditSubclassProc
},
{
WC_EDITW
,
THEMING_EditSubclassProc
},
...
@@ -100,12 +104,14 @@ MAKE_SUBCLASS_STUB(0)
...
@@ -100,12 +104,14 @@ MAKE_SUBCLASS_STUB(0)
MAKE_SUBCLASS_STUB
(
1
)
MAKE_SUBCLASS_STUB
(
1
)
MAKE_SUBCLASS_STUB
(
2
)
MAKE_SUBCLASS_STUB
(
2
)
MAKE_SUBCLASS_STUB
(
3
)
MAKE_SUBCLASS_STUB
(
3
)
MAKE_SUBCLASS_STUB
(
4
)
const
static
WNDPROC
subclassStubs
[
NUM_SUBCLASSES
]
=
{
const
static
WNDPROC
subclassStubs
[
NUM_SUBCLASSES
]
=
{
subclass_stub0
,
subclass_stub0
,
subclass_stub1
,
subclass_stub1
,
subclass_stub2
,
subclass_stub2
,
subclass_stub3
subclass_stub3
,
subclass_stub4
};
};
/***********************************************************************
/***********************************************************************
...
...
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