Author: everaldo
Date: 2007-03-29 08:41:09 -0500 (Thu, 29 Mar 2007)
New Revision: 75138
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NotifyIcon.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
Log:
* XplatUIX11.cs: Prevent system to open more than one balloon.
* NotifyIcon.cs: Prevent system to open more than one balloon and remove
some compiler warning messages.
2007-03-28 Everaldo Canuto <[EMAIL PROTECTED]>
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-03-29 13:37:36 UTC (rev 75137)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-03-29 13:41:09 UTC (rev 75138)
@@ -1,5 +1,12 @@
2007-03-28 Everaldo Canuto <[EMAIL PROTECTED]>
+ * XplatUIX11.cs: Prevent system to open more than one balloon.
+
+ * NotifyIcon.cs: Prevent system to open more than one balloon and remove
+ some compiler warning messages.
+
+2007-03-28 Everaldo Canuto <[EMAIL PROTECTED]>
+
[Fixes #79149]
* XplatUIX11.cs: Implement SystrayBalloon for X11 systems.
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NotifyIcon.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NotifyIcon.cs
2007-03-29 13:37:36 UTC (rev 75137)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NotifyIcon.cs
2007-03-29 13:41:09 UTC (rev 75138)
@@ -263,7 +263,22 @@
timer.Enabled = false;
timer.Tick += new EventHandler (HandleTimer);
}
+
+ protected override void Dispose (bool disposing)
+ {
+ if (disposing) {
+ timer.Stop();
+ timer.Dispose();
+ }
+ base.Dispose (disposing);
+ }
+
+ public new void Close () {
+ base.Close ();
+ XplatUI.SendMessage (owner, Msg.WM_USER,
IntPtr.Zero, (IntPtr) Msg.NIN_BALLOONHIDE);
+ }
+
protected override void OnShown (EventArgs e)
{
base.OnShown (e);
@@ -289,21 +304,20 @@
// To be used when we have a "close button" inside
balloon.
//private void HandleClick (object sender, EventArgs e)
//{
- // XplatUI.SendMessage (owner, Msg.WM_USER,
IntPtr.Zero, (IntPtr) Msg.NIN_BALLOONHIDE);
// Close ();
//}
private void HandleMouseDown (object sender,
MouseEventArgs e)
{
XplatUI.SendMessage (owner, Msg.WM_USER,
IntPtr.Zero, (IntPtr) Msg.NIN_BALLOONUSERCLICK);
- Close ();
+ base.Close ();
}
private void HandleTimer (object sender, EventArgs e)
{
timer.Stop ();
XplatUI.SendMessage (owner, Msg.WM_USER,
IntPtr.Zero, (IntPtr) Msg.NIN_BALLOONTIMEOUT);
- Close ();
+ base.Close ();
}
internal StringFormat Format {
@@ -327,7 +341,7 @@
}
}
- public string Text {
+ public override string Text {
get { return this.text; }
set {
if (value == this.text)
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
2007-03-29 13:37:36 UTC (rev 75137)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
2007-03-29 13:41:09 UTC (rev 75138)
@@ -5406,6 +5406,8 @@
}
#if NET_2_0
+ NotifyIcon.BalloonWindow balloon_window;
+
internal override void SystrayBalloon(IntPtr handle, int
timeout, string title, string text, ToolTipIcon icon)
{
Control control = Control.FromHandle(handle);
@@ -5413,11 +5415,16 @@
if (control == null)
return;
- NotifyIcon.BalloonWindow form = new
NotifyIcon.BalloonWindow (handle);
- form.Title = title;
- form.Text = text;
- form.Timeout = timeout;
- form.Show ();
+ if (balloon_window != null) {
+ balloon_window.Close ();
+ balloon_window.Dispose ();
+ }
+
+ balloon_window = new NotifyIcon.BalloonWindow (handle);
+ balloon_window.Title = title;
+ balloon_window.Text = text;
+ balloon_window.Timeout = timeout;
+ balloon_window.Show ();
SendMessage(handle, Msg.WM_USER, IntPtr.Zero, (IntPtr)
Msg.NIN_BALLOONSHOW);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches