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
83face5d
Commit
83face5d
authored
Apr 01, 2004
by
Robert Shearman
Committed by
Alexandre Julliard
Apr 01, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- TTM_TRACKACTIVATE can have NULL lParam when deactivating.
- Factor out common code from TOOLTIPS_DelTool{A,W}. - Update all indices correctly after delete.
parent
bd603640
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
81 deletions
+59
-81
tooltips.c
dlls/comctl32/tooltips.c
+59
-81
No files found.
dlls/comctl32/tooltips.c
View file @
83face5d
...
...
@@ -18,8 +18,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* TODO:
* - Unicode support (started).
* - Custom draw support.
* - Balloon tips.
* - Messages.
*
* Testing:
* - Run tests using Waite Group Windows95 API Bible Volume 2.
...
...
@@ -111,7 +112,7 @@ typedef struct
INT
xTrackPos
;
INT
yTrackPos
;
INT
nMaxTipWidth
;
INT
nTool
;
INT
nTool
;
/* tool that mouse was on on last relayed mouse move */
INT
nCurrentTool
;
INT
nTrackTool
;
INT
nReshowTime
;
...
...
@@ -545,11 +546,12 @@ TOOLTIPS_TrackHide (HWND hwnd, TOOLTIPS_INFO *infoPtr)
TTTOOL_INFO
*
toolPtr
;
NMHDR
hdr
;
TRACE
(
"hide tracking tooltip %d
\n
"
,
infoPtr
->
nTrackTool
);
if
(
infoPtr
->
nTrackTool
==
-
1
)
return
;
toolPtr
=
&
infoPtr
->
tools
[
infoPtr
->
nTrackTool
];
TRACE
(
"hide tracking tooltip %d!
\n
"
,
infoPtr
->
nTrackTool
);
hdr
.
hwndFrom
=
hwnd
;
hdr
.
idFrom
=
toolPtr
->
uId
;
...
...
@@ -886,26 +888,15 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static
LRESULT
TOOLTIPS_DelToolA
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
static
void
TOOLTIPS_DelToolCommon
(
HWND
hwnd
,
TOOLTIPS_INFO
*
infoPtr
,
INT
nTool
)
{
TOOLTIPS_INFO
*
infoPtr
=
TOOLTIPS_GetInfoPtr
(
hwnd
);
LPTTTOOLINFOA
lpToolInfo
=
(
LPTTTOOLINFOA
)
lParam
;
TTTOOL_INFO
*
toolPtr
;
INT
nTool
;
if
(
lpToolInfo
==
NULL
)
return
0
;
if
(
lpToolInfo
->
cbSize
<
TTTOOLINFOA_V1_SIZE
)
return
0
;
if
(
infoPtr
->
uNumTools
==
0
)
return
0
;
nTool
=
TOOLTIPS_GetToolFromInfoA
(
infoPtr
,
lpToolInfo
);
if
(
nTool
==
-
1
)
return
0
;
TRACE
(
"tool %d
\n
"
,
nTool
);
if
(
nTool
==
-
1
)
return
;
/* make sure the tooltip has disappeared before deleting it */
TOOLTIPS_Hide
(
hwnd
,
infoPtr
);
...
...
@@ -948,14 +939,47 @@ TOOLTIPS_DelToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
Free
(
oldTools
);
}
/* update any indices affected by delete */
/* destroying tool that mouse was on on last relayed mouse move */
if
(
infoPtr
->
nTool
==
nTool
)
{
/* no current tool (0 means first tool) */
/* -1 means no current tool (0 means first tool) */
infoPtr
->
nTool
=
-
1
;
}
else
if
(
infoPtr
->
nTool
>
nTool
)
infoPtr
->
nTool
--
;
if
(
infoPtr
->
nTrackTool
==
nTool
)
/* -1 means no current tool (0 means first tool) */
infoPtr
->
nTrackTool
=
-
1
;
else
if
(
infoPtr
->
nTrackTool
>
nTool
)
infoPtr
->
nTrackTool
--
;
if
(
infoPtr
->
nCurrentTool
==
nTool
)
/* -1 means no current tool (0 means first tool) */
infoPtr
->
nCurrentTool
=
-
1
;
else
if
(
infoPtr
->
nCurrentTool
>
nTool
)
infoPtr
->
nCurrentTool
--
;
infoPtr
->
uNumTools
--
;
}
static
LRESULT
TOOLTIPS_DelToolA
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TOOLTIPS_INFO
*
infoPtr
=
TOOLTIPS_GetInfoPtr
(
hwnd
);
LPTTTOOLINFOA
lpToolInfo
=
(
LPTTTOOLINFOA
)
lParam
;
INT
nTool
;
if
(
lpToolInfo
==
NULL
)
return
0
;
if
(
lpToolInfo
->
cbSize
<
TTTOOLINFOA_V1_SIZE
)
return
0
;
if
(
infoPtr
->
uNumTools
==
0
)
return
0
;
nTool
=
TOOLTIPS_GetToolFromInfoA
(
infoPtr
,
lpToolInfo
);
TOOLTIPS_DelToolCommon
(
hwnd
,
infoPtr
,
nTool
);
return
0
;
}
...
...
@@ -966,7 +990,6 @@ TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
TOOLTIPS_INFO
*
infoPtr
=
TOOLTIPS_GetInfoPtr
(
hwnd
);
LPTTTOOLINFOW
lpToolInfo
=
(
LPTTTOOLINFOW
)
lParam
;
TTTOOL_INFO
*
toolPtr
;
INT
nTool
;
if
(
lpToolInfo
==
NULL
)
...
...
@@ -977,60 +1000,8 @@ TOOLTIPS_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
return
0
;
nTool
=
TOOLTIPS_GetToolFromInfoW
(
infoPtr
,
lpToolInfo
);
if
(
nTool
==
-
1
)
return
0
;
TRACE
(
"tool %d
\n
"
,
nTool
);
/* make sure the tooltip has disappeared before deleting it */
TOOLTIPS_Hide
(
hwnd
,
infoPtr
);
/* delete text string */
toolPtr
=
&
infoPtr
->
tools
[
nTool
];
if
(
toolPtr
->
lpszText
)
{
if
(
(
toolPtr
->
lpszText
!=
LPSTR_TEXTCALLBACKW
)
&&
(
HIWORD
((
INT
)
toolPtr
->
lpszText
)
!=
0
)
)
Free
(
toolPtr
->
lpszText
);
}
/* remove subclassing */
if
(
toolPtr
->
uFlags
&
TTF_SUBCLASS
)
{
if
(
toolPtr
->
uFlags
&
TTF_IDISHWND
)
{
RemoveWindowSubclass
((
HWND
)
toolPtr
->
uId
,
TOOLTIPS_SubclassProc
,
1
);
}
else
{
RemoveWindowSubclass
(
toolPtr
->
hwnd
,
TOOLTIPS_SubclassProc
,
1
);
}
}
/* delete tool from tool list */
if
(
infoPtr
->
uNumTools
==
1
)
{
Free
(
infoPtr
->
tools
);
infoPtr
->
tools
=
NULL
;
}
else
{
TTTOOL_INFO
*
oldTools
=
infoPtr
->
tools
;
infoPtr
->
tools
=
Alloc
(
sizeof
(
TTTOOL_INFO
)
*
(
infoPtr
->
uNumTools
-
1
));
if
(
nTool
>
0
)
memcpy
(
&
infoPtr
->
tools
[
0
],
&
oldTools
[
0
],
nTool
*
sizeof
(
TTTOOL_INFO
));
if
(
nTool
<
infoPtr
->
uNumTools
-
1
)
memcpy
(
&
infoPtr
->
tools
[
nTool
],
&
oldTools
[
nTool
+
1
],
(
infoPtr
->
uNumTools
-
nTool
-
1
)
*
sizeof
(
TTTOOL_INFO
));
Free
(
oldTools
);
}
/* destroying tool that mouse was on on last relayed mouse move */
if
(
infoPtr
->
nTool
==
nTool
)
{
/* no current tool (0 means first tool) */
infoPtr
->
nTool
=
-
1
;
}
infoPtr
->
uNumTools
--
;
TOOLTIPS_DelToolCommon
(
hwnd
,
infoPtr
,
nTool
);
return
0
;
}
...
...
@@ -1482,6 +1453,9 @@ TOOLTIPS_NewToolRectA (HWND hwnd, WPARAM wParam, LPARAM lParam)
return
FALSE
;
nTool
=
TOOLTIPS_GetToolFromInfoA
(
infoPtr
,
lpti
);
TRACE
(
"nTool = %d, rect = %s
\n
"
,
nTool
,
wine_dbgstr_rect
(
&
lpti
->
rect
));
if
(
nTool
==
-
1
)
return
0
;
infoPtr
->
tools
[
nTool
].
rect
=
lpti
->
rect
;
...
...
@@ -1503,6 +1477,9 @@ TOOLTIPS_NewToolRectW (HWND hwnd, WPARAM wParam, LPARAM lParam)
return
FALSE
;
nTool
=
TOOLTIPS_GetToolFromInfoW
(
infoPtr
,
lpti
);
TRACE
(
"nTool = %d, rect = %s
\n
"
,
nTool
,
wine_dbgstr_rect
(
&
lpti
->
rect
));
if
(
nTool
==
-
1
)
return
0
;
infoPtr
->
tools
[
nTool
].
rect
=
lpti
->
rect
;
...
...
@@ -1790,14 +1767,15 @@ static LRESULT
TOOLTIPS_TrackActivate
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TOOLTIPS_INFO
*
infoPtr
=
TOOLTIPS_GetInfoPtr
(
hwnd
);
LPTTTOOLINFOA
lpToolInfo
=
(
LPTTTOOLINFOA
)
lParam
;
if
(
lpToolInfo
==
NULL
)
return
0
;
if
(
lpToolInfo
->
cbSize
<
TTTOOLINFOA_V1_SIZE
)
return
FALSE
;
if
((
BOOL
)
wParam
)
{
LPTTTOOLINFOA
lpToolInfo
=
(
LPTTTOOLINFOA
)
lParam
;
if
(
lpToolInfo
==
NULL
)
return
0
;
if
(
lpToolInfo
->
cbSize
<
TTTOOLINFOA_V1_SIZE
)
return
FALSE
;
/* activate */
infoPtr
->
nTrackTool
=
TOOLTIPS_GetToolFromInfoA
(
infoPtr
,
lpToolInfo
);
if
(
infoPtr
->
nTrackTool
!=
-
1
)
{
...
...
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