Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Balloon Tool Tips in SystemTray
Balloon Tool Tips in SystemTray [message #437792] Thu, 10 June 2004 11:46 Go to next message
Eclipse UserFriend
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 11:49 Go to previous messageGo to next message
Eclipse UserFriend
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 13:13 Go to previous messageGo to next message
Eclipse UserFriend
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 14:03 Go to previous messageGo to next message
Eclipse UserFriend
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 11:59 Go to previous message
Eclipse UserFriend
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: Sat Jul 05 01:50:04 EDT 2025

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

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

Back to the top