25 auto GetToolInfoStructSize_() ->
int
28 return static_cast<int>(v >= 0x60000 ?
sizeof(TOOLINFO) : TTTOOLINFO_V1_SIZE);
64 memset(
this, 0,
sizeof(TOOLINFO));
65 cbSize = GetToolInfoStructSize_();
68 lpszText = (
tchar*)CacheText;
80 memset(
this, 0,
sizeof(TOOLINFO));
81 cbSize = GetToolInfoStructSize_();
97 memset(
this, 0,
sizeof(TOOLINFO));
98 cbSize = GetToolInfoStructSize_();
110 int strRes, HINSTANCE hInst)
112 memset(
this, 0,
sizeof(TOOLINFO));
113 cbSize = GetToolInfoStructSize_();
126 memset(
this, 0,
sizeof(TOOLINFO));
127 cbSize = GetToolInfoStructSize_();
137 memset(
this, 0,
sizeof(TOOLINFO));
138 cbSize = GetToolInfoStructSize_();
148 int strRes, HINSTANCE hInst)
150 memset(
this, 0,
sizeof(TOOLINFO));
151 cbSize = GetToolInfoStructSize_();
172 if (&other !=
this) {
173 *((TOOLINFO*)
this) = *((TOOLINFO*)&other);
196 uFlags &= ~TTF_IDISHWND;
223 uFlags |= TTF_IDISHWND;
224 uId =
reinterpret_cast<UINT_PTR
>(toolHwnd);
235 if (text == LPSTR_TEXTCALLBACK || !text || !copy)
237 lpszText = (
tchar*)text;
243 lpszText = (
tchar*)CacheText;
255 return (uFlags & TTF_IDISHWND) ? HWND(uId) : hwnd;
266 if (uFlags & TTF_IDISHWND) {
267 CHECK(::IsWindow(HWND(uId)));
268 ::GetClientRect(HWND(uId), &rc);
310 lpszText = (LPTSTR)buff;
323 const size_t maxLen =
COUNTOF(szText) - 1;
324 WARNX(OwlControl,
_tcslen(text) > maxLen, 0,
_T(
"Tip text is too large (truncated)."));
325 szText[0] =
_T(
'\0');
326 _tcsncat(szText, text, maxLen);
336 lpszText =
CONST_CAST(LPTSTR, MAKEINTRESOURCE(resId));
351 (tt.uFlags & TTF_IDISHWND) ? ::GetDlgCtrlID(reinterpret_cast<HWND>(tt.hdr.idFrom)) : static_cast<
uint>(tt.hdr.idFrom),
368 TipText.CopyText(text);
390 TControl(parent, 0,
_T(
""), 0, 0, 0, 0, module)
393 Attr.Style = (WS_POPUP | WS_DISABLED);
396 Attr.Style |= TTS_ALWAYSTIP;
412 Attr.ExStyle |= WS_EX_TOPMOST;
423 SetStyle(WS_POPUP | WS_DISABLED | TTS_ALWAYSTIP);
491 TToolInfo t(toolWnd, tipArea, toolId, tip);
#define WARNX(group, condition, level, message)
#define PRECONDITION(condition)
virtual void Enable(bool enable=true)
Enables or disables the command sender.
uint Flags
TCommandStatus flags Is TCommandStatus::WasHandled if the command enabler has been handled.
TCommandEnabler(uint id, HWND hWndReceiver=0)
Constructs the TCommandEnabler object with the specified command ID.
@ NonSender
Command does not generate WM_COMMAND messages.
TControl(TWindow *parent, int id, LPCTSTR title, int x, int y, int w, int h, TModule *module=nullptr)
Invokes TWindow's constructor, passing it parent (parent window), title (caption text),...
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
bool Contains(const TPoint &point) const
Returns true if the given point lies within this rectangle; otherwise, it returns false.
TTooltipText identifies a tool for which text is to be displayed.
void SetText(LPCTSTR buff)
Sets text of tooltip to specified buffer.
void CopyText(LPCTSTR buff)
Sets the text of the tooltip.
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
virtual bool Create()
Creates the window interface element to be associated with this ObjectWindows interface element.
TWindow * GetParent() const
Retrieves the OWL object of the parent window. If none exists, returns 0.
void SetFlag(uint mask)
Sets the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer,...
TModule * GetModule() const
Returns a pointer to the module object.
bool IsWindow() const
Returns true if an HWND is being used.
uint32 SetStyle(uint32 style)
Sets the style bits of the underlying window or the 'Style' member of the attribute structure associa...
bool ModifyExStyle(uint32 offBits, uint32 onBits, uint swpFlags=0)
Modifies the style bits of the window.
Definition of classes for CommonControl encapsulation.
Definition of abstract GDI object class and derived classes.
THandle GetHandle() const
Return the instance handle of the library module represented by the TModule obect.
TWindowFlag
Define bit masks for the internally used flag attributes of TWindow.
@ wfAutoCreate
Create the HWND when our parent is created.
char * strnewdup(const char *s, size_t minAllocSize=0)
Object Windows Library (OWLNext Core).
const unsigned TOOLTIP_TIMERID
void InitializeCommonControls(uint controlFlags)
Wrapper for the Windows API function InitCommmonControlsEx.
const int DefTipTextCacheSize
void InUse(const T &arg)
Handy utility to avoid compiler warnings about unused parameters.
auto GetCommCtrlVersion() -> DWORD
Returns the version number of the Common Control library (ComCtl32.dll).
DIAG_DECLARE_GROUP(OwlThread)
#define CONST_CAST(targetType, object)
#define COUNTOF(s)
Array element count Important: Only use this with an argument of array type.
Definition of TUIMetric, a UI metrics provider class.
Base window class TWindow definition, including HWND encapsulation.