![]() |
Desktop Development »
Miscellaneous »
Beginners
Intermediate
CPPToolTip v2.1By Eugene PustovoytA class that allows you to display your data for a control as tooltip |
VC6, VC7Win2K, WinXP, MFC, Dev
|
|
Advanced Search Add to IE Search |
|
|
||||||||||||||||||
![]() |
|
Placing an anchor on any edge |
Tooltip for the menu item |
Tooltip for the toolbar item |
Tooltip for the map item |
Titletip for the different controls |
Tooltip with hyperlinks and hot areas |
CScrollView
To integrate PPToolTip control in your application you should add next files to your project:
Files |
Description |
| PPTooltip.h PPTooltip.cpp |
CPPTooltip class |
PPHtmlDrawer.h PPHtmlDrawer.cpp |
CPPHtmlDrawer class. It's need to drawing HTML string in tooltip body |
PPDrawManager.h |
CPPDrawManager class is a set of methods to work with graphics. |
| CeXDib.h CeXDib.cpp |
CCeXDib class thanks to Davide Pizzolato and Davide Calabro. This class use for extend background's effect. |
Extend background effects by Davide Pizzolato and Davide Calabro become available
if defined USE_SHADE:
in PPDrawManager.h #define USE_SHADE
Include PPTooltip.h in the header file where you want to use the CPPToolTip window and create a member variable for the window:
CPPToolTip m_tooltip;
Now create the window. For dialog-based applications, in your OnInitDialog:
// Call the base-class method CDialog::OnInitDialog(); // Create the CPPToolTip object m_tooltip.Create(this);
Now call AddTool function to register a tool with the tool tip
control, so that the information stored in the tool tip is displayed when the
cursor is on the tool:
m_tooltip.AddTool(GetDlgItem(IDC_BUTTON1), _T( "Tooltip to the control IDC_BUTTON1"));
or for rectangle area
m_tooltip.AddTool(this, _T("Tooltip for rectangle area"), CRect (100, 100, 200, 200));
Now you must add RelayEvent function call to pass a mouse message to a tooltip
control for processing.
BOOL ... ::PreTranslateMessage(MSG* pMsg)
{
m_tooltip.RelayEvent(pMsg);
}
1. Create CPPToolTip object in the header CMainFrame
CPPToolTip m_tooltip;
2. In CMainFrame::OnCreate() call a AddToolBar method.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { ... m_tooltip.Create(this); //Adds tooltip for toolbar m_tooltip.AddToolBar(&m_wndToolBar); return 0; }3. Add
RelayEvent function call to pass a mouse message to a tooltip
control for processing.
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
m_tooltip.RelayEvent(pMsg);
}
Notice, that the text for tooltips are automatically loaded from resources.
The string format was expanded with the third parameter, used for disabled items of the the menu and the toolbar.
Format string in resource: Parameter1\nParameter2\nParameter3
,where :
1. Create CPPToolTip object in the header CMainFrame
CPPToolTip m_tooltip;
2. In CMainFrame::OnCreate() call a Create method.
m_tooltip.Create(this);
3. Uncomments a line to enable a work with menus.
in PPTooltip.h #define PPTOOLTIP_USE_MENU
4. Adds two handlers to CMainFrame.
void CMainFrame::OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSubMenu) { m_tooltip.OnMenuSelect(nItemID, nFlags, hSubMenu); CFrameWnd::OnMenuSelect(nItemID, nFlags, hSubMenu); }5. Add
void CMainFrame::OnEnterIdle(UINT nWhy, CWnd* pWho) { m_tooltip.OnEnterIdle(nWhy, pWho); }
RelayEvent function call to pass a mouse message to a tooltip control for processing.
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
m_tooltip.RelayEvent(pMsg);
}Construction |
|
| CPPToolTip | Constructs a CPPToolTip object. |
| Create | Creates a tooltip control and attaches it to a CPPToolTip
object. |
|
Behaviour |
|
| SetBehaviour | Sets the behaviour's tooltip |
| GetBehaviour | Gets the behaviour's tooltip |
|
Background |
|
| SetColorBk | Specifies the color to use for the control. |
| SetEffectBk | Sets the control colors to the default colors. |
|
Tools |
|
| AddTool | Adds the info of the tool. |
| AddToolBar | Adds a toolbar to the tooltip control. |
| RemoveTool | Removes specified tool. |
| RemoveAllTools | Removes all tools. |
| ShowHelpTooltip | Show the tooltip as help window |
| HideTooltip | Hide the tooltip |
|
CImageList |
|
| SetImageList | Sets the image list to tooltip. |
|
Border |
|
| SetBorder | Sets the color and the width of the tooltip's border. |
| HideBorder | Hides a border of the tooltip. |
|
Notification |
|
| SetNotify | Enable notification about changing the data or the view. |
| GetNotify | Is enabled notification about changing the data or the view.. |
|
CSS Styles |
|
| SetCssStyles | Sets the CSS styles of the HTML text |
| GetCssStyles | Retrieves information about the CSS styles of the HTML text |
|
Delays |
|
| SetDelayTime | Sets the delay time for a tooltip control. |
| GetDelayTime | Retrieves the initial, pop-up, and reshow durations currently set for a CPPToolTip control |
|
Sizes |
|
| SetDefaultSizes | Sets all sizes as default. |
| SetSize | Sets the tooltip's sizes. |
| GetSize | Retrieves the size of the specified value. |
|
Direction |
|
| SetDirection | Sets a placement of the tooltip's anchor. |
| GetDirection | Retrives a placement of the tooltip's anchor. |
|
Others |
|
| SetDebugMode | Sets a debug mode for a tooltip control. |
| EnableEscapeSequences | Enables or disables an escape sequences in the HTML string. |
| SetTransparency | Sets a transparency of the tooltip. |
| GetTransparency | Gets a transparency of the tooltip. |
| SetTooltipShadow | Sets a tooltip's shadow. |
| SetImageShadow | Sets a image's shadow. |
| SetMaxTipWidth | Sets the maximum width for a tooltip window. |
| SetImageShadow | Sets a image's shadow. |
|
Hyperlinks |
|
| EnableHyperlink | Associates name of resource with his ID. |
| SetCallbackHyperlink | Search index of array by with specified name or ID resource. |
|
Menus (availables if PPTOOLTIP_USE_MENU defined only) |
|
| MenuToolPosition | Sets a position of the tooltip's anchor about menu item. |
| GetMenuToolPosition | Gets a position of the tooltip's anchor about menu item.. |
|
Operations |
|
| RelayEvent | Passes a mouse message to a tooltip control for processing. |
|
Version |
|
| GetVersionI | Get CPPToolTip version |
| GetVersionC | Get CPPToolTip version |
CPPToolTip ();
Remarks
Constructs a CPPToolTip object. You must call Create after that.
CPPToolTip Overview | Class Members
BOOL Create (CWnd* pParentWnd, BOOL bBalloonSize = TRUE);
Parameters
pParentWnd - Points to the parent window of the tooltip control,
usually a CDialog. It must not be NULL.bBalloonSize - If TRUE CPPToolTip object will be sets to balloon
size, otherwise to standard size.Return Value
Nonzero if the CPPToolTip object is successfully created; otherwise 0.
Remarks
You construct a CPPToolTip in two steps. First call the constructor to construct
the CPPToolTip object; then call Create to create the tool tip control and attach
it to the CPPToolTip object.
CPPToolTip Overview | Class Members
void SetBehaviour(DWORD dwBehaviour = 0)Parameters
dwBehaviour - The behaviour of the tooltip. This parameter can be one of the following values:
Remarks
Calls the function to set the tooltip's behaviour.
CPPToolTip Overview | Class Members
DWORD GetBehaviour()
Return value
The behavior of the tooltip. See the SetBehaviour function for the list of the available flags
Remarks
Retrieves the behavior of the tooltip.
CPPToolTip Overview | Class Members
void SetColorBk(COLORREF color) void SetColorBk(COLORREF crBegin, COLORREF crEnd)void SetColorBk(COLORREF crBegin, COLORREF crMid, COLORREF crEnd)Parameters
color - A COLORREF value that contains RGB information for the solid backgroundcrBegin - A COLORREF value that contains RGB information for the first color.crMid - A COLORREF value that contains RGB information for the middle color.
|
crEnd - A COLORREF value that contains RGB information for the end color.Remarks
Function sets the colors for gradient filling of background.
CPPToolTip Overview | Class Members
void SetEffectBk(UINT nEffect, BYTE nGranularity = 5)
Parameters
nEffect - This value sets the effect of the background bitmap. Can be one of the following values:
|
nGranularity - this parameter add an uniform noise to the background bitmap. A good value is from 5 to 20; 0 to disable the effect. The noise has a positive effect because it hides the palette steps. This parameter has no effect if the nEffect value is from CPPDrawManager::EFFECT_SOLID to CPPDrawManager::EFFECT_3VGRADIENT.Remarks
Sets an effect for the background bitmap. Note that effect value from CPPDrawManager::EFFECT_NOISE to CPPDrawManager::EFFECT_METAL is available when
#define USE_SHADE //in PPDrawManager.h
only.
CPPToolTip Overview | Class Members
void AddTool(CWnd * pWnd, DWORD dwIdString, LPCRECT lpRectBounds = NULL, DWORD dwIDTool = 0);
To be compatible with old version of CPPToolTip ...
void AddTool(CWnd * pWnd, LPCTSTR lpszString = NULL, LPCRECT lpRectBounds = NULL, DWORD dwIDTool = 0);
void AddTool(CWnd * pWnd, PPTOOLTIP_INFO & ti);
void AddTool(CWnd * pWnd, DWORD dwIdString, HICON hIcon, LPCRECT lpRectBounds = NULL, DWORD dwIDTool = 0);
void AddTool(CWnd * pWnd, DWORD dwIdString, DWORD dwIdIcon, CSize & szIcon = CSize(0, 0), LPCRECT lpRectBounds = NULL, DWORD dwIDTool = 0);
void AddTool(CWnd * pWnd, LPCTSTR lpszString, HICON hIcon, LPCRECT lpRectBounds = NULL, DWORD dwIDTool = 0);
void AddTool(CWnd * pWnd, LPCTSTR lpszString, DWORD dwIdIcon, CSize & szIcon = CSize(0, 0), LPCRECT lpRectBounds = NULL, DWORD dwIDTool = 0);
Parameters
pWnd - Pointer to the window that contains the tool.lpszString - Pointer to the text for the tool. dwIdString - ID of string resourcehIcon - Handle of the icondwIdIcon - ID of icon resourceszIcon - Specifies the width and the height, in pixels, of the icon to load.lpRectBounds - Pointer to a RECT structure containing coordinates of the tool's bounding rectangle. dwIdTool - ID of the toolti - Reference to PPTOOLTIP_INFO structure containing the parameters of the tooltip A tooltip control can be associated with more than one tool. Call this function to register a tool with the tooltip control, so that the information stored in the tooltip is displayed when the cursor is on the tool.
CPPToolTip Overview | Class Members
void RemoveTool(CToolBar * pBar)
Parameters
pBar - Pointer to the toolbar window. Remarks
Call this function to register a toolbar in the collection of toolbars supported by a tooltip control. This method automatically remove CBRS_TOOLTIPS style from toolbar's style to disable standard tooltip.
CPPToolTip Overview | Class Members
void RemoveTool(CWnd * pWnd, LPCRECT lpRectBounds = NULL)
Parameters
pWnd - Pointer to the window that contains the tool. lpRectBounds - Pointer to a RECT structure containing coordinates of the tool's bounding rectangle. Remarks
Call this function to removes the tool specified by pWnd and lpRectBounds from the collection of tools supported by a tooltip control.
CPPToolTip Overview | Class Members
void RemoveAllTools()
Remarks
Call this function to remove all tools from the collection of tools supported by a tooltip control.
CPPToolTip Overview | Class Members
void ShowHelpTooltip (LPPOINT pt, DWORD dwIdText, HICON hIcon = NULL);
void ShowHelpTooltip (LPPOINT pt, DWORD dwIdText, DWORD dwIdIcon, CSize & szIcon = CSize(0, 0));
void ShowHelpTooltip (LPPOINT pt, LPCTSTR lpszString, HICON hIcon = NULL);
void ShowHelpTooltip (LPPOINT pt, LPCTSTR lpszString, DWORD dwIdIcon, CSize & szIcon = CSize(0, 0));
void ShowHelpTooltip (LPPOINT pt, PPTOOLTIP_INFO & ti);
Parameters
pt - Pointer to a POINT structure that receives the screen coordinates of the tooltip's anchor lpszString - Pointer to the text for the help tooltip. dwIdString - ID of string resourcehIcon - Handle of the icon dwIdIcon - ID of icon resource szIcon - Specifies the width and the height, in pixels, of the icon to load.ti - Reference to PPTOOLTIP_INFO structure containing the parameters of the tooltip Remarks
Shows the help tooltip in any place of screen.
CPPToolTip Overview | Class Members
void HideTooltip ();
Remarks
Hides the tooltip.
CPPToolTip Overview | Class Members
void SetImageList(UINT nIdBitmap, int cx, int cy, int nCount, COLORREF crMask /* = RGB(255, 0, 255) */)
void SetImageList(HBITMAP hBitmap, int cx, int cy, int nCount, COLORREF crMask /* = RGB(255, 0, 255) */)
Parameters
nIdBitmap - Resource IDs of the bitmap to be associated with the image listhBitmap - Handle of the bitmap to be associated with the image listcx - Dimensions of each image, in pixels.cy - Dimensions of each image, in pixels.nCount - Number of images that the image list initially contains.crMask - Color used to generate a mask. Each pixel of this color in the specified bitmap is changed to black, and the corresponding bit in the mask is set to one.Remarks
This function sets the image list to tooltip. After this function in body of the tooltip string you can to use the <ilst> tag which will be draw the image from image list in specified place.
CPPToolTip Overview | Class Members
void SetBorder(COLORREF color, int nWidth = 1, int nHeight = 1);
void SetBorder(HBRUSH hbr, int nWidth = 1, int nHeight = 1);
Parameters
color - A COLORREF value that contains RGB information to create a solid brush to be used to draw the border.hbr - Brush handle
that identifies the brush to be used to draw the border.nWidth - Specifies the width of the border in vertical brush strokes in device units.nHeight - Specifies the height of the border in horizontal brush strokes in device units.Remarks
Call this member function
to draws a border around the tooltip's region by using the specified brush.
CPPToolTip Overview | Class Members
void HideBorder()
Remarks
The function hides the border around the tooltip's region.
CPPToolTip Overview | Class Members
void SetTooltipShadow(int nOffsetX, int nOffsetY, BYTE nDarkenPercent /* = 50 */, BOOL bGradient /* = TRUE */, int nDepthX /* = 7 */, int nDepthY /* = 7 */)
void SetImageShadow(int nOffsetX, int nOffsetY, BYTE nDarkenPercent /* = 50 */, BOOL bGradient /* = TRUE */, int nDepthX /* = 7 */, int nDepthY /* = 7 */)
Parameters
nOffsetX, nOffsetY - The offsets of the shadow from the object.nDarkenPercent - So far as colors under the shadow will be darken (0 - 100). For gradient shadow the best value is a 50 percent, for original - 25. bGradient - TRUE to use a gradient shadow.nDepthX, nDepthY - The gradient depths of the gradient shadow. For better result use odd value (3, 5, 7 ...). Remarks
This function sets the shadow to the tooltip or the images on him.
CPPToolTip Overview | Class Members
void SetNotify(BOOL bParentNotify = TRUE) void SetNotify(HWND hWnd) Parameters
bParentNotify - If TRUE the control will send the notification
to parent window. Otherwise the notification will not send.hWnd - If non-NULL the control will send the notification
to specified window. Otherwise the notification will not send.Remarks
This function enables or disables the ability to send notification messages to destination window from the control. If user enabled notify message passing from tooltip to owner class then tooltip object sends the UDM_TOOLTIP_DISPLAY notification before displaying. In a handler of this notify owner class can change any parameters of tooltip displaying. With UDM_TOOLTIP_DISPLAY notification NM_PPTOOLTIP_DISPLAY structure is transferred, contained all necessary information.
Structure NM_PPTOOLTIP_DISPLAY looks as follows:
typedef struct tagNM_PPTOOLTIP_DISPLAY { NMHDR hdr; HWND hwndTool; //HWND of the window to display a tooltip LPPOINT pt; //The current screen coordinates of //the tooltip's anchor PPTOOLTIP_INFO * ti; //The pointer to the PPTOOLTIP_INFO //structure which contains parameters for //displaying tooltip } NM_PPTOOLTIP_DISPLAY;
Owner object should process notification messages to have the ability to change tooltip appearance and placement by changing approppriate members of this structure.
Here example:
Add next lines to header and implementation files accordingly.
afx_msg void NotifyDisplayTooltip(NMHDR * pNMHDR, LRESULT * result);
ON_NOTIFY (UDM_TOOLTIP_DISPLAY, NULL, NotifyDisplayTooltip)and
void CParentDlg::NotifyDisplayTooltip(NMHDR * pNMHDR, LRESULT * result) { *result = 0;
NM_PPTOOLTIP_DISPLAY * pNotify = (NM_PPTOOLTIP_DISPLAY*)pNMHDR; switch (CWnd::FromHandle(pNotify->hwndTool) ->GetDlgCtrlID()) { case IDC_BUTTON1: //Changes the tooltip's text pNotify->ti->sTooltip = _T("Dynamically changed text for BUTTON1"); break; case IDC_BUTTON2: //Changes background color of the tooltip as RED pNotify->ti->crBegin = RGB (255, 0, 0); break; } }
CPPToolTip Overview | Class Members
BOOL GetNotify()
Return value
TRUE if the control notified the specified window.
Remarks
This function determines if notification messages are passed to destination window from the control or not.
CPPToolTip Overview | Class Members
void SetCssStyles(LPCTSTR lpszCssString /* = NULL */);Parameters
lpszCssString - Pointer to the string with CSS styles or NULL if sets the default CSS styles (like Codeproject).Remarks
Call this method to customize the CSS styles used on HTML page. For more information look the description on CPPHtmlDrawer class.
CPPToolTip Overview | Class Members
LPCTSTR GetCssStyles();
Return Value
A const pointer to the string that contains the CSS styles.
Remarks
Call this method to retrive the CSS styles used on HTML page. For more information look the description on CPPHtmlDrawer class.
CPPToolTip Overview | Class Members
void SetDelayTime(DWORD dwDuration, DWORD dwTime)
Parameters
dwDuration - Flag that specifies which duration value will be retrieved. This parameter can be one of the following values:PPTOOLTIP_TIME_AUTOPOP |
Retrieve the length of time the tooltip window remains visible if the pointer is stationary within a tool's bounding rectangle. |
|
PPTOOLTIP_TIME_INITIAL |
Retrieve the length of time the pointer must remain stationary within a tool's bounding rectangle before the tool tip window appears. |
|
PPTOOLTIP_TIME_FADEIN |
Retrieve the length of time for each step of fade-in effect. |
|
PPTOOLTIP_TIME_FADEOUT |
Retrieve the length of time for each step of fade-out effect. |
|
PPTOOLTIP_TIME_ANIMATION |
Retrieve the length of time for each step of animation. |
|
| For compatibility with 1.x versions of CPPToolTip a following values are available also: | ||
TTDT_AUTOPOP |
Same PPTOOLTIP_TIME_AUTOPOP |
|
TTDT_INITIAL |
Same PPTOOLTIP_TIME_INITIAL |
|
dwTime - The specified delay time, in milliseconds.Remarks
Call this function to set the delay time for a tooltip control. The delay time is the length of time the cursor must remain on a tool before the tooltip window appears. The default delay time is 500 milliseconds.
CPPToolTip Overview | Class Members
DWORD GetDelayTime(DWORD dwDuration) const
Return Value
The specified delay time, in milliseconds
Parameters
dwDuration - Flag that specifies which duration value will be retrieved. See CPPToolTip::SetDelayTime for a description of the valid values.Remarks
Retrieves the initial, pop-up, and reshow durations currently set for a CPPToolTip control
CPPToolTip Overview | Class Members
void SetDefaultSizes(BOOL bBalloonSize = TRUE)
Parameter
bBalloonSize - If TRUE CPPToolTip object will be sets to balloon
size, otherwise to standard size.Remarks
This function sets all sizes as default.
CPPToolTip Overview | Class Members
void SetSize(DWORD dwSizeIndex, DWORD dwValue)
Parameters
dwSizeIndex - Index of the size. This parameter can be one of the following values:PPTTSZ_ROUNDED_CX |
The width and the height of the ellipse used to draw the rounded corners. |
|
PPTTSZ_MARGIN_CX |
The left, right and top, bottom margins of the tooltip's text from the tooltip's edges. |
|
PPTTSZ_WIDTH_ANCHOR |
The width of the tooltip's anchor. |
|
PPTTSZ_HEIGHT_ANCHOR |
The height of the tooltip's anchor. |
|
PPTTSZ_MARGIN_ANCHOR |
The margin of the tooltip's anchor from his edge. |
|
PPTTSZ_OFFSET_ANCHOR_CX |
The horizontal and vertical offset of the tooltip's anchor from the hot spot of a cursor |
dwValue - The size in pixels.Remarks
Call this member function to set the tooltip's sizes. For addition information see following picture:

CPPToolTip Overview | Class Members
DWORD GetSize(DWORD nSizeIndex)
Return value
The size of the specified value.
Parameters
dwSizeIndex - Index of the size. See CPPToolTip::SetSize for a description of the valid values.Remarks
This method returns the size of the specified value. See CPPToolTip::SetSize for addition information.
CPPToolTip Overview | Class Members
void SetDirection(DWORD dwDirection = PPTOOLTIP_BOTTOMEDGE_LEFT)
Parameters
dwDirection - mouse-pointer relative placement direction of
the tooltip. This parameter can be one of the following values: PPTOOLTIP_TOPEDGE_LEFT |
A left corner of the top edge |
|
PPTOOLTIP_TOPEDGE_RIGHT |
A right corner of the top edge. |
|
PPTOOLTIP_TOPEDGE_CENTER |
By center of the top edge. |
|
PPTOOLTIP_BOTTOMEDGE_LEFT |
A left corner of the bottom edge |
|
PPTOOLTIP_BOTTOMEDGE_RIGHT |
A right corner of the bottom edge. |
|
PPTOOLTIP_BOTTOMEDGE_CENTER |
By center of the bottom edge. |
|
PPTOOLTIP_LEFTEDGE_TOP |
A top corner of the left edge |
|
PPTOOLTIP_LEFTEDGE_BOTTOM |
A bottom corner of the left edge. |
|
PPTOOLTIP_LEFTEDGE_VCENTER |
By center of the left edge. |
|
PPTOOLTIP_RIGHTEDGE_TOP |
A top corner of the right edge |
|
PPTOOLTIP_RIGHTEDGE_BOTTOM |
A bottom corner of the right edge. |
|
PPTOOLTIP_RIGHTEDGE_VCENTER |
By center of the right edge. |
|
| For compatibility with 1.x versions of CPPToolTip a following values are available also: | ||
PPTOOLTIP_LEFT_TOP |
Same PPTOOLTIP_TOPEDGE_LEFT. |
|
PPTOOLTIP_RIGHT_TOP |
Same PPTOOLTIP_TOPEDGE_RIGHT. |
|
PPTOOLTIP_LEFT_BOTTOM |
Same PPTOOLTIP_BOTTOMEDGE_LEFT. |
|
PPTOOLTIP_RIGHT_BOTTOM |
Same PPTOOLTIP_BOTTOMEDGE_RIGHT. |
|
Remarks
Sets a placement of the tooltip's anchor. For additional information above on this page.
CPPToolTip Overview | Class Members
DWORD GetDirection()
Return value
A placement of the tooltip's anchor. See CPPToolTip::SetDirection for a description of the valid values.
Remarks
Gets a placement of the tooltip's anchor.
CPPToolTip Overview | Class Members
void SetTransparency(BYTE nTransparency = 0)
Parameters
nTransparency -
A transparency value to be used on the tooltip. The default 0 assumes that your tooltip is opaque and 0xFF (255) for full transparency of the tooltip.Remarks
Sets a transparency of the tooltip.
CPPToolTip Overview | Class Members
BYTE GetTransparency()
Return value
A transparency value to be used on the tooltip.
CPPToolTip Overview | Class Members
void SetDebugMode(BOOL bDebug /*= TRUE*/)
Parameters
bDebug - Enables or disables a debug mode for the tooltip.Remarks
Call this function to set a debug mode for a tooltip. In this mode tooltip will be displaying for any control of the parent window even if tool for this window not availabled in the tool's collection of the tooltip. Tooltip in a debug mode is a information about window under the mouse (owner, title, bounding rectangle, ID etc.).
CPPToolTip Overview | Class Members
void MenuToolPosition(DWORD nPos /*= PPTOOLTIP_MENU_LEFT | PPTOOLTIP_MENU_TOP*/)
Parameters
nPos - A tooltip's position. This parameter can be any combination of single horizontal value and single vertical value of CPPToolTip:| Horizontal position | ||
PPTOOLTIP_MENU_LEFT |
||
PPTOOLTIP_MENU_RIGHT |
||
PPTOOLTIP_MENU_CENTER |
||
| Vertical position | ||
PPTOOLTIP_MENU_TOP |
||
PPTOOLTIP_MENU_BOTTOM |
||
PPTOOLTIP_MENU_VCENTER |
||
Remarks
Sets a position of the tooltip's anchor about menu item.
CPPToolTip Overview | Class Members
void EnableEscapeSequences(BOOL bEnable)
Parameters
bEnable - nables the escape sequences. If the escape sequences was disabled HTML-lite compiler will ignore the codes less then 0x20 (such \n, \r, \t).Remarks
Call this function to enable or disable escape sequences in the HTML string.
CPPToolTip Overview | Class Members
void SetMaxTipWidth(int nWidth);
Parameters
nWidth -
The maximum tool tip window width to be set.Remarks
Sets the maximum width for a tool tip window.
CPPToolTip Overview | Class Members
void RelayEvent(MSG* pMsg)
Parameters
pMsg - Pointer to a MSG structure that contains the message to relay.Remarks
Call this function to pass a mouse message to a tooltip control for processing. A tooltip control processes only the following messages, which are sent to it by RelayEvent:
| WM_LBUTTONDOWN | WM_MOUSEMOVE |
| WM_LBUTTONUP | WM_RBUTTONDOWN |
| WM_MBUTTONDOWN | WM_RBUTTONUP |
| WM_MBUTTONUP |
CPPToolTip Overview | Class Members
short GetVersionI()
Return Value
Number version of CPPToolTip.
Remarks
Returns the CPPToolTip version as a short number. Divide by 10 to get actual version.
CPPToolTip Overview | Class Members
LPCTSTR GetVersionC()
Return Value
Number version of CPPToolTip as string.
Remarks
Returns the CPPToolTip version as a string.
CPPToolTip Overview | Class Members
struct PPTOOLTIP_INFO { UINT nIDTool; CRect rectBounds; CString sTooltip; UINT nMask; UINT nStyles; UINT nDirection; UINT nEffect; UINT nBehaviour; BYTE nGranularity; BYTE nTransparency; COLORREF crBegin; COLORREF crMid; COLORREF crEnd; } PPTOOLTIP_INFO;
nIDTool |
ID of the tool | |
rectBounds |
Pointer to a RECT structure containing coordinates of the tool's bounding rectangle. The coordinates are relative to the upper-left corner of the client area of the window identified by pWnd. NULL if bounding rectangle don't uses for specified window |
|
sTooltip |
String containing the text for the tool | |
nMask |
Mask of parameters not by default. This parameter can be any combination of following values: |
|
nStyles |
||
nDirection |
This value sets a placement of the tooltip's anchor. See CPPToolTip::SetDirection for a description of the valid values. | |
nEffect |
This value sets an effect of the background bitmap. See CPPToolTip::SetEffectBk for a description of the valid values. | |
nBehaviour |
This value sets a behavior of the tooltip. See the CPPToolTip::SetBehaviour function for the list of the available flags . | |
nGranularity |
This parameter add an uniform noise to the background bitmap. See CPPToolTip::SetEffectBk for a description of the valid values. | |
nTransparency |
||
crBegin, crMid, crEnd |
The values sets the colors for gradient filling of background. See CPPToolTip::SetColorBk for a description of the valid values. |
| 14 Feb 2003 | First release |
| 17 Feb 2003 | Released version 1.1 |
| 19 Feb 2003 | Released version 1.2 |
| 02 Apr 2003 | Released version 1.3 |
| 13 Apr 2003 | Released version 1.4 |
| 17 Apr 2003 | Released version 1.5 |
| 12 Mar 2004 | Released version 2.0 |
| 21 Nov 2004 | Released version 2.1 |
CButtonST in which decisions
of some questions have been found.You are encouraged to use this class everywhere you want; there is no fee required for CPPTooltip. Freely add modifications and/or fix bugs, but please, send any of these to me!
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 4 Mar 2005 Editor: Paul Watson |
Copyright 2003 by Eugene Pustovoyt Everything else Copyright © CodeProject, 1999-2009 Web09 | Advertise on the Code Project |