Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
eece303c
Commit
eece303c
authored
19 years ago
by
James Hawkins
Committed by
Alexandre Julliard
19 years ago
Browse files
Options
Downloads
Patches
Plain Diff
- Add the HH Child window class.
- Create the Navigation and HTML panes as HH Child windows.
parent
cbec7136
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/hhctrl.ocx/help.c
+118
-4
118 additions, 4 deletions
dlls/hhctrl.ocx/help.c
with
118 additions
and
4 deletions
dlls/hhctrl.ocx/help.c
+
118
−
4
View file @
eece303c
...
...
@@ -32,10 +32,11 @@
/* Window type defaults */
#define WINTYPE_DEFAULT_X 280
#define WINTYPE_DEFAULT_Y 100
#define WINTYPE_DEFAULT_WIDTH 740
#define WINTYPE_DEFAULT_HEIGHT 640
#define WINTYPE_DEFAULT_X 280
#define WINTYPE_DEFAULT_Y 100
#define WINTYPE_DEFAULT_WIDTH 740
#define WINTYPE_DEFAULT_HEIGHT 640
#define WINTYPE_DEFAULT_NAVWIDTH 250
typedef
struct
tagHHInfo
{
...
...
@@ -75,6 +76,45 @@ static LPWSTR HH_LoadString(DWORD dwID)
return
string
;
}
/* Child Window */
static
const
WCHAR
szChildClass
[]
=
{
'H'
,
'H'
,
' '
,
'C'
,
'h'
,
'i'
,
'l'
,
'd'
,
0
};
static
const
WCHAR
szEmpty
[]
=
{
0
};
LRESULT
CALLBACK
Child_WndProc
(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
message
)
{
default:
return
DefWindowProcW
(
hWnd
,
message
,
wParam
,
lParam
);
}
return
0
;
}
static
void
HH_RegisterChildWndClass
(
HHInfo
*
pHHInfo
)
{
WNDCLASSEXW
wcex
;
wcex
.
cbSize
=
sizeof
(
WNDCLASSEXW
);
wcex
.
style
=
0
;
wcex
.
lpfnWndProc
=
(
WNDPROC
)
Child_WndProc
;
wcex
.
cbClsExtra
=
0
;
wcex
.
cbWndExtra
=
0
;
wcex
.
hInstance
=
pHHInfo
->
hInstance
;
wcex
.
hIcon
=
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_APPLICATION
);
wcex
.
hCursor
=
LoadCursorW
(
NULL
,
(
LPCWSTR
)
IDC_ARROW
);
wcex
.
hbrBackground
=
(
HBRUSH
)(
COLOR_3DFACE
);
wcex
.
lpszMenuName
=
NULL
;
wcex
.
lpszClassName
=
szChildClass
;
wcex
.
hIconSm
=
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_APPLICATION
);
RegisterClassExW
(
&
wcex
);
}
/* Toolbar */
#define ICON_SIZE 20
...
...
@@ -192,15 +232,87 @@ static BOOL HH_AddToolbar(HHInfo *pHHInfo)
/* Navigation Pane */
static
void
NP_GetNavigationRect
(
HHInfo
*
pHHInfo
,
RECT
*
rc
)
{
HWND
hwndParent
=
pHHInfo
->
pHHWinType
->
hwndHelp
;
HWND
hwndToolbar
=
pHHInfo
->
pHHWinType
->
hwndToolBar
;
RECT
rectWND
,
rectTB
;
GetClientRect
(
hwndParent
,
&
rectWND
);
GetClientRect
(
hwndToolbar
,
&
rectTB
);
rc
->
left
=
0
;
rc
->
top
=
rectTB
.
bottom
;
rc
->
bottom
=
rectWND
.
bottom
-
rectTB
.
bottom
;
if
(
pHHInfo
->
pHHWinType
->
fsValidMembers
&
HHWIN_PARAM_NAV_WIDTH
)
rc
->
right
=
pHHInfo
->
pHHWinType
->
iNavWidth
;
else
rc
->
right
=
WINTYPE_DEFAULT_NAVWIDTH
;
}
static
BOOL
HH_AddNavigationPane
(
HHInfo
*
pHHInfo
)
{
HWND
hWnd
;
HWND
hwndParent
=
pHHInfo
->
pHHWinType
->
hwndHelp
;
DWORD
dwStyles
=
WS_CHILDWINDOW
|
WS_VISIBLE
;
DWORD
dwExStyles
=
WS_EX_LEFT
|
WS_EX_LTRREADING
|
WS_EX_RIGHTSCROLLBAR
;
RECT
rc
;
NP_GetNavigationRect
(
pHHInfo
,
&
rc
);
hWnd
=
CreateWindowExW
(
dwExStyles
,
szChildClass
,
szEmpty
,
dwStyles
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
,
hwndParent
,
NULL
,
pHHInfo
->
hInstance
,
NULL
);
if
(
!
hWnd
)
return
FALSE
;
pHHInfo
->
pHHWinType
->
hwndNavigation
=
hWnd
;
return
TRUE
;
}
/* HTML Pane */
static
void
HP_GetHTMLRect
(
HHInfo
*
pHHInfo
,
RECT
*
rc
)
{
HWND
hwndParent
=
pHHInfo
->
pHHWinType
->
hwndHelp
;
HWND
hwndToolbar
=
pHHInfo
->
pHHWinType
->
hwndToolBar
;
HWND
hwndNavigation
=
pHHInfo
->
pHHWinType
->
hwndNavigation
;
RECT
rectTB
,
rectWND
,
rectNP
;
GetClientRect
(
hwndParent
,
&
rectWND
);
GetClientRect
(
hwndToolbar
,
&
rectTB
);
GetClientRect
(
hwndNavigation
,
&
rectNP
);
rc
->
left
=
rectNP
.
right
;
rc
->
top
=
rectTB
.
bottom
;
rc
->
right
=
rectWND
.
right
-
rectNP
.
right
;
rc
->
bottom
=
rectWND
.
bottom
-
rectTB
.
bottom
;
}
static
BOOL
HH_AddHTMLPane
(
HHInfo
*
pHHInfo
)
{
HWND
hWnd
;
HWND
hwndParent
=
pHHInfo
->
pHHWinType
->
hwndHelp
;
DWORD
dwStyles
=
WS_CHILDWINDOW
|
WS_VISIBLE
|
WS_CLIPCHILDREN
;
DWORD
dwExStyles
=
WS_EX_LEFT
|
WS_EX_LTRREADING
|
WS_EX_RIGHTSCROLLBAR
|
WS_EX_CLIENTEDGE
;
RECT
rc
;
HP_GetHTMLRect
(
pHHInfo
,
&
rc
);
hWnd
=
CreateWindowExW
(
dwExStyles
,
szChildClass
,
szEmpty
,
dwStyles
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
,
hwndParent
,
NULL
,
pHHInfo
->
hInstance
,
NULL
);
if
(
!
hWnd
)
return
FALSE
;
/* store the pointer to the HH info struct */
SetWindowLongPtrA
(
hWnd
,
GWLP_USERDATA
,
(
LONG_PTR
)
pHHInfo
);
ShowWindow
(
hWnd
,
SW_SHOW
);
UpdateWindow
(
hWnd
);
pHHInfo
->
pHHWinType
->
hwndHTML
=
hWnd
;
return
TRUE
;
}
...
...
@@ -319,6 +431,8 @@ static BOOL HH_CreateViewer(HHInfo *pHHInfo)
if
(
!
HH_AddToolbar
(
pHHInfo
))
return
FALSE
;
HH_RegisterChildWndClass
(
pHHInfo
);
if
(
!
HH_AddNavigationPane
(
pHHInfo
))
return
FALSE
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment