This commit was manufactured by cvs2svn to create branch 'mono-1-0'.
[mono.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / DomainUpDown.cs
index dcdb43c5e83f5d7418a5d6cdda76f4ddf6a253aa..6a02baf822e70f34f5f6cddf114188236796404f 100644 (file)
@@ -7,8 +7,30 @@
 //   implemented by Aleksey Ryabchuk (ryabchuk@yahoo.com)
 // (C) Ximian, Inc., 2002
 //
+
+//
+// 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.
+//
 using System.Collections;
 using System.ComponentModel;
+using System.Globalization;
 
 namespace System.Windows.Forms {
 
@@ -71,13 +93,21 @@ namespace System.Windows.Forms {
                                SelectedItemChanged(this, e);
                }
 
+               [MonoTODO]
+               protected override void OnChanged(object source, EventArgs e) {
+                       base.OnChanged(source, e);
+               }
+
                [MonoTODO]
                protected override void OnTextBoxKeyDown(object source, KeyEventArgs e)
-               {       // needs to be improved to work with different languages
+               {
                        if ( ReadOnly ) {
-                               string upper = e.KeyCode.ToString ( );
-                               if ( upper.Length <= 1 ) {
-                                       string lower = upper.ToLower( );
+                               char symbol = System.Convert.ToChar( (int)e.KeyCode );
+                               
+                               if ( Char.IsLetterOrDigit ( symbol ) ) {
+                                       string lower = Char.ToLower ( symbol ).ToString ( );
+                                       string upper = Char.ToUpper ( symbol ).ToString ( );
+
                                        foreach ( object item in Items ) {
                                                string sitem = item.ToString ( );
                                                if ( sitem.StartsWith ( upper ) || sitem.StartsWith ( lower ) ) {