diff options
author | Peter Dennis Bartok <pbartok@mono-cvs.ximian.com> | 2005-02-17 14:12:28 +0300 |
---|---|---|
committer | Peter Dennis Bartok <pbartok@mono-cvs.ximian.com> | 2005-02-17 14:12:28 +0300 |
commit | 37becc533233cd53b3e5637f72561e7c69829cba (patch) | |
tree | da3abba10f1657103b5135742f3bc398e4fa680e /mcs/class | |
parent | 1741016455274183e22b4902219c00242c292109 (diff) |
2005-02-17 Peter Bartok <pbartok@novell.com>
* Application.cs: Now calls registered message filters
* DockStyle.cs: Fixed attribute
* Form.cs: Fixed attribute
* Menu.cs: Fixed attribute
* ToolTip.cs: Fixed attribute
* TreeNode.cs: Added missing attributes and arranged in regions
* PropertyGrid.cs: Fixed signatures
* TreeNodeCollection.cs: Added attributes
* Splitter.cs: Added missing attributes; arranged into regions
* TabPage.cs: Added missing attributes; arranged into regions
* TextBoxBase.cs: Added missing attributes
* TextBox.cs: Added missing attributes
* ArrangeDirection.cs: Added missing attributes
* TreeNodeConverter.cs: Added stub (needed for TreeNode)
* ToolBarButton.cs: Fixed attributes
* AnchorStyles.cs: Fixed attribute
* TrackBar.cs: Fixed attributes
* TabControl.cs: Added missing attributes and arranged into regions
* ToolBar.cs: Fixed attribute
* StatusBar.cs: Fixed signature, organized into regions and added
attributes
* StatusBarPanel.cs: Fixed attributes
* ContentsResizedEventArgs.cs: Implemented
* ContentsResizedEventHandler.cs: Implemented
* DateBoldEventArgs.cs: Implemented
* DateBoldEventHandler.cs: Implemented
* UpDownEventArgs.cs: Implemented
* UpDownEventHandler.cs: Implemented
svn path=/trunk/mcs/; revision=40801
Diffstat (limited to 'mcs/class')
30 files changed, 1353 insertions, 529 deletions
diff --git a/mcs/class/Managed.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/ChangeLog index 7d43f5b6d21..2a3b3954c7d 100644 --- a/mcs/class/Managed.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/ChangeLog @@ -1,3 +1,9 @@ +2005-02-17 Peter Bartok <pbartok@novell.com> + + * System.Windows.Forms.dll.sources: Added DateBoldEventHandler.cs, + DateBoldEventArgs.cs, UpDownEventHandler.cs, UpDownEventArgs.cs, + ContentsResizedEventHandler.cs, ContentsResizedEventArgs.cs + 2005-02-15 Peter Bartok <pbartok@novell.com> * Makefile: Altered, following Harinath's suggestion of trying to diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources index 2ea1c02151d..5b957ed6b89 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources @@ -57,6 +57,8 @@ System.Windows.Forms/ComboBoxStyle.cs System.Windows.Forms/CommonDialog.cs System.Windows.Forms/ComponentModel.cs System.Windows.Forms/ContainerControl.cs +System.Windows.Forms/ContentsResizedEventArgs.cs +System.Windows.Forms/ContentsResizedEventHandler.cs System.Windows.Forms/ContextMenu.cs System.Windows.Forms/Control.cs System.Windows.Forms/ControlEventArgs.cs @@ -72,6 +74,8 @@ System.Windows.Forms/DataGrid.cs System.Windows.Forms/DataGridLineStyle.cs System.Windows.Forms/DataGridParentRowsLabelStyle.cs System.Windows.Forms/DataGridTableStyle.cs +System.Windows.Forms/DateBoldEventArgs.cs +System.Windows.Forms/DateBoldEventHandler.cs System.Windows.Forms/DateRangeEventArgs.cs System.Windows.Forms/DateRangeEventHandler.cs System.Windows.Forms/DateTimePicker.cs @@ -281,6 +285,7 @@ System.Windows.Forms/ToolTip.cs System.Windows.Forms/TrackBar.cs System.Windows.Forms/TreeNode.cs System.Windows.Forms/TreeNodeCollection.cs +System.Windows.Forms/TreeNodeConverter.cs System.Windows.Forms/TreeView.cs System.Windows.Forms/TreeViewAction.cs System.Windows.Forms/TreeViewCancelEventArgs.cs @@ -292,6 +297,8 @@ System.Windows.Forms/UICues.cs System.Windows.Forms/UICuesEventArgs.cs System.Windows.Forms/UICuesEventHandler.cs System.Windows.Forms/UpDownBase.cs +System.Windows.Forms/UpDownEventArgs.cs +System.Windows.Forms/UpDownEventHandler.cs System.Windows.Forms/UserControl.cs System.Windows.Forms/View.cs System.Windows.Forms/VScrollBar.cs diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AnchorStyles.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AnchorStyles.cs index 89d430f7d26..23355ab3786 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AnchorStyles.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AnchorStyles.cs @@ -31,7 +31,7 @@ using System.ComponentModel; namespace System.Windows.Forms { [Flags] [Serializable] - [Editor("System.Windows.Forms.Design.AnchorEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] + [Editor("System.Windows.Forms.Design.AnchorEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))] public enum AnchorStyles { None = 0x00000000, Top = 0x00000001, diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs index d44a6b7cd2f..b37537d1b79 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs @@ -84,6 +84,28 @@ namespace System.Windows.Forms { form.CreateControl(); while (!exiting && !form.end_modal && XplatUI.GetMessage(ref msg, IntPtr.Zero, 0, 0)) { + if (message_filters.Count > 0) { + Message m; + bool drop; + + drop = false; + m = new Message(); + m.Msg = (int)msg.message; + m.HWnd = msg.hwnd; + m.LParam = msg.lParam; + m.WParam = msg.wParam; + for (int i = 0; i < message_filters.Count; i++) { + if (((IMessageFilter)message_filters[i]).PreFilterMessage(ref m)) { + // we're dropping the message + drop = true; + break; + } + } + if (drop) { + continue; + } + } + XplatUI.TranslateMessage(ref msg); XplatUI.DispatchMessage(ref msg); @@ -311,6 +333,28 @@ namespace System.Windows.Forms { messageloop_started = true; while (!exiting && XplatUI.GetMessage(ref msg, IntPtr.Zero, 0, 0)) { + if (message_filters.Count > 0) { + Message m; + bool drop; + + drop = false; + m = new Message(); + m.Msg = (int)msg.message; + m.HWnd = msg.hwnd; + m.LParam = msg.lParam; + m.WParam = msg.wParam; + for (int i = 0; i < message_filters.Count; i++) { + if (((IMessageFilter)message_filters[i]).PreFilterMessage(ref m)) { + // we're dropping the message + drop = true; + break; + } + } + if (drop) { + continue; + } + } + XplatUI.TranslateMessage(ref msg); XplatUI.DispatchMessage(ref msg); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ArrangeDirection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ArrangeDirection.cs index 59123e549ae..bc6e8190e02 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ArrangeDirection.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ArrangeDirection.cs @@ -26,7 +26,10 @@ // COMPLETE +using System.Runtime.InteropServices; + namespace System.Windows.Forms { + [ComVisible(true)] public enum ArrangeDirection { Left = 0, Right = 0, diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 873f5c7c62d..8664a1e5135 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,34 @@ +2005-02-17 Peter Bartok <pbartok@novell.com> + + * Application.cs: Now calls registered message filters + * DockStyle.cs: Fixed attribute + * Form.cs: Fixed attribute + * Menu.cs: Fixed attribute + * ToolTip.cs: Fixed attribute + * TreeNode.cs: Added missing attributes and arranged in regions + * PropertyGrid.cs: Fixed signatures + * TreeNodeCollection.cs: Added attributes + * Splitter.cs: Added missing attributes; arranged into regions + * TabPage.cs: Added missing attributes; arranged into regions + * TextBoxBase.cs: Added missing attributes + * TextBox.cs: Added missing attributes + * ArrangeDirection.cs: Added missing attributes + * TreeNodeConverter.cs: Added stub (needed for TreeNode) + * ToolBarButton.cs: Fixed attributes + * AnchorStyles.cs: Fixed attribute + * TrackBar.cs: Fixed attributes + * TabControl.cs: Added missing attributes and arranged into regions + * ToolBar.cs: Fixed attribute + * StatusBar.cs: Fixed signature, organized into regions and added + attributes + * StatusBarPanel.cs: Fixed attributes + * ContentsResizedEventArgs.cs: Implemented + * ContentsResizedEventHandler.cs: Implemented + * DateBoldEventArgs.cs: Implemented + * DateBoldEventHandler.cs: Implemented + * UpDownEventArgs.cs: Implemented + * UpDownEventHandler.cs: Implemented + 2005-02-16 Jordi Mas i Hernandez <jordi@ximian.com> * Form.cs: first Menu NC refactoring diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContentsResizedEventArgs.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContentsResizedEventArgs.cs new file mode 100644 index 00000000000..765276f6cda --- /dev/null +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContentsResizedEventArgs.cs @@ -0,0 +1,51 @@ +// 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. +// +// Copyright (c) 2005 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Peter Bartok (pbartok@novell.com) +// +// + +// COMPLETE + +using System.Drawing; + +namespace System.Windows.Forms { + public class ContentsResizedEventArgs : EventArgs { + #region Local Variables + Rectangle rect; + #endregion // Local Variables + + #region Public Constructors + public ContentsResizedEventArgs(Rectangle newRectangle) { + rect = newRectangle; + } + #endregion // Public Constructors + + #region Public Instance Properties + public Rectangle NewRectangle { + get { + return rect; + } + } + #endregion // Public Instance Properties + } +} diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContentsResizedEventHandler.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContentsResizedEventHandler.cs new file mode 100644 index 00000000000..6a9f6d840a0 --- /dev/null +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContentsResizedEventHandler.cs @@ -0,0 +1,31 @@ +// 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. +// +// Copyright (c) 2005 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Peter Bartok (pbartok@novell.com) +// +// + +// COMPLETE + +namespace System.Windows.Forms { + public delegate void ContentsResizedEventHandler(object sender, ContentsResizedEventArgs e); +} diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateBoldEventArgs.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateBoldEventArgs.cs new file mode 100644 index 00000000000..755c21340b8 --- /dev/null +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateBoldEventArgs.cs @@ -0,0 +1,69 @@ +// 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. +// +// Copyright (c) 2005 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Peter Bartok (pbartok@novell.com) +// +// + +// COMPLETE + +namespace System.Windows.Forms { + public class DateBoldEventArgs : EventArgs { + #region Local Variables + private int size; + private DateTime start; + private int[] days_to_bold; + #endregion // Local Variables + + #region Internal Constructor + DateBoldEventArgs(DateTime start, int size, int[] daysToBold) { + this.start = start; + this.size = size; + this.days_to_bold = daysToBold; + } + #endregion + + #region Public Instance Properties + public int[] DaysToBold { + get { + return days_to_bold; + } + + set { + days_to_bold = value; + } + } + + public int Size { + get { + return size; + } + } + + public DateTime StartDate { + get { + return start; + } + } + #endregion // Public Instance Properties + } +} diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateBoldEventHandler.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateBoldEventHandler.cs new file mode 100644 index 00000000000..3d1e5d54e59 --- /dev/null +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateBoldEventHandler.cs @@ -0,0 +1,31 @@ +// 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. +// +// Copyright (c) 2005 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Peter Bartok (pbartok@novell.com) +// +// + +// COMPLETE + +namespace System.Windows.Forms { + public delegate void DateBoldEventHandler (object sender, DateBoldEventArgs e); +} diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DockStyle.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DockStyle.cs index b2740261a23..2176ceff218 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DockStyle.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DockStyle.cs @@ -29,7 +29,7 @@ using System.ComponentModel; namespace System.Windows.Forms { - [Editor("System.Windows.Forms.Design.DockEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] + [Editor("System.Windows.Forms.Design.DockEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))] public enum DockStyle { None = 0, Top = 1, diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs index b4e3d1601ef..1caa9b589e5 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs @@ -37,7 +37,7 @@ using System.Threading; namespace System.Windows.Forms { [DesignerCategory("Form")] [DesignTimeVisible(false)] - [Designer("System.Windows.Forms.Design.FormDesigner, System.Design")] + [Designer("System.Windows.Forms.Design.FormDesigner, " + Consts.AssemblySystem_Design, typeof(IRootDesigner))] [DefaultEvent("Load")] [ToolboxItem(false)] public class Form : ContainerControl { diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs index 3f9da7d1167..af92c360a93 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs @@ -36,7 +36,7 @@ using System.Runtime.InteropServices; namespace System.Windows.Forms { - [Designer ("System.Windows.Forms.Design.MenuDesigner, Microsoft.VisualStudio.Windows.Forms.MenuDesigner, Microsoft.VisualStudio, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f711d50a3a", (string)null)] + [Designer ("Microsoft.VisualStudio.Windows.Forms.MenuDesigner, Microsoft.VisualStudio, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", (string)null)] [ToolboxItemFilter("System.Windows.Forms", ToolboxItemFilterType.Allow)] [ListBindable(false)] public abstract class Menu : Component diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs index f1f44492533..88d455e8dbc 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs @@ -26,17 +26,18 @@ // NOT COMPLETE using System; -using System.Drawing; -using System.Windows.Forms; -using System.ComponentModel; using System.Collections; -using System.Windows.Forms.Design; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.Drawing; using System.Reflection; +using System.Windows.Forms.Design; using System.Windows.Forms.PropertyGridInternal; namespace System.Windows.Forms -{ - public class PropertyGrid : System.Windows.Forms.ContainerControl +{ + [Designer("System.Windows.Forms.Design.PropertyGridDesigner, " + Consts.AssemblySystem_Design)] + public class PropertyGrid : System.Windows.Forms.ContainerControl, ComponentModel.Com2Interop.IComPropertyBrowser { #region Private Members @@ -434,6 +435,8 @@ namespace System.Windows.Forms } } + [DefaultValue(null)] + [TypeConverter("System.Windows.Forms.PropertyGrid+SelectedObjectConverter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public object SelectedObject { get { @@ -448,6 +451,7 @@ namespace System.Windows.Forms } [BrowsableAttribute(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public object[] SelectedObjects { get { @@ -461,6 +465,8 @@ namespace System.Windows.Forms } [BrowsableAttribute(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public PropertyTab SelectedTab { get { @@ -539,6 +545,8 @@ namespace System.Windows.Forms [MonoTODO] + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] protected virtual Type DefaultTabType { get { @@ -601,7 +609,6 @@ namespace System.Windows.Forms protected override void OnGotFocus(EventArgs e) { - has_focus=true; base.OnGotFocus(e); } @@ -615,11 +622,6 @@ namespace System.Windows.Forms base.OnHandleDestroyed (e); } - protected override void OnLostFocus(EventArgs e) - { - has_focus=false; - base.OnLostFocus(e); - } protected override void OnMouseDown(MouseEventArgs e) { @@ -704,9 +706,56 @@ namespace System.Windows.Forms public event EventHandler SelectedObjectsChanged; #endregion + #region Com2Interop.IComPropertyBrowser Interface + [MonoTODO] + bool ComponentModel.Com2Interop.IComPropertyBrowser.InPropertySet { + get { + throw new NotImplementedException(); + } + } + + [MonoTODO] + void ComponentModel.Com2Interop.IComPropertyBrowser.DropDownDone() { + throw new NotImplementedException(); + } + + [MonoTODO] + bool ComponentModel.Com2Interop.IComPropertyBrowser.EnsurePendingChangesCommitted() { + throw new NotImplementedException(); + } + + [MonoTODO] + void ComponentModel.Com2Interop.IComPropertyBrowser.HandleF4() { + throw new NotImplementedException(); + } + + [MonoTODO] + void ComponentModel.Com2Interop.IComPropertyBrowser.LoadState(Microsoft.Win32.RegistryKey key) { + throw new NotImplementedException(); + } + + [MonoTODO] + void ComponentModel.Com2Interop.IComPropertyBrowser.SaveState(Microsoft.Win32.RegistryKey key) { + throw new NotImplementedException(); + } + + [MonoTODO] + private event ComponentRenameEventHandler com_component_name_changed; + event ComponentRenameEventHandler ComponentModel.Com2Interop.IComPropertyBrowser.ComComponentNameChanged { + add { com_component_name_changed += value; } + remove { com_component_name_changed -= value; } + } + #endregion // Com2Interop.IComPropertyBrowser Interface + #region PropertyTabCollection Class public class PropertyTabCollection : ICollection, IEnumerable { + #region Private Constructors + private PropertyTabCollection() { + } + + #endregion // Private Constructors + [MonoTODO] public PropertyTab this[int index] { @@ -717,7 +766,7 @@ namespace System.Windows.Forms #region ICollection Members [MonoTODO] - public bool IsSynchronized + bool ICollection.IsSynchronized { get { // TODO: Add PropertyTabCollection.IsSynchronized getter implementation @@ -726,13 +775,13 @@ namespace System.Windows.Forms } [MonoTODO] - public void CopyTo(Array array, int index) + void ICollection.CopyTo(Array array, int index) { // TODO: Add PropertyTabCollection.CopyTo implementation } [MonoTODO] - public object SyncRoot + object ICollection.SyncRoot { get { // TODO: Add PropertyTabCollection.SyncRoot getter implementation diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs index 7ae4fe2c504..9e49b3ef85d 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs @@ -17,7 +17,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -// Copyright (c) 2004 Novell, Inc. +// Copyright (c) 2004-2005 Novell, Inc. // // Authors: // Jackson Harper (jackson@ximian.com) @@ -25,13 +25,17 @@ using System; +using System.ComponentModel; +using System.ComponentModel.Design; using System.Drawing; namespace System.Windows.Forms { - - public class Splitter : Control { - + [DefaultEvent("SplitterMoved")] + [Designer("System.Windows.Forms.Design.SplitterDesigner, " + Consts.AssemblySystem_Design)] + [DefaultProperty("Dock")] + public class Splitter : Control, IMessageFilter { + #region Fields private int min_extra; private int min_size; private int move_start_x; @@ -45,7 +49,9 @@ namespace System.Windows.Forms { private SplitterEventHandler on_splitter_moving; private Control adjacent; + #endregion // Fields + #region Public Constructors public Splitter () { SetStyle (ControlStyles.UserPaint, true); @@ -55,8 +61,16 @@ namespace System.Windows.Forms { SetStyle (ControlStyles.Selectable, false); Dock = DockStyle.Left; + + min_extra = 25; + min_size = 25; } + #endregion // Public Constructors + + #region Public Instance Properties + [DefaultValue(DockStyle.Left)] + [Localizable(true)] public override DockStyle Dock { get { return base.Dock; } set { @@ -79,6 +93,8 @@ namespace System.Windows.Forms { } } + [DefaultValue(25)] + [Localizable(true)] public int MinExtra { get { return min_extra; } set { @@ -88,6 +104,8 @@ namespace System.Windows.Forms { } } + [DefaultValue(25)] + [Localizable(true)] public int MinSize { get { return min_size; @@ -99,6 +117,8 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int SplitPosition { get { Control adjacent = FindAdjacentControl (); @@ -127,27 +147,37 @@ namespace System.Windows.Forms { } } - + #endregion // Public Instance Properties + + #region Protected Instance Properties + protected override CreateParams CreateParams {
+ get {
+ return base.CreateParams;
+ }
+ }
+
+ protected override ImeMode DefaultImeMode {
+ get {
+ return base.DefaultImeMode;
+ }
+ }
+
protected override Size DefaultSize { get { return new Size (3, 3); } } - protected virtual void OnSplitterMoved (SplitterEventArgs e) - { - if (on_splitter_moved != null) - on_splitter_moved (this, e); - Move (e.SplitX, e.SplitY); - } + #endregion // Protected Instance Properties - protected virtual void OnSplitterMoving (SplitterEventArgs e) - { - if (on_splitter_moving != null) - on_splitter_moving (this, e); - Move (e.SplitX, e.SplitY); + #region Public Instance Methods + [MonoTODO] + public bool PreFilterMessage(ref Message m) { + return false; } + #endregion // Public Instance Methods + #region Protected Instance Methods protected override void OnMouseDown (MouseEventArgs e) { base.OnMouseDown (e); @@ -192,6 +222,18 @@ namespace System.Windows.Forms { adjacent = null; } + protected virtual void OnSplitterMoved (SplitterEventArgs e) { + if (on_splitter_moved != null) + on_splitter_moved (this, e); + Move (e.SplitX, e.SplitY); + } + + protected virtual void OnSplitterMoving (SplitterEventArgs e) { + if (on_splitter_moving != null) + on_splitter_moving (this, e); + Move (e.SplitX, e.SplitY); + } + protected override void SetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) { if (horz) { @@ -209,15 +251,16 @@ namespace System.Windows.Forms { base.SetBoundsCore (x, y, width, height, specified); } - private void Draw () - { + #endregion // Protected Instance Methods + + #region Internal & Private Methods + private void Draw () { using (Graphics pdc = Parent.CreateGraphics ()) { pdc.FillRectangle (new SolidBrush (Color.Red), ClientRectangle); } } - private void Move (int x, int y) - { + private void Move (int x, int y) { if (adjacent == null) return; @@ -236,8 +279,7 @@ namespace System.Windows.Forms { Draw (); } - private Control FindAdjacentControl () - { + private Control FindAdjacentControl () { if (Parent == null) return null; @@ -248,95 +290,121 @@ namespace System.Windows.Forms { switch (Dock) { - case DockStyle.Left: - if (sibling.Right == Left) - return sibling; - break; - - case DockStyle.Right: - if (sibling.Left == Right) - return sibling; - break; - - case DockStyle.Top: - if (sibling.Bottom == Top) - return sibling; - break; - - case DockStyle.Bottom: - if (sibling.Top == Bottom) - return sibling; - break; + case DockStyle.Left: + if (sibling.Right == Left) + return sibling; + break; + + case DockStyle.Right: + if (sibling.Left == Right) + return sibling; + break; + + case DockStyle.Top: + if (sibling.Bottom == Top) + return sibling; + break; + + case DockStyle.Bottom: + if (sibling.Top == Bottom) + return sibling; + break; } } return null; } + #endregion // Internal & Private Methods + + #region Events + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public new event EventHandler BackgroundImageChanged { add { base.BackgroundImageChanged += value; } remove { base.BackgroundImageChanged -= value; } } - public new event EventHandler Enter { + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler Enter { add { base.Enter += value; } remove { base.Enter -= value; } } - public new event EventHandler FontChanged { + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler FontChanged { add { base.FontChanged += value; } remove { base.FontChanged -= value; } } - public new event EventHandler ForeColorChanged { + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler ForeColorChanged { add { base.ForeColorChanged += value; } remove { base.ForeColorChanged -= value; } } - public new event EventHandler ImeModeChanged { + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler ImeModeChanged { add { base.ImeModeChanged += value; } remove { base.ImeModeChanged -= value; } } - public new event KeyEventHandler KeyDown { + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event KeyEventHandler KeyDown { add { base.KeyDown += value; } remove { base.KeyDown -= value; } } - public new event KeyPressEventHandler KeyPress { + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event KeyPressEventHandler KeyPress { add { base.KeyPress += value; } remove { base.KeyPress -= value; } } - public new event KeyEventHandler KeyUp { + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event KeyEventHandler KeyUp { add { base.KeyUp += value; } remove { base.KeyUp -= value; } } - public new event EventHandler Leave { + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler Leave { add { base.Leave += value; } remove { base.Leave -= value; } } - public new event EventHandler TabStopChanged { + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler TabStopChanged { add { base.TabStopChanged += value; } remove { base.TabStopChanged -= value; } } - public new event EventHandler TextChanged { + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler TextChanged { add { base.TextChanged += value; } remove { base.TextChanged -= value; } } - public event SplitterEventHandler SplitterMoved { + public event SplitterEventHandler SplitterMoved { add { on_splitter_moved += value; } remove { on_splitter_moved -= value; } } - public event SplitterEventHandler SplitterMoving { + public event SplitterEventHandler SplitterMoving { add { on_splitter_moving += value; } remove { on_splitter_moving -= value; } } + #endregion } } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBar.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBar.cs index a5f66df8250..d830fa785cd 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBar.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBar.cs @@ -17,7 +17,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -// Copyright (c) 2004 Novell, Inc. +// Copyright (c) 2004-2005 Novell, Inc. // // Authors: // Jackson Harper (jackson@ximian.com) @@ -28,67 +28,39 @@ // using System.Collections; +using System.ComponentModel; +using System.ComponentModel.Design; using System.Drawing; using System.Drawing.Text; using System.Drawing.Imaging; namespace System.Windows.Forms { - + [DefaultEvent("PanelClick")] + [Designer("System.Windows.Forms.Design.StatusBarDesigner, " + Consts.AssemblySystem_Design)] + [DefaultProperty("Text")] public class StatusBar : Control { - + #region Fields private StatusBarPanelCollection panels; private bool show_panels = false; private bool sizing_grip = true; internal Rectangle paint_area = new Rectangle (); + #endregion // Fields + #region Public Constructors + [MonoTODO("Change cursor when mouse is over grip")] public StatusBar () { base.Dock = DockStyle.Bottom; Anchor = AnchorStyles.Top | AnchorStyles.Left; + this.TabStop = false; } + #endregion // Public Constructors - public override string Text { - get { return base.Text; } - set { - if (value == Text) - return; - base.Text = value; - Refresh (); - } - - } - - public bool ShowPanels { - get { return show_panels; } - set { - if (show_panels == value) - return; - show_panels = value; - } - } - - public bool SizingGrip { - get { return sizing_grip; } - set { - if (sizing_grip == value) - return; - sizing_grip = value; - } - } - - public Color ForeColor { - get { return base.ForeColor; } - set { - if (value == ForeColor) - return; - if (ForeColorChanged != null) - ForeColorChanged (this, EventArgs.Empty); - Refresh (); - } - } - + #region Public Instance Properties + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public Color BackColor { get { return base.BackColor; } set { @@ -101,6 +73,8 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public Image BackgroundImage { get { return base.BackgroundImage; } set { @@ -112,6 +86,8 @@ namespace System.Windows.Forms { } } + [Localizable(true)] + [DefaultValue(DockStyle.Bottom)] public override DockStyle Dock { get { return base.Dock; } set { @@ -122,6 +98,7 @@ namespace System.Windows.Forms { } } + [Localizable(true)] public override Font Font { get { return base.Font; } set { @@ -132,6 +109,21 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public Color ForeColor { + get { return base.ForeColor; } + set { + if (value == ForeColor) + return; + if (ForeColorChanged != null) + ForeColorChanged (this, EventArgs.Empty); + Refresh (); + } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public new ImeMode ImeMode { get { return base.ImeMode; } set { @@ -143,11 +135,9 @@ namespace System.Windows.Forms { } } - public new bool TabStop { - get { return base.TabStop; } - set { base.TabStop = value; } - } - + [MergableProperty(false)] + [Localizable(true)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public StatusBarPanelCollection Panels { get { if (panels == null) @@ -156,124 +146,158 @@ namespace System.Windows.Forms { } } - public override string ToString () - { - return base.ToString () + ", Panels.Count: " + Panels.Count + - (Panels.Count > 0 ? ", Panels[0]: " + Panels [0] : String.Empty); + [DefaultValue(false)] + public bool ShowPanels { + get { return show_panels; } + set { + if (show_panels == value) + return; + show_panels = value; + } } - public new event EventHandler BackColorChanged; - public new event EventHandler ForeColorChanged; - public new event EventHandler BackgroundImageChanged; - public event StatusBarDrawItemEventHandler DrawItem; - public new event EventHandler ImeModeChanged; - public new event PaintEventHandler Paint; - public event StatusBarPanelClickEventHandler PanelClick; - + [DefaultValue(true)] + public bool SizingGrip { + get { return sizing_grip; } + set { + if (sizing_grip == value) + return; + sizing_grip = value; + } + } + + [DefaultValue(false)] + public new bool TabStop { + get { return base.TabStop; } + set { base.TabStop = value; } + } + + [Localizable(true)] + public override string Text { + get { return base.Text; } + set { + if (value == Text) + return; + base.Text = value; + Refresh (); + } + + } + + #endregion Public Instance Properties + + #region Protected Instance Properties protected override CreateParams CreateParams { get { return base.CreateParams; } } - protected override Size DefaultSize { - get { return ThemeEngine.Current.StatusBarDefaultSize; } - } - protected override ImeMode DefaultImeMode { get { return ImeMode.Disable; } } - protected override void WndProc(ref Message m) - { - switch ((Msg) m.Msg) { - case Msg.WM_PAINT: { - PaintEventArgs paint_event; + protected override Size DefaultSize { + get { return ThemeEngine.Current.StatusBarDefaultSize; } + } - paint_event = XplatUI.PaintEventStart (Handle); - DoPaint (paint_event); - XplatUI.PaintEventEnd (Handle); - return; - } - } - base.WndProc (ref m); + #endregion // Protected Instance Properties + + #region Public Instance Methods + public override string ToString () { + return base.ToString () + ", Panels.Count: " + Panels.Count + + (Panels.Count > 0 ? ", Panels[0]: " + Panels [0] : String.Empty); } + #endregion // Public Instance Methods + + #region Protected Instance Methods protected override void CreateHandle () { base.CreateHandle (); } - protected override void OnResize (EventArgs e) - { - base.OnResize (e); - - if (Width <= 0 || Height <= 0) - return; + protected override void Dispose (bool disposing) { + base.Dispose (disposing); + } - UpdateArea (); - CalcPanelSizes (); - Draw (); + protected virtual void OnDrawItem (StatusBarDrawItemEventArgs e) { + if (DrawItem != null) + DrawItem (this, e); } - protected override void OnHandleCreated (EventArgs e) - { + protected override void OnHandleCreated (EventArgs e) { base.OnHandleCreated (e); UpdateArea (); Draw(); } - protected override void OnHandleDestroyed (EventArgs e) - { + protected override void OnHandleDestroyed (EventArgs e) { base.OnHandleDestroyed (e); } - protected override void OnLayout (LayoutEventArgs e) - { + protected override void OnLayout (LayoutEventArgs e) { base.OnLayout (e); } - protected override void OnMouseDown (MouseEventArgs e) - { - if (panels == null) - return; - - float prev_x = 0; - float gap = ThemeEngine.Current.StatusBarHorzGapWidth; - for (int i = 0; i < panels.Count; i++) { - float x = panels [i].Width + prev_x + (i == panels.Count - 1 ? gap : gap / 2); - if (e.X >= prev_x && e.X <= x) { - OnPanelClick (new StatusBarPanelClickEventArgs (panels [i], - e.Button, e.Clicks, e.X, e.Y)); - break; - } - prev_x = x; - } + protected override void OnMouseDown (MouseEventArgs e) { + if (panels == null) + return; + + float prev_x = 0; + float gap = ThemeEngine.Current.StatusBarHorzGapWidth; + for (int i = 0; i < panels.Count; i++) { + float x = panels [i].Width + prev_x + (i == panels.Count - 1 ? gap : gap / 2); + if (e.X >= prev_x && e.X <= x) { + OnPanelClick (new StatusBarPanelClickEventArgs (panels [i], + e.Button, e.Clicks, e.X, e.Y)); + break; + } + prev_x = x; + } base.OnMouseDown (e); } - protected virtual void OnPanelClick (StatusBarPanelClickEventArgs e) - { + protected virtual void OnPanelClick (StatusBarPanelClickEventArgs e) { if (PanelClick != null) PanelClick (this, e); } - internal void OnDrawItemInternal (StatusBarDrawItemEventArgs e) + protected override void OnResize (EventArgs e) { - OnDrawItem (e); + base.OnResize (e); + + if (Width <= 0 || Height <= 0) + return; + + UpdateArea (); + CalcPanelSizes (); + Draw (); } - protected virtual void OnDrawItem (StatusBarDrawItemEventArgs e) - { - if (DrawItem != null) - DrawItem (this, e); + protected override void WndProc(ref Message m) { + switch ((Msg) m.Msg) { + case Msg.WM_PAINT: { + PaintEventArgs paint_event; + + paint_event = XplatUI.PaintEventStart (Handle); + DoPaint (paint_event); + XplatUI.PaintEventEnd (Handle); + return; + } + } + base.WndProc (ref m); } - protected override void Dispose (bool disposing) + #endregion // Methods + + + #region Internal Methods + internal void OnDrawItemInternal (StatusBarDrawItemEventArgs e) { - base.Dispose (disposing); + OnDrawItem (e); } private void DoPaint (PaintEventArgs pevent) @@ -345,18 +369,73 @@ namespace System.Windows.Forms { { ThemeEngine.Current.DrawStatusBar (DeviceContext, this.ClientRectangle, this); } + #endregion // Internal Methods - public class StatusBarPanelCollection : IList, ICollection, IEnumerable { - private StatusBar owner; + #region Events + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackColorChanged; + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackgroundImageChanged; + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler ForeColorChanged; + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler ImeModeChanged; + + public event StatusBarDrawItemEventHandler DrawItem; + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event PaintEventHandler Paint; + public event StatusBarPanelClickEventHandler PanelClick; + #endregion // Events + + + #region Subclass StatusBarPanelCollection + public class StatusBarPanelCollection : IList, ICollection, IEnumerable { + #region Fields + private StatusBar owner; private ArrayList panels; + #endregion // Fields + #region Public Constructors public StatusBarPanelCollection (StatusBar owner) { this.owner = owner; } + #endregion // Public Constructors + + #region Private & Internal Methods + private int AddInternal (StatusBarPanel p, bool refresh) { + if (p == null) + throw new ArgumentNullException ("value"); + if (panels == null) + panels = new ArrayList (); + + int res = panels.Add (p); + p.SetParent (owner); + + if (refresh) { + owner.CalcPanelSizes (); + owner.Refresh (); + } + + return res; + } + + #endregion // Private & Internal Methods + + #region Public Instance Properties + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public virtual int Count { get { if (panels == null) @@ -369,18 +448,6 @@ namespace System.Windows.Forms { get { return false; } } - bool IList.IsFixedSize { - get { return false; } - } - - bool ICollection.IsSynchronized { - get { return panels.IsSynchronized; } - } - - object ICollection.SyncRoot { - get { return panels.SyncRoot; } - } - public virtual StatusBarPanel this [int index] { get { if (index < 0 || index >= Count) @@ -396,39 +463,21 @@ namespace System.Windows.Forms { } } - public virtual int Add (StatusBarPanel p) - { + #endregion // Public Instance Properties + + #region Public Instance Methods + public virtual int Add (StatusBarPanel p) { return AddInternal (p, true); } - public virtual StatusBarPanel Add (string text) - { + public virtual StatusBarPanel Add (string text) { StatusBarPanel res = new StatusBarPanel (); res.Text = text; Add (res); return res; } - private int AddInternal (StatusBarPanel p, bool refresh) - { - if (p == null) - throw new ArgumentNullException ("value"); - if (panels == null) - panels = new ArrayList (); - - int res = panels.Add (p); - p.SetParent (owner); - - if (refresh) { - owner.CalcPanelSizes (); - owner.Refresh (); - } - - return res; - } - - public virtual void AddRange (StatusBarPanel [] range) - { + public virtual void AddRange (StatusBarPanel [] range) { if (range == null) throw new ArgumentNullException ("panels"); if (range.Length == 0) @@ -441,8 +490,25 @@ namespace System.Windows.Forms { owner.Refresh (); } - public virtual void Insert (int index, StatusBarPanel value) - { + public virtual void Clear () { + panels.Clear (); + + owner.Refresh (); + } + + public virtual bool Contains (StatusBarPanel panel) { + return panels.Contains (panel); + } + + public virtual IEnumerator GetEnumerator () { + return panels.GetEnumerator (); + } + + public virtual int IndexOf (StatusBarPanel panel) { + return panels.IndexOf (panel); + } + + public virtual void Insert (int index, StatusBarPanel value) { if (value == null) throw new ArgumentNullException ("value"); if (index > Count) @@ -455,36 +521,23 @@ namespace System.Windows.Forms { owner.Refresh (); } - public virtual void Clear () - { - panels.Clear (); - - owner.Refresh (); + public virtual void Remove (StatusBarPanel panel) { + panels.Remove (panel); } - public virtual bool Contains (StatusBarPanel panel) - { - return panels.Contains (panel); + public virtual void RemoveAt (int index) { + panels.RemoveAt (index); } - public virtual IEnumerator GetEnumerator () - { - return panels.GetEnumerator (); - } + #endregion // Public Instance Methods - public virtual int IndexOf (StatusBarPanel panel) - { - return panels.IndexOf (panel); - } - - public virtual void Remove (StatusBarPanel panel) - { - panels.Remove (panel); + #region IList & ICollection Interfaces + bool ICollection.IsSynchronized { + get { return panels.IsSynchronized; } } - public virtual void RemoveAt (int index) - { - panels.RemoveAt (index); + object ICollection.SyncRoot { + get { return panels.SyncRoot; } } void ICollection.CopyTo (Array dest, int index) @@ -492,18 +545,17 @@ namespace System.Windows.Forms { panels.CopyTo (dest, index); } + object IList.this [int index] { get { return panels [index]; } set { panels [index] = value; } } - int IList.Add (object value) - { + int IList.Add (object value) { return panels.Add (value); } - bool IList.Contains (object panel) - { + bool IList.Contains (object panel) { return panels.Contains (panel); } @@ -517,11 +569,17 @@ namespace System.Windows.Forms { panels.Insert (index, value); } + bool IList.IsFixedSize { + get { return false; } + } + void IList.Remove (object value) { panels.Remove (value); } + #endregion // IList & ICollection Interfaces } + #endregion // Subclass StatusBarPanelCollection } } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs index b00c4f8427a..8ac0edce554 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs @@ -115,14 +115,14 @@ namespace System.Windows.Forms { set { style = value; } } - [DefaultValue(null)] + [DefaultValue("")] [Localizable(true)] public string Text { get { return text; } set { text = value; } } - [DefaultValue(null)] + [DefaultValue("")] [Localizable(true)] public string ToolTipText { get { return tool_tip_text; } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs index f6ffae5f3fe..81dca19d599 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs @@ -24,14 +24,18 @@ using System; -using System.Drawing; using System.Collections; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.Drawing; namespace System.Windows.Forms { - + [DefaultEvent("SelectedIndexChanged")] + [DefaultProperty("TabPages")] + [Designer("System.Windows.Forms.Design.TabControlDesigner, " + Consts.AssemblySystem_Design)] public class TabControl : Control { - + #region Fields private int selected_index = -1; private TabAlignment alignment; private TabAppearance appearance; @@ -51,7 +55,9 @@ namespace System.Windows.Forms { private ButtonState right_slider_state; private ButtonState left_slider_state; private int slider_pos = 0; - + #endregion // Fields + + #region Public Constructors public TabControl () { tab_pages = new TabPageCollection (this); @@ -64,6 +70,12 @@ namespace System.Windows.Forms { SizeChanged += new EventHandler (SizeChangedHandler); } + #endregion // Public Constructors + + #region Public Instance Properties + [DefaultValue(TabAlignment.Top)] + [Localizable(true)] + [RefreshProperties(RefreshProperties.All)] public TabAlignment Alignment { get { return alignment; } set { @@ -76,6 +88,8 @@ namespace System.Windows.Forms { } } + [DefaultValue(TabAppearance.Normal)] + [Localizable(true)] public TabAppearance Appearance { get { return appearance; } set { @@ -86,11 +100,15 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public override Color BackColor { get { return base.BackColor; } set { /* nothing happens on set on MS */ } } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public override Image BackgroundImage { get { return base.BackgroundImage; } set { base.BackgroundImage = value; } @@ -102,6 +120,7 @@ namespace System.Windows.Forms { } } + [DefaultValue(TabDrawMode.Normal)] public TabDrawMode DrawMode { get { return draw_mode; } set { @@ -112,11 +131,14 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public override Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } + [DefaultValue(false)] public bool HotTrack { get { return hottrack; } set { @@ -127,11 +149,13 @@ namespace System.Windows.Forms { } } + [DefaultValue(null)] public ImageList ImageList { get { return image_list; } set { image_list = value; } } + [Localizable(true)] public Size ItemSize { get { return item_size; @@ -144,6 +168,7 @@ namespace System.Windows.Forms { } } + [DefaultValue(false)] public bool Multiline { get { return multiline; } set { @@ -156,6 +181,7 @@ namespace System.Windows.Forms { } } + [Localizable(true)] public Point Padding { get { return padding; } set { @@ -169,10 +195,14 @@ namespace System.Windows.Forms { } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int RowCount { get { return row_count; } } + [DefaultValue(-1)] + [Browsable(false)] public int SelectedIndex { get { return selected_index; } set { @@ -212,6 +242,8 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public TabPage SelectedTab { get { if (selected_index == -1) @@ -226,6 +258,8 @@ namespace System.Windows.Forms { } } + [DefaultValue(false)] + [Localizable(true)] public bool ShowToolTips { get { return show_tool_tips; } set { @@ -236,6 +270,8 @@ namespace System.Windows.Forms { } } + [DefaultValue(TabSizeMode.Normal)] + [RefreshProperties(RefreshProperties.Repaint)] public TabSizeMode SizeMode { get { return size_mode; } set { @@ -246,21 +282,32 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int TabCount { get { return tab_pages.Count; } } + [DefaultValue(null)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [MergableProperty(false)] public TabPageCollection TabPages { get { return tab_pages; } } + [Browsable(false)] + [Bindable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public override string Text { get { return base.Text; } set { base.Text = value; } } + #endregion // Public Instance Properties + + #region Internal Properties internal bool ShowSlider { get { return show_slider; } set { show_slider = value; } @@ -278,6 +325,15 @@ namespace System.Windows.Forms { get { return left_slider_state; } } + private Size DefaultItemSize { + get { + return ThemeEngine.Current.TabControlDefaultItemSize; + } + } + + #endregion // Internal Properties + + #region Protected Instance Properties [MonoTODO ("Anything special need to be done?")] protected override CreateParams CreateParams { get { @@ -291,40 +347,9 @@ namespace System.Windows.Forms { get { return new Size (200, 100); } } - private Size DefaultItemSize { - get { - return ThemeEngine.Current.TabControlDefaultItemSize; - } - } - - public new event EventHandler BackColorChanged { - add { base.BackColorChanged += value; } - remove { base.BackColorChanged -= value; } - } - - public new event EventHandler BackgroundImageChanged { - add { base.BackgroundImageChanged += value; } - remove { base.BackgroundImageChanged -= value; } - } - - public new event EventHandler ForeColorChanged { - add { base.ForeColorChanged += value; } - remove { base.ForeColorChanged -= value; } - } - - public new event PaintEventHandler Paint { - add { base.Paint += value; } - remove { base.Paint -= value; } - } - - public new event EventHandler TextChanged { - add { base.TextChanged += value; } - remove { base.TextChanged -= value; } - } - - public event DrawItemEventHandler DrawItem; - public event EventHandler SelectedIndexChanged; + #endregion // Protected Instance Properties + #region Public Instance Methods public Rectangle GetTabRect (int index) { TabPage page = GetTab (index); @@ -336,6 +361,9 @@ namespace System.Windows.Forms { return GetTab (index); } + #endregion // Public Instance Methods + + #region Protected Instance Methods protected override Control.ControlCollection CreateControlsInstance () { return new TabControl.ControlCollection (this); @@ -387,6 +415,9 @@ namespace System.Windows.Forms { } } + #endregion // Protected Instance Methods + + #region Internal & Private Methods private bool CanScrollRight { get { if (TabPages [TabCount - 1].TabBounds.Right > ClientRectangle.Right - 40) @@ -829,6 +860,50 @@ namespace System.Windows.Forms { Refresh (); } + #endregion // Internal & Private Methods + + #region Events + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackColorChanged { + add { base.BackColorChanged += value; } + remove { base.BackColorChanged -= value; } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackgroundImageChanged { + add { base.BackgroundImageChanged += value; } + remove { base.BackgroundImageChanged -= value; } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler ForeColorChanged { + add { base.ForeColorChanged += value; } + remove { base.ForeColorChanged -= value; } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event PaintEventHandler Paint { + add { base.Paint += value; } + remove { base.Paint -= value; } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler TextChanged { + add { base.TextChanged += value; } + remove { base.TextChanged -= value; } + } + + public event DrawItemEventHandler DrawItem; + public event EventHandler SelectedIndexChanged; + #endregion // Events + + + #region Class TabPage.ControlCollection public class ControlCollection : System.Windows.Forms.Control.ControlCollection { private TabControl owner; @@ -857,7 +932,9 @@ namespace System.Windows.Forms { } } } + #endregion // Class TabPage.ControlCollection + #region Class TabPage.TabPageCollection public class TabPageCollection : IList, ICollection, IEnumerable { private TabControl owner; @@ -871,6 +948,7 @@ namespace System.Windows.Forms { controls = owner.Controls; } + [Browsable(false)] public virtual int Count { get { return owner.Controls.Count; } } @@ -986,6 +1064,7 @@ namespace System.Windows.Forms { Remove ((TabPage) value); } } + #endregion // Class TabPage.TabPageCollection } } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabPage.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabPage.cs index 67ff825862b..e00aa8756cf 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabPage.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabPage.cs @@ -17,24 +17,32 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -// Copyright (c) 2004 Novell, Inc. +// Copyright (c) 2004-2005 Novell, Inc. // // Authors: // Jackson Harper (jackson@ximian.com) using System; +using System.ComponentModel; +using System.ComponentModel.Design; using System.Drawing; namespace System.Windows.Forms { - + [DefaultEvent("Click")] + [DesignTimeVisible(false)] + [DefaultProperty("Text")] + [Designer("System.Windows.Forms.Design.TabPageDesigner, " + Consts.AssemblySystem_Design)] + [ToolboxItem(false)] public class TabPage : Panel { - + #region Fields private int image_index = -1; private string tooltip_text = String.Empty; private Rectangle tab_bounds; private int row; + #endregion // Fields + #region Public Constructors public TabPage () { Visible = true; @@ -45,21 +53,34 @@ namespace System.Windows.Forms { Text = text; } + #endregion // Public Constructors + + #region Public Instance Properties + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public override AnchorStyles Anchor { get { return base.Anchor; } set { base.Anchor = value; } } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public override DockStyle Dock { get { return base.Dock; } set { base.Dock = value; } } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public new bool Enabled { get { return base.Enabled; } set { base.Enabled = value; } } + [DefaultValue(-1)] + [Editor("System.Windows.Forms.Design.ImageIndexEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))] + [Localizable(true)] + [TypeConverter(typeof(ImageIndexConverter))] public int ImageIndex { get { return image_index; } set { @@ -70,16 +91,22 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public new int TabIndex { get { return base.TabIndex; } set { base.TabIndex = value; } } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public new bool TabStop { get { return base.TabStop; } set { base.TabStop = value; } } + [Browsable(true)] + [Localizable(true)] public override string Text { get { return base.Text; } set { @@ -90,6 +117,8 @@ namespace System.Windows.Forms { } } + [Localizable(true)] + [DefaultValue("")] public string ToolTipText { get { return tooltip_text; } set { @@ -99,36 +128,16 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public new bool Visible { get { return base.Visible; } set { base.Visible = value; } } - public new event EventHandler DockChanged { - add { base.DockChanged += value; } - remove { base.DockChanged -= value; } - } - - public new event EventHandler EnabledChanged { - add { base.EnabledChanged += value; } - remove { base.EnabledChanged -= value; } - } - - public new event EventHandler TabIndexChanged { - add { base.TabIndexChanged += value; } - remove { base.TabIndexChanged -= value; } - } - - public new event EventHandler TabStopChanged { - add { base.TabStopChanged += value; } - remove { base.TabStopChanged -= value; } - } - - public new event EventHandler VisibleChanged { - add { base.VisibleChanged += value; } - remove { base.VisibleChanged -= value; } - } + #endregion // Public Instance Properties + #region Public Static Methods public static TabPage GetTabPageOfComponent (object comp) { Control control = comp as Control; @@ -143,11 +152,17 @@ namespace System.Windows.Forms { return control as TabPage; } + #endregion // Public Static Methods + + #region Public Instance Methods public override string ToString () { return "TabPage: {" + Text + "}"; } + #endregion // Public Instance Methods + + #region Internal & Private Methods and Properties internal Rectangle TabBounds { get { return tab_bounds; } set { tab_bounds = value; } @@ -169,6 +184,9 @@ namespace System.Windows.Forms { get { return base.Parent as TabControl; } } + #endregion // Internal & Private Methods and Properties + + #region Protected Instance Methods protected override ControlCollection CreateControlsInstance () { return new TabPageControlCollection (this); @@ -187,6 +205,47 @@ namespace System.Windows.Forms { } } + #endregion // Protected Instance Methods + + #region Events + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler DockChanged { + add { base.DockChanged += value; } + remove { base.DockChanged -= value; } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler EnabledChanged { + add { base.EnabledChanged += value; } + remove { base.EnabledChanged -= value; } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler TabIndexChanged { + add { base.TabIndexChanged += value; } + remove { base.TabIndexChanged -= value; } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler TabStopChanged { + add { base.TabStopChanged += value; } + remove { base.TabStopChanged -= value; } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler VisibleChanged { + add { base.VisibleChanged += value; } + remove { base.VisibleChanged -= value; } + } + + #endregion // Events + + #region Class TabPageControlCollection public class TabPageControlCollection : ControlCollection { private TabPage owner; @@ -201,6 +260,7 @@ namespace System.Windows.Forms { base.Add (value); } } + #endregion // Class TabPageControlCollection } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs index 08b29663636..f0297e33d79 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs @@ -17,7 +17,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -// Copyright (c) 2004 Novell, Inc. (http://www.novell.com) +// Copyright (c) 2004-2005 Novell, Inc. (http://www.novell.com) // // Authors: // Peter Bartok pbartok@novell.com @@ -27,6 +27,8 @@ // NOT COMPLETE using System; +using System.ComponentModel; +using System.ComponentModel.Design; using System.Drawing; namespace System.Windows.Forms { @@ -56,6 +58,7 @@ namespace System.Windows.Forms { #endregion // Private & Internal Methods #region Public Instance Properties + [DefaultValue(false)] public bool AcceptsReturn { get { return accepts_return; @@ -68,6 +71,7 @@ namespace System.Windows.Forms { } } + [DefaultValue(CharacterCasing.Normal)] public CharacterCasing CharacterCasing { get { return character_casing; @@ -80,6 +84,8 @@ namespace System.Windows.Forms { } } + [Localizable(true)] + [DefaultValue("")] public char PasswordChar { get { return password_char; @@ -92,6 +98,8 @@ namespace System.Windows.Forms { } } + [DefaultValue(ScrollBars.None)] + [Localizable(true)] public ScrollBars ScrollBars { get { return scrollbars; @@ -104,6 +112,18 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public override int SelectionLength {
+ get {
+ return base.SelectionLength;
+ }
+ set {
+ base.SelectionLength = value;
+ }
+ }
+ + public override string Text { get { return base.Text; @@ -114,6 +134,8 @@ namespace System.Windows.Forms { } } + [DefaultValue(HorizontalAlignment.Left)] + [Localizable(true)] public HorizontalAlignment TextAlign { get { return alignment; diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs index a061fafda78..3bc8da10ab0 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs @@ -17,7 +17,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -// Copyright (c) 2004 Novell, Inc. (http://www.novell.com) +// Copyright (c) 2004-2005 Novell, Inc. (http://www.novell.com) // // Authors: // Peter Bartok pbartok@novell.com @@ -27,12 +27,16 @@ // NOT COMPLETE #define Debug - +using System.ComponentModel; +using System.ComponentModel.Design; using System.Drawing; using System.Drawing.Text; using System.Text; +using System.Runtime.InteropServices; namespace System.Windows.Forms { + [DefaultEvent("TextChanged")] + [Designer("System.Windows.Forms.Design.TextBoxBaseDesigner, " + Consts.AssemblySystem_Design)] public abstract class TextBoxBase : Control { #region Local Variables internal HorizontalAlignment alignment; @@ -65,9 +69,9 @@ namespace System.Windows.Forms { #endregion // Local Variables - #region Private Constructor + #region Internal Constructor // Constructor will go when complete, only for testing - pdb - public TextBoxBase() { + internal TextBoxBase() { alignment = HorizontalAlignment.Left; accepts_return = false; accepts_tab = false; @@ -109,7 +113,7 @@ namespace System.Windows.Forms { SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); } - #endregion // Private Constructor + #endregion // Internal Constructor #region Private and Internal Methods internal string CaseAdjust(string s) { @@ -125,6 +129,7 @@ namespace System.Windows.Forms { #endregion // Private and Internal Methods #region Public Instance Properties + [DefaultValue(false)] public bool AcceptsTab { get { return accepts_tab; @@ -138,6 +143,9 @@ namespace System.Windows.Forms { } } + [DefaultValue(true)] + [Localizable(true)] + [RefreshProperties(RefreshProperties.Repaint)] public virtual bool AutoSize { get { return auto_size; @@ -156,6 +164,7 @@ namespace System.Windows.Forms { } } + [DispId(-501)] public override System.Drawing.Color BackColor { get { return base.BackColor; @@ -165,6 +174,8 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public override System.Drawing.Image BackgroundImage { get { return base.BackgroundImage; @@ -174,6 +185,8 @@ namespace System.Windows.Forms { } } + [DefaultValue(BorderStyle.Fixed3D)] + [DispId(-504)] public BorderStyle BorderStyle { get { return border_style; @@ -187,12 +200,15 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool CanUndo { get { return undo; } } + [DispId(-513)] public override System.Drawing.Color ForeColor { get { return base.ForeColor; @@ -202,6 +218,7 @@ namespace System.Windows.Forms { } } + [DefaultValue(true)] public bool HideSelection { get { return hide_selection; @@ -222,6 +239,9 @@ namespace System.Windows.Forms { } } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Editor("System.Windows.Forms.Design.StringArrayEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))] + [Localizable(true)] public string[] Lines { get { string[] lines; @@ -256,6 +276,8 @@ namespace System.Windows.Forms { } } + [DefaultValue(32767)] + [Localizable(true)] public virtual int MaxLength { get { return max_length; @@ -268,6 +290,8 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public bool Modified { get { return modified; @@ -281,6 +305,9 @@ namespace System.Windows.Forms { } } + [DefaultValue(false)] + [Localizable(true)] + [RefreshProperties(RefreshProperties.All)] public virtual bool Multiline { get { return multiline; @@ -303,12 +330,16 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [EditorBrowsable(EditorBrowsableState.Advanced)] public int PreferredHeight { get { return this.Font.Height + 7; // FIXME - consider border style as well } } + [DefaultValue(false)] public bool ReadOnly { get { return read_only; @@ -322,6 +353,8 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public virtual string SelectedText { get { return document.GetSelection(); @@ -333,6 +366,8 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public virtual int SelectionLength { get { return document.SelectionLength(); @@ -357,6 +392,8 @@ namespace System.Windows.Forms { } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int SelectionStart { get { int index; @@ -376,6 +413,7 @@ namespace System.Windows.Forms { } } + [Localizable(true)] public override string Text { get { if (document == null || document.Root == null || document.Root.text == null) { @@ -432,6 +470,7 @@ namespace System.Windows.Forms { } } + [Browsable(false)] public virtual int TextLength { get { if (document == null || document.Root == null || document.Root.text == null) { @@ -454,6 +493,8 @@ namespace System.Windows.Forms { } } + [DefaultValue(true)] + [Localizable(true)] public bool WordWrap { get { return word_wrap; @@ -910,11 +951,21 @@ Console.WriteLine("Destroying caret"); #region Events public event EventHandler AcceptsTabChanged; public event EventHandler AutoSizeChanged; + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public new event EventHandler BackgroundImageChanged { + add { base.BackgroundImageChanged += value; } + remove { base.BackgroundImageChanged -= value; } + } public event EventHandler BorderStyleChanged; + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] public event EventHandler Click; public event EventHandler HideSelectionChanged; public event EventHandler ModifiedChanged; public event EventHandler MultilineChanged; + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] public event PaintEventHandler Paint; public event EventHandler ReadOnlyChanged; #endregion // Events diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs index c6d6f8263e0..bc179cfc8d4 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs @@ -43,7 +43,7 @@ namespace System.Windows.Forms { [DefaultEvent ("ButtonClick")] [DefaultProperty ("Buttons")] - [Designer ("System.Windows.Forms.Design.ToolBarDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))] + [Designer ("System.Windows.Forms.Design.ToolBarDesigner, " + Consts.AssemblySystem_Design)] public class ToolBar : Control { #region Instance Variables diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs index 5f84a9b6abf..7be4caa1749 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs @@ -40,7 +40,7 @@ using System.Drawing.Imaging; namespace System.Windows.Forms { [DefaultProperty ("Text")] - [Designer ("System.Windows.Forms.Design.ToolBarButtonDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))] + [Designer ("System.Windows.Forms.Design.ToolBarButtonDesigner, " + Consts.AssemblySystem_Design)] [DesignTimeVisible (false)] [ToolboxItem (false)] public class ToolBarButton : Component @@ -221,7 +221,7 @@ namespace System.Windows.Forms set { tag = value; } } - [DefaultValue (null)] + [DefaultValue ("")] [Localizable (true)] public string Text { get { return text; } @@ -235,7 +235,7 @@ namespace System.Windows.Forms } } - [DefaultValue (null)] + [DefaultValue ("")] [Localizable (true)] public string ToolTipText { get { return tooltip; } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs index 36b23593074..d67ecb24f94 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs @@ -32,7 +32,7 @@ using System.ComponentModel; using System.Drawing; namespace System.Windows.Forms { - [ProvideProperty ("ToolTip", "System.Windows.Forms.Control")] + [ProvideProperty ("ToolTip", typeof(System.Windows.Forms.Control))] [ToolboxItemFilter("System.Windows.Forms", ToolboxItemFilterType.Allow)] public sealed class ToolTip : System.ComponentModel.Component, System.ComponentModel.IExtenderProvider { #region Local variables diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TrackBar.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TrackBar.cs index 52a819cf232..33370d96888 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TrackBar.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TrackBar.cs @@ -35,6 +35,7 @@ // NOT COMPLETE using System.ComponentModel; +using System.ComponentModel.Design; using System.Drawing; using System.Drawing.Imaging; using System.Drawing.Drawing2D; @@ -42,8 +43,9 @@ using System.Timers; namespace System.Windows.Forms { - + [Designer("System.Windows.Forms.Design.TrackBarDesigner, " + Consts.AssemblySystem_Design)] [DefaultEvent ("Scroll")] + [DefaultProperty("Value")] public class TrackBar : Control, ISupportInitialize { private int minimum; @@ -189,7 +191,8 @@ namespace System.Windows.Forms get { return ThemeEngine.Current.TrackBarDefaultSize; } } - [EditorBrowsable (EditorBrowsableState.Never)] + [Browsable(false)] + [EditorBrowsable (EditorBrowsableState.Never)] public override Font Font { get { return base.Font; } set { base.Font = value; } @@ -346,7 +349,7 @@ namespace System.Windows.Forms } [DefaultValue (0)] - [Bindable (false)] + [Bindable (true)] public int Value { get { return position; } set { diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNode.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNode.cs index 1c8294730d1..204f95a7964 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNode.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNode.cs @@ -24,15 +24,16 @@ // Kazuki Oikawa (kazuki@panicode.com) using System; -using System.Text; +using System.ComponentModel; using System.Drawing; using System.Runtime.Serialization; +using System.Text; namespace System.Windows.Forms { - + [TypeConverter(typeof(TreeNodeConverter))] [Serializable] - public class TreeNode : MarshalByRefObject, ICloneable /*, ISerializable */ { - + public class TreeNode : MarshalByRefObject, ICloneable, ISerializable { + #region Fields private TreeView tree_view; internal TreeNode parent; private int index; @@ -52,12 +53,17 @@ namespace System.Windows.Forms { private object tag; private IntPtr handle; - + #endregion // Fields + + #region Internal Constructors internal TreeNode (TreeView tree_view) : this () { this.tree_view = tree_view; } + #endregion // Internal Constructors + + #region Public Constructors public TreeNode () { nodes = new TreeNodeCollection (this); @@ -85,22 +91,9 @@ namespace System.Windows.Forms { Nodes.AddRange (children); } - internal TreeView TreeView { - get { - if (tree_view != null) - return tree_view; - TreeNode walk = parent; - while (walk != null) { - if (walk.TreeView != null) - tree_view = walk.TreeView; - walk = walk.parent; - } - return tree_view; - } - } + #endregion // Public Constructors #region ICloneable Members - public object Clone() { TreeNode tn = new TreeNode (text, image_index, selected_image_index); @@ -115,27 +108,28 @@ namespace System.Windows.Forms { return tn; } - #endregion + #endregion // ICloneable Members - public TreeNode Parent { - get { - if (tree_view != null && tree_view.root_node == parent) - return null; - return parent; - } + #region ISerializable Members + [MonoTODO] + public void GetObjectData(SerializationInfo info, StreamingContext context) { + throw new NotImplementedException(); } + #endregion // ISerializable Members - public string Text { - get { - if (text == null) - return String.Empty; - return text; + #region Public Instance Properties + public Color BackColor { + get { + if (prop_bag != null) + return prop_bag.BackColor; + if (TreeView != null) + return TreeView.BackColor; + return Color.Empty; } - set { - if (text == value) - return; - text = value; - bounds.Width = 0; + set { + if (prop_bag == null) + prop_bag = new OwnerDrawPropertyBag (); + prop_bag.BackColor = value; } } @@ -143,14 +137,6 @@ namespace System.Windows.Forms { get { return bounds; } } - internal Rectangle PlusMinusBounds { - get { return plus_minus_bounds; } - } - - internal Rectangle CheckBoxBounds { - get { return checkbox_bounds; } - } - public bool Checked { get { return check; } set { @@ -163,18 +149,11 @@ namespace System.Windows.Forms { } } - public Color BackColor { - get { - if (prop_bag != null) - return prop_bag.BackColor; - if (TreeView != null) - return TreeView.BackColor; - return Color.Empty; - } - set { - if (prop_bag == null) - prop_bag = new OwnerDrawPropertyBag (); - prop_bag.BackColor = value; + public TreeNode FirstNode { + get { + if (nodes.Count > 0) + return nodes [0]; + return null; } } @@ -193,37 +172,6 @@ namespace System.Windows.Forms { } } - public Font NodeFont { - get { - if (prop_bag != null) - return prop_bag.Font; - if (TreeView != null) - return TreeView.Font; - return null; - } - set { - if (prop_bag == null) - prop_bag = new OwnerDrawPropertyBag (); - prop_bag.Font = value; - } - } - - public TreeNodeCollection Nodes { - get { - if (nodes == null) - nodes = new TreeNodeCollection (this); - return nodes; - } - } - - public TreeNode FirstNode { - get { - if (nodes.Count > 0) - return nodes [0]; - return null; - } - } - public string FullPath { get { if (tree_view == null) @@ -235,22 +183,52 @@ namespace System.Windows.Forms { } } - bool BuildFullPath (StringBuilder path) - { - if (parent == null) - return false; - - if (parent.BuildFullPath (path)) - path.Append (tree_view.PathSeparator); + [Localizable(true)] + public int ImageIndex { + get { return image_index; } + set { image_index = value; } + } - path.Append (text); - return true; + public bool IsEditing { + get { return is_editing; } } public bool IsExpanded { get { return is_expanded; } } + public bool IsSelected { + get { + if (TreeView == null) + return false; + return TreeView.SelectedNode == this; + } + } + + public bool IsVisible { + get { + if (TreeView == null) + return false; + + if (bounds.Y < 0 && bounds.Y > TreeView.ClientRectangle.Height) + return false; + + TreeNode parent = Parent; + while (parent != null) { + if (!parent.IsExpanded) + return false; + parent = parent.Parent; + } + return true; + } + } + + public TreeNode LastNode { + get { + return (nodes == null || nodes.Count == 0) ? null : nodes [nodes.Count - 1]; + } + } + public TreeNode NextNode { get { if (parent == null) @@ -261,16 +239,6 @@ namespace System.Windows.Forms { } } - public TreeNode PrevNode { - get { - if (parent == null) - return null; - if (index == 0 || index > parent.Nodes.Count) - return null; - return parent.Nodes [index - 1]; - } - } - public TreeNode NextVisibleNode { get { OpenTreeNodeEnumerator o = new OpenTreeNodeEnumerator (this); @@ -283,89 +251,189 @@ namespace System.Windows.Forms { } } - public TreeNode PrevVisibleNode { + [Localizable(true)] + public Font NodeFont { get { - OpenTreeNodeEnumerator o = new OpenTreeNodeEnumerator (this); - if (!o.MovePrevious ()) - return null; - TreeNode c = (TreeNode) o.Current; - if (!c.IsInClippingRect) - return null; - return c; + if (prop_bag != null) + return prop_bag.Font; + if (TreeView != null) + return TreeView.Font; + return null; + } + set { + if (prop_bag == null) + prop_bag = new OwnerDrawPropertyBag (); + prop_bag.Font = value; } } - public TreeNode LastNode { + [ListBindable(false)] + public TreeNodeCollection Nodes { get { - return (nodes == null || nodes.Count == 0) ? null : nodes [nodes.Count - 1]; + if (nodes == null) + nodes = new TreeNodeCollection (this); + return nodes; } } - public int Index { - get { return index; } + public TreeNode Parent { + get { + if (tree_view != null && tree_view.root_node == parent) + return null; + return parent; + } } - public int ImageIndex { - get { return image_index; } - set { image_index = value; } + public TreeNode PrevNode { + get { + if (parent == null) + return null; + if (index == 0 || index > parent.Nodes.Count) + return null; + return parent.Nodes [index - 1]; + } + } + + public TreeNode PrevVisibleNode { + get { + OpenTreeNodeEnumerator o = new OpenTreeNodeEnumerator (this); + if (!o.MovePrevious ()) + return null; + TreeNode c = (TreeNode) o.Current; + if (!c.IsInClippingRect) + return null; + return c; + } } + [Localizable(true)] public int SelectedImageIndex { get { return selected_image_index; } set { selected_image_index = value; } } + [Bindable(true)] + [Localizable(false)] + [TypeConverter(typeof(System.ComponentModel.StringConverter))] + [DefaultValue(null)] public object Tag { get { return tag; } set { tag = value; } } - public bool IsSelected { + [Localizable(true)] + public string Text { get { - if (TreeView == null) - return false; - return TreeView.SelectedNode == this; + if (text == null) + return String.Empty; + return text; + } + set { + if (text == value) + return; + text = value; + bounds.Width = 0; } } - public bool IsEditing { - get { return is_editing; } - } - - public bool IsVisible { + public TreeView TreeView { get { - if (TreeView == null) - return false; - - if (bounds.Y < 0 && bounds.Y > TreeView.ClientRectangle.Height) - return false; - - TreeNode parent = Parent; - while (parent != null) { - if (!parent.IsExpanded) - return false; - parent = parent.Parent; + if (tree_view != null) + return tree_view; + TreeNode walk = parent; + while (walk != null) { + if (walk.TreeView != null) + tree_view = walk.TreeView; + walk = walk.parent; } - return true; + return tree_view; } } - public void BeginEdit () - { + #endregion // Public Instance Properties + + #region Public Static Methods + #endregion // Public Static Methods + + #region Public Instance Methods + public void BeginEdit () { is_editing = true; } - public void EndEdit (bool cancel) - { + public void Collapse () { + Collapse(false); + } + + public void EndEdit (bool cancel) { is_editing = false; if (!cancel && TreeView != null) text = TreeView.LabelEditText; } - public void Expand () - { + public void Expand () { Expand(false); } + + public void ExpandAll () { + ExpandRecursive (this); + if(TreeView != null) + TreeView.Refresh(); + } + + public int GetNodeCount (bool include_subtrees) { + if (!include_subtrees) + return Nodes.Count; + + int count = 0; + GetNodeCountRecursive (this, ref count); + + return count; + } + + public void Remove () { + if (parent == null) + return; + parent.Nodes.RemoveAt (Index); + } + + public void Toggle () { + if (is_expanded) + Collapse (); + else + Expand (); + } + + public override String ToString () { + return String.Concat ("TreeNode: ", Text); + } + + #endregion // Public Instance Methods + + #region Internal & Private Methods and Properties + internal Rectangle PlusMinusBounds { + get { return plus_minus_bounds; } + } + + internal Rectangle CheckBoxBounds { + get { return checkbox_bounds; } + } + + bool BuildFullPath (StringBuilder path) + { + if (parent == null) + return false; + + if (parent.BuildFullPath (path)) + path.Append (tree_view.PathSeparator); + + path.Append (text); + return true; + } + + public int Index { + get { return index; } + } + private void Expand (bool byInternal) { if (is_expanded) @@ -387,11 +455,6 @@ namespace System.Windows.Forms { } } - public void Collapse () - { - Collapse(false); - } - private void Collapse (bool byInternal) { if (!is_expanded) @@ -429,20 +492,6 @@ namespace System.Windows.Forms { return false; } - public void Remove () - { - if (parent == null) - return; - parent.Nodes.RemoveAt (Index); - } - - public void ExpandAll () - { - ExpandRecursive (this); - if(TreeView != null) - TreeView.Refresh(); - } - private void ExpandRecursive (TreeNode node) { node.Expand (true); @@ -478,25 +527,6 @@ namespace System.Windows.Forms { } } - public int GetNodeCount (bool include_subtrees) - { - if (!include_subtrees) - return Nodes.Count; - - int count = 0; - GetNodeCountRecursive (this, ref count); - - return count; - } - - public void Toggle () - { - if (is_expanded) - Collapse (); - else - Expand (); - } - internal void SetNodes (TreeNodeCollection nodes) { this.nodes = nodes; @@ -510,11 +540,6 @@ namespace System.Windows.Forms { } } - public override String ToString () - { - return String.Concat ("TreeNode: ", Text); - } - internal void UpdateBounds (int x, int y, int width, int height) { bounds.X = x; @@ -561,6 +586,8 @@ namespace System.Windows.Forms { return true; } } + #endregion // Internal & Private Methods and Properties + } } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs index 94a34ad2258..c6891536e2a 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs @@ -17,7 +17,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -// Copyright (c) 2004 Novell, Inc. +// Copyright (c) 2004-2005 Novell, Inc. // // Authors: // Jackson Harper (jackson@ximian.com) @@ -26,10 +26,11 @@ using System; using System.Collections; +using System.ComponentModel; using System.Globalization; namespace System.Windows.Forms { - + [Editor("System.Windows.Forms.Design.TreeNodeCollectionEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))] public class TreeNodeCollection : IList, ICollection, IEnumerable { private static readonly int OrigSize = 50; @@ -48,6 +49,8 @@ namespace System.Windows.Forms { nodes = new TreeNode [OrigSize]; } + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Advanced)] public virtual int Count { get { return count; } } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeConverter.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeConverter.cs new file mode 100644 index 00000000000..b97e93a7da1 --- /dev/null +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeConverter.cs @@ -0,0 +1,51 @@ +// 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. +// +// Copyright (c) 2005 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Peter Bartok (pbartok@novell.com) +// +// + +// NOT COMPLETE + +using System.ComponentModel; + +namespace System.Windows.Forms { + public class TreeNodeConverter : TypeConverter { + #region Public Constructors + public TreeNodeConverter() { + } + #endregion // Public Constructors + + #region Public Instance Methods + [MonoTODO] + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) {
+ return base.CanConvertTo (context, destinationType);
+ }
+ + [MonoTODO] + public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) {
+ return base.ConvertTo (context, culture, value, destinationType);
+ }
+ + #endregion // Public Instance Methods + } +} diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/UpDownEventArgs.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/UpDownEventArgs.cs new file mode 100644 index 00000000000..e0174bb11c6 --- /dev/null +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/UpDownEventArgs.cs @@ -0,0 +1,49 @@ +// 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. +// +// Copyright (c) 2005 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Peter Bartok (pbartok@novell.com) +// +// + +// COMPLETE + +namespace System.Windows.Forms { + public class UpDownEventArgs : EventArgs { + #region Local Variables + private int button_id; + #endregion // Local Variables + + #region Public Constructors + public UpDownEventArgs(int buttonPushed) { + button_id = buttonPushed; + } + #endregion // Public Constructors + + #region Public Instance Properties + public int ButtonID { + get { + return button_id; + } + } + #endregion // Public Instance Properties + } +} diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/UpDownEventHandler.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/UpDownEventHandler.cs new file mode 100644 index 00000000000..b91d9e4dea2 --- /dev/null +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/UpDownEventHandler.cs @@ -0,0 +1,31 @@ +// 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. +// +// Copyright (c) 2005 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Peter Bartok (pbartok@novell.com) +// +// + +// COMPLETE + +namespace System.Windows.Forms { + public delegate void UpDownEventHandler(object source, UpDownEventArgs e); +} |