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
Releases
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
Johnny Cai
wine
Commits
4494a500
Commit
4494a500
authored
24 years ago
by
Chris Morgan
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added changing mouse cursor when over a help topic link.
parent
4b3afdcc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
programs/winhelp/winhelp.c
+53
-12
53 additions, 12 deletions
programs/winhelp/winhelp.c
programs/winhelp/winhelp.h
+3
-0
3 additions, 0 deletions
programs/winhelp/winhelp.h
with
56 additions
and
12 deletions
programs/winhelp/winhelp.c
+
53
−
12
View file @
4494a500
...
...
@@ -6,7 +6,7 @@
#include
<stdio.h>
#include
<string.h>
#include
"win
dows
.h"
#include
"win
base
.h"
#include
"windowsx.h"
#include
"winhelp.h"
...
...
@@ -27,6 +27,7 @@ static VOID WINHELP_SetupText(HWND hWnd);
static
BOOL
WINHELP_AppendText
(
WINHELP_LINE
***
,
WINHELP_LINE_PART
***
,
LPSIZE
,
LPSIZE
,
INT
*
,
INT
,
LPCSTR
,
UINT
,
HFONT
,
COLORREF
,
HLPFILE_LINK
*
);
static
WINHELP_LINE_PART
*
WINHELP_IsOverLink
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
);
WINHELP_GLOBALS
Globals
=
{
3
,
0
,
0
,
0
,
0
,
0
};
...
...
@@ -241,6 +242,7 @@ VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
win
->
lpszName
=
ptr
;
}
else
win
->
lpszName
=
NULL
;
win
->
page
=
page
;
win
->
first_button
=
0
;
win
->
first_line
=
0
;
...
...
@@ -249,6 +251,9 @@ VOID WINHELP_CreateHelpWindow(LPCSTR lpszFile, LONG lHash, LPCSTR lpszWindow,
win
->
hTextWnd
=
0
;
win
->
hShadowWnd
=
0
;
win
->
hArrowCur
=
LoadCursorA
(
0
,
IDC_ARROWA
);
win
->
hHandCur
=
LoadCursorA
(
0
,
IDC_HANDA
);
Globals
.
active_win
=
win
;
/* Initialize default pushbuttons */
...
...
@@ -620,24 +625,32 @@ static LRESULT CALLBACK WINHELP_TextWndProc (HWND hWnd, UINT msg, WPARAM wParam,
EndPaint
(
hWnd
,
&
ps
);
break
;
case
WM_MOUSEMOVE
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
if
(
WINHELP_IsOverLink
(
hWnd
,
wParam
,
lParam
))
SetCursor
(
win
->
hHandCur
);
/* set to hand pointer cursor to indicate a link */
else
SetCursor
(
win
->
hArrowCur
);
/* set to hand pointer cursor to indicate a link */
break
;
case
WM_LBUTTONDOWN
:
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
scroll_pos
=
GetScrollPos
(
hWnd
,
SB_VERT
);
hPopupWnd
=
Globals
.
hPopupWnd
;
Globals
.
hPopupWnd
=
0
;
mouse
.
x
=
LOWORD
(
lParam
);
mouse
.
y
=
HIWORD
(
lParam
);
for
(
line
=
win
->
first_line
;
line
;
line
=
line
->
next
)
for
(
part
=
&
line
->
first_part
;
part
;
part
=
part
->
next
)
if
(
part
->
link
.
lpszPath
&&
part
->
rect
.
left
<=
mouse
.
x
&&
part
->
rect
.
right
>=
mouse
.
x
&&
part
->
rect
.
top
<=
mouse
.
y
+
scroll_pos
&&
part
->
rect
.
bottom
>=
mouse
.
y
+
scroll_pos
)
WINHELP_CreateHelpWindow
(
part
->
link
.
lpszPath
,
part
->
link
.
lHash
,
NULL
,
part
=
WINHELP_IsOverLink
(
hWnd
,
wParam
,
lParam
);
if
(
part
)
{
mouse
.
x
=
LOWORD
(
lParam
);
mouse
.
y
=
HIWORD
(
lParam
);
WINHELP_CreateHelpWindow
(
part
->
link
.
lpszPath
,
part
->
link
.
lHash
,
NULL
,
part
->
link
.
bPopup
,
hWnd
,
&
mouse
,
SW_NORMAL
);
}
if
(
hPopupWnd
)
DestroyWindow
(
hPopupWnd
);
break
;
...
...
@@ -1052,6 +1065,34 @@ INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type
return
(
MessageBox
(
0
,
newtext
,
title
,
type
));
}
WINHELP_LINE_PART
*
WINHELP_IsOverLink
(
HWND
hWnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
WINHELP_WINDOW
*
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
POINT
mouse
;
WINHELP_LINE
*
line
;
WINHELP_LINE_PART
*
part
;
int
scroll_pos
=
GetScrollPos
(
hWnd
,
SB_VERT
);
mouse
.
x
=
LOWORD
(
lParam
);
mouse
.
y
=
HIWORD
(
lParam
);
for
(
line
=
win
->
first_line
;
line
;
line
=
line
->
next
)
{
for
(
part
=
&
line
->
first_part
;
part
;
part
=
part
->
next
)
{
if
(
part
->
link
.
lpszPath
&&
part
->
rect
.
left
<=
mouse
.
x
&&
part
->
rect
.
right
>=
mouse
.
x
&&
part
->
rect
.
top
<=
mouse
.
y
+
scroll_pos
&&
part
->
rect
.
bottom
>=
mouse
.
y
+
scroll_pos
)
{
return
part
;
}
}
}
return
NULL
;
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */
This diff is collapsed.
Click to expand it.
programs/winhelp/winhelp.h
+
3
−
0
View file @
4494a500
...
...
@@ -78,6 +78,9 @@ typedef struct tagWinHelp
HFONT
(
*
fonts
)[
2
];
UINT
fonts_len
;
HCURSOR
hArrowCur
;
HCURSOR
hHandCur
;
HGLOBAL
hSelf
;
struct
tagWinHelp
*
next
;
}
WINHELP_WINDOW
;
...
...
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