Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Balloon Tool Tips in SystemTray
Balloon Tool Tips in SystemTray [message #437792] Thu, 10 June 2004 15:46 Go to next message
Vadalus is currently offline VadalusFriend
Messages: 24
Registered: July 2009
Junior Member
Hi All,

Does anyone know whether Balloon Text Tips are intended to be inluded in
the 3.0 release of eclipse. Seems like a small extension to the
SysTray/TrayItem stuff and is extremly useful.

It can be added quite simple (for win32 anyway) via:

public void setBalloonText (int iconState, String title, String text,
int msTimeout) {
checkWidget ();
if (OS.IsWinCE) return;
NOTIFYICONDATA iconData = OS.IsUnicode ? (NOTIFYICONDATA) new
NOTIFYICONDATAW () : new NOTIFYICONDATAA ();
TCHAR buffer1 = new TCHAR (0, title == null ? "" : title, true);
TCHAR buffer2 = new TCHAR (0, text == null ? "" : text, true);
/*
* Note that the size of the szTip field is different
* in version 5.0 of shell32.dll.
*/
int length1 = OS.SHELL32_MAJOR < 5 ? 64 : 128;
int length2 = OS.SHELL32_MAJOR < 5 ? 64 : 128;

if (OS.IsUnicode) {
char [] szInfo = ((NOTIFYICONDATAW) iconData).szInfo;
char [] szInfoTitle = ((NOTIFYICONDATAW) iconData).szInfoTitle;
length1 = Math.min (length1 - 1, buffer1.length ());
System.arraycopy (buffer1.chars, 0, szInfoTitle, 0, length1);
length2 = Math.min (length2 - 1, buffer2.length ());
System.arraycopy (buffer2.chars, 0, szInfo, 0, length2);
} else {
byte [] szInfo = ((NOTIFYICONDATAA) iconData).szInfo;
byte [] szInfoTitle = ((NOTIFYICONDATAA) iconData).szInfoTitle;
length1 = Math.min (length1 - 1, buffer1.length ());
System.arraycopy (buffer1.bytes, 0, szInfoTitle, 0, length1);
length2 = Math.min (length2 - 1, buffer2.length ());
System.arraycopy (buffer2.bytes, 0, szInfo, 0, length2);
}
iconData.cbSize = NOTIFYICONDATA.sizeof;
iconData.uID = id;
iconData.hWnd = display.hwndMessage;
iconData.uFlags = OS.NIF_INFO;
iconData.dwInfoFlags = iconState;
iconData.uVersion = msTimeout;

OS.Shell_NotifyIcon (OS.NIM_MODIFY, iconData);
}
Re: Balloon Tool Tips in SystemTray [message #437793 is a reply to message #437792] Thu, 10 June 2004 15:49 Go to previous messageGo to next message
Vadalus is currently offline VadalusFriend
Messages: 24
Registered: July 2009
Junior Member
oops, looks as though the timeout stuff does not work. Another field
(uTimeout) needs to be added to NOTIFYICONDATA

As per

typedef struct _NOTIFYICONDATA {
DWORD cbSize;
HWND hWnd;
UINT uID;
UINT uFlags;
UINT uCallbackMessage;
HICON hIcon;
TCHAR szTip[64];
DWORD dwState;
DWORD dwStateMask;
TCHAR szInfo[256];
union {
UINT uTimeout;
UINT uVersion;
};
TCHAR szInfoTitle[64];
DWORD dwInfoFlags;
GUID guidItem;
} NOTIFYICONDATA, *PNOTIFYICONDATA;


Vadalus wrote:

> Hi All,
>
> Does anyone know whether Balloon Text Tips are intended to be inluded in
> the 3.0 release of eclipse. Seems like a small extension to the
> SysTray/TrayItem stuff and is extremly useful.
>
> It can be added quite simple (for win32 anyway) via:
>
> public void setBalloonText (int iconState, String title, String text,
> int msTimeout) {
> checkWidget ();
> if (OS.IsWinCE) return;
> NOTIFYICONDATA iconData = OS.IsUnicode ? (NOTIFYICONDATA) new
> NOTIFYICONDATAW () : new NOTIFYICONDATAA ();
> TCHAR buffer1 = new TCHAR (0, title == null ? "" : title, true);
> TCHAR buffer2 = new TCHAR (0, text == null ? "" : text, true);
> /*
> * Note that the size of the szTip field is different
> * in version 5.0 of shell32.dll.
> */
> int length1 = OS.SHELL32_MAJOR < 5 ? 64 : 128;
> int length2 = OS.SHELL32_MAJOR < 5 ? 64 : 128;
>
> if (OS.IsUnicode) {
> char [] szInfo = ((NOTIFYICONDATAW) iconData).szInfo;
> char [] szInfoTitle = ((NOTIFYICONDATAW) iconData).szInfoTitle;
> length1 = Math.min (length1 - 1, buffer1.length ());
> System.arraycopy (buffer1.chars, 0, szInfoTitle, 0, length1);
> length2 = Math.min (length2 - 1, buffer2.length ());
> System.arraycopy (buffer2.chars, 0, szInfo, 0, length2);
> } else {
> byte [] szInfo = ((NOTIFYICONDATAA) iconData).szInfo;
> byte [] szInfoTitle = ((NOTIFYICONDATAA) iconData).szInfoTitle;
> length1 = Math.min (length1 - 1, buffer1.length ());
> System.arraycopy (buffer1.bytes, 0, szInfoTitle, 0, length1);
> length2 = Math.min (length2 - 1, buffer2.length ());
> System.arraycopy (buffer2.bytes, 0, szInfo, 0, length2);
> }
> iconData.cbSize = NOTIFYICONDATA.sizeof;
> iconData.uID = id;
> iconData.hWnd = display.hwndMessage;
> iconData.uFlags = OS.NIF_INFO;
> iconData.dwInfoFlags = iconState;
> iconData.uVersion = msTimeout;
>
> OS.Shell_NotifyIcon (OS.NIM_MODIFY, iconData);
> }
Re: Balloon Tool Tips in SystemTray [message #437824 is a reply to message #437793] Thu, 10 June 2004 17:13 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Not for 3.0. Enter a buzilla report. I'm not sure all platforms have them.
Can you use the tool top instead?

"Vadalus" <news@vadalus.com> wrote in message
news:ca9ve6$jer$1@eclipse.org...
> oops, looks as though the timeout stuff does not work. Another field
> (uTimeout) needs to be added to NOTIFYICONDATA
>
> As per
>
> typedef struct _NOTIFYICONDATA {
> DWORD cbSize;
> HWND hWnd;
> UINT uID;
> UINT uFlags;
> UINT uCallbackMessage;
> HICON hIcon;
> TCHAR szTip[64];
> DWORD dwState;
> DWORD dwStateMask;
> TCHAR szInfo[256];
> union {
> UINT uTimeout;
> UINT uVersion;
> };
> TCHAR szInfoTitle[64];
> DWORD dwInfoFlags;
> GUID guidItem;
> } NOTIFYICONDATA, *PNOTIFYICONDATA;
>
>
> Vadalus wrote:
>
> > Hi All,
> >
> > Does anyone know whether Balloon Text Tips are intended to be inluded in
> > the 3.0 release of eclipse. Seems like a small extension to the
> > SysTray/TrayItem stuff and is extremly useful.
> >
> > It can be added quite simple (for win32 anyway) via:
> >
> > public void setBalloonText (int iconState, String title, String text,
> > int msTimeout) {
> > checkWidget ();
> > if (OS.IsWinCE) return;
> > NOTIFYICONDATA iconData = OS.IsUnicode ? (NOTIFYICONDATA) new
> > NOTIFYICONDATAW () : new NOTIFYICONDATAA ();
> > TCHAR buffer1 = new TCHAR (0, title == null ? "" : title, true);
> > TCHAR buffer2 = new TCHAR (0, text == null ? "" : text, true);
> > /*
> > * Note that the size of the szTip field is different
> > * in version 5.0 of shell32.dll.
> > */
> > int length1 = OS.SHELL32_MAJOR < 5 ? 64 : 128;
> > int length2 = OS.SHELL32_MAJOR < 5 ? 64 : 128;
> >
> > if (OS.IsUnicode) {
> > char [] szInfo = ((NOTIFYICONDATAW) iconData).szInfo;
> > char [] szInfoTitle = ((NOTIFYICONDATAW) iconData).szInfoTitle;
> > length1 = Math.min (length1 - 1, buffer1.length ());
> > System.arraycopy (buffer1.chars, 0, szInfoTitle, 0, length1);
> > length2 = Math.min (length2 - 1, buffer2.length ());
> > System.arraycopy (buffer2.chars, 0, szInfo, 0, length2);
> > } else {
> > byte [] szInfo = ((NOTIFYICONDATAA) iconData).szInfo;
> > byte [] szInfoTitle = ((NOTIFYICONDATAA) iconData).szInfoTitle;
> > length1 = Math.min (length1 - 1, buffer1.length ());
> > System.arraycopy (buffer1.bytes, 0, szInfoTitle, 0, length1);
> > length2 = Math.min (length2 - 1, buffer2.length ());
> > System.arraycopy (buffer2.bytes, 0, szInfo, 0, length2);
> > }
> > iconData.cbSize = NOTIFYICONDATA.sizeof;
> > iconData.uID = id;
> > iconData.hWnd = display.hwndMessage;
> > iconData.uFlags = OS.NIF_INFO;
> > iconData.dwInfoFlags = iconState;
> > iconData.uVersion = msTimeout;
> >
> > OS.Shell_NotifyIcon (OS.NIM_MODIFY, iconData);
> > }
Re: Balloon Tool Tips in SystemTray [message #437836 is a reply to message #437824] Thu, 10 June 2004 18:03 Go to previous messageGo to next message
Vadalus is currently offline VadalusFriend
Messages: 24
Registered: July 2009
Junior Member
not for notification purposes, no. Tool tips (which is what I presume
you meant) do not "pop-up".

L

Steve Northover wrote:

> Not for 3.0. Enter a buzilla report. I'm not sure all platforms have them.
> Can you use the tool top instead?
>
> "Vadalus" <news@vadalus.com> wrote in message
> news:ca9ve6$jer$1@eclipse.org...
>
>>oops, looks as though the timeout stuff does not work. Another field
>>(uTimeout) needs to be added to NOTIFYICONDATA
>>
>>As per
>>
>>typedef struct _NOTIFYICONDATA {
>> DWORD cbSize;
>> HWND hWnd;
>> UINT uID;
>> UINT uFlags;
>> UINT uCallbackMessage;
>> HICON hIcon;
>> TCHAR szTip[64];
>> DWORD dwState;
>> DWORD dwStateMask;
>> TCHAR szInfo[256];
>> union {
>> UINT uTimeout;
>> UINT uVersion;
>> };
>> TCHAR szInfoTitle[64];
>> DWORD dwInfoFlags;
>> GUID guidItem;
>>} NOTIFYICONDATA, *PNOTIFYICONDATA;
>>
>>
>>Vadalus wrote:
>>
>>
>>>Hi All,
>>>
>>>Does anyone know whether Balloon Text Tips are intended to be inluded in
>>>the 3.0 release of eclipse. Seems like a small extension to the
>>>SysTray/TrayItem stuff and is extremly useful.
>>>
>>>It can be added quite simple (for win32 anyway) via:
>>>
>>>public void setBalloonText (int iconState, String title, String text,
>>>int msTimeout) {
>>> checkWidget ();
>>> if (OS.IsWinCE) return;
>>> NOTIFYICONDATA iconData = OS.IsUnicode ? (NOTIFYICONDATA) new
>>>NOTIFYICONDATAW () : new NOTIFYICONDATAA ();
>>> TCHAR buffer1 = new TCHAR (0, title == null ? "" : title, true);
>>> TCHAR buffer2 = new TCHAR (0, text == null ? "" : text, true);
>>> /*
>>> * Note that the size of the szTip field is different
>>> * in version 5.0 of shell32.dll.
>>> */
>>> int length1 = OS.SHELL32_MAJOR < 5 ? 64 : 128;
>>> int length2 = OS.SHELL32_MAJOR < 5 ? 64 : 128;
>>>
>>> if (OS.IsUnicode) {
>>> char [] szInfo = ((NOTIFYICONDATAW) iconData).szInfo;
>>> char [] szInfoTitle = ((NOTIFYICONDATAW) iconData).szInfoTitle;
>>> length1 = Math.min (length1 - 1, buffer1.length ());
>>> System.arraycopy (buffer1.chars, 0, szInfoTitle, 0, length1);
>>> length2 = Math.min (length2 - 1, buffer2.length ());
>>> System.arraycopy (buffer2.chars, 0, szInfo, 0, length2);
>>> } else {
>>> byte [] szInfo = ((NOTIFYICONDATAA) iconData).szInfo;
>>> byte [] szInfoTitle = ((NOTIFYICONDATAA) iconData).szInfoTitle;
>>> length1 = Math.min (length1 - 1, buffer1.length ());
>>> System.arraycopy (buffer1.bytes, 0, szInfoTitle, 0, length1);
>>> length2 = Math.min (length2 - 1, buffer2.length ());
>>> System.arraycopy (buffer2.bytes, 0, szInfo, 0, length2);
>>> }
>>> iconData.cbSize = NOTIFYICONDATA.sizeof;
>>> iconData.uID = id;
>>> iconData.hWnd = display.hwndMessage;
>>> iconData.uFlags = OS.NIF_INFO;
>>> iconData.dwInfoFlags = iconState;
>>> iconData.uVersion = msTimeout;
>>>
>>> OS.Shell_NotifyIcon (OS.NIM_MODIFY, iconData);
>>>}
>
>
>
Re: Balloon Tool Tips in SystemTray [message #437869 is a reply to message #437836] Fri, 11 June 2004 15:59 Go to previous message
Matthew Hatem is currently offline Matthew HatemFriend
Messages: 47
Registered: July 2009
Member
I agree. Balloon tips are quite useful but are win32 specific. Gnome
and KDE do not support balloon tips in notification icons yet, however
the specification defined at opendesktop.org does describe how they
should be supported.

I could see supporting the "Plain" style balloon tip on windows, and
emulating this on Gnome and KDE using a shell with a region defined to
make it look similar to the Windows balloons. GTK should give you
enough info to place the balloon and even trace it to the trayicon to
which it belongs.

-m@

Vadalus wrote:

> not for notification purposes, no. Tool tips (which is what I presume
> you meant) do not "pop-up".
>
> L
>
> Steve Northover wrote:
>
>> Not for 3.0. Enter a buzilla report. I'm not sure all platforms have
>> them.
>> Can you use the tool top instead?
>>
>> "Vadalus" <news@vadalus.com> wrote in message
>> news:ca9ve6$jer$1@eclipse.org...
>>
>>> oops, looks as though the timeout stuff does not work. Another field
>>> (uTimeout) needs to be added to NOTIFYICONDATA
>>>
>>> As per
>>>
>>> typedef struct _NOTIFYICONDATA {
>>> DWORD cbSize;
>>> HWND hWnd;
>>> UINT uID;
>>> UINT uFlags;
>>> UINT uCallbackMessage;
>>> HICON hIcon;
>>> TCHAR szTip[64];
>>> DWORD dwState;
>>> DWORD dwStateMask;
>>> TCHAR szInfo[256];
>>> union {
>>> UINT uTimeout;
>>> UINT uVersion;
>>> };
>>> TCHAR szInfoTitle[64];
>>> DWORD dwInfoFlags;
>>> GUID guidItem;
>>> } NOTIFYICONDATA, *PNOTIFYICONDATA;
>>>
>>>
>>> Vadalus wrote:
>>>
>>>
>>>> Hi All,
>>>>
>>>> Does anyone know whether Balloon Text Tips are intended to be
>>>> inluded in
>>>> the 3.0 release of eclipse. Seems like a small extension to the
>>>> SysTray/TrayItem stuff and is extremly useful.
>>>>
>>>> It can be added quite simple (for win32 anyway) via:
>>>>
>>>> public void setBalloonText (int iconState, String title, String text,
>>>> int msTimeout) {
>>>> checkWidget ();
>>>> if (OS.IsWinCE) return;
>>>> NOTIFYICONDATA iconData = OS.IsUnicode ? (NOTIFYICONDATA) new
>>>> NOTIFYICONDATAW () : new NOTIFYICONDATAA ();
>>>> TCHAR buffer1 = new TCHAR (0, title == null ? "" : title, true);
>>>> TCHAR buffer2 = new TCHAR (0, text == null ? "" : text, true);
>>>> /*
>>>> * Note that the size of the szTip field is different
>>>> * in version 5.0 of shell32.dll.
>>>> */
>>>> int length1 = OS.SHELL32_MAJOR < 5 ? 64 : 128;
>>>> int length2 = OS.SHELL32_MAJOR < 5 ? 64 : 128;
>>>>
>>>> if (OS.IsUnicode) {
>>>> char [] szInfo = ((NOTIFYICONDATAW) iconData).szInfo;
>>>> char [] szInfoTitle = ((NOTIFYICONDATAW) iconData).szInfoTitle;
>>>> length1 = Math.min (length1 - 1, buffer1.length ());
>>>> System.arraycopy (buffer1.chars, 0, szInfoTitle, 0, length1);
>>>> length2 = Math.min (length2 - 1, buffer2.length ());
>>>> System.arraycopy (buffer2.chars, 0, szInfo, 0, length2);
>>>> } else {
>>>> byte [] szInfo = ((NOTIFYICONDATAA) iconData).szInfo;
>>>> byte [] szInfoTitle = ((NOTIFYICONDATAA) iconData).szInfoTitle;
>>>> length1 = Math.min (length1 - 1, buffer1.length ());
>>>> System.arraycopy (buffer1.bytes, 0, szInfoTitle, 0, length1);
>>>> length2 = Math.min (length2 - 1, buffer2.length ());
>>>> System.arraycopy (buffer2.bytes, 0, szInfo, 0, length2);
>>>> }
>>>> iconData.cbSize = NOTIFYICONDATA.sizeof;
>>>> iconData.uID = id;
>>>> iconData.hWnd = display.hwndMessage;
>>>> iconData.uFlags = OS.NIF_INFO;
>>>> iconData.dwInfoFlags = iconState;
>>>> iconData.uVersion = msTimeout;
>>>>
>>>> OS.Shell_NotifyIcon (OS.NIM_MODIFY, iconData);
>>>> }
>>
>>
>>
>>
Previous Topic:getSWTImage returning null for SWT.ICON_ERROR
Next Topic:How to remove a MenuItem
Goto Forum:
  


Current Time: Thu Apr 25 20:10:48 GMT 2024

Powered by FUDForum. Page generated in 0.03137 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top