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 Border3DSide.cs


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms Border3DSide.cs,NONE,1.1 Border3DStyle.cs,NONE,1.1 ButtonBorderStyle.cs,NONE,1.1 ButtonState.cs,NONE,1.1 CaptionButton.cs,NONE,1.1 ControlPaint.cs,NONE,1.1 FlatStyle.cs,NONE,1.1 FrameStyle.cs,NONE,1.1 IButtonControl.cs,NONE,1.1 ImageList.cs,NONE,1.1 MenuGlyph.cs,NONE,1.1 ScrollButton.cs,NONE,1.1 Button.cs,1.1,1.2 ButtonBase.cs,1.1,1.2 Control.cs,1.3,1.4
Date: Wed, 11 Jun 2003 22:55:51 -0400

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

Modified Files:
        Button.cs ButtonBase.cs Control.cs 
Added Files:
        Border3DSide.cs Border3DStyle.cs ButtonBorderStyle.cs 
        ButtonState.cs CaptionButton.cs ControlPaint.cs FlatStyle.cs 
        FrameStyle.cs IButtonControl.cs ImageList.cs MenuGlyph.cs 
        ScrollButton.cs 
Log Message:


Implement the "ButtonBase" and "Button" classes, to provide simple
control functionality.


--- NEW FILE ---
/*
 * Border3DSide.cs - Implementation of the
 *                      "System.Windows.Forms.Border3DSide" 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.Runtime.InteropServices;

#if !ECMA_COMPAT
[ComVisible(true)]
#endif
[Flags]
public enum Border3DSide
{
        Left    = 0x0001,
        Top             = 0x0002,
        Right   = 0x0004,
        Bottom  = 0x0008,
        Middle  = 0x0800,
        All             = 0x080F

}; // enum Border3DSide

}; // namespace System.Windows.Forms

--- NEW FILE ---
/*
 * Border3DStyle.cs - Implementation of the
 *                      "System.Windows.Forms.Border3DStyle" 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.Runtime.InteropServices;

#if !ECMA_COMPAT
[ComVisible(true)]
#endif
public enum Border3DStyle
{
        RaisedOuter = 0x0001,
        SunkenOuter = 0x0002,
        RaisedInner = 0x0004,
        Raised          = 0x0005,
        Etched          = 0x0006,
        SunkenInner = 0x0008,
        Bump            = 0x0009,
        Sunken          = 0x000A,
        Adjust          = 0x2000,
        Flat            = 0x400A,

}; // enum Border3DStyle

}; // namespace System.Windows.Forms

--- NEW FILE ---
/*
 * ButtonBorderStyle.cs - Implementation of the
 *                      "System.Windows.Forms.ButtonBorderStyle" 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
{

public enum ButtonBorderStyle
{
        None    = 0,
        Dotted  = 1,
        Dashed  = 2,
        Solid   = 3,
        Inset   = 4,
        Outset  = 5

}; // enum ButtonBorderStyle

}; // namespace System.Windows.Forms

--- NEW FILE ---
/*
 * ButtonState.cs - Implementation of the
 *                      "System.Windows.Forms.ButtonState" 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
{

[Flags]
public enum ButtonState
{
        Normal          = 0x0000,
        Inactive        = 0x0100,
        Pushed          = 0x0200,
        Checked         = 0x0400,
        Flat            = 0x4000,
        All                     = 0x4700,

}; // enum ButtonState

}; // namespace System.Windows.Forms

--- NEW FILE ---
/*
 * CaptionButton.cs - Implementation of the
 *                      "System.Windows.Forms.CaptionButton" 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
{

public enum CaptionButton
{
        Close           = 0,
        Minimize        = 1,
        Maximize        = 2,
        Restore         = 3,
        Help            = 4

}; // enum CaptionButton

}; // namespace System.Windows.Forms

--- NEW FILE ---
/*
 * ControlPaint.cs - Implementation of the
 *                      "System.Windows.Forms.ControlPaint" 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;
using System.Drawing.Drawing2D;

public sealed class ControlPaint
{
        // This class cannot be instantiated.
        private ControlPaint() {}

        // Get the ControlDark color, taking contrast into account.
        public static Color ContrastControlDark
                        {
                                get
                                {
                                        return SystemColors.ControlDark;
                                }
                        }

        // Get the "dark" version of a color.
        public static Color Dark(Color baseColor)
                        {
                                return Dark(baseColor, 0.5f);
                        }
        public static Color DarkDark(Color baseColor)
                        {
                                return Dark(baseColor, 1.0f);
                        }
        [TODO]
        public static Color Dark(Color baseColor, float percOfDarkDark)
                        {
                                if(baseColor.ToKnownColor() == 
KnownColor.Control)
                                {
                                        if(percOfDarkDark <= 0.5f)
                                        {
                                                return SystemColors.ControlDark;
                                        }
                                        else
                                        {
                                                return 
SystemColors.ControlDarkDark;
                                        }
                                }
                                // TODO
                                return baseColor;
                        }

        // Get the "light" version of a color.
        public static Color Light(Color baseColor)
                        {
                                return Light(baseColor, 0.5f);
                        }
        public static Color LightLight(Color baseColor)
                        {
                                return Light(baseColor, 1.0f);
                        }
        [TODO]
        public static Color Light(Color baseColor, float percOfLightLight)
                        {
                                if(baseColor.ToKnownColor() == 
KnownColor.Control)
                                {
                                        if(percOfLightLight <= 0.5f)
                                        {
                                                return 
SystemColors.ControlLight;
                                        }
                                        else
                                        {
                                                return 
SystemColors.ControlLightLight;
                                        }
                                }
                                // TODO
                                return baseColor;
                        }

        // Draw a simple button border.
        public static void DrawBorder
                                (Graphics graphics, Rectangle bounds,
                                 Color color, ButtonBorderStyle style)
                        {
                                Pen pen;
                                switch(style)
                                {
                                        case ButtonBorderStyle.Dotted:
                                        {
                                                pen = new Pen(color, 1.0f);
                                                pen.EndCap = LineCap.Square;
                                                pen.DashStyle = DashStyle.Dot;
                                                graphics.DrawRectangle(pen, 
bounds);
                                                pen.Dispose();
                                        }
                                        break;

                                        case ButtonBorderStyle.Dashed:
                                        {
                                                pen = new Pen(color, 1.0f);
                                                pen.EndCap = LineCap.Square;
                                                pen.DashStyle = DashStyle.Dash;
                                                graphics.DrawRectangle(pen, 
bounds);
                                                pen.Dispose();
                                        }
                                        break;

                                        case ButtonBorderStyle.Solid:
                                        {
                                                pen = new Pen(color, 1.0f);
                                                pen.EndCap = LineCap.Square;
                                                graphics.DrawRectangle(pen, 
bounds);
                                                pen.Dispose();
                                        }
                                        break;

                                        case ButtonBorderStyle.Inset:
                                        {
                                                pen = new Pen(Dark(color), 
1.0f);
                                                pen.EndCap = LineCap.Square;
                                                graphics.DrawLine(pen, bounds.X,
                                                                                
  bounds.Y + bounds.Height - 1,
                                                                                
  bounds.X, bounds.Y);
                                                graphics.DrawLine(pen, bounds.X 
+ 1, bounds.Y,
                                                                                
  bounds.X + bounds.Width - 1,
                                                                                
  bounds.Y);
                                                pen.Color = Light(color);
                                                graphics.DrawLine(pen, bounds.X 
+ 1,
                                                                                
  bounds.Y + bounds.Height - 1,
                                                                                
  bounds.X + bounds.Width - 1,
                                                                                
  bounds.Y + bounds.Height - 1);
                                                graphics.DrawLine(pen, bounds.X 
+ bounds.Width - 1,
                                                                                
  bounds.Y + bounds.Height - 2,
                                                                                
  bounds.X + bounds.Width - 1,
                                                                                
  bounds.Y + 1);
                                                pen.Dispose();
                                        }
                                        break;

                                        case ButtonBorderStyle.Outset:
                                        {
                                                pen = new Pen(Light(color), 
1.0f);
                                                pen.EndCap = LineCap.Square;
                                                graphics.DrawLine(pen, bounds.X,
                                                                                
  bounds.Y + bounds.Height - 1,
                                                                                
  bounds.X, bounds.Y);
                                                graphics.DrawLine(pen, bounds.X 
+ 1, bounds.Y,
                                                                                
  bounds.X + bounds.Width - 1,
                                                                                
  bounds.Y);
                                                pen.Color = Dark(color);
                                                graphics.DrawLine(pen, bounds.X 
+ 1,
                                                                                
  bounds.Y + bounds.Height - 1,
                                                                                
  bounds.X + bounds.Width - 1,
                                                                                
  bounds.Y + bounds.Height - 1);
                                                graphics.DrawLine(pen, bounds.X 
+ bounds.Width - 1,
                                                                                
  bounds.Y + bounds.Height - 2,
                                                                                
  bounds.X + bounds.Width - 1,
                                                                                
  bounds.Y + 1);
                                                pen.Dispose();
                                        }
                                        break;
                                }
                        }
        [TODO]
        public static void DrawBorder
                                (Graphics graphics, Rectangle bounds, Color 
leftColor,
                             int leftWidth, ButtonBorderStyle leftStyle, Color 
topColor,
                                 int topWidth, ButtonBorderStyle topStyle, 
Color rightColor,
                                 int rightWidth, ButtonBorderStyle rightStyle,
                                 Color bottomColor, int bottomWidth,
                                 ButtonBorderStyle bottomStyle)
                        {
                                // TODO
                        }

        // Draw a 3D border within a rectangle.
        public static void DrawBorder3D(Graphics graphics, Rectangle rectangle)
                        {
                                DrawBorder3D(graphics, rectangle.X, rectangle.Y,
                                                         rectangle.Width, 
rectangle.Height,
                                                         Border3DStyle.Etched,
                                                         Border3DSide.Left | 
Border3DSide.Top |
                                                         Border3DSide.Right | 
Border3DSide.Bottom);
                        }
        public static void DrawBorder3D(Graphics graphics, Rectangle rectangle,
                                                                        
Border3DStyle style)
                        {
                                DrawBorder3D(graphics, rectangle.X, rectangle.Y,
                                                         rectangle.Width, 
rectangle.Height, style,
                                                         Border3DSide.Left | 
Border3DSide.Top |
                                                         Border3DSide.Right | 
Border3DSide.Bottom);
                        }
        public static void DrawBorder3D(Graphics graphics, Rectangle rectangle,
                                                                        
Border3DStyle style, Border3DSide sides)
                        {
                                DrawBorder3D(graphics, rectangle.X, rectangle.Y,
                                                         rectangle.Width, 
rectangle.Height, style, sides);
                        }
        public static void DrawBorder3D(Graphics graphics, int x, int y,
                                                                        int 
width, int height)
                        {
                                DrawBorder3D(graphics, x, y, width, height,
                                                         Border3DStyle.Etched,
                                                         Border3DSide.Left | 
Border3DSide.Top |
                                                         Border3DSide.Right | 
Border3DSide.Bottom);
                        }
        public static void DrawBorder3D(Graphics graphics, int x, int y,
                                                                        int 
width, int height,
                                                                        
Border3DStyle style)
                        {
                                DrawBorder3D(graphics, x, y, width, height, 
style,
                                                         Border3DSide.Left | 
Border3DSide.Top |
                                                         Border3DSide.Right | 
Border3DSide.Bottom);
                        }
        [TODO]
        public static void DrawBorder3D(Graphics graphics, int x, int y,
                                                                        int 
width, int height,
                                                                        
Border3DStyle style,
                                                                        
Border3DSide sides)
                        {
                                // TODO
                        }

        // Draw a button control.
        public static void DrawButton(Graphics graphics, Rectangle rectangle,
                                                                  ButtonState 
state)
                        {
                                DrawButton(graphics, rectangle.X, rectangle.Y,
                                                   rectangle.Width, 
rectangle.Height, state,
                                                   SystemColors.ControlText,
                                                   SystemColors.Control, false);
                        }
        public static void DrawButton(Graphics graphics, int x, int y,
                                                                  int width, 
int height, ButtonState state)
                        {
                                DrawButton(graphics, x, y, width, height, state,
                                                   SystemColors.ControlText,
                                                   SystemColors.Control, false);
                        }
        internal static void DrawButton
                                (Graphics graphics, int x, int y, int width, 
int height,
                                 ButtonState state, Color foreColor, Color 
backColor,
                                 bool isDefault)
                        {
                                Color light, lightlight, dark, darkdark;
                                Pen pen;
                                Brush brush;

                                // Draw the border around the edges of the 
button.
                                if((state & ButtonState.Flat) == 0)
                                {
                                        if((state & ButtonState.Pushed) != 0)
                                        {
                                                if(isDefault)
                                                {
                                                        lightlight = 
Dark(backColor);
                                                        darkdark = lightlight;
                                                        light = backColor;
                                                        dark = backColor;
                                                }
                                                else
                                                {
                                                        lightlight = 
DarkDark(backColor);
                                                        darkdark = 
LightLight(backColor);
                                                        light = Dark(backColor);
                                                        dark = Light(backColor);
                                                }
                                        }
                                        else
                                        {
                                                lightlight = 
LightLight(backColor);
                                                darkdark = DarkDark(backColor);
                                                light = Light(backColor);
                                                dark = Dark(backColor);
                                        }
                                        if(isDefault && width >= 2 && height >= 
2)
                                        {
                                                pen = new Pen(foreColor, 1.0f);
                                                pen.EndCap = LineCap.Square;
                                                graphics.DrawRectangle(pen, x, 
y, width, height);
                                                pen.Dispose();
                                                ++x;
                                                ++y;
                                                width -= 2;
                                                height -= 2;
                                        }
                                        if(width >= 4 && height >= 4)
                                        {
                                                pen = new Pen(lightlight, 1.0f);
                                                pen.EndCap = LineCap.Square;
                                                graphics.DrawLine(pen, x, y + 
height - 2, x, y);
                                                graphics.DrawLine(pen, x + 1, 
y, x + width - 2, y);
                                                pen.Color = darkdark;
                                                graphics.DrawLine(pen, x + 
width - 1, y,
                                                                                
  x + width - 1, y + height - 1);
                                                graphics.DrawLine(pen, x + 
width - 2, y + height - 1,
                                                                                
  x, y + height - 1);
                                                pen.Color = light;
                                                graphics.DrawLine(pen, x + 1, y 
+ height - 3,
                                                                                
  x + 1, y + 1);
                                                graphics.DrawLine(pen, x + 2, y 
+ 1,
                                                                                
  x + width - 3, y + 1);
                                                pen.Color = dark;
                                                graphics.DrawLine(pen, x + 
width - 2, y + 1,
                                                                                
  x + width - 2, y + height - 2);
                                                graphics.DrawLine(pen, x + 
width - 3, y + height - 2,
                                                                                
  x + 1, y + height - 2);
                                                pen.Dispose();
                                                x += 2;
                                                y += 2;
                                                width -= 4;
                                                height -= 4;
                                        }
                                }

                                // Fill the button contents with the background 
color.
                                if(width > 0 && height > 0)
                                {
                                        brush = new SolidBrush(backColor);
                                        graphics.FillRectangle(brush, x, y, 
width, height);
                                        brush.Dispose();
                                }
                        }

        // Draw a caption button control.
        public static void DrawCaptionButton
                                (Graphics graphics, Rectangle rectangle,
                                 CaptionButton button, ButtonState state)
                        {
                                DrawCaptionButton(graphics, rectangle.X, 
rectangle.Y,
                                                                  
rectangle.Width, rectangle.Height,
                                                                  button, 
state);
                        }
        [TODO]
        public static void DrawCaptionButton
                                (Graphics graphics, int x, int y, int width, 
int height,
                                 CaptionButton button, ButtonState state)
                        {
                                // TODO
                        }

        // Draw a check box control.
        public static void DrawCheckBox(Graphics graphics, Rectangle rectangle,
                                                                    ButtonState 
state)
                        {
                                DrawCheckBox(graphics, rectangle.X, rectangle.Y,
                                                     rectangle.Width, 
rectangle.Height, state);
                        }
        [TODO]
        public static void DrawCheckBox(Graphics graphics, int x, int y,
                                                                    int width, 
int height, ButtonState state)
                        {
                                // TODO
                        }

        // Draw a combo box's drop down button control.
        public static void DrawComboButton(Graphics graphics, Rectangle 
rectangle,
                                                                       
ButtonState state)
                        {
                                DrawComboButton(graphics, rectangle.X, 
rectangle.Y,
                                                        rectangle.Width, 
rectangle.Height, state);
                        }
        [TODO]
        public static void DrawComboButton(Graphics graphics, int x, int y,
                                                                       int 
width, int height,
                                                                           
ButtonState state)
                        {
                                // TODO
                        }

        // Draw a container grab handle.
        [TODO]
        public static void DrawContainerGrabHandle
                                (Graphics graphics, Rectangle rectangle)
                        {
                                // TODO
                        }

        // Draw a focus rectangle.
        public static void DrawFocusRectangle
                                (Graphics graphics, Rectangle rectangle)
                        {
                                DrawFocusRectangle(graphics, rectangle,
                                                                   
SystemColors.ControlText,
                                                                   
SystemColors.Control);
                        }
        public static void DrawFocusRectangle
                                (Graphics graphics, Rectangle rectangle,
                                 Color foreColor, Color backColor)
                        {
                                Pen pen = new Pen(foreColor, 1.0f);
                                pen.EndCap = LineCap.Square;
                                pen.DashStyle = DashStyle.Dot;
                                graphics.DrawRectangle(pen, rectangle);
                                pen.Dispose();
                        }

        // Draw a grab handle.
        [TODO]
        public static void DrawGrabHandle
                                (Graphics graphics, Rectangle rectangle,
                                 bool primary, bool enabled)
                        {
                                // TODO
                        }

        // Draw a grid of dots.
        [TODO]
        public static void DrawGrid(Graphics graphics, Rectangle area,
                                                                Size 
pixelsBetweenDots, Color backColor)
                        {
                                // TODO
                        }

        // Draw an image in its disabled state.
        [TODO]
        public static void DrawImageDisabled
                                (Graphics graphics, Image image,
                                 int x, int y, Color background)
                        {
                                // TODO
                        }

        // Draw a locked selection frame.
        [TODO]
        public static void DrawLockedFrame
                                (Graphics graphics, Rectangle rectangle, bool 
primary)
                        {
                                // TODO
                        }

        // Draw a menu glyph.
        public static void DrawMenuGlyph
                                (Graphics graphics, Rectangle rectangle, 
MenuGlyph glyph)
                        {
                                DrawMenuGlyph(graphics, rectangle.X, 
rectangle.Y,
                                                      rectangle.Width, 
rectangle.Height, glyph);
                        }
        [TODO]
        public static void DrawMenuGlyph
                                (Graphics graphics, int x, int y, int width,
                                 int height, MenuGlyph glyph)
                        {
                                // TODO
                        }

        // Draw a three-state check box control.
        public static void DrawMixedCheckBox
                                (Graphics graphics, Rectangle rectangle, 
ButtonState state)
                        {
                                DrawMixedCheckBox(graphics, rectangle.X, 
rectangle.Y,
                                                          rectangle.Width, 
rectangle.Height, state);
                        }
        [TODO]
        public static void DrawMixedCheckBox
                                (Graphics graphics, int x, int y, int width,
                                 int height, ButtonState state)
                        {
                                // TODO
                        }

        // Draw a radio button control.
        public static void DrawRadioButton
                                (Graphics graphics, Rectangle rectangle, 
ButtonState state)
                        {
                                DrawRadioButton(graphics, rectangle.X, 
rectangle.Y,
                                                        rectangle.Width, 
rectangle.Height, state);
                        }
        [TODO]
        public static void DrawRadioButton
                                (Graphics graphics, int x, int y, int width,
                                 int height, ButtonState state)
                        {
                                // TODO
                        }

        // Draw a reversible frame.
        [TODO]
        public static void DrawReversibleFrame
                                (Rectangle rectangle, Color backColor, 
FrameStyle style)
                        {
                                // TODO
                        }

        // Draw a reversible line.
        [TODO]
        public static void DrawReversibleLine
                                (Point start, Point end, Color backColor)
                        {
                                // TODO
                        }

        // Draw a scroll button control.
        public static void DrawScrollButton
                                (Graphics graphics, Rectangle rectangle,
                                 ScrollButton button, ButtonState state)
                        {
                                DrawScrollButton(graphics, rectangle.X, 
rectangle.Y,
                                                         rectangle.Width, 
rectangle.Height,
                                                                 button, state);
                        }
        [TODO]
        public static void DrawScrollButton
                                (Graphics graphics, int x, int y, int width, 
int height,
                                 ScrollButton button, ButtonState state)
                        {
                                // TODO
                        }

        // Draw a selection frame.
        [TODO]
        public static void DrawSelectionFrame
                                (Graphics graphics, bool active, Rectangle 
outsideRect,
                                 Rectangle insideRect, Color backColor)
                        {
                                // TODO
                        }

        // Draw a size grip.
        public static void DrawSizeGrip
                                (Graphics graphics, Color backColor, Rectangle 
rectangle)
                        {
                                DrawSizeGrip(graphics, backColor, rectangle.X, 
rectangle.Y,
                                                         rectangle.Width, 
rectangle.Height);
                        }
        [TODO]
        public static void DrawSizeGrip
                                (Graphics graphics, Color backColor,
                                 int x, int y, int width, int height)
                        {
                                // TODO
                        }

        // Draw a disabled string.
        public static void DrawStringDisabled
                                (Graphics graphics, String s, Font font,
                             Color color, RectangleF layoutRectangle,
                                 StringFormat format)
                        {
                                SolidBrush brush = new SolidBrush(Light(color));
                                layoutRectangle.Offset(1.0f, 1.0f);
                                graphics.DrawString(s, font, brush, 
layoutRectangle, format);
                                brush.Color = Dark(color);
                                layoutRectangle.Offset(-1.0f, -1.0f);
                                graphics.DrawString(s, font, brush, 
layoutRectangle, format);
                                brush.Dispose();
                        }

        // Draw a filled reversible rectangle.
        [TODO]
        public static void FillReversibleRectangle
                                (Rectangle rectangle, Color backColor)
                        {
                                // TODO
                        }

}; // class ControlPaint

}; // namespace System.Windows.Forms

--- NEW FILE ---
/*
 * FlatStyle.cs - Implementation of the
 *                      "System.Windows.Forms.FlatStyle" 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
{

public enum FlatStyle
{
        Flat            = 0,
        Popup           = 1,
        Standard        = 2,
        System          = 3

}; // enum FlatStyle

}; // namespace System.Windows.Forms

--- NEW FILE ---
/*
 * FrameStyle.cs - Implementation of the
 *                      "System.Windows.Forms.FrameStyle" 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
{

public enum FrameStyle
{
        Dashed  = 0,
        Thick   = 1

}; // enum FrameStyle

}; // namespace System.Windows.Forms

--- NEW FILE ---
/*
 * IButtonControl.cs - Implementation of the
 *                      "System.Windows.Forms.IButtonControl" 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
{

public interface IButtonControl
{
        // Get or set the dialog result.
        DialogResult DialogResult { get; set; }

        // Notify the button that it is now the default button.
        void NotifyDefault(bool value);

        // Perform a click on this control.
        void PerformClick();

}; // interface IButtonControl

}; // namespace System.Windows.Forms

--- NEW FILE ---
/*
 * ImageList.cs - Implementation of the
 *                      "System.Windows.Forms.ImageList" 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
{

[TODO]
public class ImageList
{
        // TODO

}; // class ImageList

}; // namespace System.Windows.Forms

--- NEW FILE ---
/*
 * MenuGlyph.cs - Implementation of the
 *                      "System.Windows.Forms.MenuGlyph" 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
{

public enum MenuGlyph
{
        Min                     = 0,
        Arrow           = 0,
        Checkmark       = 1,
        Bullet          = 2,
        Max                     = 2

}; // enum MenuGlyph

}; // namespace System.Windows.Forms

--- NEW FILE ---
/*
 * ScrollButton.cs - Implementation of the
 *                      "System.Windows.Forms.ScrollButton" 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
{

public enum ScrollButton
{
        Up              = 0,
        Min             = 0,
        Down    = 1,
        Left    = 2,
        Right   = 3,
        Max             = 3

}; // enum ScrollButton

}; // namespace System.Windows.Forms

Index: Button.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/Button.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Button.cs   11 Jun 2003 07:07:19 -0000      1.1
--- Button.cs   12 Jun 2003 02:55:48 -0000      1.2
***************
*** 25,29 ****
  using System.Windows.Forms.Toolkit;
  
! public class Button : ButtonBase
  {
        // Internal result.
--- 25,29 ----
  using System.Windows.Forms.Toolkit;
  
! public class Button : ButtonBase, IButtonControl
  {
        // Internal result.
***************
*** 31,35 ****
  
        // Contructor.
!       public Button() {}
  
        // Get or set the dialog result associated with this button.
--- 31,40 ----
  
        // Contructor.
!       public Button()
!                       {
!                               // Turn off the standard click styles.
!                               SetStyle(ControlStyles.StandardClick |
!                                                
ControlStyles.StandardDoubleClick, false);
!                       }
  
        // Get or set the dialog result associated with this button.
***************
*** 46,49 ****
--- 51,66 ----
                        }
  
+       // Notify the button that it is now the default button.
+       public virtual void NotifyDefault(bool value)
+                       {
+                               IsDefault = value;
+                       }
+ 
+       // Perform a click on this control.
+       public void PerformClick()
+                       {
+                               OnClick(EventArgs.Empty);
+                       }
+ 
        // Process a button click.
        protected override void OnClick(EventArgs e)
***************
*** 61,64 ****
--- 78,121 ----
                                // Perform the default button click behaviour.
                                base.OnClick(e);
+                       }
+ 
+       // Convert this object into a string.
+       public override String ToString()
+                       {
+                               return base.ToString() + ", Text: " + Text;
+                       }
+ 
+       // Get the create parameters.  Not used in this implementation.
+       protected override CreateParams CreateParams
+                       {
+                               get
+                               {
+                                       return base.CreateParams;
+                               }
+                       }
+ 
+       // Handle the mouse up event to cause "Click" to be emitted.
+       protected override void OnMouseUp(MouseEventArgs e)
+                       {
+                               bool clicked = (entered && pressed);
+                               base.OnMouseUp(e);
+                               if(clicked)
+                               {
+                                       OnClick(EventArgs.Empty);
+                               }
+                       }
+ 
+       // Process a key mnemonic.
+       protected override bool ProcessMnemonic(char charCode)
+                       {
+                               if(IsMnemonic(charCode, Text))
+                               {
+                                       PerformClick();
+                                       return true;
+                               }
+                               else
+                               {
+                                       return base.ProcessMnemonic(charCode);
+                               }
                        }
  

Index: ButtonBase.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/ButtonBase.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** ButtonBase.cs       11 Jun 2003 07:07:19 -0000      1.1
--- ButtonBase.cs       12 Jun 2003 02:55:48 -0000      1.2
***************
*** 23,30 ****
  {
  
  public abstract class ButtonBase : Control
  {
        // Contructor.
!       internal ButtonBase() {}
  
  }; // class ButtonBase
--- 23,503 ----
  {
  
+ using System.Drawing;
+ 
  public abstract class ButtonBase : Control
  {
+       // Internal state.
+       private FlatStyle flatStyle;
+       private Image image;
+       private ContentAlignment imageAlign;
+       private int imageIndex;
+       private ImageList imageList;
+       private ContentAlignment textAlign;
+       private bool isDefault;
+       internal bool entered;
+       internal bool pressed;
+       private bool hasFocus;
+       private MouseButtons button;
+       private StringFormat format;
+ 
        // Contructor.
!       protected ButtonBase()
!                       {
!                               flatStyle = FlatStyle.Standard;
!                               imageAlign = ContentAlignment.MiddleCenter;
!                               imageIndex = -1;
!                               textAlign = ContentAlignment.MiddleCenter;
!                               format = new StringFormat();
!                               SetStringFormat();
!                               SetStyle(ControlStyles.ResizeRedraw, true);
!                       }
! 
!       // Get or set this control's properties.
!       public FlatStyle FlatStyle
!                       {
!                               get
!                               {
!                                       return flatStyle;
!                               }
!                               set
!                               {
!                                       if(flatStyle != value)
!                                       {
!                                               flatStyle = value;
!                                               Redraw();
!                                       }
!                               }
!                       }
!       public Image Image
!                       {
!                               get
!                               {
!                                       return image;
!                               }
!                               set
!                               {
!                                       if(image != value)
!                                       {
!                                               image = value;
!                                               Redraw();
!                                       }
!                               }
!                       }
!       public ContentAlignment ImageAlign
!                       {
!                               get
!                               {
!                                       return imageAlign;
!                               }
!                               set
!                               {
!                                       if(imageAlign != value)
!                                       {
!                                               imageAlign = value;
!                                               Redraw();
!                                       }
!                               }
!                       }
!       public int ImageIndex
!                       {
!                               get
!                               {
!                                       return imageIndex;
!                               }
!                               set
!                               {
!                                       if(imageIndex != value)
!                                       {
!                                               imageIndex = value;
!                                               Redraw();
!                                       }
!                               }
!                       }
!       public ImageList ImageList
!                       {
!                               get
!                               {
!                                       return imageList;
!                               }
!                               set
!                               {
!                                       if(imageList != value)
!                                       {
!                                               imageList = value;
!                                               Redraw();
!                                       }
!                               }
!                       }
!       public new ImeMode ImeMode
!                       {
!                               get
!                               {
!                                       return base.ImeMode;
!                               }
!                               set
!                               {
!                                       base.ImeMode = value;
!                               }
!                       }
!       public virtual ContentAlignment TextAlign
!                       {
!                               get
!                               {
!                                       return textAlign;
!                               }
!                               set
!                               {
!                                       if(textAlign != value)
!                                       {
!                                               textAlign = value;
!                                               SetStringFormat();
!                                               Redraw();
!                                       }
!                               }
!                       }
!       protected override CreateParams CreateParams
!                       {
!                               get
!                               {
!                                       return base.CreateParams;
!                               }
!                       }
!       protected override ImeMode DefaultImeMode
!                       {
!                               get
!                               {
!                                       return ImeMode.Disable;
!                               }
!                       }
!       protected override Size DefaultSize
!                       {
!                               get
!                               {
!                                       return new Size(75, 23);
!                               }
!                       }
!       protected bool IsDefault
!                       {
!                               get
!                               {
!                                       return isDefault;
!                               }
!                               set
!                               {
!                                       if(isDefault != value)
!                                       {
!                                               isDefault = value;
!                                               Redraw();
!                                       }
!                               }
!                       }
! 
! #if !CONFIG_COMPACT_FORMS
! 
!       // Create the accessibility object for this control.
!       protected override AccessibleObject CreateAccessibilityInstance()
!                       {
!                               return base.CreateAccessibilityInstance();
!                       }
! 
! #endif
! 
!       // Dispose of this instance.
!       protected override void Dispose(bool disposing)
!                       {
!                               // Nothing to do in this implementation.
!                               base.Dispose(disposing);
!                       }
! 
!       // Set the correct string format, based on text alignment and RTL info.
!       private void SetStringFormat()
!                       {
!                               ContentAlignment align = 
RtlTranslateAlignment(textAlign);
!                               switch(textAlign)
!                               {
!                                       case ContentAlignment.TopLeft:
!                                       {
!                                               format.Alignment = 
StringAlignment.Near;
!                                               format.LineAlignment = 
StringAlignment.Near;
!                                       }
!                                       break;
! 
!                                       case ContentAlignment.TopCenter:
!                                       {
!                                               format.Alignment = 
StringAlignment.Center;
!                                               format.LineAlignment = 
StringAlignment.Near;
!                                       }
!                                       break;
! 
!                                       case ContentAlignment.TopRight:
!                                       {
!                                               format.Alignment = 
StringAlignment.Far;
!                                               format.LineAlignment = 
StringAlignment.Near;
!                                       }
!                                       break;
! 
!                                       case ContentAlignment.MiddleLeft:
!                                       {
!                                               format.Alignment = 
StringAlignment.Near;
!                                               format.LineAlignment = 
StringAlignment.Center;
!                                       }
!                                       break;
! 
!                                       case ContentAlignment.MiddleCenter:
!                                       {
!                                               format.Alignment = 
StringAlignment.Center;
!                                               format.LineAlignment = 
StringAlignment.Center;
!                                       }
!                                       break;
! 
!                                       case ContentAlignment.MiddleRight:
!                                       {
!                                               format.Alignment = 
StringAlignment.Far;
!                                               format.LineAlignment = 
StringAlignment.Center;
!                                       }
!                                       break;
! 
!                                       case ContentAlignment.BottomLeft:
!                                       {
!                                               format.Alignment = 
StringAlignment.Near;
!                                               format.LineAlignment = 
StringAlignment.Far;
!                                       }
!                                       break;
! 
!                                       case ContentAlignment.BottomCenter:
!                                       {
!                                               format.Alignment = 
StringAlignment.Center;
!                                               format.LineAlignment = 
StringAlignment.Far;
!                                       }
!                                       break;
! 
!                                       case ContentAlignment.BottomRight:
!                                       {
!                                               format.Alignment = 
StringAlignment.Far;
!                                               format.LineAlignment = 
StringAlignment.Far;
!                                       }
!                                       break;
!                               }
!                       }
! 
!       // Calculate the current state of the button for its visual appearance.
!       internal virtual ButtonState CalculateState()
!                       {
!                               ButtonState state = ButtonState.Normal;
!                               if(Enabled)
!                               {
!                                       if(entered && pressed)
!                                       {
!                                               state |= ButtonState.Pushed;
!                                               if(flatStyle == FlatStyle.Flat)
!                                               {
!                                                       state |= 
ButtonState.Flat;
!                                               }
!                                       }
!                                       else if(entered)
!                                       {
!                                               if(flatStyle == FlatStyle.Flat)
!                                               {
!                                                       state |= 
ButtonState.Flat;
!                                               }
!                                       }
!                                       else
!                                       {
!                                               if(flatStyle == FlatStyle.Flat 
||
!                                                  flatStyle == FlatStyle.Popup)
!                                               {
!                                                       state |= 
ButtonState.Flat;
!                                               }
!                                       }
!                               }
!                               else
!                               {
!                                       state |= ButtonState.Inactive;
!                                       if(flatStyle == FlatStyle.Flat ||
!                                          flatStyle == FlatStyle.Popup)
!                                       {
!                                               state |= ButtonState.Flat;
!                                       }
!                               }
!                               return state;
!                       }
! 
!       // Draw the button in its current state on a Graphics surface.
!       private void Draw(Graphics graphics)
!                       {
!                               ButtonState state = CalculateState();
!                               Size clientSize = ClientSize;
!                               int x = 0;
!                               int y = 0;
!                               int width = clientSize.Width;
!                               int height = clientSize.Height;
! 
!                               // Draw the border and background.
!                               ControlPaint.DrawButton
!                                       (graphics, x, y, width, height, state,
!                                        ForeColor, BackColor, isDefault);
! 
!                               // TODO: draw the image.
! 
!                               // Draw the focus rectangle.
!                               if(hasFocus)
!                               {
!                                       ControlPaint.DrawFocusRectangle
!                                               (graphics, new Rectangle(x + 4, 
y + 4,
!                                                                               
                 width - 8, height - 8),
!                                                ForeColor, BackColor);
!                               }
! 
!                               // Get the text layout rectangle.
!                               RectangleF layout = new RectangleF
!                                       (x + 2, y + 2, width - 4, height - 4);
!                               if(entered && pressed)
!                               {
!                                       layout.Offset(1.0f, 1.0f);
!                               }
! 
!                               // Draw the text on the button.
!                               String text = Text;
!                               Font font = Font;
!                               if(text != null && text != String.Empty)
!                               {
!                                       if(Enabled)
!                                       {
!                                               Brush brush = new 
SolidBrush(ForeColor);
!                                               graphics.DrawString(text, font, 
brush, layout, format);
!                                               brush.Dispose();
!                                       }
!                                       else
!                                       {
!                                               ControlPaint.DrawStringDisabled
!                                                       (graphics, text, font, 
BackColor, layout, format);
!                                       }
!                               }
!                       }
! 
!       // Redraw the button after a state change.
!       private void Redraw()
!                       {
!                               // Bail out if the button is not currently 
visible.
!                               if(!Visible)
!                               {
!                                       return;
!                               }
! 
!                               // Redraw the button.
!                               Graphics graphics = CreateGraphics();
!                               Draw(graphics);
!                               graphics.Dispose();
!                       }
! 
!       // Override events from the "Control" class.
!       protected override void OnEnabledChanged(EventArgs e)
!                       {
!                               Redraw();
!                               base.OnEnabledChanged(e);
!                       }
!       protected override void OnGotFocus(EventArgs e)
!                       {
!                               hasFocus = true;
!                               Redraw();
!                               base.OnGotFocus(e);
!                       }
!       [TODO]
!       protected override void OnKeyDown(KeyEventArgs e)
!                       {
!                               // TODO
!                               base.OnKeyDown(e);
!                       }
!       [TODO]
!       protected override void OnKeyUp(KeyEventArgs e)
!                       {
!                               // TODO
!                               base.OnKeyUp(e);
!                       }
!       [TODO]
!       protected override void OnLostFocus(EventArgs e)
!                       {
!                               hasFocus = false;
!                               Redraw();
!                               base.OnLostFocus(e);
!                       }
!       protected override void OnMouseDown(MouseEventArgs e)
!                       {
!                               if(button == MouseButtons.None)
!                               {
!                                       button = e.Button;
!                                       pressed = true;
!                                       Redraw();
!                               }
!                               base.OnMouseDown(e);
!                       }
!       protected override void OnMouseEnter(EventArgs e)
!                       {
!                               entered = true;
!                               Redraw();
!                               base.OnMouseEnter(e);
!                       }
!       protected override void OnMouseLeave(EventArgs e)
!                       {
!                               entered = false;
!                               Redraw();
!                               base.OnMouseLeave(e);
!                       }
!       protected override void OnMouseMove(MouseEventArgs e)
!                       {
!                               base.OnMouseMove(e);
!                       }
!       protected override void OnMouseUp(MouseEventArgs e)
!                       {
!                               if(button == e.Button)
!                               {
!                                       button = MouseButtons.None;
!                                       pressed = false;
!                                       Redraw();
!                               }
!                               base.OnMouseUp(e);
!                       }
!       protected override void OnPaint(PaintEventArgs e)
!                       {
!                               Draw(e.Graphics);
!                               base.OnPaint(e);
!                       }
!       protected override void OnParentChanged(EventArgs e)
!                       {
!                               Redraw();
!                               base.OnParentChanged(e);
!                       }
!       protected override void OnTextChanged(EventArgs e)
!                       {
!                               Redraw();
!                               base.OnTextChanged(e);
!                       }
!       protected override void OnRightToLeftChanged(EventArgs e)
!                       {
!                               SetStringFormat();
!                               Redraw();
!                               base.OnRightToLeftChanged(e);
!                       }
!       protected override void OnVisibleChanged(EventArgs e)
!                       {
!                               if(!Visible)
!                               {
!                                       entered = false;
!                                       pressed = false;
!                                       hasFocus = false;
!                                       button = MouseButtons.None;
!                               }
!                               base.OnVisibleChanged(e);
!                       }
! 
! #if !CONFIG_COMPACT_FORMS
! 
!       // Process a message.
!       public override void WndProc(ref Message m)
!                       {
!                               base.WndProc(ref m);
!                       }
! 
! #endif // !CONFIG_COMPACT_FORMS
  
  }; // class ButtonBase

Index: Control.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/Control.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Control.cs  11 Jun 2003 19:07:24 -0000      1.3
--- Control.cs  12 Jun 2003 02:55:48 -0000      1.4
***************
*** 26,29 ****
--- 26,30 ----
  using System.Drawing;
  using System.Drawing.Toolkit;
+ using System.Drawing.Text;
  using System.Collections;
  using System.Windows.Forms.Toolkit;
***************
*** 64,67 ****
--- 65,69 ----
        private ControlStyles styles;
        private CreateParams createParams;
+       private static Font defaultFont;
  
        // Constructors.
***************
*** 551,561 ****
                                }
                        }
-       [TODO]
        public static Font DefaultFont
                        {
                                get
                                {
!                                       // TODO
!                                       return null;
                                }
                        }
--- 553,570 ----
                                }
                        }
        public static Font DefaultFont
                        {
                                get
                                {
!                                       lock(typeof(Control))
!                                       {
!                                               if(defaultFont == null)
!                                               {
!                                                       defaultFont = new Font
!                                                               (new FontFamily
!                                                                       
(GenericFontFamilies.SansSerif), 12.0f);
!                                               }
!                                               return defaultFont;
!                                       }
                                }
                        }





reply via email to

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