2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ScrollableControl.cs
index fa7241ae1f0be4aad6a179e55ce3364f0a266ca9..0f667b99e0b25818049d1d9c29579d7732d1cfe8 100644 (file)
 // Authors:
 //     Peter Bartok    pbartok@novell.com
 //
-//
-// $Revision: 1.5 $
-// $Modtime: $
-// $Log: ScrollableControl.cs,v $
-// Revision 1.5  2004/09/22 20:12:45  pbartok
-// - Implemented DockPadding property
-// - Implemented AutoScroll property
-// - Implemented AutoScrollMargin property
-// - Implemented AutoScrollMinSize property
-// - Implemented AutoScrollPosition property
-// - Implemented DisplayRectangle property (still incomplete)
-// - Implemented CreateParams property
-// - Implemented HScroll property
-// - Implemented VScroll property
-// - Implemented OnVisibleChanged property
-//
-// Revision 1.4  2004/09/09 03:01:35  ravindra
-// Removed unreachable code.
-//
-// Revision 1.3  2004/08/12 15:25:49  jordi
-// calls ctrlbase instead of exeception
-//
-// Revision 1.2  2004/08/11 22:20:59  pbartok
-// - Signature fixes
-//
-// Revision 1.1  2004/07/09 05:21:25  pbartok
-// - Initial check-in
-//
-//
+
 
 // NOT COMPLETE
 
@@ -214,7 +186,7 @@ namespace System.Windows.Forms {
 
                #region Public Constructors
                public ScrollableControl() {
-                       base.SetStyle(ControlStyles.ContainerControl, true);
+                       SetStyle(ControlStyles.ContainerControl, true);
                        auto_scroll = false;
                        auto_hscroll = false;
                        auto_vscroll = false;
@@ -224,12 +196,6 @@ namespace System.Windows.Forms {
                        auto_scroll_min_size = new Size(0, 0);
                        auto_scroll_position = new Point(0, 0);
                        dock_padding = new DockPaddingEdges();
-
-                       hscrollbar = new ScrollBar();
-                       hscrollbar.Visible = false;
-
-                       vscrollbar = new ScrollBar();
-                       vscrollbar.Visible = false;
                }
                #endregion      // Public Constructors
 
@@ -351,6 +317,8 @@ namespace System.Windows.Forms {
                        set {
                                if (hscroll_visible != value) {
                                        hscroll_visible = value;
+                                       if (hscroll_visible && hscrollbar == null)
+                                               hscrollbar = new ScrollBar ();
                                }
                        }
                }
@@ -363,6 +331,8 @@ namespace System.Windows.Forms {
                        set {
                                if (vscroll_visible != value) {
                                        vscroll_visible = value;
+                                       if (vscroll_visible && vscrollbar == null)
+                                               vscrollbar = new ScrollBar ();
                                }
                        }
                }
@@ -393,11 +363,11 @@ namespace System.Windows.Forms {
                }
 
                protected override void OnVisibleChanged(EventArgs e) {
-                       ;; // Nothing to do yet
+                       base.OnVisibleChanged(e);
                }
 
                protected override void ScaleCore(float dx, float dy) {
-                       throw new NotImplementedException();
+                       base.ScaleCore(dx, dy);
                }
 
                protected void SetDisplayRectLocation(int x, int y) {