Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added the generated files

  • Loading branch information...
commit 2ffd300aa82203d84d5ec65cf34b2bedaad814a0 1 parent ac28f7a
James Clancey authored
1  .gitignore
View
@@ -20,7 +20,6 @@ Thumbs.db
*.ilk
*.log
*.pidb
-*.g.cs
.svn
[Bb]in
[Dd]ebug*/
1,240 MonoMac.Windows.Forms/Templates/ControlTemplate.g.cs
View
@@ -0,0 +1,1240 @@
+using System;
+using System.Collections;
+using System.Linq;
+using MonoMac.AppKit;
+using System.Drawing;
+using MonoMac.Foundation;
+namespace System.Windows.Forms
+{
+ public partial class UserControl
+ {
+ public string Name { get; set; }
+ public SizeF Size {
+ get { return this.Frame.Size; }
+ set { this.Frame = new RectangleF (this.Frame.Location, value); }
+ }
+
+ public PointF Location {
+ get { return this.Frame.Location; }
+ set { this.Frame = new RectangleF (value, this.Frame.Size); }
+ }
+
+ public bool Visible{
+ get{ return Hidden;}
+ set {Hidden = value;}
+ }
+ public Rectangle ClientRectangle
+ {
+ get{ return Rectangle.Round(this.Bounds);}
+ set{ this.Bounds = value;}
+ }
+ public SizeF ClientSize
+ {
+ get {return this.Bounds.Size;}
+ set {this.SetBoundsSize(value);}
+ }
+ public float Width
+ {
+ get{return this.Size.Width;}
+ set {this.Size = new SizeF(value,this.Size.Height);}
+ }
+
+ public float Height
+ {
+ get{return this.Size.Height;}
+ set {this.Size = new SizeF(this.Size.Width,value);}
+ }
+
+ public AnchorStyles Anchor {get;set;}
+ public BorderStyle BorderStyle{get;set;}
+
+
+ public bool Focused
+ {
+ get {
+ if(this.CurrentEditor == null)
+ return false;
+ return this.Window.FirstResponder == this.CurrentEditor;}
+ }
+
+ public virtual void Refresh()
+ {
+ this.Display();
+ }
+
+
+ public virtual void Invalidate()
+ {
+ this.SetNeedsDisplay();
+ }
+
+ public void Focus()
+ {
+ this.BecomeFirstResponder();
+ }
+ public virtual void Invalidate(Region region)
+ {
+ var rect = region.GetBounds(Graphics.FromHwnd (this.Handle));
+ this.SetNeedsDisplayInRect(rect);
+ }
+
+ [Obsolete("Not Implemented.", false)]
+ public int TabIndex {get;set;}
+
+ [Obsolete("Not Implemented.", false)]
+ public AutoScaleMode AutoScaleMode {get;set;}
+
+ public event EventHandler AutoSizeChanged;
+ public event EventHandler AutoValidateChanged;
+ public event EventHandler GotFocus;
+ public event EventHandler SizeChanged;
+
+ #region Mouse
+
+ // Mouse Down
+ public override void FireMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Up
+ public override void FireMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Move
+ public override void FireMouseMoved (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+
+ }
+
+ public override void FireScrollWheel (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseWheel!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+
+ public override void FireMouseEntered (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseEnter!= null)
+ MouseEnter(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireMouseExited(NSEvent theEvent)
+ {
+ if(MouseLeave != null)
+ MouseLeave(this,new EventArgs());
+ }
+ public override void FireMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireRightMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public event MouseEventHandler MouseDown;
+ public event MouseEventHandler MouseUp;
+ public event MouseEventHandler MouseMove;
+ public event MouseEventHandler MouseDoubleClick;
+ public event MouseEventHandler MouseWheel;
+ public event EventHandler MouseEnter;
+ public event EventHandler MouseHover;
+ public event EventHandler MouseLeave;
+
+ #endregion
+
+ }
+
+
+ public partial class Button
+ {
+ public string Name { get; set; }
+ public SizeF Size {
+ get { return this.Frame.Size; }
+ set { this.Frame = new RectangleF (this.Frame.Location, value); }
+ }
+
+ public PointF Location {
+ get { return this.Frame.Location; }
+ set { this.Frame = new RectangleF (value, this.Frame.Size); }
+ }
+
+ public bool Visible{
+ get{ return Hidden;}
+ set {Hidden = value;}
+ }
+ public Rectangle ClientRectangle
+ {
+ get{ return Rectangle.Round(this.Bounds);}
+ set{ this.Bounds = value;}
+ }
+ public SizeF ClientSize
+ {
+ get {return this.Bounds.Size;}
+ set {this.SetBoundsSize(value);}
+ }
+ public float Width
+ {
+ get{return this.Size.Width;}
+ set {this.Size = new SizeF(value,this.Size.Height);}
+ }
+
+ public float Height
+ {
+ get{return this.Size.Height;}
+ set {this.Size = new SizeF(this.Size.Width,value);}
+ }
+
+ public AnchorStyles Anchor {get;set;}
+ public BorderStyle BorderStyle{get;set;}
+
+
+ public bool Focused
+ {
+ get {
+ if(this.CurrentEditor == null)
+ return false;
+ return this.Window.FirstResponder == this.CurrentEditor;}
+ }
+
+ public virtual void Refresh()
+ {
+ this.Display();
+ }
+
+
+ public virtual void Invalidate()
+ {
+ this.SetNeedsDisplay();
+ }
+
+ public void Focus()
+ {
+ this.BecomeFirstResponder();
+ }
+ public virtual void Invalidate(Region region)
+ {
+ var rect = region.GetBounds(Graphics.FromHwnd (this.Handle));
+ this.SetNeedsDisplayInRect(rect);
+ }
+
+ [Obsolete("Not Implemented.", false)]
+ public int TabIndex {get;set;}
+
+ [Obsolete("Not Implemented.", false)]
+ public AutoScaleMode AutoScaleMode {get;set;}
+
+ public event EventHandler AutoSizeChanged;
+ public event EventHandler AutoValidateChanged;
+ public event EventHandler GotFocus;
+ public event EventHandler SizeChanged;
+
+ #region Mouse
+
+ // Mouse Down
+ public override void FireMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Up
+ public override void FireMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Move
+ public override void FireMouseMoved (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+
+ }
+
+ public override void FireScrollWheel (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseWheel!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+
+ public override void FireMouseEntered (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseEnter!= null)
+ MouseEnter(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireMouseExited(NSEvent theEvent)
+ {
+ if(MouseLeave != null)
+ MouseLeave(this,new EventArgs());
+ }
+ public override void FireMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireRightMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public event MouseEventHandler MouseDown;
+ public event MouseEventHandler MouseUp;
+ public event MouseEventHandler MouseMove;
+ public event MouseEventHandler MouseDoubleClick;
+ public event MouseEventHandler MouseWheel;
+ public event EventHandler MouseEnter;
+ public event EventHandler MouseHover;
+ public event EventHandler MouseLeave;
+
+ #endregion
+
+ }
+
+
+ public partial class TextBox
+ {
+ public string Name { get; set; }
+ public SizeF Size {
+ get { return this.Frame.Size; }
+ set { this.Frame = new RectangleF (this.Frame.Location, value); }
+ }
+
+ public PointF Location {
+ get { return this.Frame.Location; }
+ set { this.Frame = new RectangleF (value, this.Frame.Size); }
+ }
+
+ public bool Visible{
+ get{ return Hidden;}
+ set {Hidden = value;}
+ }
+ public Rectangle ClientRectangle
+ {
+ get{ return Rectangle.Round(this.Bounds);}
+ set{ this.Bounds = value;}
+ }
+ public SizeF ClientSize
+ {
+ get {return this.Bounds.Size;}
+ set {this.SetBoundsSize(value);}
+ }
+ public float Width
+ {
+ get{return this.Size.Width;}
+ set {this.Size = new SizeF(value,this.Size.Height);}
+ }
+
+ public float Height
+ {
+ get{return this.Size.Height;}
+ set {this.Size = new SizeF(this.Size.Width,value);}
+ }
+
+ public AnchorStyles Anchor {get;set;}
+ public BorderStyle BorderStyle{get;set;}
+
+
+ public bool Focused
+ {
+ get {
+ if(this.CurrentEditor == null)
+ return false;
+ return this.Window.FirstResponder == this.CurrentEditor;}
+ }
+
+ public virtual void Refresh()
+ {
+ this.Display();
+ }
+
+
+ public virtual void Invalidate()
+ {
+ this.SetNeedsDisplay();
+ }
+
+ public void Focus()
+ {
+ this.BecomeFirstResponder();
+ }
+ public virtual void Invalidate(Region region)
+ {
+ var rect = region.GetBounds(Graphics.FromHwnd (this.Handle));
+ this.SetNeedsDisplayInRect(rect);
+ }
+
+ [Obsolete("Not Implemented.", false)]
+ public int TabIndex {get;set;}
+
+ [Obsolete("Not Implemented.", false)]
+ public AutoScaleMode AutoScaleMode {get;set;}
+
+ public event EventHandler AutoSizeChanged;
+ public event EventHandler AutoValidateChanged;
+ public event EventHandler GotFocus;
+ public event EventHandler SizeChanged;
+
+ #region Mouse
+
+ // Mouse Down
+ public override void FireMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Up
+ public override void FireMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Move
+ public override void FireMouseMoved (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+
+ }
+
+ public override void FireScrollWheel (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseWheel!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+
+ public override void FireMouseEntered (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseEnter!= null)
+ MouseEnter(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireMouseExited(NSEvent theEvent)
+ {
+ if(MouseLeave != null)
+ MouseLeave(this,new EventArgs());
+ }
+ public override void FireMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireRightMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public event MouseEventHandler MouseDown;
+ public event MouseEventHandler MouseUp;
+ public event MouseEventHandler MouseMove;
+ public event MouseEventHandler MouseDoubleClick;
+ public event MouseEventHandler MouseWheel;
+ public event EventHandler MouseEnter;
+ public event EventHandler MouseHover;
+ public event EventHandler MouseLeave;
+
+ #endregion
+
+ }
+
+
+ public partial class ComboBox
+ {
+ public string Name { get; set; }
+ public SizeF Size {
+ get { return this.Frame.Size; }
+ set { this.Frame = new RectangleF (this.Frame.Location, value); }
+ }
+
+ public PointF Location {
+ get { return this.Frame.Location; }
+ set { this.Frame = new RectangleF (value, this.Frame.Size); }
+ }
+
+ public bool Visible{
+ get{ return Hidden;}
+ set {Hidden = value;}
+ }
+ public Rectangle ClientRectangle
+ {
+ get{ return Rectangle.Round(this.Bounds);}
+ set{ this.Bounds = value;}
+ }
+ public SizeF ClientSize
+ {
+ get {return this.Bounds.Size;}
+ set {this.SetBoundsSize(value);}
+ }
+ public float Width
+ {
+ get{return this.Size.Width;}
+ set {this.Size = new SizeF(value,this.Size.Height);}
+ }
+
+ public float Height
+ {
+ get{return this.Size.Height;}
+ set {this.Size = new SizeF(this.Size.Width,value);}
+ }
+
+ public AnchorStyles Anchor {get;set;}
+ public BorderStyle BorderStyle{get;set;}
+
+
+ public bool Focused
+ {
+ get {
+ if(this.CurrentEditor == null)
+ return false;
+ return this.Window.FirstResponder == this.CurrentEditor;}
+ }
+
+ public virtual void Refresh()
+ {
+ this.Display();
+ }
+
+
+ public virtual void Invalidate()
+ {
+ this.SetNeedsDisplay();
+ }
+
+ public void Focus()
+ {
+ this.BecomeFirstResponder();
+ }
+ public virtual void Invalidate(Region region)
+ {
+ var rect = region.GetBounds(Graphics.FromHwnd (this.Handle));
+ this.SetNeedsDisplayInRect(rect);
+ }
+
+ [Obsolete("Not Implemented.", false)]
+ public int TabIndex {get;set;}
+
+ [Obsolete("Not Implemented.", false)]
+ public AutoScaleMode AutoScaleMode {get;set;}
+
+ public event EventHandler AutoSizeChanged;
+ public event EventHandler AutoValidateChanged;
+ public event EventHandler GotFocus;
+ public event EventHandler SizeChanged;
+
+ #region Mouse
+
+ // Mouse Down
+ public override void FireMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Up
+ public override void FireMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Move
+ public override void FireMouseMoved (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+
+ }
+
+ public override void FireScrollWheel (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseWheel!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+
+ public override void FireMouseEntered (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseEnter!= null)
+ MouseEnter(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireMouseExited(NSEvent theEvent)
+ {
+ if(MouseLeave != null)
+ MouseLeave(this,new EventArgs());
+ }
+ public override void FireMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireRightMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public event MouseEventHandler MouseDown;
+ public event MouseEventHandler MouseUp;
+ public event MouseEventHandler MouseMove;
+ public event MouseEventHandler MouseDoubleClick;
+ public event MouseEventHandler MouseWheel;
+ public event EventHandler MouseEnter;
+ public event EventHandler MouseHover;
+ public event EventHandler MouseLeave;
+
+ #endregion
+
+ }
+
+
+ public partial class ListBox
+ {
+ public string Name { get; set; }
+ public SizeF Size {
+ get { return this.Frame.Size; }
+ set { this.Frame = new RectangleF (this.Frame.Location, value); }
+ }
+
+ public PointF Location {
+ get { return this.Frame.Location; }
+ set { this.Frame = new RectangleF (value, this.Frame.Size); }
+ }
+
+ public bool Visible{
+ get{ return Hidden;}
+ set {Hidden = value;}
+ }
+ public Rectangle ClientRectangle
+ {
+ get{ return Rectangle.Round(this.Bounds);}
+ set{ this.Bounds = value;}
+ }
+ public SizeF ClientSize
+ {
+ get {return this.Bounds.Size;}
+ set {this.SetBoundsSize(value);}
+ }
+ public float Width
+ {
+ get{return this.Size.Width;}
+ set {this.Size = new SizeF(value,this.Size.Height);}
+ }
+
+ public float Height
+ {
+ get{return this.Size.Height;}
+ set {this.Size = new SizeF(this.Size.Width,value);}
+ }
+
+ public AnchorStyles Anchor {get;set;}
+ public BorderStyle BorderStyle{get;set;}
+
+
+ public bool Focused
+ {
+ get {
+ if(this.CurrentEditor == null)
+ return false;
+ return this.Window.FirstResponder == this.CurrentEditor;}
+ }
+
+ public virtual void Refresh()
+ {
+ this.Display();
+ }
+
+
+ public virtual void Invalidate()
+ {
+ this.SetNeedsDisplay();
+ }
+
+ public void Focus()
+ {
+ this.BecomeFirstResponder();
+ }
+ public virtual void Invalidate(Region region)
+ {
+ var rect = region.GetBounds(Graphics.FromHwnd (this.Handle));
+ this.SetNeedsDisplayInRect(rect);
+ }
+
+ [Obsolete("Not Implemented.", false)]
+ public int TabIndex {get;set;}
+
+ [Obsolete("Not Implemented.", false)]
+ public AutoScaleMode AutoScaleMode {get;set;}
+
+ public event EventHandler AutoSizeChanged;
+ public event EventHandler AutoValidateChanged;
+ public event EventHandler GotFocus;
+ public event EventHandler SizeChanged;
+
+ #region Mouse
+
+ // Mouse Down
+ public override void FireMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Up
+ public override void FireMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Move
+ public override void FireMouseMoved (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+
+ }
+
+ public override void FireScrollWheel (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseWheel!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+
+ public override void FireMouseEntered (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseEnter!= null)
+ MouseEnter(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireMouseExited(NSEvent theEvent)
+ {
+ if(MouseLeave != null)
+ MouseLeave(this,new EventArgs());
+ }
+ public override void FireMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireRightMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public event MouseEventHandler MouseDown;
+ public event MouseEventHandler MouseUp;
+ public event MouseEventHandler MouseMove;
+ public event MouseEventHandler MouseDoubleClick;
+ public event MouseEventHandler MouseWheel;
+ public event EventHandler MouseEnter;
+ public event EventHandler MouseHover;
+ public event EventHandler MouseLeave;
+
+ #endregion
+
+ }
+
+
+ public partial class TrackBar
+ {
+ public string Name { get; set; }
+ public SizeF Size {
+ get { return this.Frame.Size; }
+ set { this.Frame = new RectangleF (this.Frame.Location, value); }
+ }
+
+ public PointF Location {
+ get { return this.Frame.Location; }
+ set { this.Frame = new RectangleF (value, this.Frame.Size); }
+ }
+
+ public bool Visible{
+ get{ return Hidden;}
+ set {Hidden = value;}
+ }
+ public Rectangle ClientRectangle
+ {
+ get{ return Rectangle.Round(this.Bounds);}
+ set{ this.Bounds = value;}
+ }
+ public SizeF ClientSize
+ {
+ get {return this.Bounds.Size;}
+ set {this.SetBoundsSize(value);}
+ }
+ public float Width
+ {
+ get{return this.Size.Width;}
+ set {this.Size = new SizeF(value,this.Size.Height);}
+ }
+
+ public float Height
+ {
+ get{return this.Size.Height;}
+ set {this.Size = new SizeF(this.Size.Width,value);}
+ }
+
+ public AnchorStyles Anchor {get;set;}
+ public BorderStyle BorderStyle{get;set;}
+
+
+ public bool Focused
+ {
+ get {
+ if(this.CurrentEditor == null)
+ return false;
+ return this.Window.FirstResponder == this.CurrentEditor;}
+ }
+
+ public virtual void Refresh()
+ {
+ this.Display();
+ }
+
+
+ public virtual void Invalidate()
+ {
+ this.SetNeedsDisplay();
+ }
+
+ public void Focus()
+ {
+ this.BecomeFirstResponder();
+ }
+ public virtual void Invalidate(Region region)
+ {
+ var rect = region.GetBounds(Graphics.FromHwnd (this.Handle));
+ this.SetNeedsDisplayInRect(rect);
+ }
+
+ [Obsolete("Not Implemented.", false)]
+ public int TabIndex {get;set;}
+
+ [Obsolete("Not Implemented.", false)]
+ public AutoScaleMode AutoScaleMode {get;set;}
+
+ public event EventHandler AutoSizeChanged;
+ public event EventHandler AutoValidateChanged;
+ public event EventHandler GotFocus;
+ public event EventHandler SizeChanged;
+
+ #region Mouse
+
+ // Mouse Down
+ public override void FireMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Up
+ public override void FireMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Move
+ public override void FireMouseMoved (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+
+ }
+
+ public override void FireScrollWheel (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseWheel!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+
+ public override void FireMouseEntered (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseEnter!= null)
+ MouseEnter(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireMouseExited(NSEvent theEvent)
+ {
+ if(MouseLeave != null)
+ MouseLeave(this,new EventArgs());
+ }
+ public override void FireMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireRightMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public event MouseEventHandler MouseDown;
+ public event MouseEventHandler MouseUp;
+ public event MouseEventHandler MouseMove;
+ public event MouseEventHandler MouseDoubleClick;
+ public event MouseEventHandler MouseWheel;
+ public event EventHandler MouseEnter;
+ public event EventHandler MouseHover;
+ public event EventHandler MouseLeave;
+
+ #endregion
+
+ }
+
+
+ public partial class Panel
+ {
+ public string Name { get; set; }
+ public SizeF Size {
+ get { return this.Frame.Size; }
+ set { this.Frame = new RectangleF (this.Frame.Location, value); }
+ }
+
+ public PointF Location {
+ get { return this.Frame.Location; }
+ set { this.Frame = new RectangleF (value, this.Frame.Size); }
+ }
+
+ public bool Visible{
+ get{ return Hidden;}
+ set {Hidden = value;}
+ }
+ public Rectangle ClientRectangle
+ {
+ get{ return Rectangle.Round(this.Bounds);}
+ set{ this.Bounds = value;}
+ }
+ public SizeF ClientSize
+ {
+ get {return this.Bounds.Size;}
+ set {this.SetBoundsSize(value);}
+ }
+ public float Width
+ {
+ get{return this.Size.Width;}
+ set {this.Size = new SizeF(value,this.Size.Height);}
+ }
+
+ public float Height
+ {
+ get{return this.Size.Height;}
+ set {this.Size = new SizeF(this.Size.Width,value);}
+ }
+
+ public AnchorStyles Anchor {get;set;}
+ public BorderStyle BorderStyle{get;set;}
+
+ public bool Focused
+ {
+ get {return this.Window.FirstResponder == this;}
+ }
+
+ public virtual void Refresh()
+ {
+ this.Display();
+ }
+
+
+ public virtual void Invalidate()
+ {
+ this.SetNeedsDisplayInRect(this.Frame);
+ }
+
+
+ public void Focus()
+ {
+ this.BecomeFirstResponder();
+ }
+ public virtual void Invalidate(Region region)
+ {
+ var rect = region.GetBounds(Graphics.FromHwnd (this.Handle));
+ this.SetNeedsDisplayInRect(rect);
+ }
+
+ [Obsolete("Not Implemented.", false)]
+ public int TabIndex {get;set;}
+
+ [Obsolete("Not Implemented.", false)]
+ public AutoScaleMode AutoScaleMode {get;set;}
+
+ public event EventHandler AutoSizeChanged;
+ public event EventHandler AutoValidateChanged;
+ public event EventHandler GotFocus;
+ public event EventHandler SizeChanged;
+
+ #region Mouse
+
+ // Mouse Down
+ public override void FireMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseDown (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseDown!= null)
+ MouseDown(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Up
+ public override void FireMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Right, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireOtherMouseUp (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseUp!= null)
+ MouseUp(this,new MouseEventArgs (MouseButtons.Middle, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ // Mouse Move
+ public override void FireMouseMoved (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+
+ }
+
+ public override void FireScrollWheel (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseWheel!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+
+ public override void FireMouseEntered (NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseEnter!= null)
+ MouseEnter(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireMouseExited(NSEvent theEvent)
+ {
+ if(MouseLeave != null)
+ MouseLeave(this,new EventArgs());
+ }
+ public override void FireMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public override void FireRightMouseDragged(NSEvent theEvent)
+ {
+ PointF point = this.ConvertPointfromView(theEvent.LocationInWindow,null);
+ if(MouseMove!= null)
+ MouseMove(this,new MouseEventArgs (MouseButtons.Left, theEvent.ClickCount, (int)point.X, (int)point.Y, 0));
+ }
+ public event MouseEventHandler MouseDown;
+ public event MouseEventHandler MouseUp;
+ public event MouseEventHandler MouseMove;
+ public event MouseEventHandler MouseDoubleClick;
+ public event MouseEventHandler MouseWheel;
+ public event EventHandler MouseEnter;
+ public event EventHandler MouseHover;
+ public event EventHandler MouseLeave;
+
+ #endregion
+
+ }
+
+
+}
+
+
1  MonoMac.Windows.Forms/Templates/DataGridColumn.g.cs
View
@@ -0,0 +1 @@
+
280 MonoMac.Windows.Forms/Templates/DrawingTemplate.g.cs
View
@@ -0,0 +1,280 @@
+using System;
+using System.Collections;
+using System.Linq;
+using MonoMac.AppKit;
+using System.Drawing;
+using MonoMac.Foundation;
+namespace System.Windows.Forms
+{
+ public partial class UserControl
+ {
+
+ public override void DrawRect (RectangleF dirtyRect)
+ {
+
+ using (var graphics = Graphics.FromHwnd(this.Handle))
+ {
+ var events = new PaintEventArgs(graphics,Rectangle.Round(dirtyRect));
+ OnPaintBackground(events);
+ OnPaint(events);
+ }
+ if(shouldDraw)
+ base.DrawRect(dirtyRect);
+ }
+
+ public bool shouldDraw;
+
+ public PaintEventHandler Paint { get; set; }
+ protected virtual void OnPaint(PaintEventArgs e)
+ {
+ if (Paint != null)
+ Paint (this, e);
+ shouldDraw = true;
+ }
+
+ protected virtual void OnPaintBackground(PaintEventArgs e)
+ {
+ if(BackColor == null)
+ BackColor = Color.Transparent;
+ if(BackColor == Color.Transparent)
+ return;
+ Pen pen = new Pen(BackColor);
+ e.Graphics.DrawRectangle(pen,e.ClipRectangle);
+ }
+ }
+
+
+ public partial class Button
+ {
+
+ public override void DrawRect (RectangleF dirtyRect)
+ {
+
+ using (var graphics = Graphics.FromHwnd(this.Handle))
+ {
+ var events = new PaintEventArgs(graphics,Rectangle.Round(dirtyRect));
+ OnPaintBackground(events);
+ OnPaint(events);
+ }
+ if(shouldDraw)
+ base.DrawRect(dirtyRect);
+ }
+
+ public bool shouldDraw;
+
+ public PaintEventHandler Paint { get; set; }
+ protected virtual void OnPaint(PaintEventArgs e)
+ {
+ if (Paint != null)
+ Paint (this, e);
+ shouldDraw = true;
+ }
+
+ protected virtual void OnPaintBackground(PaintEventArgs e)
+ {
+ if(BackColor == null)
+ BackColor = Color.Transparent;
+ if(BackColor == Color.Transparent)
+ return;
+ Pen pen = new Pen(BackColor);
+ e.Graphics.DrawRectangle(pen,e.ClipRectangle);
+ }
+ }
+
+
+ public partial class TextBox
+ {
+
+ public override void DrawRect (RectangleF dirtyRect)
+ {
+
+ using (var graphics = Graphics.FromHwnd(this.Handle))
+ {
+ var events = new PaintEventArgs(graphics,Rectangle.Round(dirtyRect));
+ OnPaintBackground(events);
+ OnPaint(events);
+ }
+ if(shouldDraw)
+ base.DrawRect(dirtyRect);
+ }
+
+ public bool shouldDraw;
+
+ public PaintEventHandler Paint { get; set; }
+ protected virtual void OnPaint(PaintEventArgs e)
+ {
+ if (Paint != null)
+ Paint (this, e);
+ shouldDraw = true;
+ }
+
+ protected virtual void OnPaintBackground(PaintEventArgs e)
+ {
+ if(BackColor == null)
+ BackColor = Color.Transparent;
+ if(BackColor == Color.Transparent)
+ return;
+ Pen pen = new Pen(BackColor);
+ e.Graphics.DrawRectangle(pen,e.ClipRectangle);
+ }
+ }
+
+
+ public partial class ComboBox
+ {
+
+ public override void DrawRect (RectangleF dirtyRect)
+ {
+
+ using (var graphics = Graphics.FromHwnd(this.Handle))
+ {
+ var events = new PaintEventArgs(graphics,Rectangle.Round(dirtyRect));
+ OnPaintBackground(events);
+ OnPaint(events);
+ }
+ if(shouldDraw)
+ base.DrawRect(dirtyRect);
+ }
+
+ public bool shouldDraw;
+
+ public PaintEventHandler Paint { get; set; }
+ protected virtual void OnPaint(PaintEventArgs e)
+ {
+ if (Paint != null)
+ Paint (this, e);
+ shouldDraw = true;
+ }
+
+ protected virtual void OnPaintBackground(PaintEventArgs e)
+ {
+ if(BackColor == null)
+ BackColor = Color.Transparent;
+ if(BackColor == Color.Transparent)
+ return;
+ Pen pen = new Pen(BackColor);
+ e.Graphics.DrawRectangle(pen,e.ClipRectangle);
+ }
+ }
+
+
+ public partial class ListBox
+ {
+
+ public override void DrawRect (RectangleF dirtyRect)
+ {
+
+ using (var graphics = Graphics.FromHwnd(this.Handle))
+ {
+ var events = new PaintEventArgs(graphics,Rectangle.Round(dirtyRect));
+ OnPaintBackground(events);
+ OnPaint(events);
+ }
+ if(shouldDraw)
+ base.DrawRect(dirtyRect);
+ }
+
+ public bool shouldDraw;
+
+ public PaintEventHandler Paint { get; set; }
+ protected virtual void OnPaint(PaintEventArgs e)
+ {
+ if (Paint != null)
+ Paint (this, e);
+ shouldDraw = true;
+ }
+
+ protected virtual void OnPaintBackground(PaintEventArgs e)
+ {
+ if(BackColor == null)
+ BackColor = Color.Transparent;
+ if(BackColor == Color.Transparent)
+ return;
+ Pen pen = new Pen(BackColor);
+ e.Graphics.DrawRectangle(pen,e.ClipRectangle);
+ }
+ }
+
+
+ public partial class TrackBar
+ {
+
+ public override void DrawRect (RectangleF dirtyRect)
+ {
+
+ using (var graphics = Graphics.FromHwnd(this.Handle))
+ {
+ var events = new PaintEventArgs(graphics,Rectangle.Round(dirtyRect));
+ OnPaintBackground(events);
+ OnPaint(events);
+ }
+ if(shouldDraw)
+ base.DrawRect(dirtyRect);
+ }
+
+ public bool shouldDraw;
+
+ public PaintEventHandler Paint { get; set; }
+ protected virtual void OnPaint(PaintEventArgs e)
+ {
+ if (Paint != null)
+ Paint (this, e);
+ shouldDraw = true;
+ }
+
+ protected virtual void OnPaintBackground(PaintEventArgs e)
+ {
+ if(BackColor == null)
+ BackColor = Color.Transparent;
+ if(BackColor == Color.Transparent)
+ return;
+ Pen pen = new Pen(BackColor);
+ e.Graphics.DrawRectangle(pen,e.ClipRectangle);
+ }
+ }
+
+
+ public partial class Panel
+ {
+
+ public override void DrawRect (RectangleF dirtyRect)
+ {
+
+ using (var graphics = Graphics.FromHwnd(this.Handle))
+ {
+ var events = new PaintEventArgs(graphics,Rectangle.Round(dirtyRect));
+ OnPaintBackground(events);
+ OnPaint(events);
+ }
+ if(shouldDraw)
+ base.DrawRect(dirtyRect);
+ }
+
+ public bool shouldDraw;
+
+ public PaintEventHandler Paint { get; set; }
+ protected virtual void OnPaint(PaintEventArgs e)
+ {
+ if (Paint != null)
+ Paint (this, e);
+
+ shouldDraw = true;
+ }
+
+ protected virtual void OnPaintBackground(PaintEventArgs e)
+ {
+
+ if(BackColor == null)
+ BackColor = Color.Transparent;
+ if(BackColor == Color.Transparent)
+ return;
+ Pen pen = new Pen(BackColor);
+ e.Graphics.DrawRectangle(pen,e.ClipRectangle);
+
+ }
+ }
+
+
+}
+
+
79 MonoMac.Windows.Forms/Templates/FontTemplate.g.cs
View
@@ -0,0 +1,79 @@
+using System;
+using System.Collections;
+using System.Linq;
+using MonoMac.AppKit;
+using System.Drawing;
+using MonoMac.Foundation;
+namespace System.Windows.Forms
+{
+ public partial class UserControl
+ {
+ public new System.Drawing.Font Font
+ {
+ get {
+ if(base.Font == null)
+ return new System.Drawing.Font ("Arial", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ return new System.Drawing.Font(base.Font.FontName, base.Font.PointSize, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ }
+ set {
+ base.Font = MonoMac.AppKit.NSFont.FromFontName(value.Name,value.Size);
+
+ }
+ }
+ }
+
+
+ public partial class Button
+ {
+ public new System.Drawing.Font Font
+ {
+ get {
+ if(base.Font == null)
+ return new System.Drawing.Font ("Arial", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ return new System.Drawing.Font(base.Font.FontName, base.Font.PointSize, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ }
+ set {
+ base.Font = MonoMac.AppKit.NSFont.FromFontName(value.Name,value.Size);
+
+ }
+ }
+ }
+
+
+ public partial class TextBox
+ {
+ public new System.Drawing.Font Font
+ {
+ get {
+ if(base.Font == null)
+ return new System.Drawing.Font ("Arial", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ return new System.Drawing.Font(base.Font.FontName, base.Font.PointSize, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ }
+ set {
+ base.Font = MonoMac.AppKit.NSFont.FromFontName(value.Name,value.Size);
+
+ }
+ }
+ }
+
+
+ public partial class ComboBox
+ {
+ public new System.Drawing.Font Font
+ {
+ get {
+ if(base.Font == null)
+ return new System.Drawing.Font ("Arial", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ return new System.Drawing.Font(base.Font.FontName, base.Font.PointSize, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ }
+ set {
+ base.Font = MonoMac.AppKit.NSFont.FromFontName(value.Name,value.Size);
+
+ }
+ }
+ }
+
+
+}
+
+
73 MonoMac.Windows.Forms/Templates/KeyPressEventsTemplate.g.cs
View
@@ -0,0 +1,73 @@
+using System;
+using System.Collections;
+using System.Linq;
+using MonoMac.AppKit;
+using System.Drawing;
+using MonoMac.Foundation;
+namespace System.Windows.Forms
+{
+ public partial class TextBox
+ {
+ public override void KeyDown (NSEvent theEvent)
+ {
+ base.KeyDown (theEvent);
+ if(OnKeyDown != null)
+ OnKeyDown(this,new KeyEventArgs(theEvent));
+ }
+ public override void KeyUp (NSEvent theEvent)
+ {
+ base.KeyUp (theEvent);
+ if (OnKeyUp != null)
+ OnKeyUp(this, new KeyEventArgs(theEvent));
+ if(KeyPress != null)
+ KeyPress(this, new KeyPressEventArgs(theEvent.Characters.ToCharArray()[0]));
+ }
+
+ public override void DidChange (NSNotification notification)
+ {
+ base.DidChange (notification);
+ if(TextChanged != null)
+ TextChanged(this,new EventArgs());
+ }
+
+ public event EventHandler TextChanged;
+ public event KeyPressEventHandler KeyPress;
+ public event KeyEventHandler OnKeyUp;
+ public event KeyEventHandler OnKeyDown;
+ }
+
+
+ public partial class ComboBox
+ {
+ public override void KeyDown (NSEvent theEvent)
+ {
+ base.KeyDown (theEvent);
+ if(OnKeyDown != null)
+ OnKeyDown(this,new KeyEventArgs(theEvent));
+ }
+ public override void KeyUp (NSEvent theEvent)
+ {
+ base.KeyUp (theEvent);
+ if (OnKeyUp != null)
+ OnKeyUp(this, new KeyEventArgs(theEvent));
+ if(KeyPress != null)
+ KeyPress(this, new KeyPressEventArgs(theEvent.Characters.ToCharArray()[0]));
+ }
+
+ public override void DidChange (NSNotification notification)
+ {
+ base.DidChange (notification);
+ if(TextChanged != null)
+ TextChanged(this,new EventArgs());
+ }
+
+ public event EventHandler TextChanged;
+ public event KeyPressEventHandler KeyPress;
+ public event KeyEventHandler OnKeyUp;
+ public event KeyEventHandler OnKeyDown;
+ }
+
+
+}
+
+
809 MonoMac.Windows.Forms/Templates/MouseTemplate.g.cs
View
@@ -0,0 +1,809 @@
+using System;
+using System.Collections;
+using System.Linq;
+using MonoMac.AppKit;
+using System.Drawing;
+using MonoMac.Foundation;
+namespace System.Windows.Forms
+{
+ public partial class ButtonMouseView : NSButton
+ {
+ public override void MouseUp (NSEvent theEvent)
+ {
+ base.MouseUp (theEvent);
+ FireMouseUp(theEvent);
+ }
+ public virtual void FireMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDown (NSEvent theEvent)
+ {
+ base.MouseDown (theEvent);
+ FireMouseDown (theEvent);
+ }
+ public virtual void FireMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseMoved (NSEvent theEvent)
+ {
+ base.MouseMoved (theEvent);
+ FireMouseMoved (theEvent);
+ }
+ public virtual void FireMouseMoved(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ base.RightMouseDown (theEvent);
+ FireRightMouseDown (theEvent);
+ }
+ public virtual void FireRightMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ base.RightMouseUp (theEvent);
+ FireRightMouseUp(theEvent);
+ }
+ public virtual void FireRightMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDragged (NSEvent theEvent)
+ {
+ base.RightMouseDragged (theEvent);
+ RightMouseDragged (theEvent);
+ }
+ public virtual void FireRightMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDragged (NSEvent theEvent)
+ {
+ base.MouseDragged (theEvent);
+ FireMouseDragged (theEvent);
+ }
+ public virtual void FireMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseDown (NSEvent theEvent)
+ {
+ base.OtherMouseDown (theEvent);
+ FireOtherMouseDown (theEvent);
+ }
+ public virtual void FireOtherMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseUp (NSEvent theEvent)
+ {
+ base.OtherMouseUp (theEvent);
+ FireOtherMouseUp (theEvent);
+ }
+ public virtual void FireOtherMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseEntered (NSEvent theEvent)
+ {
+ base.MouseEntered (theEvent);
+ FireMouseEntered(theEvent);
+ }
+ public virtual void FireMouseEntered(NSEvent theEvent)
+ {
+
+ }
+ public override void ScrollWheel (NSEvent theEvent)
+ {
+ base.ScrollWheel (theEvent);
+ FireScrollWheel (theEvent);
+ }
+ public virtual void FireScrollWheel(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseExited (NSEvent theEvent)
+ {
+ base.MouseExited (theEvent);
+ FireMouseExited (theEvent);
+ }
+ public virtual void FireMouseExited (NSEvent theEvent)
+ {
+
+ }
+ }
+
+
+
+ public partial class TextBoxMouseView : NSTextField
+ {
+ public override void MouseUp (NSEvent theEvent)
+ {
+ base.MouseUp (theEvent);
+ FireMouseUp(theEvent);
+ }
+ public virtual void FireMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDown (NSEvent theEvent)
+ {
+ base.MouseDown (theEvent);
+ FireMouseDown (theEvent);
+ }
+ public virtual void FireMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseMoved (NSEvent theEvent)
+ {
+ base.MouseMoved (theEvent);
+ FireMouseMoved (theEvent);
+ }
+ public virtual void FireMouseMoved(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ base.RightMouseDown (theEvent);
+ FireRightMouseDown (theEvent);
+ }
+ public virtual void FireRightMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ base.RightMouseUp (theEvent);
+ FireRightMouseUp(theEvent);
+ }
+ public virtual void FireRightMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDragged (NSEvent theEvent)
+ {
+ base.RightMouseDragged (theEvent);
+ RightMouseDragged (theEvent);
+ }
+ public virtual void FireRightMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDragged (NSEvent theEvent)
+ {
+ base.MouseDragged (theEvent);
+ FireMouseDragged (theEvent);
+ }
+ public virtual void FireMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseDown (NSEvent theEvent)
+ {
+ base.OtherMouseDown (theEvent);
+ FireOtherMouseDown (theEvent);
+ }
+ public virtual void FireOtherMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseUp (NSEvent theEvent)
+ {
+ base.OtherMouseUp (theEvent);
+ FireOtherMouseUp (theEvent);
+ }
+ public virtual void FireOtherMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseEntered (NSEvent theEvent)
+ {
+ base.MouseEntered (theEvent);
+ FireMouseEntered(theEvent);
+ }
+ public virtual void FireMouseEntered(NSEvent theEvent)
+ {
+
+ }
+ public override void ScrollWheel (NSEvent theEvent)
+ {
+ base.ScrollWheel (theEvent);
+ FireScrollWheel (theEvent);
+ }
+ public virtual void FireScrollWheel(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseExited (NSEvent theEvent)
+ {
+ base.MouseExited (theEvent);
+ FireMouseExited (theEvent);
+ }
+ public virtual void FireMouseExited (NSEvent theEvent)
+ {
+
+ }
+ }
+
+
+
+ public partial class ComboBoxMouseView : NSComboBox
+ {
+ public override void MouseUp (NSEvent theEvent)
+ {
+ base.MouseUp (theEvent);
+ FireMouseUp(theEvent);
+ }
+ public virtual void FireMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDown (NSEvent theEvent)
+ {
+ base.MouseDown (theEvent);
+ FireMouseDown (theEvent);
+ }
+ public virtual void FireMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseMoved (NSEvent theEvent)
+ {
+ base.MouseMoved (theEvent);
+ FireMouseMoved (theEvent);
+ }
+ public virtual void FireMouseMoved(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ base.RightMouseDown (theEvent);
+ FireRightMouseDown (theEvent);
+ }
+ public virtual void FireRightMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ base.RightMouseUp (theEvent);
+ FireRightMouseUp(theEvent);
+ }
+ public virtual void FireRightMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDragged (NSEvent theEvent)
+ {
+ base.RightMouseDragged (theEvent);
+ RightMouseDragged (theEvent);
+ }
+ public virtual void FireRightMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDragged (NSEvent theEvent)
+ {
+ base.MouseDragged (theEvent);
+ FireMouseDragged (theEvent);
+ }
+ public virtual void FireMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseDown (NSEvent theEvent)
+ {
+ base.OtherMouseDown (theEvent);
+ FireOtherMouseDown (theEvent);
+ }
+ public virtual void FireOtherMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseUp (NSEvent theEvent)
+ {
+ base.OtherMouseUp (theEvent);
+ FireOtherMouseUp (theEvent);
+ }
+ public virtual void FireOtherMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseEntered (NSEvent theEvent)
+ {
+ base.MouseEntered (theEvent);
+ FireMouseEntered(theEvent);
+ }
+ public virtual void FireMouseEntered(NSEvent theEvent)
+ {
+
+ }
+ public override void ScrollWheel (NSEvent theEvent)
+ {
+ base.ScrollWheel (theEvent);
+ FireScrollWheel (theEvent);
+ }
+ public virtual void FireScrollWheel(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseExited (NSEvent theEvent)
+ {
+ base.MouseExited (theEvent);
+ FireMouseExited (theEvent);
+ }
+ public virtual void FireMouseExited (NSEvent theEvent)
+ {
+
+ }
+ }
+
+
+
+ public partial class ListBoxMouseView : NSScrollView
+ {
+ public override void MouseUp (NSEvent theEvent)
+ {
+ base.MouseUp (theEvent);
+ FireMouseUp(theEvent);
+ }
+ public virtual void FireMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDown (NSEvent theEvent)
+ {
+ base.MouseDown (theEvent);
+ FireMouseDown (theEvent);
+ }
+ public virtual void FireMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseMoved (NSEvent theEvent)
+ {
+ base.MouseMoved (theEvent);
+ FireMouseMoved (theEvent);
+ }
+ public virtual void FireMouseMoved(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ base.RightMouseDown (theEvent);
+ FireRightMouseDown (theEvent);
+ }
+ public virtual void FireRightMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ base.RightMouseUp (theEvent);
+ FireRightMouseUp(theEvent);
+ }
+ public virtual void FireRightMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDragged (NSEvent theEvent)
+ {
+ base.RightMouseDragged (theEvent);
+ RightMouseDragged (theEvent);
+ }
+ public virtual void FireRightMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDragged (NSEvent theEvent)
+ {
+ base.MouseDragged (theEvent);
+ FireMouseDragged (theEvent);
+ }
+ public virtual void FireMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseDown (NSEvent theEvent)
+ {
+ base.OtherMouseDown (theEvent);
+ FireOtherMouseDown (theEvent);
+ }
+ public virtual void FireOtherMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseUp (NSEvent theEvent)
+ {
+ base.OtherMouseUp (theEvent);
+ FireOtherMouseUp (theEvent);
+ }
+ public virtual void FireOtherMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseEntered (NSEvent theEvent)
+ {
+ base.MouseEntered (theEvent);
+ FireMouseEntered(theEvent);
+ }
+ public virtual void FireMouseEntered(NSEvent theEvent)
+ {
+
+ }
+ public override void ScrollWheel (NSEvent theEvent)
+ {
+ base.ScrollWheel (theEvent);
+ FireScrollWheel (theEvent);
+ }
+ public virtual void FireScrollWheel(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseExited (NSEvent theEvent)
+ {
+ base.MouseExited (theEvent);
+ FireMouseExited (theEvent);
+ }
+ public virtual void FireMouseExited (NSEvent theEvent)
+ {
+
+ }
+ }
+
+
+
+ public partial class TrackBarMouseView : NSSlider
+ {
+ public override void MouseUp (NSEvent theEvent)
+ {
+ base.MouseUp (theEvent);
+ FireMouseUp(theEvent);
+ }
+ public virtual void FireMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDown (NSEvent theEvent)
+ {
+ base.MouseDown (theEvent);
+ FireMouseDown (theEvent);
+ }
+ public virtual void FireMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseMoved (NSEvent theEvent)
+ {
+ base.MouseMoved (theEvent);
+ FireMouseMoved (theEvent);
+ }
+ public virtual void FireMouseMoved(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ base.RightMouseDown (theEvent);
+ FireRightMouseDown (theEvent);
+ }
+ public virtual void FireRightMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ base.RightMouseUp (theEvent);
+ FireRightMouseUp(theEvent);
+ }
+ public virtual void FireRightMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDragged (NSEvent theEvent)
+ {
+ base.RightMouseDragged (theEvent);
+ RightMouseDragged (theEvent);
+ }
+ public virtual void FireRightMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDragged (NSEvent theEvent)
+ {
+ base.MouseDragged (theEvent);
+ FireMouseDragged (theEvent);
+ }
+ public virtual void FireMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseDown (NSEvent theEvent)
+ {
+ base.OtherMouseDown (theEvent);
+ FireOtherMouseDown (theEvent);
+ }
+ public virtual void FireOtherMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseUp (NSEvent theEvent)
+ {
+ base.OtherMouseUp (theEvent);
+ FireOtherMouseUp (theEvent);
+ }
+ public virtual void FireOtherMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseEntered (NSEvent theEvent)
+ {
+ base.MouseEntered (theEvent);
+ FireMouseEntered(theEvent);
+ }
+ public virtual void FireMouseEntered(NSEvent theEvent)
+ {
+
+ }
+ public override void ScrollWheel (NSEvent theEvent)
+ {
+ base.ScrollWheel (theEvent);
+ FireScrollWheel (theEvent);
+ }
+ public virtual void FireScrollWheel(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseExited (NSEvent theEvent)
+ {
+ base.MouseExited (theEvent);
+ FireMouseExited (theEvent);
+ }
+ public virtual void FireMouseExited (NSEvent theEvent)
+ {
+
+ }
+ }
+
+
+
+ public partial class UserControlMouseView : NSControl
+ {
+ public override void MouseUp (NSEvent theEvent)
+ {
+ base.MouseUp (theEvent);
+ FireMouseUp(theEvent);
+ }
+ public virtual void FireMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDown (NSEvent theEvent)
+ {
+ base.MouseDown (theEvent);
+ FireMouseDown (theEvent);
+ }
+ public virtual void FireMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseMoved (NSEvent theEvent)
+ {
+ base.MouseMoved (theEvent);
+ FireMouseMoved (theEvent);
+ }
+ public virtual void FireMouseMoved(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ base.RightMouseDown (theEvent);
+ FireRightMouseDown (theEvent);
+ }
+ public virtual void FireRightMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ base.RightMouseUp (theEvent);
+ FireRightMouseUp(theEvent);
+ }
+ public virtual void FireRightMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDragged (NSEvent theEvent)
+ {
+ base.RightMouseDragged (theEvent);
+ RightMouseDragged (theEvent);
+ }
+ public virtual void FireRightMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDragged (NSEvent theEvent)
+ {
+ base.MouseDragged (theEvent);
+ FireMouseDragged (theEvent);
+ }
+ public virtual void FireMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseDown (NSEvent theEvent)
+ {
+ base.OtherMouseDown (theEvent);
+ FireOtherMouseDown (theEvent);
+ }
+ public virtual void FireOtherMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseUp (NSEvent theEvent)
+ {
+ base.OtherMouseUp (theEvent);
+ FireOtherMouseUp (theEvent);
+ }
+ public virtual void FireOtherMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseEntered (NSEvent theEvent)
+ {
+ base.MouseEntered (theEvent);
+ FireMouseEntered(theEvent);
+ }
+ public virtual void FireMouseEntered(NSEvent theEvent)
+ {
+
+ }
+ public override void ScrollWheel (NSEvent theEvent)
+ {
+ base.ScrollWheel (theEvent);
+ FireScrollWheel (theEvent);
+ }
+ public virtual void FireScrollWheel(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseExited (NSEvent theEvent)
+ {
+ base.MouseExited (theEvent);
+ FireMouseExited (theEvent);
+ }
+ public virtual void FireMouseExited (NSEvent theEvent)
+ {
+
+ }
+ }
+
+
+
+ public partial class PanelMouseView : NSView
+ {
+ public override void MouseUp (NSEvent theEvent)
+ {
+ base.MouseUp (theEvent);
+ FireMouseUp(theEvent);
+ }
+ public virtual void FireMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDown (NSEvent theEvent)
+ {
+ base.MouseDown (theEvent);
+ FireMouseDown (theEvent);
+ }
+ public virtual void FireMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseMoved (NSEvent theEvent)
+ {
+ base.MouseMoved (theEvent);
+ FireMouseMoved (theEvent);
+ }
+ public virtual void FireMouseMoved(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDown (NSEvent theEvent)
+ {
+ base.RightMouseDown (theEvent);
+ FireRightMouseDown (theEvent);
+ }
+ public virtual void FireRightMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseUp (NSEvent theEvent)
+ {
+ base.RightMouseUp (theEvent);
+ FireRightMouseUp(theEvent);
+ }
+ public virtual void FireRightMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void RightMouseDragged (NSEvent theEvent)
+ {
+ base.RightMouseDragged (theEvent);
+ RightMouseDragged (theEvent);
+ }
+ public virtual void FireRightMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseDragged (NSEvent theEvent)
+ {
+ base.MouseDragged (theEvent);
+ FireMouseDragged (theEvent);
+ }
+ public virtual void FireMouseDragged(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseDown (NSEvent theEvent)
+ {
+ base.OtherMouseDown (theEvent);
+ FireOtherMouseDown (theEvent);
+ }
+ public virtual void FireOtherMouseDown(NSEvent theEvent)
+ {
+
+ }
+ public override void OtherMouseUp (NSEvent theEvent)
+ {
+ base.OtherMouseUp (theEvent);
+ FireOtherMouseUp (theEvent);
+ }
+ public virtual void FireOtherMouseUp(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseEntered (NSEvent theEvent)
+ {
+ base.MouseEntered (theEvent);
+ FireMouseEntered(theEvent);
+ }
+ public virtual void FireMouseEntered(NSEvent theEvent)
+ {
+
+ }
+ public override void ScrollWheel (NSEvent theEvent)
+ {
+ base.ScrollWheel (theEvent);
+ FireScrollWheel (theEvent);
+ }
+ public virtual void FireScrollWheel(NSEvent theEvent)
+ {
+
+ }
+ public override void MouseExited (NSEvent theEvent)
+ {
+ base.MouseExited (theEvent);
+ FireMouseExited (theEvent);
+ }
+ public virtual void FireMouseExited (NSEvent theEvent)
+ {
+
+ }
+ }
+
+
+
+}
+
+
123 MonoMac.Windows.Forms/Templates/UserControlTemplate.g.cs
View
@@ -0,0 +1,123 @@
+using System;
+using System.Collections;
+using System.Linq;
+using MonoMac.AppKit;
+using System.Drawing;
+using MonoMac.Foundation;
+namespace System.Windows.Forms
+{
+ public partial class UserControl
+ {
+
+ private controls theControls;
+ public controls Controls {
+ get {
+ if (theControls == null)
+ theControls = new controls (this);
+ return theControls;
+ }
+ }
+
+ public class controls
+ {
+ private NSView theView;
+ public controls (Form form)
+ {
+ theView = form.ContentView;
+ }
+ public controls (NSView view)
+ {
+ theView = view;
+ }
+
+
+ public void Add (NSView item)
+ {
+ theView.AddSubview (item);
+ SetTab ();
+ }
+
+ public void Clear ()
+ {
+ foreach (var view in theView.Subviews)
+ {
+ view.RemoveFromSuperview ();
+ }
+ }
+
+ public bool Contains (NSView item)
+ {
+ return theView.Subviews.Contains (item);
+ }
+
+ public void CopyTo (NSView[] array, int arrayIndex)
+ {
+ theView.Subviews.CopyTo (array, arrayIndex);
+ }
+
+ public bool Remove (NSView item)
+ {
+ item.RemoveFromSuperview ();
+ SetTab ();
+ return true;
+
+ }
+
+ public int Count {
+ get { return theView.Subviews.Count (); }
+ }
+
+ public bool IsReadOnly {
+ get { return false; }
+ }
+
+ public int IndexOf (NSView item)
+ {
+ return theView.Subviews.ToList ().IndexOf (item);
+
+ }
+
+ public void Insert (int index, NSView item)
+ {
+ if (index == 0)
+ {
+ theView.AddSubview (item, NSWindowOrderingMode.Below, null);
+ return;
+ }
+
+ var rowBelow = theView.Subviews[index - 1];
+ theView.AddSubview (item, NSWindowOrderingMode.Below, rowBelow);
+ SetTab ();
+ }
+
+ public void RemoveAt (int index)
+ {
+ theView.Subviews[index].RemoveFromSuperview ();
+ SetTab ();
+ }
+
+ public NSView this[int index] {
+ get { return theView.Subviews[index]; }
+
+ set { theView.Subviews[index] = value; }
+ }
+ //TODO: Make it work, It doesn't work as is
+ public void SetTab ()
+ {
+ /*
+ var controls = theForm.ContentView.Subviews.OrderBy (x => x.Tag).ToList ();
+ for (int i = 0; i < controls.Count - 1; i++)
+ {
+ var firstControl = controls[i];
+ var nextControl = controls[i + 1];
+ firstControl.NextResponder = nextControl;
+ }
+ */
+
+ }
+ }
+ }
+
+}
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.