Bugzilla – Attachment 263105 Details for
Bug 428845
ColorDialog: Begin implementation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Patch Uploaded.
color.patch (text/plain), 14.42 KB, created by
Neville Gao
on 2009-01-04 10:52:12 UTC
(
hide
)
Description:
Patch Uploaded.
Filename:
MIME Type:
Creator:
Neville Gao
Created:
2009-01-04 10:52:12 UTC
Size:
14.42 KB
patch
obsolete
>Index: Mono.UIAutomation.Winforms.mdp >=================================================================== >--- Mono.UIAutomation.Winforms.mdp (revision 122389) >+++ Mono.UIAutomation.Winforms.mdp (working copy) >@@ -375,7 +375,6 @@ > <File name="Mono.UIAutomation.Winforms.Behaviors/DataGrid/DataItemValueProviderBehavior.cs" subtype="Code" buildaction="Compile" /> > <File name="Mono.UIAutomation.Winforms/PopupButtonPanelProvider.cs" subtype="Code" buildaction="Compile" /> > <File name="Mono.UIAutomation.Winforms/PopupButtonProvider.cs" subtype="Code" buildaction="Compile" /> >- <File name="Mono.UIAutomation.Winforms.Behaviors/PopupButtonPanel" subtype="Directory" buildaction="Compile" /> > <File name="Mono.UIAutomation.Winforms.Behaviors/PopupButtonPanel/InvokeProviderBehavior.cs" subtype="Code" buildaction="Compile" /> > <File name="Mono.UIAutomation.Winforms.Behaviors/ToolStripButton/InvokeProviderBehavior.cs" subtype="Code" buildaction="Compile" /> > <File name="Mono.UIAutomation.Winforms.Events/ToolStripButton/InvokePatternInvokedEvent.cs" subtype="Code" buildaction="Compile" /> >@@ -383,6 +382,11 @@ > <File name="Mono.UIAutomation.Winforms/MessageBoxFormProvider.cs" subtype="Code" buildaction="Compile" /> > <File name="Mono.UIAutomation.Winforms.Behaviors/DateTimePicker/ToggleProviderBehavior.cs" subtype="Code" buildaction="Compile" /> > <File name="Mono.UIAutomation.Winforms.Events/DateTimePicker/TogglePatternToggleStateEvent.cs" subtype="Code" buildaction="Compile" /> >+ <File name="Globals.cs" subtype="Code" buildaction="Compile" /> >+ <File name="Mono.UIAutomation.Winforms.Events/Form/WindowDeactivatedEvent.cs" subtype="Code" buildaction="Compile" /> >+ <File name="Mono.UIAutomation.Winforms.Behaviors/BaseColorControl/SmallColorControlInvokeProviderBehavior.cs" subtype="Code" buildaction="Compile" /> >+ <File name="Mono.UIAutomation.Winforms/BaseColorControlProvider.cs" subtype="Code" buildaction="Compile" /> >+ <File name="Mono.UIAutomation.Winforms.Events/BaseColorControl/SmallColorControlInvokePatternInvokedEvent.cs" subtype="Code" buildaction="Compile" /> > </Contents> > <References> > <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> >@@ -409,4 +413,4 @@ > <AsmRefVar Name="REFERENCES" /> > <ProjectRefVar Name="REFERENCES" /> > </MonoDevelop.Autotools.MakefileInfo> >-</Project> >+</Project> >\ No newline at end of file >Index: Mono.UIAutomation.Winforms/BaseColorControlProvider.cs >=================================================================== >--- Mono.UIAutomation.Winforms/BaseColorControlProvider.cs (revision 0) >+++ Mono.UIAutomation.Winforms/BaseColorControlProvider.cs (revision 0) >@@ -0,0 +1,103 @@ >+// 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) 2008 Novell, Inc. (http://www.novell.com) >+// >+// Authors: >+// Neville Gao <nevillegao@gmail.com> >+// >+ >+using System; >+using System.Windows.Forms; >+using System.Windows.Automation; >+using System.Windows.Automation.Provider; >+using Mono.Unix; >+using Mono.UIAutomation.Winforms.Behaviors; >+using Mono.UIAutomation.Winforms.Behaviors.BaseColorControl; >+ >+namespace Mono.UIAutomation.Winforms >+{ >+ internal class BaseColorControlProvider : FragmentRootControlProvider >+ { >+ #region Constructor >+ >+ public BaseColorControlProvider (ColorDialog.BaseColorControl baseColorControl) >+ : base (baseColorControl) >+ { >+ } >+ >+ #endregion >+ >+ #region SimpleControlProvider: Specializations >+ >+ protected override object GetProviderPropertyValue (int propertyId) >+ { >+ if (propertyId == AutomationElementIdentifiers.ControlTypeProperty.Id) >+ return ControlType.Pane.Id; >+ else if (propertyId == AutomationElementIdentifiers.LocalizedControlTypeProperty.Id) >+ return Catalog.GetString ("pane"); >+ else >+ return base.GetProviderPropertyValue (propertyId); >+ } >+ >+ #endregion >+ >+ #region Internal Class: SmallColorControl Provider >+ >+ internal class SmallColorControlProvider : FragmentControlProvider >+ { >+ #region Constructor >+ >+ public SmallColorControlProvider (ColorDialog.BaseColorControl.SmallColorControl smallColorControl) >+ : base (smallColorControl) >+ { >+ } >+ >+ #endregion >+ >+ #region SimpleControlProvider: Specializations >+ >+ public override void Initialize() >+ { >+ base.Initialize (); >+ >+ SetBehavior (InvokePatternIdentifiers.Pattern, >+ new SmallColorControlInvokeProviderBehavior (this)); >+ } >+ >+ #endregion >+ >+ #region SimpleControlProvider: Specializations >+ >+ protected override object GetProviderPropertyValue (int propertyId) >+ { >+ if (propertyId == AutomationElementIdentifiers.ControlTypeProperty.Id) >+ return ControlType.Button.Id; >+ else if (propertyId == AutomationElementIdentifiers.LocalizedControlTypeProperty.Id) >+ return Catalog.GetString ("button"); >+ else >+ return base.GetProviderPropertyValue (propertyId); >+ } >+ >+ #endregion >+ } >+ >+ #endregion >+ } >+} >Index: Mono.UIAutomation.Winforms/ProviderFactory.cs >=================================================================== >--- Mono.UIAutomation.Winforms/ProviderFactory.cs (revision 122389) >+++ Mono.UIAutomation.Winforms/ProviderFactory.cs (working copy) >@@ -119,6 +119,8 @@ > SWF.DataGrid dgrid; > SWF.DateTimePicker dtp; > SWF.PrintPreviewControl ppc; >+ SWF.ColorDialog.BaseColorControl bcc; >+ SWF.ColorDialog.BaseColorControl.SmallColorControl scc; > > SWF.StatusStrip ss; > SWF.MenuStrip ms; >@@ -260,6 +262,10 @@ > provider = new PopupButtonPanelProvider (pbp); > else if ((pbtn = component as SWF.PopupButtonPanel.PopupButton) != null) > provider = new PopupButtonProvider (pbtn); >+ else if ((bcc = component as SWF.ColorDialog.BaseColorControl) != null) >+ provider = new BaseColorControlProvider (bcc); >+ else if ((scc = component as SWF.ColorDialog.BaseColorControl.SmallColorControl) != null) >+ provider = new BaseColorControlProvider.SmallColorControlProvider (scc); > else { > //TODO: We have to solve the problem when there's a Custom control > // Ideally the first thing we do is send a wndproc message to >Index: Mono.UIAutomation.Winforms.Behaviors/BaseColorControl/SmallColorControlInvokeProviderBehavior.cs >=================================================================== >--- Mono.UIAutomation.Winforms.Behaviors/BaseColorControl/SmallColorControlInvokeProviderBehavior.cs (revision 0) >+++ Mono.UIAutomation.Winforms.Behaviors/BaseColorControl/SmallColorControlInvokeProviderBehavior.cs (revision 0) >@@ -0,0 +1,95 @@ >+// 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) 2008 Novell, Inc. (http://www.novell.com) >+// >+// Authors: >+// Neville Gao <nevillegao@gmail.com> >+// >+ >+using System; >+using System.Windows.Forms; >+using System.Windows.Automation; >+using System.Windows.Automation.Provider; >+using Mono.UIAutomation.Winforms; >+using Mono.UIAutomation.Winforms.Events; >+using Mono.UIAutomation.Winforms.Events.BaseColorControl; >+ >+namespace Mono.UIAutomation.Winforms.Behaviors.BaseColorControl >+{ >+ internal class SmallColorControlInvokeProviderBehavior >+ : ProviderBehavior, IInvokeProvider >+ { >+ #region Constructor >+ >+ public SmallColorControlInvokeProviderBehavior (BaseColorControlProvider.SmallColorControlProvider provider) >+ : base (provider) >+ { >+ } >+ >+ #endregion >+ >+ #region IProviderBehavior Interface >+ >+ public override AutomationPattern ProviderPattern { >+ get { return InvokePatternIdentifiers.Pattern; } >+ } >+ >+ public override void Connect () >+ { >+ Provider.SetEvent (ProviderEventType.InvokePatternInvokedEvent, >+ new SmallColorControlInvokePatternInvokedEvent (Provider)); >+ } >+ >+ public override void Disconnect () >+ { >+ Provider.SetEvent (ProviderEventType.InvokePatternInvokedEvent, >+ null); >+ } >+ >+ #endregion >+ >+ #region IInvokeProvider Members >+ >+ public virtual void Invoke () >+ { >+ if (!Provider.Control.Enabled) >+ throw new ElementNotEnabledException (); >+ >+ PerformClick (); >+ } >+ >+ #endregion >+ >+ #region Private Methods >+ >+ private void PerformClick () >+ { >+ if (Provider.Control.InvokeRequired == true) { >+ Provider.Control.BeginInvoke (new MethodInvoker (PerformClick)); >+ return; >+ } >+ >+ // TODO: >+// ((ColorDialog.BaseColorControl.SmallColorControl) Provider.Cotrol).InternalColor >+ } >+ >+ #endregion >+ } >+} >Index: Makefile.am >=================================================================== >--- Makefile.am (revision 122389) >+++ Makefile.am (working copy) >@@ -44,6 +44,7 @@ > > FILES = \ > Globals.cs \ >+ Mono.UIAutomation.Winforms.Behaviors/BaseColorControl/SmallColorControlInvokeProviderBehavior.cs \ > Mono.UIAutomation.Winforms.Behaviors/Button/InvokeProviderBehavior.cs \ > Mono.UIAutomation.Winforms.Behaviors/CheckBox/ToggleProviderBehavior.cs \ > Mono.UIAutomation.Winforms.Behaviors/CheckedListBox/ListItemToggleProviderBehavior.cs \ >@@ -155,6 +156,7 @@ > Mono.UIAutomation.Winforms.Events/AutomationNamePropertyEvent.cs \ > Mono.UIAutomation.Winforms.Events/BaseAutomationEvent.cs \ > Mono.UIAutomation.Winforms.Events/BaseAutomationPropertyEvent.cs \ >+ Mono.UIAutomation.Winforms.Events/BaseColorControl/SmallColorControlInvokePatternInvokedEvent.cs \ > Mono.UIAutomation.Winforms.Events/Button/InvokePatternInvokedEvent.cs \ > Mono.UIAutomation.Winforms.Events/CheckBox/TogglePatternToggleStateEvent.cs \ > Mono.UIAutomation.Winforms.Events/CheckedListBox/ListItemTogglePatternToggleStateEvent.cs \ >@@ -336,6 +338,7 @@ > Mono.UIAutomation.Winforms.Navigation/ParentNavigation.cs \ > Mono.UIAutomation.Winforms.Navigation/SimpleNavigation.cs \ > Mono.UIAutomation.Winforms/AssemblyInfo.cs \ >+ Mono.UIAutomation.Winforms/BaseColorControlProvider.cs \ > Mono.UIAutomation.Winforms/ButtonProvider.cs \ > Mono.UIAutomation.Winforms/CheckBoxProvider.cs \ > Mono.UIAutomation.Winforms/CheckedListBoxProvider.cs \ >Index: Mono.UIAutomation.Winforms.Events/BaseColorControl/SmallColorControlInvokePatternInvokedEvent.cs >=================================================================== >--- Mono.UIAutomation.Winforms.Events/BaseColorControl/SmallColorControlInvokePatternInvokedEvent.cs (revision 0) >+++ Mono.UIAutomation.Winforms.Events/BaseColorControl/SmallColorControlInvokePatternInvokedEvent.cs (revision 0) >@@ -0,0 +1,70 @@ >+// 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) 2008 Novell, Inc. (http://www.novell.com) >+// >+// Authors: >+// Neville Gao <nevillegao@gmail.com> >+// >+ >+using System; >+using System.Windows.Automation; >+using System.Windows.Automation.Provider; >+using System.Windows.Forms; >+using Mono.UIAutomation.Winforms.Events; >+ >+namespace Mono.UIAutomation.Winforms.Events.BaseColorControl >+{ >+ >+ internal class SmallColorControlInvokePatternInvokedEvent : BaseAutomationEvent >+ { >+ >+ #region Constructors >+ >+ public SmallColorControlInvokePatternInvokedEvent (SimpleControlProvider provider) >+ : base (provider, InvokePatternIdentifiers.InvokedEvent) >+ { >+ } >+ >+ #endregion >+ >+ #region IConnectable Overrides >+ >+ public override void Connect () >+ { >+ Provider.Control.Click += new EventHandler (OnClick); >+ } >+ >+ public override void Disconnect () >+ { >+ Provider.Control.Click -= new EventHandler (OnClick); >+ } >+ >+ #endregion >+ >+ #region Private Methods >+ >+ private void OnClick (object sender, EventArgs e) >+ { >+ RaiseAutomationEvent (); >+ } >+ >+ #endregion >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 428845
:
262582
| 263105 |
263526
|
272206