dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms UserControl.cs,


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms UserControl.cs,NONE,1.1 EventId.cs,1.2,1.3
Date: Fri, 13 Jun 2003 06:56:32 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms
In directory subversions:/tmp/cvs-serv1540/System.Windows.Forms

Modified Files:
        EventId.cs 
Added Files:
        UserControl.cs 
Log Message:


Implement the UserControl widget.


--- NEW FILE ---
/*
 * UserControl.cs - Implementation of the
 *                      "System.Windows.Forms.UserControl" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.Windows.Forms
{

using System.Drawing;

public class UserControl : ContainerControl
{
        // Constructor.
        public UserControl() {}

        // Event that is emitted before the control becomes
        // visible for the first time.
        public event EventHandler Load
                        {
                                add
                                {
                                        AddHandler(EventId.Load, value);
                                }
                                remove
                                {
                                        RemoveHandler(EventId.Load, value);
                                }
                        }

        // Get the default size of the user control
        public override Size DefaultSize
                        {
                                get
                                {
                                        return new Size(150, 150);
                                }
                        }

        // Override the control create event.
        protected override void OnCreateControl()
                        {
                                base.OnCreateControl();
                                OnLoad(EventArgs.Empty);
                        }

        // Raise the "Load" event.
        protected virtual void OnLoad(EventArgs e)
                        {
                                EventHandler handler;
                                handler = 
(EventHandler)(GetHandler(EventId.Load));
                                if(handler != null)
                                {
                                        handler(this, e);
                                }
                        }

        // Override the mouse down event.
        protected override void OnMouseDown(MouseEventArgs e)
                        {
                                base.OnMouseDown(e);
                        }

#if !CONFIG_COMPACT_FORMS

        // Process a message.
        public override void WndProc(ref Message m)
                        {
                                base.WndProc(ref m);
                        }

#endif // !CONFIG_COMPACT_FORMS

}; // class UserControl

}; // namespace System.Windows.Forms

Index: EventId.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/EventId.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** EventId.cs  13 Jun 2003 01:30:23 -0000      1.2
--- EventId.cs  13 Jun 2003 10:56:29 -0000      1.3
***************
*** 95,98 ****
--- 95,101 ----
        TextAlignChanged,
  
+       // "UserControl" events.
+       Load,
+ 
  }; // enum EventId
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]