* ColorDialog.cs, FontDialog.cs: Make use of the updated 3D border
authorAlexander Olk <aolk@mono-cvs.ximian.com>
Fri, 31 Mar 2006 14:51:23 +0000 (14:51 -0000)
committerAlexander Olk <aolk@mono-cvs.ximian.com>
Fri, 31 Mar 2006 14:51:23 +0000 (14:51 -0000)
  code

2006-03-30  Alexander Olk  <alex.olk@googlemail.com>

svn path=/trunk/mcs/; revision=58846

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColorDialog.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs

index c59e6c316140def21eb7fbdad634a10d34d57f6d..5b0278bed8057de3c7b10044cd36fac842b0af4c 100644 (file)
@@ -1,3 +1,8 @@
+2006-03-30  Alexander Olk  <alex.olk@googlemail.com>
+
+       * ColorDialog.cs, FontDialog.cs: Make use of the updated 3D border
+         code
+
 2006-03-30  Alexander Olk  <alex.olk@googlemail.com>
 
        * ThemeWin32Classic.cs: Updated MainMenu drawing of selected and
index 30941e94ef310b3623dc396946e7631f53a7eed9..9c9c417e58511abd7bd67964cc804094733471f5 100644 (file)
@@ -115,37 +115,31 @@ namespace System.Windows.Forms {
                        hueTextBox.Location = new Point (324, 203);
                        hueTextBox.Size = new Size (27, 21);
                        hueTextBox.TabIndex = 11;
-                       hueTextBox.TextAlign = HorizontalAlignment.Right;
                        hueTextBox.MaxLength = 3;
                        // satTextBox
                        satTextBox.Location = new Point (324, 225);
                        satTextBox.Size = new Size (27, 21);
                        satTextBox.TabIndex = 15;
-                       satTextBox.TextAlign = HorizontalAlignment.Right;
                        satTextBox.MaxLength = 3;
                        // greenTextBox
                        greenTextBox.Location = new Point (404, 225);
                        greenTextBox.Size = new Size (27, 21);
                        greenTextBox.TabIndex = 18;
-                       greenTextBox.TextAlign = HorizontalAlignment.Right;
                        greenTextBox.MaxLength = 3;
                        // briTextBox
                        briTextBox.Location = new Point (324, 247);
                        briTextBox.Size = new Size (27, 21);
                        briTextBox.TabIndex = 16;
-                       briTextBox.TextAlign = HorizontalAlignment.Right;
                        briTextBox.MaxLength = 3;
                        // blueTextBox
                        blueTextBox.Location = new Point (404, 247);
                        blueTextBox.Size = new Size (27, 21);
                        blueTextBox.TabIndex = 19;
-                       blueTextBox.TextAlign = HorizontalAlignment.Right;
                        blueTextBox.MaxLength = 3;
                        // redTextBox
                        redTextBox.Location = new Point (404, 203);
                        redTextBox.Size = new Size (27, 21);
                        redTextBox.TabIndex = 17;
-                       redTextBox.TextAlign = HorizontalAlignment.Right;
                        redTextBox.MaxLength = 3;
                        
                        // redLabel
@@ -498,18 +492,21 @@ namespace System.Windows.Forms {
                // not working 100 %, S.W.F.TextBox isn't finished yet
                void OnKeyPressTextBoxes (object sender, KeyPressEventArgs e)
                {
-                       // accept only '0', '1', ... , '9'
-                       // 48 = '0', 57 = '9'
-                       if (e.KeyChar < (char)48 || e.KeyChar > (char)57)
+                       if (Char.IsLetter (e.KeyChar) || Char.IsWhiteSpace (e.KeyChar) || Char.IsPunctuation (e.KeyChar)) {
                                e.Handled = true;
+                               return; 
+                       }
                        
                        TextChangedTextBoxes (sender);
                }
                
                // not working 100 %, S.W.F.TextBox isn't finished yet
+               // setting TextBox.Maxlength gives us weird results
                void TextChangedTextBoxes (object sender)
                {
-                       if (((TextBox)sender).Text.Length == 0)
+                       TextBox tmp_box = sender as TextBox;
+                       
+                       if (tmp_box.Text.Length == 0)
                                return;
                        
                        int val;
@@ -833,12 +830,10 @@ namespace System.Windows.Forms {
                                {
                                        base.OnPaint (pe);
                                        
-//                                     pe.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (BackColor), 0, 0, 26, 23);
-                                       
                                        pe.Graphics.FillRectangle (ThemeEngine.Current.ResPool.GetSolidBrush (internalcolor),
                                                                   new Rectangle (4, 4, 17, 15));
                                        
-                                       DrawBorder (pe.Graphics, new Rectangle (4, 4, 17, 15));
+                                       ControlPaint.DrawBorder3D (pe.Graphics, 3, 3, 19, 17, Border3DStyle.Sunken);
                                        
                                        if (isSelected) {
                                                pe.Graphics.DrawRectangle (ThemeEngine.Current.ResPool.GetPen (Color.Black),
@@ -867,13 +862,6 @@ namespace System.Windows.Forms {
                                        
                                        base.OnLostFocus (e);
                                }
-                               
-                               private void DrawBorder (Graphics dc, Rectangle rect)
-                               {
-                                       Pen pen = ThemeEngine.Current.ResPool.GetPen (Color.Black);
-                                       dc.DrawLine (pen, rect.X, rect.Y, rect.X, rect.Bottom - 1);
-                                       dc.DrawLine (pen, rect.X + 1, rect.Y, rect.Right - 1, rect.Y);
-                               }
                        }
                        
                        private SmallColorControl[] smallColorControl;
@@ -913,7 +901,7 @@ namespace System.Windows.Forms {
                                userSmallColorControl [15] = new SmallColorControl (Color.White);
                                
                                smallColorControl = new SmallColorControl [48];
-                               smallColorControl [0] = new SmallColorControl (Color.FromArgb (((Byte)(255)), ((Byte)(128)), ((Byte)(138))));
+                               smallColorControl [0] = new SmallColorControl (Color.FromArgb (((Byte)(255)), ((Byte)(128)), ((Byte)(128))));
                                smallColorControl [1] = new SmallColorControl (Color.FromArgb (((Byte)(128)), ((Byte)(128)), ((Byte)(64))));
                                smallColorControl [2] = new SmallColorControl (Color.Gray);
                                smallColorControl [3] = new SmallColorControl (Color.FromArgb (((Byte)(128)), ((Byte)(0)), ((Byte)(255))));
index e9ad0f60837c1b0e399700e3a8c643af5f5ab3ab..e0f0b22084c421d4727096b37690e507f6880c91 100644 (file)
@@ -260,6 +260,7 @@ namespace System.Windows.Forms
                        examplePanel.Location = new Point( 8, 20 );
                        examplePanel.TabIndex = 0;
                        examplePanel.Size = new Size( 156, 40 );
+                       examplePanel.BorderStyle = BorderStyle.Fixed3D;
                        
                        form.AcceptButton = okButton;
                        
@@ -681,8 +682,6 @@ namespace System.Windows.Forms
                        
                        e.Graphics.FillRectangle( ThemeEngine.Current.ResPool.GetSolidBrush( SystemColors.Control ), 0, 0, 156, 40 );
                        
-                       ControlPaint.DrawBorder3D(e.Graphics, e.ClipRectangle, Border3DStyle.SunkenInner);
-                       
                        string text = "AaBbYyZz";
                        
                        SizeF fontSizeF = e.Graphics.MeasureString( text, font );