Listview: Implemented Get/SetToolTips functions

Dimitrie O. Paun dpaun at rogers.com
Fri May 9 17:12:20 CDT 2003


On May 9, 2003 02:45 pm, BiGgUn wrote:

>  static INT LISTVIEW_GetTopIndex(LISTVIEW_INFO *);
>  static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *, INT, BOOL);
>  static HWND CreateEditLabelT(LISTVIEW_INFO *, LPCWSTR, DWORD, INT, INT,INT, INT, BOOL); 
> +static HWND LISTVIEW_GetToolTips( LISTVIEW_INFO *);
> +static HWND LISTVIEW_SetToolTips( LISTVIEW_INFO *, HWND);

I don't think you need these here.

>  /******** Text handling functions *************************************/
>
> @@ -5729,6 +5741,20 @@
>
>  /***
>   * DESCRIPTION:
> + * Returns tooltip associated to the listview
> + *
> + * PARAMETER(S):
> + * [I] infoPtr : valid pointer to the listview structure
> + *
> + * RETURN:
> + *   Handle on listview tooltip
> + */
> +static HWND LISTVIEW_GetToolTips( LISTVIEW_INFO *infoPtr) {
> +    return infoPtr->hwndToolTip;
> +}

Please just inline this one in the WinProc, the file is already
too big and hard to maintain.

> +/***
> + * DESCRIPTION:
> + * Determines which listview item is located at the specified position.
> + *
> + * PARAMETER(S):
> + * [I] infoPtr        : valid pointer to the listview structure
> + * [I] hwndNewToolTip : handle to new ToolTip
> + *
> + * RETURN:
> + *   old tool tip
> + */
> +static HWND LISTVIEW_SetToolTips( LISTVIEW_INFO *infoPtr, HWND hwndNewToolTip) {

Please follow the bracket convention used in the rest of the file.
Indentation is currently mixed 2 or 4 space, please use 4 going forward.

> + HWND hwndOldToolTip = infoPtr->hwndToolTip;
> +    infoPtr->hwndToolTip = hwndNewToolTip;
> +    return hwndOldToolTip;
> +}

Don't we need to do something with the new tool tip?
I guess it's not part of this patch... :)

> +  /* init ToolTip */
> +  infoPtr->hwndToolTip = NULL;

Is this needed? Isn't the info structure initialized to 0?

>
>    case LVM_GETTOOLTIPS:
> -    FIXME("LVM_GETTOOLTIPS: unimplemented\n");
> -    return FALSE;
> +    return (LRESULT)LISTVIEW_GetToolTips(infoPtr);

Yeah, just make this one:
+	return (LRESULT)infoPtr->hwndToolTip;


-- 
Dimi.




More information about the wine-devel mailing list