2025-11-27 16:46:48 +09:00

42 lines
3.5 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\froman\fprq2 Times New Roman;}{\f3\froman Times New Roman;}}
{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green0\blue255;}
\deflang1033\horzdoc{\*\fchars }{\*\lchars }\pard\plain\f2\fs48\cf1\b COXItemTip\plain\f2\fs48\b
\par \plain\f2\fs24
\par Generic class that provides tips for items from List Control that are not entirely visible. Derived from COXHookWnd - generic class that is used to subclass any CWnd and provides capability to handle any message routed to the hooked window before it. Handles WM_MOUSEMOVE messages to handle drawing tips. When mouse is moved over any of items that only partially seen then item tip will be displayed (the same functionality as CTreeCtrl provides)
\par To use it:
\par \pard\li720\fi-360\plain\f2\fs24 1.\tab call Attach to hook any CListCtrl based control
\par 2.\tab for ownerdraw CListCtrl you have to provide additional information about current item. Such information can be requested in two ways. There is WM_DOYOUNEEDITEMTIP message which COXItemTip will send to corresponding CListCtrl each time it needs to request specific information by means of NEEDITEMTIPINFO structure. Another way to provide item information is to use callback function that can be set while calling COXItemInfo::Attach fuction and should be defined as:
\par
\par \tab \tab void CallbackNeedItemTip(LPARAM lpSource, LPARAM lpInfo)
\par
\par \tab where lpSource is a pointer to COXItemTip object that is requesting item information and lpInfo is pointer to NEEDITEMTIPINFO structure.
\par
\par 3.\tab Before WM_DOYOUNEEDITEMTIP message or callback function is fired above described structure is filled by COXItemTip::NeedItemTip function. But if a hooked CListCtrl is ownerdrawfixed then next elements could be defined incorrectly: row, col, rectItem, itemText, offset.
\par \pard\li720\plain\f2\fs24 In the case when you don't have and don't want to provide item info using above described ways but still don't like the settings that COXItemTip uses by default you can use the following functions to change them:
\par
\par \plain\f2\fs24\cf2\ul SetTextFont\plain\f2\fs24
\par \plain\f2\fs24\cf2\ul GetTextFont\plain\f2\fs24
\par
\par \plain\f2\fs24\cf2\ul SetTextColor\plain\f2\fs24
\par \plain\f2\fs24\cf2\ul GetTextColor\plain\f2\fs24
\par
\par \plain\f2\fs24\cf2\ul SetBkColor\plain\f2\fs24
\par \plain\f2\fs24\cf2\ul GetBkColor\plain\f2\fs24
\par
\par \plain\f2\fs24\cf2\ul SetOffset\plain\f2\fs24
\par \plain\f2\fs24\cf2\ul GetOffset\plain\f2\fs24
\par
\par
\par
\par \pard\plain\f2\fs48\cf1\b COXItemTipWnd\plain\f2\fs48\b
\par \plain\f2\fs24
\par COXItemTipWnd window.
\par This Class displays item tips. It functions in a similar fashion as tool tip window. \~ COXItemTip class uses this class to display item tips for elements in a CListControl derived class. But it can be used directly by calling it's public functions.
\par To use this class independantly you have to:
\par \pard\li720\fi-360\plain\f2\fs24 1.\tab call the \plain\f2\fs24\cf2\ul Create\plain\f2\fs24 function.
\par \tab You can use hbrBackground argument to provide the background color you prefer your tips to have.
\par 2.\tab call the \plain\f2\fs24\cf2\ul Display\plain\f2\fs24 function to display an item tip.
\par 3.\tab call \plain\f2\fs24\cf2\ul Hide\plain\f2\fs24 to hide item tip window
\par \pard\li720\plain\f2\fs24
\par }