IonicWind Software

Aurora Compiler => Coding Help - Aurora 101 => Topic started by: ExMember001 on June 23, 2007, 08:17:02 PM

Title: How to use Ctooltip
Post by: ExMember001 on June 23, 2007, 08:17:02 PM
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.
Title: Re: How to use Ctooltip
Post by: Bruce Peaslee on June 24, 2007, 11:49:40 AM
See tabctrl_demo2.src in the Aurora examples for usage.
Title: Re: How to use Ctooltip
Post by: ExMember001 on June 24, 2007, 02:18:10 PM
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
Title: Re: How to use Ctooltip
Post by: sapero on June 24, 2007, 05:04:21 PM
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();
}
}
Title: Re: How to use Ctooltip
Post by: ExMember001 on June 24, 2007, 05:44:44 PM
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();