OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TToolInfo Class Reference

TToolInfo contains information about a particular tool (a tool is either a window or an application-defined rectangular area within a window's client area). More...

#include <owl/tooltip.h>

Inheritance diagram for owl::TToolInfo:

Public Member Functions

 TToolInfo (bool allocCache=false)
 This is the default constructor of TToolInfo.
 
 TToolInfo (HWND window, const TRect &rect, uint toolId, LPCTSTR txt=LPSTR_TEXTCALLBACK)
 Constructor for a tool implemented as a rectangular area within a window's client area.
 
 TToolInfo (HWND window, const TRect &rect, uint toolId, const tstring &txt)
 String overload.
 
 TToolInfo (HWND window, const TRect &, uint toolId, int resId, HINSTANCE txtResModule)
 Constructor for a tool implemented as a rectangular area within a window's client area.
 
 TToolInfo (HWND parent, HWND toolHwnd, LPCTSTR txt=LPSTR_TEXTCALLBACK)
 Constructor for a tool implemented as windows (child/controls).
 
 TToolInfo (HWND parent, HWND toolHwnd, const tstring &txt)
 String overload.
 
 TToolInfo (HWND parent, HWND toolHwnd, int resId, HINSTANCE strResModule)
 Constructor for a tool implemented as a window (child/control).
 
void EnableSubclassing (bool enable=true)
 Enable Subclassing have to be called for Dialog controls.
 
HWND GetToolWindow () const
 Returns the actual HWND linked to a tool.
 
void GetToolRect (TRect &rect) const
 Retrieves the actual RECT linked to a tool.
 
bool IsPointInTool (HWND win, const TPoint &pt) const
 This method determines whether a particular location of a window is relevant to this tool.
 
 TToolInfo (const TToolInfo &)
 
TToolInfooperator= (const TToolInfo &)
 
bool operator== (const TToolInfo &ti) const
 If the IDs of two tools (or the Window Handles of two tools for cases when 'uFlags & TTF_IDISHWND') are similar and the handle of the window containing them matches, we'll infer that the structures are referring to the same tool.
 
LPCTSTR GetCacheText () const
 
void FlushCacheText ()
 
Set data members of the TOOLINFO structure which identify each tool
void SetToolInfo (HWND window, uint toolId, const TRect &rc)
 Sets the hwnd, uId and rect members of the TOOLINFO base.
 
void SetToolInfo (HWND window, uint toolId)
 Sets the hwnd and uId members of the TOOLINFO base.
 
void SetToolInfo (HWND toolHwnd, HWND parent)
 Sets the hwnd and uId members of the TOOLINFO base.
 
Set the text associated with a tooltip and the tool rectangles
void SetText (int resId, HINSTANCE hinstance)
 Sets the text of this tool by providing a string resource identifier and the handle of the instance containing that resource.
 
void SetText (LPCTSTR text, bool copy=true)
 Sets the text of this tool by providing a buffer that contains the string.
 
void SetText (const tstring &text)
 
void SetRect (const TRect &rect)
 Sets the bounding rectangle of the tool.
 

Detailed Description

TToolInfo contains information about a particular tool (a tool is either a window or an application-defined rectangular area within a window's client area).

For example, it contains the text to be displayed in the tooltip window.

Definition at line 35 of file tooltip.h.

Constructor & Destructor Documentation

◆ TToolInfo() [1/8]

owl::TToolInfo::TToolInfo ( bool allocCache = false)

This is the default constructor of TToolInfo.

It's used mainly when retrieving information about the current tool of the tooltip control or for initializing a brand new tool to be registered with the control. For example:

tooltip.GetCurrentTool(ti);
TToolInfo contains information about a particular tool (a tool is either a window or an application-d...
Definition tooltip.h:35

Definition at line 62 of file tooltip.cpp.

References owl::DefTipTextCacheSize.

◆ TToolInfo() [2/8]

owl::TToolInfo::TToolInfo ( HWND window,
const TRect & rc,
uint toolId,
LPCTSTR txt = LPSTR_TEXTCALLBACK )

Constructor for a tool implemented as a rectangular area within a window's client area.

The window argument receives the TTN_NEEDTEXT notification in case the txt argument defaults to LPSTR_TEXTCALLBACK.

Definition at line 77 of file tooltip.cpp.

References SetRect(), SetText(), and SetToolInfo().

◆ TToolInfo() [3/8]

owl::TToolInfo::TToolInfo ( HWND window,
const TRect & rect,
uint toolId,
const tstring & txt )

String overload.

Definition at line 95 of file tooltip.cpp.

References SetRect(), SetText(), and SetToolInfo().

◆ TToolInfo() [4/8]

owl::TToolInfo::TToolInfo ( HWND window,
const TRect & rc,
uint toolId,
int strRes,
HINSTANCE hInst )

Constructor for a tool implemented as a rectangular area within a window's client area.

The strRes and hInst arguments specify a string resource of the message to be used by the tooltip window.

Definition at line 109 of file tooltip.cpp.

References SetText(), and SetToolInfo().

◆ TToolInfo() [5/8]

owl::TToolInfo::TToolInfo ( HWND parent,
HWND toolWnd,
LPCTSTR txt = LPSTR_TEXTCALLBACK )

Constructor for a tool implemented as windows (child/controls).

The parent argument receives the TTN_NEEDTEXT notification in case the txt argument defaults to LPSTR_TEXTCALLBACK.

Definition at line 123 of file tooltip.cpp.

References SetText(), and SetToolInfo().

◆ TToolInfo() [6/8]

owl::TToolInfo::TToolInfo ( HWND parent,
HWND toolHwnd,
const tstring & txt )

String overload.

Definition at line 135 of file tooltip.cpp.

References SetText(), and SetToolInfo().

◆ TToolInfo() [7/8]

owl::TToolInfo::TToolInfo ( HWND parent,
HWND toolWnd,
int strRes,
HINSTANCE hInst )

Constructor for a tool implemented as a window (child/control).

The strRes and hInst arguments specify a string resource to be used by the tooltip window.

Definition at line 147 of file tooltip.cpp.

References SetText(), and SetToolInfo().

◆ TToolInfo() [8/8]

owl::TToolInfo::TToolInfo ( const TToolInfo & other)

Definition at line 159 of file tooltip.cpp.

Member Function Documentation

◆ EnableSubclassing()

void owl::TToolInfo::EnableSubclassing ( bool enable = true)
inline

Enable Subclassing have to be called for Dialog controls.

Definition at line 355 of file tooltip.h.

◆ FlushCacheText()

void owl::TToolInfo::FlushCacheText ( )
inline

Definition at line 384 of file tooltip.h.

◆ GetCacheText()

LPCTSTR owl::TToolInfo::GetCacheText ( ) const
inline

Definition at line 375 of file tooltip.h.

References CONST_CAST.

◆ GetToolRect()

void owl::TToolInfo::GetToolRect ( TRect & rc) const

Retrieves the actual RECT linked to a tool.

For tools implemented as a rectangle within a client area, that rectangle is retrieved. For tools associated with a control, the latter's client area is retrieved.

Definition at line 264 of file tooltip.cpp.

References CHECK.

◆ GetToolWindow()

HWND owl::TToolInfo::GetToolWindow ( ) const

Returns the actual HWND linked to a tool.

For tools implemented as a rectangle within a client area, the window's handle is returned. For tools associated with a control, the handle of the control is returned.

Definition at line 253 of file tooltip.cpp.

◆ IsPointInTool()

bool owl::TToolInfo::IsPointInTool ( HWND win,
const TPoint & pt ) const

This method determines whether a particular location of a window is relevant to this tool.

For tools implemented as a rectangle within a window's client area, simply check that the pt argument is within that rectangle. For tools representing a child window, check that pt is within the client area of the child window. Returns true if succesful, or false if it fails.

Note
The pt argument must be relative to the window's client area.

Definition at line 285 of file tooltip.cpp.

References GetToolRect(), and GetToolWindow().

◆ operator=()

TToolInfo & owl::TToolInfo::operator= ( const TToolInfo & other)

Definition at line 170 of file tooltip.cpp.

References SetText().

◆ operator==()

bool owl::TToolInfo::operator== ( const TToolInfo & ti) const
inline

If the IDs of two tools (or the Window Handles of two tools for cases when 'uFlags & TTF_IDISHWND') are similar and the handle of the window containing them matches, we'll infer that the structures are referring to the same tool.

Definition at line 366 of file tooltip.h.

◆ SetRect()

void owl::TToolInfo::SetRect ( const TRect & rc)
inline

Sets the bounding rectangle of the tool.

The coordinates are relative to the upper-left corner of the client area of the window.

Note
This flag is only valid if the tool is a rectangle within the window and not a control parented to the window.

Definition at line 347 of file tooltip.h.

◆ SetText() [1/3]

void owl::TToolInfo::SetText ( const tstring & text)
inline

Definition at line 88 of file tooltip.h.

References SetText().

◆ SetText() [2/3]

void owl::TToolInfo::SetText ( int resId,
HINSTANCE hinstance )
inline

Sets the text of this tool by providing a string resource identifier and the handle of the instance containing that resource.

Definition at line 335 of file tooltip.h.

References CONST_CAST.

◆ SetText() [3/3]

void owl::TToolInfo::SetText ( LPCTSTR text,
bool copy = true )

Sets the text of this tool by providing a buffer that contains the string.

The boolean 'copy' flag specifies whether the method should make a local copy of the string.

Definition at line 233 of file tooltip.cpp.

References strnewdup().

◆ SetToolInfo() [1/3]

void owl::TToolInfo::SetToolInfo ( HWND toolHwnd,
HWND parent )

Sets the hwnd and uId members of the TOOLINFO base.

TOOLINFO::hwnd is set to parent, and TOOLINFO::uId is set to toolHwnd. The flag TTF_IDISHWND is set in TOOLINFO::uFlags.

Definition at line 218 of file tooltip.cpp.

References PRECONDITION.

◆ SetToolInfo() [2/3]

void owl::TToolInfo::SetToolInfo ( HWND window,
uint toolId )

Sets the hwnd and uId members of the TOOLINFO base.

TOOLINFO::hwnd is set to window, and TOOLINFO::uId is set to toolId. The flag TTF_IDISHWND is cleared in TOOLINFO::uFlags.

Definition at line 192 of file tooltip.cpp.

References PRECONDITION.

◆ SetToolInfo() [3/3]

void owl::TToolInfo::SetToolInfo ( HWND window,
uint toolId,
const TRect & rc )

Sets the hwnd, uId and rect members of the TOOLINFO base.

TOOLINFO::hwnd is set to window, TOOLINFO::uId is set to toolId, and TOOLINFO::rect is set to rc. The flag TTF_IDISHWND is cleared in TOOLINFO::uFlags.

Definition at line 206 of file tooltip.cpp.

References SetRect(), and SetToolInfo().


The documentation for this class was generated from the following files: