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
6ae7fe65
Commit
6ae7fe65
authored
Jan 27, 2010
by
Erich Hoover
Committed by
Alexandre Julliard
Jan 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Handle Index tab sub-topics.
parent
50f67cba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
199 additions
and
1 deletion
+199
-1
help.c
dlls/hhctrl.ocx/help.c
+192
-1
hhctrl.h
dlls/hhctrl.ocx/hhctrl.h
+7
-0
No files found.
dlls/hhctrl.ocx/help.c
View file @
6ae7fe65
...
@@ -429,7 +429,25 @@ static LRESULT OnTopicChange(HWND hwnd, void *user_data)
...
@@ -429,7 +429,25 @@ static LRESULT OnTopicChange(HWND hwnd, void *user_data)
return
0
;
return
0
;
}
}
if
(
iiter
->
nItems
>
1
)
{
if
(
iiter
->
nItems
>
1
)
{
FIXME
(
"Support for sub-topics not implemented.
\n
"
);
int
i
=
0
;
LVITEMW
lvi
;
SendMessageW
(
info
->
popup
.
hwndList
,
LVM_DELETEALLITEMS
,
0
,
0
);
for
(
i
=
0
;
i
<
iiter
->
nItems
;
i
++
)
{
IndexSubItem
*
item
=
&
iiter
->
items
[
i
];
WCHAR
*
name
=
iiter
->
keyword
;
if
(
item
->
name
)
name
=
item
->
name
;
memset
(
&
lvi
,
0
,
sizeof
(
lvi
));
lvi
.
iItem
=
i
;
lvi
.
mask
=
LVIF_TEXT
|
LVIF_PARAM
;
lvi
.
cchTextMax
=
strlenW
(
name
)
+
1
;
lvi
.
pszText
=
name
;
lvi
.
lParam
=
(
LPARAM
)
item
;
SendMessageW
(
info
->
popup
.
hwndList
,
LVM_INSERTITEMW
,
0
,
(
LPARAM
)
&
lvi
);
}
ShowWindow
(
info
->
popup
.
hwndPopup
,
SW_SHOW
);
return
0
;
return
0
;
}
}
name
=
iiter
->
items
[
0
].
name
;
name
=
iiter
->
items
[
0
].
name
;
...
@@ -825,6 +843,176 @@ static BOOL AddIndexTab(HHInfo *info)
...
@@ -825,6 +843,176 @@ static BOOL AddIndexTab(HHInfo *info)
return
TRUE
;
return
TRUE
;
}
}
/* The Index tab's sub-topic popup */
static
void
ResizePopupChild
(
HHInfo
*
info
)
{
int
scroll_width
=
GetSystemMetrics
(
SM_CXVSCROLL
);
int
border_width
=
GetSystemMetrics
(
SM_CXBORDER
);
int
edge_width
=
GetSystemMetrics
(
SM_CXEDGE
);
INT
width
,
height
;
RECT
rect
;
if
(
!
info
)
return
;
GetClientRect
(
info
->
popup
.
hwndPopup
,
&
rect
);
SetWindowPos
(
info
->
popup
.
hwndCallback
,
HWND_TOP
,
0
,
0
,
rect
.
right
,
rect
.
bottom
,
SWP_NOMOVE
);
rect
.
left
=
TAB_MARGIN
;
rect
.
top
=
TAB_TOP_PADDING
+
TAB_MARGIN
;
rect
.
right
-=
TAB_RIGHT_PADDING
+
TAB_MARGIN
;
rect
.
bottom
-=
TAB_MARGIN
;
width
=
rect
.
right
-
rect
.
left
;
height
=
rect
.
bottom
-
rect
.
top
;
SetWindowPos
(
info
->
popup
.
hwndList
,
NULL
,
rect
.
left
,
rect
.
top
,
width
,
height
,
SWP_NOZORDER
|
SWP_NOACTIVATE
);
SendMessageW
(
info
->
popup
.
hwndList
,
LVM_SETCOLUMNWIDTH
,
0
,
width
-
scroll_width
-
2
*
border_width
-
2
*
edge_width
);
}
static
LRESULT
CALLBACK
HelpPopup_WndProc
(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HHInfo
*
info
=
(
HHInfo
*
)
GetWindowLongPtrW
(
hWnd
,
GWLP_USERDATA
);
switch
(
message
)
{
case
WM_SIZE
:
ResizePopupChild
(
info
);
return
0
;
case
WM_DESTROY
:
DestroyWindow
(
hWnd
);
return
0
;
case
WM_CLOSE
:
ShowWindow
(
hWnd
,
SW_HIDE
);
return
0
;
default:
return
DefWindowProcW
(
hWnd
,
message
,
wParam
,
lParam
);
}
return
0
;
}
static
LRESULT
CALLBACK
PopupChild_WndProc
(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
message
)
{
case
WM_NOTIFY
:
{
NMHDR
*
nmhdr
=
(
NMHDR
*
)
lParam
;
if
(
nmhdr
->
code
==
NM_DBLCLK
)
{
HHInfo
*
info
=
(
HHInfo
*
)
GetWindowLongPtrW
(
hWnd
,
GWLP_USERDATA
);
IndexSubItem
*
iter
;
if
(
info
==
0
||
lParam
==
0
)
return
0
;
iter
=
(
IndexSubItem
*
)
((
NMITEMACTIVATE
*
)
lParam
)
->
lParam
;
if
(
iter
==
0
)
return
0
;
NavigateToChm
(
info
,
info
->
index
->
merge
.
chm_file
,
iter
->
local
);
ShowWindow
(
info
->
popup
.
hwndPopup
,
SW_HIDE
);
return
0
;
}
break
;
}
default:
return
DefWindowProcW
(
hWnd
,
message
,
wParam
,
lParam
);
}
return
0
;
}
static
BOOL
AddIndexPopup
(
HHInfo
*
info
)
{
static
const
WCHAR
szPopupChildClass
[]
=
{
'H'
,
'H'
,
' '
,
'P'
,
'o'
,
'p'
,
'u'
,
'p'
,
' '
,
'C'
,
'h'
,
'i'
,
'l'
,
'd'
,
0
};
static
const
WCHAR
windowCaptionW
[]
=
{
'S'
,
'e'
,
'l'
,
'e'
,
'c'
,
't'
,
' '
,
'T'
,
'o'
,
'p'
,
'i'
,
'c'
,
':'
,
0
};
static
const
WCHAR
windowClassW
[]
=
{
'H'
,
'H'
,
' '
,
'P'
,
'o'
,
'p'
,
'u'
,
'p'
,
0
};
HWND
hwndList
,
hwndPopup
,
hwndCallback
;
char
hidden_column
[]
=
"Column"
;
WNDCLASSEXW
wcex
;
LVCOLUMNA
lvc
;
if
(
info
->
tabs
[
TAB_INDEX
].
id
==
-
1
)
return
TRUE
;
/* No "Index" tab */
wcex
.
cbSize
=
sizeof
(
WNDCLASSEXW
);
wcex
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
wcex
.
lpfnWndProc
=
HelpPopup_WndProc
;
wcex
.
cbClsExtra
=
0
;
wcex
.
cbWndExtra
=
0
;
wcex
.
hInstance
=
hhctrl_hinstance
;
wcex
.
hIcon
=
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_APPLICATION
);
wcex
.
hCursor
=
LoadCursorW
(
NULL
,
(
LPCWSTR
)
IDC_ARROW
);
wcex
.
hbrBackground
=
(
HBRUSH
)(
COLOR_MENU
+
1
);
wcex
.
lpszMenuName
=
NULL
;
wcex
.
lpszClassName
=
windowClassW
;
wcex
.
hIconSm
=
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_APPLICATION
);
RegisterClassExW
(
&
wcex
);
wcex
.
cbSize
=
sizeof
(
WNDCLASSEXW
);
wcex
.
style
=
0
;
wcex
.
lpfnWndProc
=
PopupChild_WndProc
;
wcex
.
cbClsExtra
=
0
;
wcex
.
cbWndExtra
=
0
;
wcex
.
hInstance
=
hhctrl_hinstance
;
wcex
.
hIcon
=
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_APPLICATION
);
wcex
.
hCursor
=
LoadCursorW
(
NULL
,
(
LPCWSTR
)
IDC_ARROW
);
wcex
.
hbrBackground
=
(
HBRUSH
)(
COLOR_BTNFACE
+
1
);
wcex
.
lpszMenuName
=
NULL
;
wcex
.
lpszClassName
=
szPopupChildClass
;
wcex
.
hIconSm
=
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_APPLICATION
);
RegisterClassExW
(
&
wcex
);
hwndPopup
=
CreateWindowExW
(
WS_EX_LEFT
|
WS_EX_LTRREADING
|
WS_EX_APPWINDOW
|
WS_EX_WINDOWEDGE
|
WS_EX_RIGHTSCROLLBAR
,
windowClassW
,
windowCaptionW
,
WS_POPUPWINDOW
|
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
|
WS_CLIPSIBLINGS
|
WS_CLIPCHILDREN
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
300
,
200
,
info
->
WinType
.
hwndHelp
,
NULL
,
hhctrl_hinstance
,
NULL
);
if
(
!
hwndPopup
)
return
FALSE
;
hwndCallback
=
CreateWindowExW
(
WS_EX_LEFT
|
WS_EX_LTRREADING
|
WS_EX_RIGHTSCROLLBAR
,
szPopupChildClass
,
szEmpty
,
WS_CHILDWINDOW
|
WS_VISIBLE
,
0
,
0
,
0
,
0
,
hwndPopup
,
NULL
,
hhctrl_hinstance
,
NULL
);
if
(
!
hwndCallback
)
return
FALSE
;
ShowWindow
(
hwndPopup
,
SW_HIDE
);
hwndList
=
CreateWindowExW
(
WS_EX_CLIENTEDGE
,
WC_LISTVIEWW
,
szEmpty
,
WS_CHILD
|
WS_BORDER
|
LVS_SINGLESEL
|
LVS_REPORT
|
LVS_NOCOLUMNHEADER
,
50
,
50
,
100
,
100
,
hwndCallback
,
NULL
,
hhctrl_hinstance
,
NULL
);
if
(
!
hwndList
)
{
ERR
(
"Could not create popup ListView control
\n
"
);
return
FALSE
;
}
memset
(
&
lvc
,
0
,
sizeof
(
lvc
));
lvc
.
mask
=
LVCF_TEXT
;
lvc
.
pszText
=
hidden_column
;
if
(
SendMessageW
(
hwndList
,
LVM_INSERTCOLUMNA
,
0
,
(
LPARAM
)
&
lvc
)
==
-
1
)
{
ERR
(
"Could not create popup ListView column
\n
"
);
return
FALSE
;
}
info
->
popup
.
hwndCallback
=
hwndCallback
;
info
->
popup
.
hwndPopup
=
hwndPopup
;
info
->
popup
.
hwndList
=
hwndList
;
SetWindowLongPtrW
(
hwndPopup
,
GWLP_USERDATA
,
(
LONG_PTR
)
info
);
SetWindowLongPtrW
(
hwndCallback
,
GWLP_USERDATA
,
(
LONG_PTR
)
info
);
ResizePopupChild
(
info
);
ShowWindow
(
hwndList
,
SW_SHOW
);
return
TRUE
;
}
/* Viewer Window */
/* Viewer Window */
static
LRESULT
Help_OnSize
(
HWND
hWnd
)
static
LRESULT
Help_OnSize
(
HWND
hWnd
)
...
@@ -1003,6 +1191,9 @@ static BOOL CreateViewer(HHInfo *pHHInfo)
...
@@ -1003,6 +1191,9 @@ static BOOL CreateViewer(HHInfo *pHHInfo)
if
(
!
AddIndexTab
(
pHHInfo
))
if
(
!
AddIndexTab
(
pHHInfo
))
return
FALSE
;
return
FALSE
;
if
(
!
AddIndexPopup
(
pHHInfo
))
return
FALSE
;
InitContent
(
pHHInfo
);
InitContent
(
pHHInfo
);
InitIndex
(
pHHInfo
);
InitIndex
(
pHHInfo
);
...
...
dlls/hhctrl.ocx/hhctrl.h
View file @
6ae7fe65
...
@@ -108,6 +108,12 @@ typedef struct {
...
@@ -108,6 +108,12 @@ typedef struct {
}
HHTab
;
}
HHTab
;
typedef
struct
{
typedef
struct
{
HWND
hwndList
;
HWND
hwndPopup
;
HWND
hwndCallback
;
}
IndexPopup
;
typedef
struct
{
IOleClientSite
*
client_site
;
IOleClientSite
*
client_site
;
IWebBrowser2
*
web_browser
;
IWebBrowser2
*
web_browser
;
IOleObject
*
wb_object
;
IOleObject
*
wb_object
;
...
@@ -129,6 +135,7 @@ typedef struct {
...
@@ -129,6 +135,7 @@ typedef struct {
CHMInfo
*
pCHMInfo
;
CHMInfo
*
pCHMInfo
;
ContentItem
*
content
;
ContentItem
*
content
;
IndexItem
*
index
;
IndexItem
*
index
;
IndexPopup
popup
;
HWND
hwndTabCtrl
;
HWND
hwndTabCtrl
;
HWND
hwndSizeBar
;
HWND
hwndSizeBar
;
HFONT
hFont
;
HFONT
hFont
;
...
...
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