}
+#if NET_2_0
+ public MainMenu (IContainer container) : this ()
+ {
+ container.Add (this);
+ }
+#endif
+
#region Public Properties
[Localizable(true)]
+#if NET_2_0
+ [AmbientValue (RightToLeft.Inherit)]
+#endif
public virtual RightToLeft RightToLeft {
get { return right_to_left;}
set { right_to_left = value; }
ThemeEngine.Current.DrawMenuBar (pe.Graphics, this, rect);
- if (Paint != null)
- Paint (this, pe);
+ PaintEventHandler eh = (PaintEventHandler)(Events [PaintEvent]);
+ if (eh != null)
+ eh (this, pe);
}
internal override void InvalidateItem (MenuItem item)
if (form == null)
return;
- /* this is a disgusting hack. this code.. ugh. */
- Rectangle r = Rect;
+ Rectangle clip = Rect;
Height = 0; /* need this so the theme code will re-layout the menu items
(why is the theme code doing the layout? argh) */
- form.Invalidate (r);
+ Draw (clip);
}
/* Mouse events from the form */
tracker.OnMotion (args);
}
- internal event PaintEventHandler Paint;
+ static object PaintEvent = new object ();
+
+ internal event PaintEventHandler Paint {
+ add { Events.AddHandler (PaintEvent, value); }
+ remove { Events.RemoveHandler (PaintEvent, value); }
+ }
#endregion Private Methods
}