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
6a09a4f8
Commit
6a09a4f8
authored
Sep 21, 2005
by
James Hawkins
Committed by
Alexandre Julliard
Sep 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the SizeBar.
parent
97c944c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
125 additions
and
12 deletions
+125
-12
help.c
dlls/hhctrl.ocx/help.c
+125
-12
No files found.
dlls/hhctrl.ocx/help.c
View file @
6a09a4f8
...
...
@@ -42,6 +42,8 @@
#define WINTYPE_DEFAULT_HEIGHT 640
#define WINTYPE_DEFAULT_NAVWIDTH 250
static
const
WCHAR
szEmpty
[]
=
{
0
};
typedef
struct
tagHHInfo
{
HH_WINTYPEW
*
pHHWinType
;
...
...
@@ -50,6 +52,7 @@ typedef struct tagHHInfo
HINSTANCE
hInstance
;
LPWSTR
szCmdLine
;
HWND
hwndTabCtrl
;
HWND
hwndSizeBar
;
HFONT
hFont
;
}
HHInfo
;
...
...
@@ -82,14 +85,117 @@ static LPWSTR HH_LoadString(DWORD dwID)
return
string
;
}
/* Size Bar */
#define SIZEBAR_WIDTH 4
static
const
WCHAR
szSizeBarClass
[]
=
{
'H'
,
'H'
,
' '
,
'S'
,
'i'
,
'z'
,
'e'
,
'B'
,
'a'
,
'r'
,
0
};
/* Draw the SizeBar */
static
void
SB_OnPaint
(
HWND
hWnd
)
{
PAINTSTRUCT
ps
;
HDC
hdc
;
RECT
rc
;
hdc
=
BeginPaint
(
hWnd
,
&
ps
);
GetClientRect
(
hWnd
,
&
rc
);
/* dark frame */
rc
.
right
+=
1
;
rc
.
bottom
-=
1
;
FrameRect
(
hdc
,
&
rc
,
GetStockObject
(
GRAY_BRUSH
));
/* white highlight */
SelectObject
(
hdc
,
GetStockObject
(
WHITE_PEN
));
MoveToEx
(
hdc
,
rc
.
right
,
1
,
NULL
);
LineTo
(
hdc
,
1
,
1
);
LineTo
(
hdc
,
1
,
rc
.
bottom
-
1
);
MoveToEx
(
hdc
,
0
,
rc
.
bottom
,
NULL
);
LineTo
(
hdc
,
rc
.
right
,
rc
.
bottom
);
EndPaint
(
hWnd
,
&
ps
);
}
LRESULT
CALLBACK
SizeBar_WndProc
(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
message
)
{
case
WM_PAINT
:
SB_OnPaint
(
hWnd
);
break
;
default:
return
DefWindowProcW
(
hWnd
,
message
,
wParam
,
lParam
);
}
return
0
;
}
static
void
HH_RegisterSizeBarClass
(
HHInfo
*
pHHInfo
)
{
WNDCLASSEXW
wcex
;
wcex
.
cbSize
=
sizeof
(
WNDCLASSEXW
);
wcex
.
style
=
0
;
wcex
.
lpfnWndProc
=
(
WNDPROC
)
SizeBar_WndProc
;
wcex
.
cbClsExtra
=
0
;
wcex
.
cbWndExtra
=
0
;
wcex
.
hInstance
=
pHHInfo
->
hInstance
;
wcex
.
hIcon
=
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_APPLICATION
);
wcex
.
hCursor
=
LoadCursorW
(
NULL
,
(
LPCWSTR
)
IDC_SIZEWE
);
wcex
.
hbrBackground
=
(
HBRUSH
)(
COLOR_MENU
+
1
);
wcex
.
lpszMenuName
=
NULL
;
wcex
.
lpszClassName
=
szSizeBarClass
;
wcex
.
hIconSm
=
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_APPLICATION
);
RegisterClassExW
(
&
wcex
);
}
static
void
SB_GetSizeBarRect
(
HHInfo
*
pHHInfo
,
RECT
*
rc
)
{
RECT
rectWND
,
rectTB
,
rectNP
;
GetClientRect
(
pHHInfo
->
pHHWinType
->
hwndHelp
,
&
rectWND
);
GetClientRect
(
pHHInfo
->
pHHWinType
->
hwndToolBar
,
&
rectTB
);
GetClientRect
(
pHHInfo
->
pHHWinType
->
hwndNavigation
,
&
rectNP
);
rc
->
left
=
rectNP
.
right
;
rc
->
top
=
rectTB
.
bottom
;
rc
->
bottom
=
rectWND
.
bottom
-
rectTB
.
bottom
;
rc
->
right
=
SIZEBAR_WIDTH
;
}
static
BOOL
HH_AddSizeBar
(
HHInfo
*
pHHInfo
)
{
HWND
hWnd
;
HWND
hwndParent
=
pHHInfo
->
pHHWinType
->
hwndHelp
;
DWORD
dwStyles
=
WS_CHILDWINDOW
|
WS_VISIBLE
|
WS_OVERLAPPED
;
DWORD
dwExStyles
=
WS_EX_LEFT
|
WS_EX_LTRREADING
|
WS_EX_RIGHTSCROLLBAR
;
RECT
rc
;
SB_GetSizeBarRect
(
pHHInfo
,
&
rc
);
hWnd
=
CreateWindowExW
(
dwExStyles
,
szSizeBarClass
,
szEmpty
,
dwStyles
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
,
hwndParent
,
NULL
,
pHHInfo
->
hInstance
,
NULL
);
if
(
!
hWnd
)
return
FALSE
;
pHHInfo
->
hwndSizeBar
=
hWnd
;
return
TRUE
;
}
/* Child Window */
static
const
WCHAR
szChildClass
[]
=
{
'H'
,
'H'
,
' '
,
'C'
,
'h'
,
'i'
,
'l'
,
'd'
,
0
};
static
const
WCHAR
szEmpty
[]
=
{
0
};
static
void
Child_OnPaint
(
HWND
hWnd
)
{
PAINTSTRUCT
ps
;
...
...
@@ -397,18 +503,16 @@ static BOOL HH_AddNavigationPane(HHInfo *pHHInfo)
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
;
RECT
rectTB
,
rectWND
,
rectNP
,
rectSB
;
GetClientRect
(
hwndParent
,
&
rectWND
);
GetClientRect
(
hwndToolbar
,
&
rectTB
);
GetClientRect
(
hwndNavigation
,
&
rectNP
);
GetClientRect
(
pHHInfo
->
pHHWinType
->
hwndHelp
,
&
rectWND
);
GetClientRect
(
pHHInfo
->
pHHWinType
->
hwndToolBar
,
&
rectTB
);
GetClientRect
(
pHHInfo
->
pHHWinType
->
hwndNavigation
,
&
rectNP
);
GetClientRect
(
pHHInfo
->
hwndSizeBar
,
&
rectSB
);
rc
->
left
=
rectNP
.
right
;
rc
->
left
=
rectNP
.
right
+
rectSB
.
right
;
rc
->
top
=
rectTB
.
bottom
;
rc
->
right
=
rectWND
.
right
-
r
ectNP
.
righ
t
;
rc
->
right
=
rectWND
.
right
-
r
c
->
lef
t
;
rc
->
bottom
=
rectWND
.
bottom
-
rectTB
.
bottom
;
}
...
...
@@ -451,7 +555,7 @@ static void Help_OnSize(HWND hWnd, LPARAM lParam)
if
(
!
pHHInfo
)
return
;
/* Only resize the Navigation pane vertically */
/* Only resize the Navigation pane
and SizeBar
vertically */
if
(
HIWORD
(
lParam
))
{
NP_GetNavigationRect
(
pHHInfo
,
&
rc
);
...
...
@@ -462,6 +566,10 @@ static void Help_OnSize(HWND hWnd, LPARAM lParam)
SetWindowPos
(
pHHInfo
->
hwndTabCtrl
,
HWND_TOP
,
0
,
0
,
rc
.
right
-
TAB_RIGHT_PADDING
,
rc
.
bottom
-
TAB_TOP_PADDING
,
SWP_NOMOVE
);
SB_GetSizeBarRect
(
pHHInfo
,
&
rc
);
SetWindowPos
(
pHHInfo
->
hwndSizeBar
,
HWND_TOP
,
0
,
0
,
rc
.
right
,
rc
.
bottom
,
SWP_NOMOVE
);
}
HP_GetHTMLRect
(
pHHInfo
,
&
rc
);
...
...
@@ -608,6 +716,11 @@ static BOOL HH_CreateViewer(HHInfo *pHHInfo)
if
(
!
HH_AddNavigationPane
(
pHHInfo
))
return
FALSE
;
HH_RegisterSizeBarClass
(
pHHInfo
);
if
(
!
HH_AddSizeBar
(
pHHInfo
))
return
FALSE
;
if
(
!
HH_AddHTMLPane
(
pHHInfo
))
return
FALSE
;
...
...
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