SavvyUI C++ UI Library
Loading...
Searching...
No Matches
ToolTip.h
Go to the documentation of this file.
1#pragma once
2
3#include "Component.h"
4
14class ToolTip : public Component
15{
19 wstring _text;
20 ButtonType _color;
21
22protected:
23
33 BOOL getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
34
39
40public:
41
46
50 virtual ~ToolTip();
51
55 void setInfo(const wstring& text, const ButtonType& color = ButtonType::INFO);
56
60 void show(Component *parent, int width = 200, int height = 70);
61
65 void hide();
66
70 wstring getText();
71
72public: // Overridables
73
79 void onPaint(Graphics *g);
80
85
96 void onMousePressed(WinHandle hWnd, int x, int y, int clickCount, BOOL shiftPressed, BOOL ctrlPressed);
97
98 void onTimer(unsigned int timerId);
99};
HWND WinHandle
Definition Common.h:16
ButtonType
Definition Common.h:151
@ INFO
Definition Common.h:154
Component()
Constructs a new Component instance.
Definition Graphics.h:161
virtual ~ToolTip()
Destroys the ToolTip component.
void hide()
Hides the tooltip.
void onMousePressed(WinHandle hWnd, int x, int y, int clickCount, BOOL shiftPressed, BOOL ctrlPressed)
Handles mouse press events.
wstring getText()
Gets the text of the tooltip.
void show(Component *parent, int width=200, int height=70)
Shows the tooltip at position.
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Retrieves options needed to create the tooltip window.
void setInfo(const wstring &text, const ButtonType &color=ButtonType::INFO)
Sets the text and colors of the tooltip.
void windowCreated()
Called after the window has been successfully created.
void onWindowResized()
Called when the window has been resized.
ToolTip()
Constructs a ToolTip component.
void onPaint(Graphics *g)
Paints the tooltip to the provided device context.
void onTimer(unsigned int timerId)
Called on timer events.