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
0ea424e7
Commit
0ea424e7
authored
Aug 03, 2010
by
David Hedberg
Committed by
Alexandre Julliard
Aug 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explorerframe: Create the treeview on initialization.
parent
4d6982e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
1 deletion
+116
-1
Makefile.in
dlls/explorerframe/Makefile.in
+1
-1
explorerframe_main.h
dlls/explorerframe/explorerframe_main.h
+3
-0
nstc.c
dlls/explorerframe/nstc.c
+112
-0
No files found.
dlls/explorerframe/Makefile.in
View file @
0ea424e7
...
@@ -4,7 +4,7 @@ TOPOBJDIR = ../..
...
@@ -4,7 +4,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
explorerframe.dll
MODULE
=
explorerframe.dll
IMPORTS
=
uuid user32
IMPORTS
=
uuid
shell32
user32
C_SRCS
=
\
C_SRCS
=
\
explorerframe_main.c
\
explorerframe_main.c
\
...
...
dlls/explorerframe/explorerframe_main.h
View file @
0ea424e7
...
@@ -23,6 +23,9 @@
...
@@ -23,6 +23,9 @@
#include "shlobj.h"
#include "shlobj.h"
/* Not declared in commctrl.h ("for internal use (msdn)") */
#define TVS_EX_NOSINGLECOLLAPSE 0x0001
extern
HINSTANCE
explorerframe_hinstance
;
extern
HINSTANCE
explorerframe_hinstance
;
extern
LONG
EFRAME_refCount
;
extern
LONG
EFRAME_refCount
;
...
...
dlls/explorerframe/nstc.c
View file @
0ea424e7
...
@@ -39,26 +39,133 @@ typedef struct {
...
@@ -39,26 +39,133 @@ typedef struct {
LONG
ref
;
LONG
ref
;
HWND
hwnd_main
;
HWND
hwnd_main
;
HWND
hwnd_tv
;
NSTCSTYLE
style
;
NSTCSTYLE
style
;
}
NSTC2Impl
;
}
NSTC2Impl
;
static
const
DWORD
unsupported_styles
=
NSTCS_SINGLECLICKEXPAND
|
NSTCS_NOREPLACEOPEN
|
NSTCS_NOORDERSTREAM
|
NSTCS_FAVORITESMODE
|
NSTCS_EMPTYTEXT
|
NSTCS_ALLOWJUNCTIONS
|
NSTCS_SHOWTABSBUTTON
|
NSTCS_SHOWDELETEBUTTON
|
NSTCS_SHOWREFRESHBUTTON
|
NSTCS_SPRINGEXPAND
|
NSTCS_RICHTOOLTIP
|
NSTCS_NOINDENTCHECKS
;
/*************************************************************************
* NamespaceTree helper functions
*/
static
DWORD
treeview_style_from_nstcs
(
NSTC2Impl
*
This
,
NSTCSTYLE
nstcs
,
NSTCSTYLE
nstcs_mask
,
DWORD
*
new_style
)
{
DWORD
old_style
,
tv_mask
=
0
;
TRACE
(
"%p, %x, %x, %p
\n
"
,
This
,
nstcs
,
nstcs_mask
,
new_style
);
if
(
This
->
hwnd_tv
)
old_style
=
GetWindowLongPtrW
(
This
->
hwnd_tv
,
GWL_STYLE
);
else
old_style
=
/* The default */
WS_CHILD
|
WS_VISIBLE
|
WS_CLIPSIBLINGS
|
WS_CLIPCHILDREN
|
WS_TABSTOP
|
TVS_NOHSCROLL
|
TVS_NONEVENHEIGHT
|
TVS_INFOTIP
|
TVS_EDITLABELS
|
TVS_TRACKSELECT
;
if
(
nstcs_mask
&
NSTCS_HASEXPANDOS
)
tv_mask
|=
TVS_HASBUTTONS
;
if
(
nstcs_mask
&
NSTCS_HASLINES
)
tv_mask
|=
TVS_HASLINES
;
if
(
nstcs_mask
&
NSTCS_FULLROWSELECT
)
tv_mask
|=
TVS_FULLROWSELECT
;
if
(
nstcs_mask
&
NSTCS_HORIZONTALSCROLL
)
tv_mask
|=
TVS_NOHSCROLL
;
if
(
nstcs_mask
&
NSTCS_ROOTHASEXPANDO
)
tv_mask
|=
TVS_LINESATROOT
;
if
(
nstcs_mask
&
NSTCS_SHOWSELECTIONALWAYS
)
tv_mask
|=
TVS_SHOWSELALWAYS
;
if
(
nstcs_mask
&
NSTCS_NOINFOTIP
)
tv_mask
|=
TVS_INFOTIP
;
if
(
nstcs_mask
&
NSTCS_EVENHEIGHT
)
tv_mask
|=
TVS_NONEVENHEIGHT
;
if
(
nstcs_mask
&
NSTCS_DISABLEDRAGDROP
)
tv_mask
|=
TVS_DISABLEDRAGDROP
;
if
(
nstcs_mask
&
NSTCS_NOEDITLABELS
)
tv_mask
|=
TVS_EDITLABELS
;
if
(
nstcs_mask
&
NSTCS_CHECKBOXES
)
tv_mask
|=
TVS_CHECKBOXES
;
*
new_style
=
0
;
if
(
nstcs
&
NSTCS_HASEXPANDOS
)
*
new_style
|=
TVS_HASBUTTONS
;
if
(
nstcs
&
NSTCS_HASLINES
)
*
new_style
|=
TVS_HASLINES
;
if
(
nstcs
&
NSTCS_FULLROWSELECT
)
*
new_style
|=
TVS_FULLROWSELECT
;
if
(
!
(
nstcs
&
NSTCS_HORIZONTALSCROLL
))
*
new_style
|=
TVS_NOHSCROLL
;
if
(
nstcs
&
NSTCS_ROOTHASEXPANDO
)
*
new_style
|=
TVS_LINESATROOT
;
if
(
nstcs
&
NSTCS_SHOWSELECTIONALWAYS
)
*
new_style
|=
TVS_SHOWSELALWAYS
;
if
(
!
(
nstcs
&
NSTCS_NOINFOTIP
))
*
new_style
|=
TVS_INFOTIP
;
if
(
!
(
nstcs
&
NSTCS_EVENHEIGHT
))
*
new_style
|=
TVS_NONEVENHEIGHT
;
if
(
nstcs
&
NSTCS_DISABLEDRAGDROP
)
*
new_style
|=
TVS_DISABLEDRAGDROP
;
if
(
!
(
nstcs
&
NSTCS_NOEDITLABELS
))
*
new_style
|=
TVS_EDITLABELS
;
if
(
nstcs
&
NSTCS_CHECKBOXES
)
*
new_style
|=
TVS_CHECKBOXES
;
*
new_style
=
(
old_style
&
~
tv_mask
)
|
(
*
new_style
&
tv_mask
);
TRACE
(
"old: %08x, new: %08x
\n
"
,
old_style
,
*
new_style
);
return
old_style
^*
new_style
;
}
/*************************************************************************
/*************************************************************************
* NamespaceTree window functions
* NamespaceTree window functions
*/
*/
static
LRESULT
create_namespacetree
(
HWND
hWnd
,
CREATESTRUCTW
*
crs
)
static
LRESULT
create_namespacetree
(
HWND
hWnd
,
CREATESTRUCTW
*
crs
)
{
{
NSTC2Impl
*
This
=
crs
->
lpCreateParams
;
NSTC2Impl
*
This
=
crs
->
lpCreateParams
;
HIMAGELIST
ShellSmallIconList
;
DWORD
treeview_style
,
treeview_ex_style
;
TRACE
(
"%p (%p)
\n
"
,
This
,
crs
);
TRACE
(
"%p (%p)
\n
"
,
This
,
crs
);
SetWindowLongPtrW
(
hWnd
,
GWLP_USERDATA
,
(
LPARAM
)
This
);
SetWindowLongPtrW
(
hWnd
,
GWLP_USERDATA
,
(
LPARAM
)
This
);
This
->
hwnd_main
=
hWnd
;
This
->
hwnd_main
=
hWnd
;
treeview_style_from_nstcs
(
This
,
This
->
style
,
0xFFFFFFFF
,
&
treeview_style
);
This
->
hwnd_tv
=
CreateWindowExW
(
0
,
WC_TREEVIEWW
,
NULL
,
treeview_style
,
0
,
0
,
crs
->
cx
,
crs
->
cy
,
hWnd
,
NULL
,
explorerframe_hinstance
,
NULL
);
if
(
!
This
->
hwnd_tv
)
{
ERR
(
"Failed to create treeview!
\n
"
);
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
treeview_ex_style
=
TVS_EX_DRAWIMAGEASYNC
|
TVS_EX_RICHTOOLTIP
|
TVS_EX_DOUBLEBUFFER
|
TVS_EX_NOSINGLECOLLAPSE
;
if
(
This
->
style
&
NSTCS_AUTOHSCROLL
)
treeview_ex_style
|=
TVS_EX_AUTOHSCROLL
;
if
(
This
->
style
&
NSTCS_FADEINOUTEXPANDOS
)
treeview_ex_style
|=
TVS_EX_FADEINOUTEXPANDOS
;
if
(
This
->
style
&
NSTCS_PARTIALCHECKBOXES
)
treeview_ex_style
|=
TVS_EX_PARTIALCHECKBOXES
;
if
(
This
->
style
&
NSTCS_EXCLUSIONCHECKBOXES
)
treeview_ex_style
|=
TVS_EX_EXCLUSIONCHECKBOXES
;
if
(
This
->
style
&
NSTCS_DIMMEDCHECKBOXES
)
treeview_ex_style
|=
TVS_EX_DIMMEDCHECKBOXES
;
SendMessageW
(
This
->
hwnd_tv
,
TVM_SETEXTENDEDSTYLE
,
treeview_ex_style
,
0xffff
);
if
(
Shell_GetImageLists
(
NULL
,
&
ShellSmallIconList
))
{
SendMessageW
(
This
->
hwnd_tv
,
TVM_SETIMAGELIST
,
(
WPARAM
)
TVSIL_NORMAL
,
(
LPARAM
)
ShellSmallIconList
);
}
else
{
ERR
(
"Failed to get the System Image List.
\n
"
);
}
INameSpaceTreeControl_AddRef
((
INameSpaceTreeControl
*
)
This
);
INameSpaceTreeControl_AddRef
((
INameSpaceTreeControl
*
)
This
);
return
TRUE
;
return
TRUE
;
}
}
static
LRESULT
resize_namespacetree
(
NSTC2Impl
*
This
)
{
RECT
rc
;
TRACE
(
"%p
\n
"
,
This
);
GetClientRect
(
This
->
hwnd_main
,
&
rc
);
MoveWindow
(
This
->
hwnd_tv
,
0
,
0
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
TRUE
);
return
TRUE
;
}
static
LRESULT
destroy_namespacetree
(
NSTC2Impl
*
This
)
static
LRESULT
destroy_namespacetree
(
NSTC2Impl
*
This
)
{
{
TRACE
(
"%p
\n
"
,
This
);
TRACE
(
"%p
\n
"
,
This
);
...
@@ -76,6 +183,7 @@ static LRESULT CALLBACK NSTC2_WndProc(HWND hWnd, UINT uMessage,
...
@@ -76,6 +183,7 @@ static LRESULT CALLBACK NSTC2_WndProc(HWND hWnd, UINT uMessage,
switch
(
uMessage
)
switch
(
uMessage
)
{
{
case
WM_NCCREATE
:
return
create_namespacetree
(
hWnd
,
(
CREATESTRUCTW
*
)
lParam
);
case
WM_NCCREATE
:
return
create_namespacetree
(
hWnd
,
(
CREATESTRUCTW
*
)
lParam
);
case
WM_SIZE
:
return
resize_namespacetree
(
This
);
case
WM_DESTROY
:
return
destroy_namespacetree
(
This
);
case
WM_DESTROY
:
return
destroy_namespacetree
(
This
);
default:
return
DefWindowProcW
(
hWnd
,
uMessage
,
wParam
,
lParam
);
default:
return
DefWindowProcW
(
hWnd
,
uMessage
,
wParam
,
lParam
);
}
}
...
@@ -152,6 +260,10 @@ static HRESULT WINAPI NSTC2_fnInitialize(INameSpaceTreeControl2* iface,
...
@@ -152,6 +260,10 @@ static HRESULT WINAPI NSTC2_fnInitialize(INameSpaceTreeControl2* iface,
TRACE
(
"%p (%p, %p, %x)
\n
"
,
This
,
hwndParent
,
prc
,
nstcsFlags
);
TRACE
(
"%p (%p, %p, %x)
\n
"
,
This
,
hwndParent
,
prc
,
nstcsFlags
);
if
(
nstcsFlags
&
unsupported_styles
)
FIXME
(
"0x%08x contains the unsupported style(s) 0x%08x
\n
"
,
nstcsFlags
,
nstcsFlags
&
unsupported_styles
);
This
->
style
=
nstcsFlags
;
This
->
style
=
nstcsFlags
;
if
(
!
GetClassInfoW
(
explorerframe_hinstance
,
NSTC2_CLASS_NAME
,
&
wc
))
if
(
!
GetClassInfoW
(
explorerframe_hinstance
,
NSTC2_CLASS_NAME
,
&
wc
))
...
...
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