Skip to content

Commit

Permalink
* Splitter.cs: No decorations for the splitter form. Cache the
Browse files Browse the repository at this point in the history
	hatch brush.


svn path=/trunk/mcs/; revision=43936
  • Loading branch information
Jackson Harper committed May 3, 2005
1 parent 63118be commit 5613f90
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
@@ -1,3 +1,8 @@
2005-05-03 Jackson Harper <jackson@ximian.com>

* Splitter.cs: No decorations for the splitter form. Cache the
hatch brush.

2005-05-03 Jackson Harper <jackson@ximian.com>

* TreeView.cs: Use dashed lines to connect nodes. Use the
Expand Down
25 changes: 21 additions & 4 deletions mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs
Expand Up @@ -465,23 +465,40 @@ private Control FindAdjacentControl ()
#endregion

#region Private Class
public class SplitterForm : System.Windows.Forms.Form
public class SplitterForm : Form
{
private HatchBrush hatch;

public SplitterForm()
{

SetStyle (ControlStyles.UserPaint, true);
SetStyle (ControlStyles.AllPaintingInWmPaint, true);

// TODO: This has to be here, or the form doesn't draw right
this.MinimumSize = new System.Drawing.Size(1, 1);
this.Text = "Form2";

hatch = new HatchBrush (HatchStyle.SmallCheckerBoard, Color.White, Color.Black);
}

protected override CreateParams CreateParams {
get {
CreateParams cp;

cp = base.CreateParams;

cp.Style = (int)WindowStyles.WS_POPUP;
cp.Style |= (int)WindowStyles.WS_CLIPSIBLINGS;

cp.ExStyle = (int) WindowStyles.WS_EX_TOPMOST;

return cp;
}
}

protected override void OnPaint(PaintEventArgs e)
{
//TODO: The HatchBrush should be cached
e.Graphics.FillRectangle(new HatchBrush(HatchStyle.SmallCheckerBoard, Color.White,Color.Black),ClientRectangle);
e.Graphics.FillRectangle (hatch,ClientRectangle);
base.OnPaint (e);
}

Expand Down

0 comments on commit 5613f90

Please sign in to comment.