Author: pbartok
Date: 2005-03-18 21:56:09 -0500 (Fri, 18 Mar 2005)
New Revision: 42025

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Panel.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBar.cs
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
Log:
2005-03-18  Peter Bartok  <[EMAIL PROTECTED]>

        * ControlPaint.cs: 
          - Don't throw NotImplemented exceptions, just print a notice once 
            instead (requested by Miguel). This makes running existing SWF 
            apps a bit easier
        * Control.cs:
          - Commented out Drag'N'Drop XplatUI call (no driver support yet)
          - Added context menu trigger on right click
        * Panel.cs: Trigger invalidate on resize
        * StatusBar.cs:
          - Removed old double-buffer drawing
          - Added ResizeRedraw style to force proper update of statusbar
        * ListView.cs:
          - Removed debug output
        * ThemeWin32Classic.cs:
          - Fixed drawing of status bar, now draws Text property if there 
            are no defined panels



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-03-19 02:40:32 UTC (rev 42024)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-03-19 02:56:09 UTC (rev 42025)
@@ -1,3 +1,22 @@
+2005-03-18  Peter Bartok  <[EMAIL PROTECTED]>
+
+       * ControlPaint.cs: 
+         - Don't throw NotImplemented exceptions, just print a notice once 
+           instead (requested by Miguel). This makes running existing SWF 
+           apps a bit easier
+       * Control.cs:
+         - Commented out Drag'N'Drop XplatUI call (no driver support yet)
+         - Added context menu trigger on right click
+       * Panel.cs: Trigger invalidate on resize
+       * StatusBar.cs:
+         - Removed old double-buffer drawing
+         - Added ResizeRedraw style to force proper update of statusbar
+       * ListView.cs:
+         - Removed debug output
+       * ThemeWin32Classic.cs:
+         - Fixed drawing of status bar, now draws Text property if there 
+           are no defined panels
+
 2005-03-18  Jackson Harper  <[EMAIL PROTECTED]>
 
        * ImageList.cs: When the image stream is set pull all the images

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2005-03-19 02:40:32 UTC (rev 42024)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2005-03-19 02:56:09 UTC (rev 42025)
@@ -1015,7 +1015,9 @@
                        }
 
                        set {
-                               XplatUI.State.DropTarget=value;
+                               #if later
+                                       XplatUI.State.DropTarget=value;
+                               #endif
                        }
                }
 
@@ -3263,6 +3265,10 @@
                                }
 
                                case Msg.WM_RBUTTONUP: {
+                                       if (context_menu != null) {
+                                               context_menu.Show(this, new 
Point(LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 
())));
+                                       }
+
                                        HandleClick(mouse_clicks);
                                        OnMouseUp (new MouseEventArgs 
(FromParamToMouseButtons ((int) m.WParam.ToInt32()) | MouseButtons.Right, 
                                                mouse_clicks, 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs  
2005-03-19 02:40:32 UTC (rev 42024)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs  
2005-03-19 02:56:09 UTC (rev 42025)
@@ -369,18 +369,33 @@
                }
 
                [MonoTODO("Figure out a good System.Drawing way for XOR 
drawing")]
+               private static bool DRFNotImpl = false;
                public static void DrawReversibleFrame(Rectangle rectangle, 
Color backColor, FrameStyle style) {
-                       throw new NotImplementedException();
+                       if (!DRFNotImpl) {
+                               DRFNotImpl = true;
+                               Console.WriteLine("NOT IMPLEMENTED: 
FillReversibleRectangle(Rectangle rectangle, Color backColor)");
+                       }
+                       //throw new NotImplementedException();
                }
 
                [MonoTODO("Figure out a good System.Drawing way for XOR 
drawing")]
+               private static bool DRLNotImpl = false;
                public static void DrawReversibleLine(Point start, Point end, 
Color backColor) {
-                       throw new NotImplementedException();
+                       if (!DRLNotImpl) {
+                               DRLNotImpl = true;
+                               Console.WriteLine("NOT IMPLEMENTED: 
FillReversibleRectangle(Rectangle rectangle, Color backColor)");
+                       }
+                       //throw new NotImplementedException();
                }
 
                [MonoTODO("Figure out a good System.Drawing way for XOR 
drawing")]
+               private static bool FRRNotImpl = false;
                public static void FillReversibleRectangle(Rectangle rectangle, 
Color backColor) {
-                       throw new NotImplementedException();
+                       if (!FRRNotImpl) {
+                               FRRNotImpl = true;
+                               Console.WriteLine("NOT IMPLEMENTED: 
FillReversibleRectangle(Rectangle rectangle, Color backColor)");
+                       }
+                       //throw new NotImplementedException();
                }
 
 
@@ -393,8 +408,13 @@
                }
 
                [MonoTODO]
+               private static bool DSFNotImpl = false;
                public static void DrawSelectionFrame(Graphics graphics, bool 
active, Rectangle outsideRect, Rectangle insideRect, Color backColor) {
-                       throw new NotImplementedException();
+                       if (!DSFNotImpl) {
+                               DSFNotImpl = true;
+                               Console.WriteLine("NOT IMPLEMENTED: 
DrawSelectionFrame(Graphics graphics, bool active, Rectangle outsideRect, 
Rectangle insideRect, Color backColor)");
+                       }
+                       //throw new NotImplementedException();
                }
 
                public static void DrawSizeGrip (Graphics graphics, Color 
backColor, Rectangle bounds)

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2005-03-19 02:40:32 UTC (rev 42024)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2005-03-19 02:56:09 UTC (rev 42025)
@@ -1198,8 +1198,6 @@
 
                private void ListView_Paint (object sender, PaintEventArgs pe)
                {
-                       Console.WriteLine ("ListView_Paint {0} {1}", 
this.TotalWidth, this.TotalHeight);
-                       
                        if (this.Width <= 0 || this.Height <=  0 ||
                            this.Visible == false || this.updating == true)
                                return;

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Panel.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Panel.cs 
2005-03-19 02:40:32 UTC (rev 42024)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Panel.cs 
2005-03-19 02:56:09 UTC (rev 42025)
@@ -102,6 +102,7 @@
                #region Protected Instance Methods
                protected override void OnResize(EventArgs e) {
                        base.OnResize (e);
+                       Invalidate(true);
                }
 
                #endregion      // Protected Instance Methods

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBar.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBar.cs     
2005-03-19 02:40:32 UTC (rev 42024)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBar.cs     
2005-03-19 02:56:09 UTC (rev 42025)
@@ -55,6 +55,7 @@
                        base.Dock = DockStyle.Bottom;
                        Anchor = AnchorStyles.Top | AnchorStyles.Left;
                        this.TabStop = false;
+                       this.SetStyle(ControlStyles.ResizeRedraw, true);
                }
                #endregion      // Public Constructors
 
@@ -302,13 +303,12 @@
 
                private void DoPaint (PaintEventArgs pevent)
                {
-                      if (Width <= 0 || Height <=  0 || Visible == false)
-                              return;
+                       if (Width <= 0 || Height <=  0 || Visible == false)
+                               return;
 
-                      UpdateArea ();
-                      CalcPanelSizes ();
-                      Draw();
-                      pevent.Graphics.DrawImage (ImageBuffer, 0, 0);
+                       UpdateArea ();
+                       CalcPanelSizes ();
+                       ThemeEngine.Current.DrawStatusBar (pevent.Graphics, 
this.ClientRectangle, this);
                }
 
                private void CalcPanelSizes ()

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2005-03-19 02:40:32 UTC (rev 42024)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2005-03-19 02:56:09 UTC (rev 42025)
@@ -2685,16 +2685,22 @@
 
                        dc.FillRectangle (GetControlBackBrush (sb.BackColor), 
area);
                        
-                       if (sb.ShowPanels && sb.Panels.Count == 0) {
-                               // Create a default panel.
-                               SolidBrush br_forecolor = GetControlForeBrush 
(sb.ForeColor);
-                               
-                               StatusBarPanel panel = new StatusBarPanel ();
-                               Rectangle new_area = new Rectangle (area.X + 
horz_border,
-                                       area.Y + horz_border,
-                                       area.Width - StatusBarSizeGripWidth - 
horz_border,
-                                       area.Height - horz_border);
-                               DrawStatusBarPanel (dc, new_area, -1, 
br_forecolor, panel);
+                       if (sb.Panels.Count == 0 && sb.Text != String.Empty) {
+                               string text = sb.Text;
+                               StringFormat string_format = new StringFormat 
();
+                               string_format.Trimming = 
StringTrimming.Character;
+                               string_format.FormatFlags = 
StringFormatFlags.NoWrap;
+
+                               if (text [0] == '\t') {
+                                       string_format.Alignment = 
StringAlignment.Center;
+                                       text = text.Substring (1);
+                                       if (text [0] == '\t') {
+                                               string_format.Alignment = 
StringAlignment.Far;
+                                               text = text.Substring (1);
+                                       }
+                               }
+               
+                               dc.DrawString (text, sb.Font, 
ResPool.GetSolidBrush (sb.ForeColor), new Rectangle(area.X + 2, area.Y + 2, 
area.Width - 4, area.Height - 4), string_format);
                        } else if (sb.ShowPanels) {
                                SolidBrush br_forecolor = GetControlForeBrush 
(sb.ForeColor);
                                int prev_x = area.X + horz_border;

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

Reply via email to