Code Search for Developers
 
 
  

VLabel.cs from MASE: Agile Software Engineering at Krugle


Show VLabel.cs syntax highlighted

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.ComponentModel;

namespace Whiteboard
{
	/// <summary>
	/// 
	/// This is an label that extends the traditional System.Windows.Forms.Label
	/// to ensure that we can rotate the label to be displayed on all sides of the
	/// horizontal display.
	/// 
	/// </summary>
	public class VLabel : System.Windows.Forms.Label
	{

		private bool bFlip = true;

		public VLabel()
		{
		}


		protected override void OnPaint(PaintEventArgs e)
		{
			Graphics g = e.Graphics;

			StringFormat stringFormat = new StringFormat();
			stringFormat.Alignment = StringAlignment.Center;
			stringFormat.Trimming = StringTrimming.None;
			stringFormat.FormatFlags = StringFormatFlags.DirectionVertical;

			Brush textBrush = new SolidBrush(this.ForeColor);
		
			Matrix storedState = g.Transform;

			if (bFlip)
			{
				g.RotateTransform(180f);

				g.TranslateTransform(-ClientRectangle.Width, 
									 -ClientRectangle.Height);
			}

			g.DrawString(
				this.Text,
				this.Font,
				textBrush,
				ClientRectangle,
				stringFormat);

			g.Transform = storedState;
		}

		[Description("When this parameter is true the VLabel flips at 180 degrees."),Category("Appearance")]
		public bool Flip180
		{
			get
			{
				return bFlip;
			}
			set
			{
				bFlip = value;
				this.Invalidate();
			}
		}
	}
}




See more files for this project here

MASE: Agile Software Engineering

The MASE project investigates methods to support the coordination and executable acceptance testing of software projects. Keywords: Agile methods, distributed teams, Extreme Programming. See http://ebe.cpsc.ucalgary.ca/ebe for more information.

Project homepage: http://sourceforge.net/projects/mase
Programming language(s): Java,XML
License: other

  ApplicationProperties.cs
  CardLocationWith4Corners.cs
  HandWrittenObj.cs
  HandwrittenStoryCard.cs
  Iteration.cs
  Iteration.resx
  MaseListen.cs
  MaseUpdate.cs
  ProcessNode.cs
  ProjectNode.cs
  RegisterObj.cs
  Serializer.cs
  SingleWS.cs
  StoryObj.cs
  TabletContentandUtil.cs
  Utility.cs
  VLabel.cs
  VLabel.resx