Author: aolk
Date: 2006-09-24 05:54:29 -0400 (Sun, 24 Sep 2006)
New Revision: 65844

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs
Log:
2006-09-24  Alexander Olk  <[EMAIL PROTECTED]>

        * FontDialog.cs: Fixed the up/down arrow keys issue from bug #79478.
          It is now possible to change the selected index in a FontXXXListBox
          with the up and down arrow keys from the FontXXXTextBoxes.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-09-23 23:25:33 UTC (rev 65843)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-09-24 09:54:29 UTC (rev 65844)
@@ -1,3 +1,9 @@
+2006-09-24  Alexander Olk  <[EMAIL PROTECTED]>
+
+       * FontDialog.cs: Fixed the up/down arrow keys issue from bug #79478.
+         It is now possible to change the selected index in a FontXXXListBox
+         with the up and down arrow keys from the FontXXXTextBoxes.
+
 2006-09-22  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * SystemInformation.cs: Return a clone of the theme's MenuFont because

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs    
2006-09-23 23:25:33 UTC (rev 65843)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs    
2006-09-24 09:54:29 UTC (rev 65844)
@@ -397,6 +397,10 @@
                        fontstyleTextBox.TextChanged += new EventHandler 
(OnFontStyleTextTextChanged);
                        fontsizeTextBox.TextChanged += new EventHandler 
(OnFontSizeTextBoxTextChanged);
                        
+                       fontTextBox.KeyDown += new KeyEventHandler 
(OnFontTextBoxKeyDown);
+                       fontstyleTextBox.KeyDown += new KeyEventHandler 
(OnFontStyleTextBoxKeyDown);
+                       fontsizeTextBox.KeyDown += new KeyEventHandler 
(OnFontSizeTextBoxKeyDown);
+                       
                        Font = form.Font;
                }
                #endregion      // Public Constructors
@@ -871,6 +875,75 @@
                
                bool internal_textbox_change = false;
                
+               void OnFontTextBoxKeyDown (object sender, KeyEventArgs e)
+               {
+                       if (e.KeyCode == Keys.Up) {
+                               int sel_index = fontListBox.SelectedIndex;
+                               
+                               sel_index--;
+                               
+                               if (sel_index < 0)
+                                       sel_index = 0;
+                               
+                               fontListBox.SelectedIndex = sel_index;
+                       } else if (e.KeyCode == Keys.Down) {
+                               int sel_index = fontListBox.SelectedIndex;
+                               
+                               sel_index++;
+                               
+                               if (sel_index > fontListBox.Items.Count - 1)
+                                       sel_index = fontListBox.Items.Count - 1;
+                               
+                               fontListBox.SelectedIndex = sel_index;
+                       }
+               }
+               
+               void OnFontStyleTextBoxKeyDown (object sender, KeyEventArgs e)
+               {
+                       if (e.KeyCode == Keys.Up) {
+                               int sel_index = fontstyleListBox.SelectedIndex;
+                               
+                               sel_index--;
+                               
+                               if (sel_index < 0)
+                                       sel_index = 0;
+                               
+                               fontstyleListBox.SelectedIndex = sel_index;
+                       } else if (e.KeyCode == Keys.Down) {
+                               int sel_index = fontstyleListBox.SelectedIndex;
+                               
+                               sel_index++;
+                               
+                               if (sel_index > fontstyleListBox.Items.Count - 
1)
+                                       sel_index = 
fontstyleListBox.Items.Count - 1;
+                               
+                               fontstyleListBox.SelectedIndex = sel_index;
+                       }
+               }
+               
+               void OnFontSizeTextBoxKeyDown (object sender, KeyEventArgs e)
+               {
+                       if (e.KeyCode == Keys.Up) {
+                               int sel_index = fontsizeListBox.SelectedIndex;
+                               
+                               sel_index--;
+                               
+                               if (sel_index < 0)
+                                       sel_index = 0;
+                               
+                               fontsizeListBox.SelectedIndex = sel_index;
+                       } else if (e.KeyCode == Keys.Down) {
+                               int sel_index = fontsizeListBox.SelectedIndex;
+                               
+                               sel_index++;
+                               
+                               if (sel_index > fontsizeListBox.Items.Count - 1)
+                                       sel_index = fontsizeListBox.Items.Count 
- 1;
+                               
+                               fontsizeListBox.SelectedIndex = sel_index;
+                       }
+               }
+               
                void OnFontTextBoxKeyPress (object sender, KeyPressEventArgs e)
                {
                        internal_textbox_change = true;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to