Hi,
i try to set tooltips to my controls, the problem is that i dont understand how to use it.
anyone can show me a little example on how to set a tooltip to a button? Please.
See tabctrl_demo2.src in the Aurora examples for usage.
sorry but nothing related to ctooltip there ;)
my tooltips for my toolbar work but i want to set a tooltip to a simple button with the class ctooltip
how do i do that?
i'm initialising the tooltips after the button creation with
ctooltip tp;
tp.initialize(this);
then i'm adding an hint with addhint(...)
tp.AddHint(this, PButton_C, "Centrer le text");
but the tooltips doesnt show when my mouse hover the button
Hello, here's the simplest example:#include "windows.inc"
#include "commctrl.inc"
#define IDC_TT1 1000
#define IDC_TT2 1001
class CDlg:CDialog
{
declare OnInitDialog(),int;
declare OnClose(),int;
declare OnControl(int nID, int nNotifyCode, unsigned int hControl),int;
CTooltip m_tt;
}
global sub main()
{
CDlg dlg;
dlg.Create(0,0,300,98,0x80CB0880,0,"Tooltip Demo",0);
dlg.AddControl(CTBUTTON,"Tooltip 1",47,27,91,39,0x50010000,0x0,IDC_TT1);
dlg.AddControl(CTBUTTON,"Tooltip 2",169,28,91,39,0x50010000,0x0,IDC_TT2);
dlg.DoModal();
}
CDlg::OnClose(),int
{
CloseDialog(1);
}
CDlg::OnInitDialog(),int
{
m_tt.Create(0x80000000,0x80000000,0x80000000,0x80000000, WS_POPUP,0,"",this);
m_tt.AddHint(this, GetControl(IDC_TT1)->m_hwnd, "this is hint 1", TTF_IDISHWND | TTF_SUBCLASS);
m_tt.AddHint(this, GetControl(IDC_TT2)->m_hwnd, "this is hint 2", TTF_IDISHWND | TTF_SUBCLASS);
}
CDlg::OnControl(int nID, int nNotifyCode, unsigned int hControl),int
{
switch (nID)
{
case IDCANCEL:
OnClose();
}
}
thanx Sapero, i was near... my code was missing the TTF_IDISHWND|TTF_SUBCLASS
works great now using it with m_tt.Initialize(this); instead of create();