This commit was manufactured by cvs2svn to create branch 'mono-1-0'.
[mono.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / PictureBox.cs
index 1ed7c26ebe0730f2b921eb7935d373f44b35778d..8c067f97cefa0d7df66d6de48e0aec93f1a30d0b 100644 (file)
@@ -8,6 +8,27 @@
 //
 // (C) 2002 Ximian, Inc
 //
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 using System.Drawing;
 using System.ComponentModel;
 
@@ -27,6 +48,7 @@ namespace System.Windows.Forms {
                        sizeMode = PictureBoxSizeMode.Normal;
                        borderStyle = BorderStyle.None;
                        SetStyle ( ControlStyles.UserPaint, true );
+                       SetStyle ( ControlStyles.Selectable, false );
                }
 
                public BorderStyle BorderStyle {
@@ -123,7 +145,13 @@ namespace System.Windows.Forms {
                                }
                        }
                }
+
                
+               [MonoTODO]
+               protected override void Dispose(bool disposing) { 
+                       base.Dispose(disposing);
+               }               
+
                [MonoTODO]
                protected override void OnEnabledChanged(EventArgs e) 
                {
@@ -131,24 +159,24 @@ namespace System.Windows.Forms {
                        base.OnEnabledChanged(e);
                }
 
-               protected override void OnPaint(PaintEventArgs e) 
+               protected override void OnPaint(PaintEventArgs pe) 
                {
                        if ( Image != null ) {
                                switch ( SizeMode ) {
                                case PictureBoxSizeMode.StretchImage:
-                                       e.Graphics.DrawImage ( Image, ClientRectangle );
+                                       pe.Graphics.DrawImage ( Image, ClientRectangle );
                                break;
                                case PictureBoxSizeMode.CenterImage:
                                        int dx = (ClientRectangle.Width - Image.Width)/2;
                                        int dy = (ClientRectangle.Height- Image.Height)/2;
-                                       e.Graphics.DrawImage ( Image, dx, dy );
+                                       pe.Graphics.DrawImage ( Image, dx, dy );
                                break;
                                default:
-                                       e.Graphics.DrawImage ( Image, 0, 0 );
+                                       pe.Graphics.DrawImage ( Image, 0, 0 );
                                break;
                                }
                        }
-                       base.OnPaint(e);
+                       base.OnPaint(pe);
                }
 
                protected override void OnParentChanged(EventArgs e) 
@@ -183,6 +211,8 @@ namespace System.Windows.Forms {
                        base.OnVisibleChanged ( e );
                }
 
+               [MonoTODO]
+               //this should be inherited.
                protected override void OnPaintBackground (PaintEventArgs e) {
                        if ( SizeMode != PictureBoxSizeMode.StretchImage ) 
                                base.OnPaintBackground ( e );