OWLNext 7.0
Borland's Object Windows Library for the modern age
|
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>
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 &) | |
TToolInfo & | operator= (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. | |
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.
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:
Definition at line 62 of file tooltip.cpp.
References owl::DefTipTextCacheSize.
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().
String overload.
Definition at line 95 of file tooltip.cpp.
References SetRect(), SetText(), and SetToolInfo().
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().
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().
String overload.
Definition at line 135 of file tooltip.cpp.
References SetText(), and SetToolInfo().
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().
owl::TToolInfo::TToolInfo | ( | const TToolInfo & | other | ) |
Definition at line 159 of file tooltip.cpp.
|
inline |
Definition at line 375 of file tooltip.h.
References CONST_CAST.
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.
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.
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.
Definition at line 285 of file tooltip.cpp.
References GetToolRect(), and GetToolWindow().
Definition at line 170 of file tooltip.cpp.
References SetText().
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.
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().
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.
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.
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().