summaryrefslogtreecommitdiff
path: root/widgettooltip.cpp
blob: 9c27267e06690e832e61a80d791246adb66de694 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <skygi/skygi.h>

#include "widgettooltip.h"

CTooltip::CTooltip() {
	this->hWnd = NULL;
	this->PopupTime = 0;
	memset(this->Text, '\0', sizeof(this->Text));
}

HRESULT CTooltip::Create(HANDLE parent, HANDLE owner, char * text, unsigned int popuptime) {
	this->hWnd = GI_WidgetTooltipCreate(parent, owner, text, popuptime);
	strncpy(this->Text, text, strlen(this->Text));
	this->PopupTime = popuptime;
	if (this->hWnd) {
		return S_OK;
	}
	return E_HANDLE;
}

HRESULT CTooltip::Enable() {
	return GI_WidgetTooltipEnable(this->hWnd);
}

HRESULT CTooltip::Disable() {
	return GI_WidgetTooltipDisable(this->hWnd);
}

HRESULT	CTooltip::SetText(char * text) {
	memset(this->Text, '\0', sizeof(this->Text));
	strncpy(this->Text, text, 63);
	return GI_WidgetTooltipSet(this->hWnd, text, this->PopupTime);
}

char * CTooltip::GetText() {
	return this->Text;
}

HRESULT	CTooltip::SetPopupTime(unsigned int popuptime) {
	this->PopupTime = popuptime;
	return GI_WidgetTooltipSet(this->hWnd, this->Text, popuptime);
}

unsigned int	CTooltip::GetPopupTime() {
	return this->PopupTime;
}