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