diff --git a/Demo.WindowsForms/BSE.Windows.Forms/ProgressBar/ProgressBar.Designer.cs b/Demo.WindowsForms/BSE.Windows.Forms/ProgressBar/ProgressBar.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/ProgressBar/ProgressBar.Designer.cs @@ -0,0 +1,38 @@ +namespace BSE.Windows.Forms +{ + partial class ProgressBar + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.Size = new System.Drawing.Size(100, 23); + this.Name = "progressBar"; + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/ProgressBar/ProgressBar.cs b/Demo.WindowsForms/BSE.Windows.Forms/ProgressBar/ProgressBar.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/ProgressBar/ProgressBar.cs @@ -0,0 +1,474 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Text; +using System.Windows.Forms; +using System.Drawing; +using System.Globalization; +using Demo.WindowsForms.Properties; +using System.Drawing.Drawing2D; + +namespace BSE.Windows.Forms +{ + /// + /// Represents a Windows progress bar control. + /// + /// Copyright © 2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + [ToolboxBitmap(typeof(System.Windows.Forms.ProgressBar))] + public partial class ProgressBar : Control + { + #region Events + /// + /// Occurs when the value of the BorderColor property changes. + /// + [Description("Occurs when the value of the BorderColor property is changed on the control.")] + public event EventHandler BorderColorChanged; + /// + /// Occurs when the value of the BackgroundColor property changes. + /// + [Description("Occurs when the value of the BackgroundColor property is changed on the control.")] + public event EventHandler BackgroundColorChanged; + /// + /// Occurs when the value of the ValueColor property changes. + /// + [Description("Occurs when the value of the ValueColor property is changed on the control.")] + public event EventHandler ValueColorChanged; + #endregion + + #region FieldsPrivate + private Color m_backgroundColor; + private Color m_valueColor; + private Color m_borderColor; + private int m_iMinimum; + private int m_iMaximum; + private int m_iValue; + #endregion + + #region Properties + /// + /// Gets or sets the color used for the background rectangle of this control. + /// + /// + /// Type: + /// A Color used for the background rectangle of this control. + /// + [Browsable(true)] + [Description("The color used for the background rectangle of this control.")] + public Color BackgroundColor + { + get { return this.m_backgroundColor; } + set + { + if (this.m_backgroundColor != value) + { + this.m_backgroundColor = value; + OnBackgroundColorChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the color used for the value rectangle of this control. + /// + /// + /// Type: + /// A Color used for the value rectangle of this control. + /// + [Browsable(true)] + [Description("The color used for the value rectangle of this control.")] + public Color ValueColor + { + get { return this.m_valueColor; } + set + { + if (this.m_valueColor != value) + { + this.m_valueColor = value; + OnValueColorChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the border color for the control. + /// + /// + /// Type: + /// A Color that represents the border color of the control. + /// + public Color BorderColor + { + get { return this.m_borderColor; } + set + { + if (this.m_borderColor != value) + { + this.m_borderColor = value; + OnBorderColorChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the background color for the control. + /// + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Color BackColor + { + get { return base.BackColor; } + set { base.BackColor = value; } + } + /// + /// Gets or sets the maximum value of the range of the control. + /// + /// + /// Type: + /// The maximum value of the range. The default is 100. + /// + [Browsable(true)] + [Description("The upper bound of range this ProgressBar is working with.")] + public int Maximum + { + get { return this.m_iMaximum; } + set + { + if (this.m_iMaximum != value) + { + if (value < 0) + { + object[] args = new object[] { "Maximum", value.ToString(CultureInfo.CurrentCulture), "Maximum" }; + throw new ArgumentOutOfRangeException("Maximum", string.Format(CultureInfo.InvariantCulture, Resources.IDS_InvalidLowBoundArgument, args)); + } + if (this.m_iMinimum > value) + { + this.m_iMinimum = value; + } + this.m_iMaximum = value; + if (this.m_iValue > this.m_iMaximum) + { + this.m_iValue = this.m_iMaximum; + } + UpdatePos(); + } + } + } + /// + /// Gets or sets the minimum value of the range of the control. + /// + /// + /// Type: + /// The minimum value of the range. The default is 0. + /// + [Browsable(true)] + [Description("The lower bound of range this ProgressBar is working with.")] + public int Minimum + { + get { return this.m_iMinimum; } + set + { + if (this.m_iMinimum != value) + { + if (value < 0) + { + object[] args = new object[] { "Minimum", value.ToString(CultureInfo.CurrentCulture), "Minimum" }; + throw new ArgumentOutOfRangeException("Minimum", string.Format(CultureInfo.InvariantCulture, Resources.IDS_InvalidLowBoundArgument, args)); + } + if (this.m_iMaximum < value) + { + this.m_iMaximum = value; + } + this.m_iMinimum = value; + if (this.m_iValue < this.m_iMinimum) + { + this.m_iValue = this.m_iMinimum; + } + UpdatePos(); + } + } + } + /// + /// Gets or sets the current position of the progress bar. + /// + /// + /// Type: + /// The position within the range of the progress bar. The default is 0. + /// + [Browsable(true)] + [Description("The current value for the ProgressBar, in the range specified by the minimum and maximum properties.")] + public int Value + { + get { return this.m_iValue; } + set + { + if (this.m_iValue != value) + { + if ((value < this.m_iMinimum) || (value > this.m_iMaximum)) + { + throw new ArgumentOutOfRangeException("Value", string.Format(CultureInfo.InvariantCulture, Resources.IDS_InvalidBoundArgument, new object[] { "Value", value.ToString(CultureInfo.CurrentCulture), "'minimum'", "'maximum'" })); + } + this.m_iValue = value; + UpdatePos(); + } + } + } + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the ProgressBar class. + /// + public ProgressBar() + { + this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); + this.SetStyle(ControlStyles.UserPaint, true); + this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + this.SetStyle(ControlStyles.ResizeRedraw, true); + this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); + InitializeComponent(); + + this.m_iMaximum = 100; + this.m_backgroundColor = Color.FromArgb(20, 20, 255); + this.m_valueColor = Color.FromArgb(255, 0, 255); + this.m_borderColor = SystemColors.ActiveBorder; + this.BackColor = Color.Transparent; + } + #endregion + + #region MethodsProtected + /// + /// Raises the Paint event. + /// + /// A PaintEventArgs that contains the event data. + protected override void OnPaint(PaintEventArgs e) + { + using (UseAntiAlias antiAlias = new UseAntiAlias(e.Graphics)) + { + Graphics graphics = e.Graphics; + DrawProgressBar( + graphics, + this.ClientRectangle, + this.m_backgroundColor, + this.m_valueColor, + this.m_borderColor, + this.RightToLeft, + this.Minimum, + this.Maximum, + this.Value); + + if (string.IsNullOrEmpty(this.Text) == false) + { + using (UseClearTypeGridFit useClearTypeGridFit = new UseClearTypeGridFit(graphics)) + { + using (SolidBrush textBrush = new SolidBrush(this.ForeColor)) + { + using (StringFormat stringFormat = new StringFormat()) + { + stringFormat.FormatFlags = StringFormatFlags.NoWrap; + if (this.RightToLeft == RightToLeft.Yes) + { + stringFormat.FormatFlags |= StringFormatFlags.DirectionRightToLeft; + } + stringFormat.Trimming = StringTrimming.EllipsisCharacter; + stringFormat.LineAlignment = StringAlignment.Center; + stringFormat.Alignment = StringAlignment.Center; + + Rectangle stringRectangle = this.ClientRectangle; + graphics.DrawString(this.Text, this.Font, textBrush, stringRectangle, stringFormat); + } + } + } + } + } + } + /// + /// Raises the BorderColor changed event. + /// + /// The source of the event. + /// A EventArgs that contains the event data. + protected virtual void OnBorderColorChanged(object sender, EventArgs e) + { + this.Invalidate(true); + if (this.BorderColorChanged != null) + { + this.BorderColorChanged(sender, e); + } + } + /// + /// Raises the BackgroundColor changed event. + /// + /// The source of the event. + /// A EventArgs that contains the event data. + protected virtual void OnBackgroundColorChanged(object sender, EventArgs e) + { + Invalidate(); + if (this.BackgroundColorChanged != null) + { + this.BackgroundColorChanged(sender, e); + } + } + /// + /// Raises the ValueColor changed event. + /// + /// The source of the event. + /// A EventArgs that contains the event data. + protected virtual void OnValueColorChanged(object sender, EventArgs e) + { + Invalidate(true); + if (this.ValueColorChanged != null) + { + this.ValueColorChanged(sender, e); + } + } + #endregion + + #region MethodsPrivate + private void UpdatePos() + { + this.Invalidate(true); + } + + private static void DrawProgressBar( + Graphics graphics, + Rectangle clientRectangle, + Color colorBackgroundEnd, + Color colorValueEnd, + Color borderColor, + RightToLeft rightToLeft, + int iMinimum, + int iMaximum, + int iValue) + { + + Rectangle outerRectangle = GetRectangleBackground(clientRectangle); + + using (GraphicsPath outerRectangleGraphicsPath = GetBackgroundPath(outerRectangle, 4)) + { + if (outerRectangleGraphicsPath != null) + { + using (LinearGradientBrush gradientBrush = GetGradientBackBrush(outerRectangle, colorBackgroundEnd)) + { + if (gradientBrush != null) + { + graphics.FillPath(gradientBrush, outerRectangleGraphicsPath); + } + } + + // Draws the value rectangle + if (iValue > 0) + { + Rectangle valueRectangle = GetRectangleValue(outerRectangle, rightToLeft, iMinimum, iMaximum, iValue); + using (GraphicsPath valueGraphicsPath = GetValuePath(valueRectangle, rightToLeft, 5)) + { + using (LinearGradientBrush gradientBrush = GetGradientBackBrush(valueRectangle, colorValueEnd)) + { + if (gradientBrush != null) + { + graphics.FillPath(gradientBrush, valueGraphicsPath); + } + } + } + } + using (Pen borderPen = new Pen(borderColor)) + { + graphics.DrawPath(borderPen, outerRectangleGraphicsPath); + } + } + } + } + private static Rectangle GetRectangleBackground(Rectangle clientRectangle) + { + Rectangle rectangleBackground = clientRectangle; + rectangleBackground.Inflate(-1, -1); + return rectangleBackground; + } + private static Rectangle GetRectangleValue(Rectangle backgroundRectangle, RightToLeft rightToLeft, int iMinimum, int iMaximum, int iValue) + { + Rectangle valueRectangle = backgroundRectangle; + int iProgressRange = iMaximum - iMinimum; + int iValueRange = iValue - iMinimum; + int iRange = (int)((float)iValueRange / (float)iProgressRange * backgroundRectangle.Width); + valueRectangle.Width = iRange; + if (rightToLeft == RightToLeft.Yes) + { + valueRectangle.X = backgroundRectangle.Width - valueRectangle.Width; + } + return valueRectangle; + } + private static GraphicsPath GetBackgroundPath(Rectangle bounds, int radius) + { + int x = bounds.X; + int y = bounds.Y; + int width = bounds.Width; + int height = bounds.Height; + GraphicsPath graphicsPath = new GraphicsPath(); + graphicsPath.AddArc(x, y, radius, radius, 180, 90); //Upper left corner + graphicsPath.AddArc(x + width - radius, y, radius, radius, 270, 90); //Upper right corner + graphicsPath.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90);//Lower right corner + graphicsPath.AddArc(x, y + height - radius, radius, radius, 90, 90); //Lower left corner + graphicsPath.CloseFigure(); + return graphicsPath; + } + + private static GraphicsPath GetValuePath(Rectangle bounds, RightToLeft rightToLeft, int radius) + { + int x = bounds.X; + int y = bounds.Y; + int width = bounds.Width; + int height = bounds.Height; + GraphicsPath graphicsPath = new GraphicsPath(); + if (rightToLeft == RightToLeft.No) + { + graphicsPath.AddArc(x, y, radius, radius, 180, 90); //Upper left corner + graphicsPath.AddLine(x + radius, y, x + width, y); //Upper line + graphicsPath.AddLine(x + width, y, x + width, y + height); //Right line + graphicsPath.AddArc(x, y + height - radius, radius, radius, 90, 90); //Lower left corner + } + else + { + graphicsPath.AddLine(x, y, width - radius, y); //Upper Line + graphicsPath.AddArc(x + width - radius, y, radius, radius, 270, 90); // Upper right corner + graphicsPath.AddLine(x + width, y + radius, x + width, y + radius + height - (2 * radius)); // right line + graphicsPath.AddArc(x + width - radius, y + radius + height - (2 * radius), radius, radius, 360, 90); // Lower right corner + graphicsPath.AddLine(x + width - radius, y + height, x, y + height); // Lower line + } + graphicsPath.CloseFigure(); + return graphicsPath; + } + + private static LinearGradientBrush GetGradientBackBrush(Rectangle bounds, Color backColor) + { + if (IsZeroWidthOrHeight(bounds)) + { + return null; + } + LinearGradientBrush linearGradientBrush = linearGradientBrush = new LinearGradientBrush(bounds, Color.White, backColor, LinearGradientMode.Vertical); + if (linearGradientBrush != null) + { + Blend blend = new Blend(); + blend.Positions = new float[] { 0.0F, 0.2F, 0.3F, 0.5F, 0.6F, 0.8F, 1.0F }; + blend.Factors = new float[] { 0.3F, 0.4F, 0.5F, 0.8F, 1.0F, 1.0F, 0.9F }; + linearGradientBrush.Blend = blend; + } + return linearGradientBrush; + } + /// + /// Checks if the rectangle width or height is equal to 0. + /// + /// the rectangle to check + /// true if the with or height of the rectangle is 0 else false + private static bool IsZeroWidthOrHeight(Rectangle rectangle) + { + if (rectangle.Width != 0) + { + return (rectangle.Height == 0); + } + return true; + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/ProgressBar/ToolStripProgressBar.cs b/Demo.WindowsForms/BSE.Windows.Forms/ProgressBar/ToolStripProgressBar.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/ProgressBar/ToolStripProgressBar.cs @@ -0,0 +1,260 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using System.Windows.Forms.Design; +using System.Drawing; +using System.ComponentModel; + +namespace BSE.Windows.Forms +{ + /// + /// Represents a Windows progress bar control contained in a StatusStrip. + /// + [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip | ToolStripItemDesignerAvailability.StatusStrip)] + [ToolboxBitmap(typeof(System.Windows.Forms.ProgressBar))] + public class ToolStripProgressBar : ToolStripControlHost + { + #region Events + #endregion + + #region Constants + #endregion + + #region FieldsPrivate + #endregion + + #region Properties + /// + /// Gets the ProgressBar. + /// + /// + /// Type: + /// A ProgressBar. + /// + public ProgressBar ProgressBar + { + get { return base.Control as ProgressBar; } + } + /// + /// Gets or sets a value indicating whether items are to be placed from right to left + /// and text is to be written from right to left. + /// + /// + /// Type: + /// true if items are to be placed from right to left and text is to be written from right to left; otherwise, false. + /// + public override RightToLeft RightToLeft + { + get { return this.ProgressBar.RightToLeft; } + set { this.ProgressBar.RightToLeft = value; } + } + /// + /// Gets or sets the color used for the background rectangle for this . + /// + /// + /// Type: + /// A Color used for the background rectangle of this ToolStripProgressBar. + /// + [Browsable(true)] + [Category("Appearance")] + [Description("The color used for the background rectangle of this control.")] + public Color BackgroundColor + { + get { return this.ProgressBar.BackgroundColor; } + set { this.ProgressBar.BackgroundColor = value; } + } + /// + /// Gets or sets the color used for the value rectangle of this control. + /// Gets or sets color used for the value rectangle for this . + /// + /// + /// Type: + /// A Color used for the value rectangle for this ToolStripProgressBar. + /// + [Browsable(true)] + [Category("Appearance")] + [Description("The end color of the gradient used for the value rectangle of this control.")] + public Color ValueColor + { + get { return this.ProgressBar.ValueColor; } + set { this.ProgressBar.ValueColor = value; } + } + /// + /// Gets or sets the foreground color of the hosted control. + /// + /// + /// Type: + /// A representing the foreground color of the hosted control. + /// + [Browsable(true)] + [Category("Appearance")] + [Description("The Foreground color used to display text on the progressbar")] + public override Color ForeColor + { + get { return this.ProgressBar.ForeColor; } + set { this.ProgressBar.ForeColor = value; } + } + /// + /// Gets or sets the font to be used on the hosted control. + /// + /// + /// Type: + /// The Font for the hosted control. + /// + [Category("Appearance")] + [Description("The font used to display text on the progressbar")] + public override Font Font + { + get { return this.ProgressBar.Font; } + set { this.ProgressBar.Font = value; } + } + /// + /// Gets or sets the upper bound of the range that is defined for this . + /// + /// + /// Type: + /// An integer representing the upper bound of the range. The default is 100. + /// + [Category("Behavior")] + [DefaultValue(100)] + [RefreshProperties(RefreshProperties.All)] + [Description("The upper bound of the range this progressbar is working with.")] + public int Maximum + { + get { return this.ProgressBar.Maximum; } + set { this.ProgressBar.Maximum = value; } + } + /// + /// Gets or sets the lower bound of the range that is defined for this . + /// + /// + /// Type: + /// An integer representing the lower bound of the range. The default is 0. + /// + [Category("Behavior")] + [DefaultValue(0)] + [RefreshProperties(RefreshProperties.All)] + [Description("The lower bound of the range this progressbar is working with.")] + public int Minimum + { + get { return this.ProgressBar.Minimum; } + set { this.ProgressBar.Minimum = value; } + } + /// + /// Gets or sets the current value of the . + /// + /// + /// Type: + /// An integer representing the current value. + /// + [Category("Behavior")] + [DefaultValue(0)] + [RefreshProperties(RefreshProperties.All)] + [Description("The current value for the progressbar, in the range specified by the minimum and maximum.")] + public int Value + { + get { return this.ProgressBar.Value; } + set { this.ProgressBar.Value = value; } + } + /// + /// Gets or sets the text displayed on the . + /// + /// + /// Type: + /// A representing the display text. + /// + [Category("Behavior")] + [Description("The text to display on the progressbar")] + public override string Text + { + get { return this.ProgressBar.Text; } + set { this.ProgressBar.Text = value; } + } + /// + /// Gets the height and width of the ToolStripProgressBar in pixels. + /// + /// + /// Type: + /// A Point value representing the height and width. + /// + protected override Size DefaultSize + { + get { return new Size(100, 15); } + } + /// + /// Gets the spacing between the and adjacent items. + /// + protected override Padding DefaultMargin + { + get + { + if ((base.Owner != null) && (base.Owner is StatusStrip)) + { + return new Padding(1, 3, 1, 3); + } + return new Padding(1, 1, 1, 2); + } + } + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the ToolStripProgressBar class. + /// + public ToolStripProgressBar() + : base(CreateControlInstance()) + { + } + #endregion + + #region MethodsProtected + /// + /// Raises the OwnerChanged event. + /// + /// An EventArgs that contains the event data. + protected override void OnOwnerChanged(EventArgs e) + { + if (base.Owner != null) + { + base.Owner.RendererChanged += new EventHandler(OwnerRendererChanged); + } + base.OnOwnerChanged(e); + } + #endregion + + #region MethodsPrivate + private static Control CreateControlInstance() + { + BSE.Windows.Forms.ProgressBar progressBar = new BSE.Windows.Forms.ProgressBar(); + progressBar.Size = new Size(100, 15); + + return progressBar; + } + private void OwnerRendererChanged(object sender, EventArgs e) + { + ToolStripRenderer toolsTripRenderer = this.Owner.Renderer; + if (toolsTripRenderer != null) + { + if (toolsTripRenderer is BseRenderer) + { + ToolStripProfessionalRenderer renderer = toolsTripRenderer as ToolStripProfessionalRenderer; + if (renderer != null) + { + this.ProgressBar.BorderColor = renderer.ColorTable.ToolStripBorder; + } + if (this.Owner.GetType() != typeof(StatusStrip)) + { + this.Margin = new Padding(1, 1, 1, 3); + } + } + else + { + this.Margin = DefaultMargin; + } + } + } + #endregion + + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Renderer/BseColorTable.cs b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/BseColorTable.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/BseColorTable.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BSE.Windows.Forms +{ + /// + /// Baseclass for a colortable for the + /// + public class BseColorTable : BSE.Windows.Forms.ProfessionalColorTable + { + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Renderer/BseRenderer.cs b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/BseRenderer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/BseRenderer.cs @@ -0,0 +1,790 @@ +using System.Drawing; +using System.Drawing.Text; +using System.Drawing.Drawing2D; +using System.Windows.Forms; +using System.Diagnostics; + +namespace BSE.Windows.Forms +{ + /// + /// Draw ToolStrips using the Office 2007 themed appearance. + /// + public class BseRenderer : ToolStripProfessionalRenderer + { + #region FieldsPrivate + private static Rectangle[] baseSizeGripRectangles; + private static int MarginInset; + private static Blend MenuItemBlend; + private static Blend ButtonBlend; + #endregion + + #region MethodsPublic + static BseRenderer() + { + MarginInset = 2; + + // One time creation of the blend for the button gradient brush + ButtonBlend = new Blend(); + ButtonBlend.Positions = new float[] { 0.0F, 0.1F, 0.2F, 0.5F, 1.0F }; + ButtonBlend.Factors = new float[] { 0.6F, 0.7F, 0.8F, 1.0F, 1.0F }; + // One time creation of the blend for the menuitem gradient brush + MenuItemBlend = new Blend(); + MenuItemBlend.Positions = new float[] { 0.0F, 0.1F, 0.2F, 0.5F, 1.0F }; + MenuItemBlend.Factors = new float[] { 0.7F, 0.8F, 0.9F, 1.0F, 1.0F }; + + baseSizeGripRectangles = new Rectangle[] { new Rectangle(8, 0, 2, 2), new Rectangle(8, 4, 2, 2), new Rectangle(8, 8, 2, 2), new Rectangle(4, 4, 2, 2), new Rectangle(4, 8, 2, 2), new Rectangle(0, 8, 2, 2) }; + } + /// + /// Initialize a new instance of the BseRenderer class. + /// + public BseRenderer() + : base(new BSE.Windows.Forms.ColorTableBlack()) + { + this.ColorTable.UseSystemColors = false; + } + /// + /// Initializes a new instance of the BseRenderer class. + /// + /// A to be used for painting. + public BseRenderer(ProfessionalColorTable professionalColorTable) + : base(professionalColorTable) + { + } + #endregion + + #region MethodsProtected + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) + { + if (ColorTable.UseSystemColors == true) + { + base.OnRenderArrow(e); + } + else + { + ProfessionalColorTable colorTable = ColorTable as BSE.Windows.Forms.ProfessionalColorTable; + if ((colorTable != null) && (e.Item.Enabled == true)) + { + if (e.Item.Owner is MenuStrip) + { + e.ArrowColor = colorTable.MenuItemText; + } + else if (e.Item.Owner is StatusStrip) + { + e.ArrowColor = colorTable.StatusStripText; + } + else + { + if (e.Item.Owner.GetType() != typeof(ToolStripDropDownMenu)) + { + e.ArrowColor = colorTable.ToolStripText; + } + } + } + base.OnRenderArrow(e); + } + } + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e) + { + if (ColorTable.UseSystemColors == true) + { + base.OnRenderDropDownButtonBackground(e); + } + else + { + ToolStripButton item = e.Item as ToolStripButton; + Rectangle buttonBounds = new Rectangle(Point.Empty, item.Size); + if (IsZeroWidthOrHeight(buttonBounds) == true) + { + return; + } + Graphics graphics = e.Graphics; + ProfessionalColorTable colorTable = ColorTable as ProfessionalColorTable; + if (colorTable != null) + { + using (UseAntiAlias antiAlias = new UseAntiAlias(graphics)) + { + Rectangle buttonRectangle = GetButtonRectangle(buttonBounds); + + if (item.Checked == true) + { + //Draws the border of the button for the checked ToolStripButton control + DrawButtonBorder(graphics, buttonRectangle, colorTable.ButtonPressedBorder); + } + if ((item.Selected == true) && (item.Pressed == false)) + { + //Renders the upper button part of the selected ToolStripButton control + RenderButton(graphics, buttonRectangle, colorTable.MenuItemTopLevelSelectedGradientBegin); + //Draws the border of the button for the selected ToolStripButton control + DrawButtonBorder(graphics, buttonRectangle, colorTable.ButtonSelectedHighlightBorder); + //DrawButtonBorder(graphics, buttonRectangle, Color.FromArgb(196, 194, 196)); + } + if (item.Pressed == true) + { + //Renders the upper button part of the pressed ToolStripButton control + RenderButton(graphics, buttonRectangle, colorTable.MenuItemPressedGradientBegin); + //Draws the inner border of the button for the pressed ToolStripButton control + DrawInnerButtonBorder(graphics, buttonRectangle, colorTable.ButtonSelectedHighlightBorder); + //Draws the outer border of the button for the pressed ToolStripButton control + DrawButtonBorder(graphics, buttonRectangle, colorTable.MenuBorder); + } + } + } + else + { + base.OnRenderDropDownButtonBackground(e); + } + } + } + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnRenderDropDownButtonBackground(ToolStripItemRenderEventArgs e) + { + if (ColorTable.UseSystemColors == true) + { + base.OnRenderDropDownButtonBackground(e); + } + else + { + ToolStripDropDownButton item = e.Item as ToolStripDropDownButton; + Rectangle buttonBounds = new Rectangle(Point.Empty, item.Size); + if (IsZeroWidthOrHeight(buttonBounds) == true) + { + return; + } + Graphics graphics = e.Graphics; + ProfessionalColorTable colorTable = ColorTable as ProfessionalColorTable; + + if (colorTable != null) + { + using (UseAntiAlias antiAlias = new UseAntiAlias(graphics)) + { + Rectangle buttonRectangle = GetButtonRectangle(buttonBounds); + if ((item.Selected == true) && (item.Pressed == false)) + { + //Renders the upper button part of the selected ToolStripDropDownButton control + RenderButton(graphics, buttonRectangle, colorTable.MenuItemTopLevelSelectedGradientBegin); + //Draws the border of the button for the selected ToolStripDropDownButton control + DrawButtonBorder(graphics, buttonRectangle, colorTable.ButtonSelectedHighlightBorder); + } + if (item.Pressed == true) + { + //Renders the upper button part of the pressed ToolStripDropDownButton control + RenderButton(graphics, buttonRectangle, colorTable.MenuItemPressedGradientBegin); + //Draws the inner border of the button for the pressed ToolStripDropDownButton control + DrawInnerButtonBorder(graphics, buttonRectangle, colorTable.ButtonSelectedHighlightBorder); + //Draws the outer border of the button for the pressed ToolStripDropDownButton control + DrawButtonBorder(graphics, buttonRectangle, colorTable.MenuBorder); + } + } + } + else + { + base.OnRenderDropDownButtonBackground(e); + } + } + } + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnRenderSplitButtonBackground(ToolStripItemRenderEventArgs e) + { + if (ColorTable.UseSystemColors == true) + { + base.OnRenderDropDownButtonBackground(e); + } + else + { + ToolStripSplitButton item = e.Item as ToolStripSplitButton; + Rectangle buttonBounds = new Rectangle(Point.Empty, item.ButtonBounds.Size); + if (IsZeroWidthOrHeight(buttonBounds) == true) + { + return; + } + Graphics graphics = e.Graphics; + ProfessionalColorTable colorTable = ColorTable as ProfessionalColorTable; + if (colorTable != null) + { + using (UseAntiAlias antiAlias = new UseAntiAlias(graphics)) + { + Rectangle buttonRectangle = GetButtonRectangle(buttonBounds); + Rectangle dropDownButtonBounds = new Rectangle(item.DropDownButtonBounds.Location, item.DropDownButtonBounds.Size); + Rectangle dropDownButtonRectangle = GetButtonRectangle(dropDownButtonBounds); + + if ((item.Selected == true) && (item.Pressed == false) && (item.ButtonPressed == false)) + { + //Renders the upper button part of the selected ToolStripSplitButton control + RenderButton(graphics, buttonRectangle, colorTable.MenuItemTopLevelSelectedGradientBegin); + //Renders the dropDownButton part of the selected ToolStripSplitButton control + RenderButton(graphics, dropDownButtonRectangle, colorTable.MenuItemTopLevelSelectedGradientBegin); + //Draws the border of the button part for the selected ToolStripSplitButton control + DrawButtonBorder(graphics, buttonRectangle, colorTable.ButtonSelectedHighlightBorder); + //Draws the border of the dropDownButton part for the selected ToolStripSplitButton control + DrawButtonBorder(graphics, dropDownButtonRectangle, colorTable.ButtonSelectedHighlightBorder); + } + if (item.ButtonPressed == true) + { + //Renders the upper button part of the pressed ToolStripSplitButton control + RenderButton(graphics, buttonRectangle, colorTable.MenuItemPressedGradientBegin); + //Renders the dropDownButton part of the pressed ToolStripSplitButton control + RenderButton(graphics, dropDownButtonRectangle, colorTable.MenuItemPressedGradientBegin); + //Draws the inner border of the button part for the pressed ToolStripSplitButton control + DrawInnerButtonBorder(graphics, buttonRectangle, colorTable.ButtonSelectedHighlightBorder); + //Draws the outer border of the button part for the pressed ToolStripSplitButton control + DrawButtonBorder(graphics, buttonRectangle, colorTable.MenuBorder); + //Draws the inner border of the dropDownButton part for the pressed ToolStripSplitButton control + DrawInnerButtonBorder(graphics, dropDownButtonRectangle, colorTable.ButtonSelectedHighlightBorder); + //Draws the outer border of the dropDownButton part for the pressed ToolStripSplitButton control + DrawButtonBorder(graphics, dropDownButtonRectangle, colorTable.MenuBorder); + } + if (item.DropDownButtonPressed == true) + { + //Renders the upper button part of the pressed ToolStripSplitButton control + RenderButton(graphics, buttonRectangle, colorTable.MenuItemTopLevelSelectedGradientBegin); + //Renders the dropDownButton part of the pressed ToolStripSplitButton control + RenderButton(graphics, dropDownButtonRectangle, colorTable.MenuItemTopLevelSelectedGradientBegin); + //Draws the border of the button part for the pressed ToolStripSplitButton control + DrawButtonBorder(graphics, buttonRectangle, ColorTable.ButtonSelectedHighlightBorder); + //Draws the border of the dropDownButton part for the pressed ToolStripSplitButton control + DrawButtonBorder(graphics, dropDownButtonRectangle, ColorTable.ButtonSelectedHighlightBorder); + } + if (e.Item.Owner is MenuStrip) + { + base.DrawArrow(new ToolStripArrowRenderEventArgs(graphics, item, dropDownButtonBounds, colorTable.MenuItemText, ArrowDirection.Down)); + } + if (e.Item.Owner is StatusStrip) + { + base.DrawArrow(new ToolStripArrowRenderEventArgs(graphics, item, dropDownButtonBounds, colorTable.StatusStripText, ArrowDirection.Down)); + } + if (e.Item.Owner is ToolStrip) + { + base.DrawArrow(new ToolStripArrowRenderEventArgs(graphics, item, dropDownButtonBounds, colorTable.ToolStripText, ArrowDirection.Down)); + } + } + } + else + { + base.OnRenderDropDownButtonBackground(e); + } + } + } + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) + { + ToolStripMenuItem item = e.Item as ToolStripMenuItem; + Rectangle bounds = new Rectangle(Point.Empty, item.Size); + if (IsZeroWidthOrHeight(bounds) == true) + { + return; + } + Graphics graphics = e.Graphics; + ProfessionalColorTable colorTable = ColorTable as BSE.Windows.Forms.ProfessionalColorTable; + if (colorTable != null) + { + using (UseAntiAlias useAntiAlias = new UseAntiAlias(graphics)) + { + if (e.ToolStrip is MenuStrip) + { + if ((item.Selected == true) && (item.Pressed == false)) + { + RenderMenuItem(graphics, bounds, colorTable.MenuItemTopLevelSelectedGradientBegin); + ControlPaint.DrawBorder(e.Graphics, bounds, colorTable.MenuItemTopLevelSelectedBorder, ButtonBorderStyle.Solid); + } + if (item.Pressed == true) + { + RenderButton(graphics, bounds, ColorTable.MenuItemPressedGradientBegin); + Rectangle innerBorderRectangle = bounds; + innerBorderRectangle.Inflate(-1, -1); + ControlPaint.DrawBorder(e.Graphics, innerBorderRectangle, ColorTable.ButtonSelectedHighlightBorder, ButtonBorderStyle.Solid); + ControlPaint.DrawBorder(e.Graphics, bounds, ColorTable.MenuBorder, ButtonBorderStyle.Solid); + } + } + else + { + base.OnRenderMenuItemBackground(e); + } + } + } + else + { + base.OnRenderMenuItemBackground(e); + } + } + /// + /// Raises the RenderItemText event. + /// + /// A ToolStripItemTextRenderEventArgs that contains the event data. + protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) + { + if (ColorTable.UseSystemColors == false) + { + ProfessionalColorTable colorTable = ColorTable as BSE.Windows.Forms.ProfessionalColorTable; + if (colorTable != null) + { + if ((e.ToolStrip is MenuStrip))// && (e.Item.Selected == false) && e.Item.Pressed == false) + { + if (colorTable.MenuItemText != Color.Empty) + { + e.TextColor = colorTable.MenuItemText; + } + } + else if ((e.ToolStrip is StatusStrip))// && (e.Item.Selected == false) && e.Item.Pressed == false) + { + if (colorTable.StatusStripText != Color.Empty) + { + e.TextColor = colorTable.StatusStripText; + } + } + else if (e.ToolStrip is ToolStripDropDown) + { + //base.OnRenderItemText(e); + } + else + { + if (colorTable.ToolStripText != Color.Empty) + { + e.TextColor = colorTable.ToolStripText; + } + } + } + } + base.OnRenderItemText(e); + } + /// + /// Raises the RenderToolStripContentPanelBackground event. + /// + /// An ToolStripContentPanelRenderEventArgs containing the event data. + protected override void OnRenderToolStripContentPanelBackground(ToolStripContentPanelRenderEventArgs e) + { + // Must call base class, otherwise the subsequent drawing does not appear! + base.OnRenderToolStripContentPanelBackground(e); + if (ColorTable.UseSystemColors == false) + { + // Cannot paint a zero sized area + if ((e.ToolStripContentPanel.Width > 0) && + (e.ToolStripContentPanel.Height > 0)) + { + using (LinearGradientBrush backBrush = new LinearGradientBrush(e.ToolStripContentPanel.ClientRectangle, + ColorTable.ToolStripContentPanelGradientBegin, + ColorTable.ToolStripContentPanelGradientEnd, + LinearGradientMode.Vertical)) + { + e.Graphics.FillRectangle(backBrush, e.ToolStripContentPanel.ClientRectangle); + } + } + } + } + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnRenderOverflowButtonBackground(ToolStripItemRenderEventArgs e) + { + base.OnRenderOverflowButtonBackground(e); + ToolStripItem item = e.Item; + if ((item.Selected == false) && (item.Pressed == false)) + { + ProfessionalColorTable colorTable = ColorTable as ProfessionalColorTable; + if (colorTable != null) + { + Graphics graphics = e.Graphics; + bool bRightToLeft = item.RightToLeft == RightToLeft.Yes; + + bool bOrientation = e.ToolStrip.Orientation == Orientation.Horizontal; + Rectangle arrowRectangle = Rectangle.Empty; + if (bRightToLeft) + { + arrowRectangle = new Rectangle(0, item.Height - 8, 9, 5); + } + else + { + arrowRectangle = new Rectangle(item.Width - 12, item.Height - 8, 9, 5); + } + + ArrowDirection arrowDirection = bOrientation ? ArrowDirection.Down : ArrowDirection.Right; + int x = (bRightToLeft && bOrientation) ? -1 : 1; + arrowRectangle.Offset(x, 1); + RenderArrowInternal(graphics, arrowRectangle, arrowDirection, colorTable.ToolStripGradientMiddle); + arrowRectangle.Offset(-1 * x, -1); + RenderArrowInternal(graphics, arrowRectangle, arrowDirection, colorTable.ToolStripText); + if (bOrientation) + { + x = bRightToLeft ? -2 : 0; + RenderOverflowButtonLine(graphics, colorTable.ToolStripText, (int)(arrowRectangle.Right - 6), (int)(arrowRectangle.Y - 2), (int)(arrowRectangle.Right - 2), (int)(arrowRectangle.Y - 2)); + RenderOverflowButtonLine(graphics, colorTable.ToolStripGradientMiddle, (int)((arrowRectangle.Right - 5) + x), (int)(arrowRectangle.Y - 1), (int)((arrowRectangle.Right - 1) + x), (int)(arrowRectangle.Y - 1)); + } + else + { + RenderOverflowButtonLine(graphics, colorTable.ToolStripText, arrowRectangle.X, arrowRectangle.Y, arrowRectangle.X, arrowRectangle.Bottom - 1); + RenderOverflowButtonLine(graphics, colorTable.ToolStripGradientMiddle, arrowRectangle.X + 1, arrowRectangle.Y + 1, arrowRectangle.X + 1, arrowRectangle.Bottom); + } + } + } + } + /// + /// Raises the RenderSeparator event. + /// + /// An ToolStripSeparatorRenderEventArgs containing the event data. + protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e) + { + if (ColorTable.UseSystemColors == false) + { + e.Item.ForeColor = ColorTable.RaftingContainerGradientBegin; + } + base.OnRenderSeparator(e); + } + /// + /// Raises the RenderStatusStripSizingGrip event. + /// + /// A ToolStripRenderEventArgs that contains the event data. + protected override void OnRenderStatusStripSizingGrip(ToolStripRenderEventArgs e) + { + Graphics graphics = e.Graphics; + StatusStrip toolStrip = e.ToolStrip as StatusStrip; + if (toolStrip != null) + { + Rectangle sizeGripBounds = toolStrip.SizeGripBounds; + if (IsZeroWidthOrHeight(sizeGripBounds) == false) + { + Rectangle[] rectanglesLight = new Rectangle[baseSizeGripRectangles.Length]; + Rectangle[] rectanglesDark = new Rectangle[baseSizeGripRectangles.Length]; + for (int i = 0; i < baseSizeGripRectangles.Length; i++) + { + Rectangle rectangleDark = baseSizeGripRectangles[i]; + if (toolStrip.RightToLeft == RightToLeft.Yes) + { + rectangleDark.X = (sizeGripBounds.Width - rectangleDark.X) - rectangleDark.Width; + } + rectangleDark.Offset(sizeGripBounds.X, sizeGripBounds.Bottom - 12); + rectanglesLight[i] = rectangleDark; + if (toolStrip.RightToLeft == RightToLeft.Yes) + { + rectangleDark.Offset(1, -1); + } + else + { + rectangleDark.Offset(-1, -1); + } + rectanglesDark[i] = rectangleDark; + } + using (SolidBrush darkBrush = new SolidBrush(ColorTable.GripDark), + lightBrush = new SolidBrush(ColorTable.GripDark)) + { + graphics.FillRectangles(lightBrush, rectanglesLight); + graphics.FillRectangles(darkBrush, rectanglesDark); + } + } + } + } + /// + /// Raises the RenderToolStripBackground event. + /// + /// An ToolStripRenderEventArgs containing the event data. + protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) + { + if (ColorTable.UseSystemColors == true) + { + base.OnRenderToolStripBackground(e); + } + else + { + Trace.WriteLine("ToolStrip: " + e.ToolStrip.GetType()); + Rectangle backgroundRectangle = new Rectangle(0, 0, e.ToolStrip.Width, e.ToolStrip.Height); + Rectangle innerRectangle = backgroundRectangle; + innerRectangle.Height = (backgroundRectangle.Height / 2) + 1; + // Cannot paint a zero sized area + if ((backgroundRectangle.Width > 0) && (backgroundRectangle.Height > 0)) + { + if (e.ToolStrip is StatusStrip) + { + using (SolidBrush outerBrush = new SolidBrush(ColorTable.StatusStripGradientEnd)) + { + e.Graphics.FillRectangle(outerBrush, backgroundRectangle); + } + + int y2 = backgroundRectangle.Height / 2; + Rectangle upperRectangle = new Rectangle(backgroundRectangle.X, backgroundRectangle.Y, backgroundRectangle.Width, y2); + upperRectangle.Height += 1; + using (LinearGradientBrush innerRectangleBrush = new LinearGradientBrush( + upperRectangle, + ColorTable.StatusStripGradientBegin, + Color.FromArgb(128,ColorTable.StatusStripGradientBegin), + LinearGradientMode.Vertical)) + { + e.Graphics.FillRectangle(innerRectangleBrush, upperRectangle); //draw top bubble + } + + y2 = (backgroundRectangle.Height / 4) + 1; + Rectangle lowerRectangle = new Rectangle(backgroundRectangle.X, backgroundRectangle.Height - y2, backgroundRectangle.Width, y2); + + using (LinearGradientBrush innerRectangleBrush = new LinearGradientBrush( + lowerRectangle, + ColorTable.StatusStripGradientEnd, + Color.FromArgb(128,ColorTable.StatusStripGradientBegin), + LinearGradientMode.Vertical)) + { + e.Graphics.FillRectangle(innerRectangleBrush, lowerRectangle); //draw top bubble + } + } + else if (e.ToolStrip is MenuStrip) + { + using (SolidBrush outerBrush = new SolidBrush(ColorTable.MenuStripGradientEnd)) + { + e.Graphics.FillRectangle(outerBrush, backgroundRectangle); + } + + int y2 = backgroundRectangle.Height / 3; + Rectangle lowerRectangle = new Rectangle(backgroundRectangle.X, backgroundRectangle.Y, backgroundRectangle.Width, y2); + + using (LinearGradientBrush innerRectangleBrush = new LinearGradientBrush( + lowerRectangle, + ColorTable.MenuStripGradientBegin, + Color.FromArgb(128, ColorTable.StatusStripGradientBegin), + LinearGradientMode.Vertical)) + { + e.Graphics.FillRectangle(innerRectangleBrush, lowerRectangle); //draw top bubble + } + } + else if (e.ToolStrip is ToolStripDropDown) + { + base.OnRenderToolStripBackground(e); + } + else + { + using (SolidBrush outerBrush = new SolidBrush(ColorTable.ToolStripGradientEnd)) + { + e.Graphics.FillRectangle(outerBrush, backgroundRectangle); + } + + int y2 = backgroundRectangle.Height / 2; + Rectangle upperRectangle = new Rectangle(backgroundRectangle.X, backgroundRectangle.Y, backgroundRectangle.Width, y2); + + using (LinearGradientBrush innerRectangleBrush = new LinearGradientBrush( + upperRectangle, + ColorTable.ToolStripGradientBegin, + ColorTable.ToolStripGradientMiddle, + LinearGradientMode.Vertical)) + { + e.Graphics.FillRectangle(innerRectangleBrush, upperRectangle); //draw top bubble + } + + y2 = backgroundRectangle.Height / 4; + Rectangle lowerRectangle = new Rectangle(backgroundRectangle.X, backgroundRectangle.Height - y2, backgroundRectangle.Width, y2); + + using (LinearGradientBrush innerRectangleBrush = new LinearGradientBrush( + lowerRectangle, + ColorTable.ToolStripGradientEnd, + ColorTable.ToolStripGradientMiddle, + LinearGradientMode.Vertical)) + { + e.Graphics.FillRectangle(innerRectangleBrush, lowerRectangle); //draw top bubble + } + } + } + } + } + /// + /// Raises the RenderImageMargin event. + /// + /// An ToolStripRenderEventArgs containing the event data. + protected override void OnRenderImageMargin(ToolStripRenderEventArgs e) + { + if (ColorTable.UseSystemColors == true) + { + base.OnRenderToolStripBackground(e); + } + else + { + if ((e.ToolStrip is ContextMenuStrip) || + (e.ToolStrip is ToolStripDropDownMenu)) + { + // Start with the total margin area + Rectangle marginRectangle = e.AffectedBounds; + + // Do we need to draw with separator on the opposite edge? + bool bIsRightToLeft = (e.ToolStrip.RightToLeft == RightToLeft.Yes); + + marginRectangle.Y += MarginInset; + marginRectangle.Height -= MarginInset * 2; + + // Reduce so it is inside the border + if (bIsRightToLeft == false) + { + marginRectangle.X += MarginInset; + } + else + { + marginRectangle.X += MarginInset / 2; + } + + // Draw the entire margine area in a solid color + using (SolidBrush backBrush = new SolidBrush( + ColorTable.ImageMarginGradientBegin)) + e.Graphics.FillRectangle(backBrush, marginRectangle); + } + else + { + base.OnRenderImageMargin(e); + } + } + } + + #endregion + + #region MethodsPrivate + private static GraphicsPath GetBackgroundPath(Rectangle bounds, int radius) + { + int x = bounds.X; + int y = bounds.Y; + int width = bounds.Width; + int height = bounds.Height; + GraphicsPath graphicsPath = new GraphicsPath(); + graphicsPath.AddArc(x, y, radius, radius, 180, 90); //Upper left corner + graphicsPath.AddArc(x + width - radius, y, radius, radius, 270, 90); //Upper right corner + graphicsPath.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90);//Lower right corner + graphicsPath.AddArc(x, y + height - radius, radius, radius, 90, 90); //Lower left corner + graphicsPath.CloseFigure(); + return graphicsPath; + } + + private static void RenderButton(Graphics graphics, Rectangle buttonBounds, Color gradientColor) + { + using (GraphicsPath graphicsPath = GetBackgroundPath(buttonBounds, 3)) + { + using (LinearGradientBrush backBrush = new LinearGradientBrush(buttonBounds, + gradientColor, + Color.Transparent, + LinearGradientMode.Vertical)) + { + backBrush.Blend = ButtonBlend; + graphics.FillPath(backBrush, graphicsPath); + } + } + } + + private static void RenderMenuItem(Graphics graphics, Rectangle menuBounds, Color gradientColor) + { + using (LinearGradientBrush backBrush = new LinearGradientBrush( + menuBounds, + gradientColor, + Color.Transparent, + LinearGradientMode.Vertical)) + { + backBrush.Blend = MenuItemBlend; + graphics.FillRectangle(backBrush, menuBounds); + } + } + + private static void DrawButtonBorder(Graphics graphics, Rectangle buttonBounds, Color borderColor) + { + using (GraphicsPath itemPath = GetBackgroundPath(buttonBounds, 3)) + { + using (Pen itemPen = new Pen(borderColor)) + { + graphics.DrawPath(itemPen, itemPath); + } + } + } + + private static void DrawInnerButtonBorder(Graphics graphics, Rectangle buttonBounds, Color innerBorderColor) + { + Rectangle innerButtonRectangle = buttonBounds; + innerButtonRectangle.Height -= 1; + innerButtonRectangle.Width -= 1; + using (GraphicsPath innerBorderPath = GetBackgroundPath(innerButtonRectangle, 3)) + { + using (Pen itemPen = new Pen(innerBorderColor)) + { + graphics.DrawPath(itemPen, innerBorderPath); + } + } + } + + private static Rectangle GetButtonRectangle(Rectangle bounds) + { + Rectangle buttonRectangle = bounds; + buttonRectangle.Width -= 1; + buttonRectangle.Height -= 1; + buttonRectangle.Inflate(0, -1); + return buttonRectangle; + } + /// + /// Renders the arrows in the OverflowButton. + /// + /// The Graphics to draw on. + /// The rectangle in which the arrows should drawn. + /// the direction of the arrows. + /// The color used to fill the arrow polygons + private static void RenderArrowInternal(Graphics graphics, Rectangle dropDownRectangle, ArrowDirection direction, Color color) + { + Point point = new Point(dropDownRectangle.Left + (dropDownRectangle.Width / 2), dropDownRectangle.Top + (dropDownRectangle.Height / 2)); + point.X += dropDownRectangle.Width % 2; + Point[] points = null; + switch (direction) + { + case ArrowDirection.Left: + points = new Point[] { new Point(point.X + 2, point.Y - 3), new Point(point.X + 2, point.Y + 3), new Point(point.X - 1, point.Y) }; + break; + + case ArrowDirection.Up: + points = new Point[] { new Point(point.X - 2, point.Y + 1), new Point(point.X + 3, point.Y + 1), new Point(point.X, point.Y - 2) }; + break; + + case ArrowDirection.Right: + points = new Point[] { new Point(point.X - 2, point.Y - 3), new Point(point.X - 2, point.Y + 3), new Point(point.X + 1, point.Y) }; + break; + + default: + points = new Point[] { new Point(point.X - 2, point.Y - 1), new Point(point.X + 3, point.Y - 1), new Point(point.X, point.Y + 2) }; + break; + } + using (SolidBrush backBrush = new SolidBrush(color)) + { + graphics.FillPolygon(backBrush, points); + } + } + /// + /// Renders the lines in the OverflowButton. + /// + /// The Graphics to draw on. + /// The color used to fill the line + /// The x-coordinate of the first point. + /// The y-coordinate of the first point. + /// The x-coordinate of the second point. + /// The y-coordinate of the second point. + private static void RenderOverflowButtonLine(Graphics graphics,Color color, int x1, int y1, int x2, int y2) + { + using (Pen pen = new Pen(color)) + { + graphics.DrawLine(pen, x1, y1, x2, y2); + } + } + /// + /// Checks if the rectangle width or height is equal to 0. + /// + /// the rectangle to check + /// true if the with or height of the rectangle is 0 else false + private static bool IsZeroWidthOrHeight(Rectangle rectangle) + { + if (rectangle.Width != 0) + { + return (rectangle.Height == 0); + } + return true; + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Renderer/ColorTableBlack.cs b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/ColorTableBlack.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/ColorTableBlack.cs @@ -0,0 +1,84 @@ +using System.Drawing; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + /// + /// Provide Office 2007 black theme colors + /// + public class ColorTableBlack : BSE.Windows.Forms.BseColorTable + { + #region FieldsPrivate + private PanelColors m_panelColorTable; + #endregion + + #region Properties + /// + /// Gets the associated ColorTable for the XPanderControls + /// + public override PanelColors PanelColorTable + { + get + { + if (this.m_panelColorTable == null) + { + this.m_panelColorTable = new PanelColorsBlack(); + } + return this.m_panelColorTable; + } + } + #endregion + + #region MethodsProtected + /// + /// Initializes a color dictionary with defined colors + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + base.InitColors(rgbTable); + rgbTable[KnownColors.ButtonPressedBorder] = Color.FromArgb(145, 153, 164); + rgbTable[KnownColors.ButtonPressedGradientBegin] = Color.FromArgb(141, 170, 253); + rgbTable[KnownColors.ButtonPressedGradientEnd] = Color.FromArgb(98, 101, 252); + rgbTable[KnownColors.ButtonPressedGradientMiddle] = Color.FromArgb(43, 93, 255); + rgbTable[KnownColors.ButtonSelectedGradientBegin] = Color.FromArgb(106, 109, 228); + rgbTable[KnownColors.ButtonSelectedGradientEnd] = Color.FromArgb(88, 111, 226); + rgbTable[KnownColors.ButtonSelectedGradientMiddle] = Color.FromArgb(39, 39, 217); + rgbTable[KnownColors.ButtonSelectedHighlightBorder] = Color.FromArgb(145, 153, 164); + rgbTable[KnownColors.GripDark] = Color.FromArgb(102, 102, 102); + rgbTable[KnownColors.GripLight] = Color.FromArgb(182, 182, 182); + rgbTable[KnownColors.ImageMarginGradientBegin] = Color.FromArgb(239, 239, 239); + rgbTable[KnownColors.MenuBorder] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.MenuItemSelectedGradientBegin] = Color.FromArgb(231, 239, 243); + rgbTable[KnownColors.MenuItemSelectedGradientEnd] = Color.FromArgb(218, 235, 243); + rgbTable[KnownColors.MenuItemText] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.MenuItemTopLevelSelectedBorder] = Color.FromArgb(145, 153, 164); + rgbTable[KnownColors.MenuItemTopLevelSelectedGradientBegin] = Color.FromArgb(205, 208, 213); + rgbTable[KnownColors.MenuStripGradientBegin] = Color.FromArgb(102, 102, 102); + rgbTable[KnownColors.MenuStripGradientEnd] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.OverflowButtonGradientBegin] = Color.FromArgb(136, 144, 254); + rgbTable[KnownColors.OverflowButtonGradientEnd] = Color.FromArgb(111, 145, 255); + rgbTable[KnownColors.OverflowButtonGradientMiddle] = Color.FromArgb(42, 52, 254); + rgbTable[KnownColors.RaftingContainerGradientBegin] = Color.FromArgb(83, 83, 83); + rgbTable[KnownColors.RaftingContainerGradientEnd] = Color.FromArgb(83, 83, 83); + rgbTable[KnownColors.SeparatorDark] = Color.FromArgb(102, 102, 102); + rgbTable[KnownColors.SeparatorLight] = Color.FromArgb(182, 182, 182); + rgbTable[KnownColors.StatusStripGradientBegin] = Color.FromArgb(100, 100, 100); + rgbTable[KnownColors.StatusStripGradientEnd] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.StatusStripText] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.ToolStripBorder] = Color.FromArgb(102, 102, 102); + rgbTable[KnownColors.ToolStripContentPanelGradientBegin] = Color.FromArgb(42, 42, 42); + rgbTable[KnownColors.ToolStripContentPanelGradientEnd] = Color.FromArgb(10, 10, 10); + rgbTable[KnownColors.ToolStripDropDownBackground] = Color.FromArgb(250, 250, 250); + rgbTable[KnownColors.ToolStripGradientBegin] = Color.FromArgb(102, 102, 102); + rgbTable[KnownColors.ToolStripGradientEnd] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.ToolStripGradientMiddle] = Color.FromArgb(52, 52, 52); + rgbTable[KnownColors.ToolStripPanelGradientBegin] = Color.FromArgb(12, 12, 12); + rgbTable[KnownColors.ToolStripPanelGradientEnd] = Color.FromArgb(2, 2, 2); + rgbTable[KnownColors.ToolStripText] = Color.FromArgb(255, 255, 255); + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Renderer/ColorTableBlue.cs b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/ColorTableBlue.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/ColorTableBlue.cs @@ -0,0 +1,84 @@ +using System.Drawing; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + /// + /// Provide Office 2007 black theme colors + /// + public class ColorTableBlue : BSE.Windows.Forms.BseColorTable + { + #region FieldsPrivate + private PanelColors m_panelColorTable; + #endregion + + #region Properties + /// + /// Gets the associated ColorTable for the XPanderControls + /// + public override PanelColors PanelColorTable + { + get + { + if (this.m_panelColorTable == null) + { + this.m_panelColorTable = new PanelColorsBlue(); + } + return this.m_panelColorTable; + } + } + #endregion + + #region MethodsProtected + /// + /// Initializes a color dictionary with defined colors + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + base.InitColors(rgbTable); + rgbTable[KnownColors.ButtonPressedBorder] = Color.FromArgb(145, 153, 164); + rgbTable[KnownColors.ButtonPressedGradientBegin] = Color.FromArgb(141, 170, 253); + rgbTable[KnownColors.ButtonPressedGradientEnd] = Color.FromArgb(98, 101, 252); + rgbTable[KnownColors.ButtonPressedGradientMiddle] = Color.FromArgb(43, 93, 255); + rgbTable[KnownColors.ButtonSelectedGradientBegin] = Color.FromArgb(188, 205, 254); + rgbTable[KnownColors.ButtonSelectedGradientEnd] = Color.FromArgb(153, 155, 253); + rgbTable[KnownColors.ButtonSelectedGradientMiddle] = Color.FromArgb(111, 145, 255); + rgbTable[KnownColors.ButtonSelectedHighlightBorder] = Color.FromArgb(145, 153, 164); + rgbTable[KnownColors.GripDark] = Color.FromArgb(102, 102, 102); + rgbTable[KnownColors.GripLight] = Color.FromArgb(182, 182, 182); + rgbTable[KnownColors.ImageMarginGradientBegin] = Color.FromArgb(239, 239, 239); + rgbTable[KnownColors.MenuBorder] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.MenuItemSelectedGradientBegin] = Color.FromArgb(231, 239, 243); + rgbTable[KnownColors.MenuItemSelectedGradientEnd] = Color.FromArgb(218, 235, 243); + rgbTable[KnownColors.MenuItemText] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.MenuItemTopLevelSelectedBorder] = Color.FromArgb(145, 153, 164); + rgbTable[KnownColors.MenuItemTopLevelSelectedGradientBegin] = Color.FromArgb(205, 208, 213); + rgbTable[KnownColors.MenuStripGradientBegin] = Color.FromArgb(128, 128, 255); + rgbTable[KnownColors.MenuStripGradientEnd] = Color.FromArgb(0, 0, 128); + rgbTable[KnownColors.OverflowButtonGradientBegin] = Color.FromArgb(166, 189, 254); + rgbTable[KnownColors.OverflowButtonGradientEnd] = Color.FromArgb(119, 123, 253); + rgbTable[KnownColors.OverflowButtonGradientMiddle] = Color.FromArgb(63, 108, 253); + rgbTable[KnownColors.RaftingContainerGradientBegin] = Color.FromArgb(83, 83, 83); + rgbTable[KnownColors.RaftingContainerGradientEnd] = Color.FromArgb(83, 83, 83); + rgbTable[KnownColors.SeparatorDark] = Color.FromArgb(102, 102, 102); + rgbTable[KnownColors.SeparatorLight] = Color.FromArgb(182, 182, 182); + rgbTable[KnownColors.StatusStripGradientBegin] = Color.FromArgb(128, 128, 255); + rgbTable[KnownColors.StatusStripGradientEnd] = Color.FromArgb(0, 0, 128); + rgbTable[KnownColors.StatusStripText] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.ToolStripBorder] = Color.FromArgb(102, 102, 102); + rgbTable[KnownColors.ToolStripContentPanelGradientBegin] = Color.FromArgb(0, 0, 139); + rgbTable[KnownColors.ToolStripContentPanelGradientEnd] = Color.FromArgb(0, 0, 128); + rgbTable[KnownColors.ToolStripDropDownBackground] = Color.FromArgb(250, 250, 250); + rgbTable[KnownColors.ToolStripGradientBegin] = Color.FromArgb(128, 128, 255); + rgbTable[KnownColors.ToolStripGradientEnd] = Color.FromArgb(0, 0, 139); + rgbTable[KnownColors.ToolStripGradientMiddle] = Color.FromArgb(0, 0, 128); + rgbTable[KnownColors.ToolStripPanelGradientBegin] = Color.FromArgb(0, 0, 128); + rgbTable[KnownColors.ToolStripPanelGradientEnd] = Color.FromArgb(0, 0, 128); + rgbTable[KnownColors.ToolStripText] = Color.FromArgb(255, 255, 255); + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007BlackColorTable.cs b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007BlackColorTable.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007BlackColorTable.cs @@ -0,0 +1,89 @@ +using System.Drawing; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + /// + /// Provides colors used for Microsoft Office 2007 black display elements. + /// + public class Office2007BlackColorTable : BSE.Windows.Forms.OfficeColorTable + { + #region FieldsPrivate + private PanelColors m_panelColorTable; + #endregion + + #region Properties + /// + /// Gets the associated ColorTable for the XPanderControls + /// + public override PanelColors PanelColorTable + { + get + { + if (this.m_panelColorTable == null) + { + this.m_panelColorTable = new PanelColorsOffice2007Black(); + } + return this.m_panelColorTable; + } + } + #endregion + + #region MethodsProtected + /// + /// Initializes a color dictionary with defined colors. + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + rgbTable[KnownColors.ButtonPressedBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.ButtonPressedGradientBegin] = Color.FromArgb(248, 181, 106); + rgbTable[KnownColors.ButtonPressedGradientEnd] = Color.FromArgb(255, 208, 134); + rgbTable[KnownColors.ButtonPressedGradientMiddle] = Color.FromArgb(251, 140, 60); + rgbTable[KnownColors.ButtonSelectedBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.ButtonSelectedGradientBegin] = Color.FromArgb(255, 245, 204); + rgbTable[KnownColors.ButtonSelectedGradientEnd] = Color.FromArgb(255, 219, 117); + rgbTable[KnownColors.ButtonSelectedGradientMiddle] = Color.FromArgb(255, 231, 162); + rgbTable[KnownColors.ButtonSelectedHighlightBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.CheckBackground] = Color.FromArgb(255, 227, 149); + rgbTable[KnownColors.CheckSelectedBackground] = Color.FromArgb(254, 128, 62); + rgbTable[KnownColors.GripDark] = Color.FromArgb(145, 153, 164); + rgbTable[KnownColors.GripLight] = Color.FromArgb(221, 224, 227); + rgbTable[KnownColors.ImageMarginGradientBegin] = Color.FromArgb(239, 239, 239); + rgbTable[KnownColors.MenuBorder] = Color.FromArgb(145, 153, 164); + rgbTable[KnownColors.MenuItemBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.MenuItemPressedGradientBegin] = Color.FromArgb(145, 153, 164); + rgbTable[KnownColors.MenuItemPressedGradientEnd] = Color.FromArgb(108, 117, 128); + rgbTable[KnownColors.MenuItemPressedGradientMiddle] = Color.FromArgb(126, 135, 146); + rgbTable[KnownColors.MenuItemSelected] = Color.FromArgb(255, 238, 194); + rgbTable[KnownColors.MenuItemSelectedGradientBegin] = Color.FromArgb(255, 245, 204); + rgbTable[KnownColors.MenuItemSelectedGradientEnd] = Color.FromArgb(255, 223, 132); + rgbTable[KnownColors.MenuItemText] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.MenuStripGradientBegin] = Color.FromArgb(83, 83, 83); + rgbTable[KnownColors.MenuStripGradientEnd] = Color.FromArgb(83, 83, 83); + rgbTable[KnownColors.OverflowButtonGradientBegin] = Color.FromArgb(178, 183, 191); + rgbTable[KnownColors.OverflowButtonGradientEnd] = Color.FromArgb(81, 88, 98); + rgbTable[KnownColors.OverflowButtonGradientMiddle] = Color.FromArgb(145, 153, 164); + rgbTable[KnownColors.RaftingContainerGradientBegin] = Color.FromArgb(83, 83, 83); + rgbTable[KnownColors.RaftingContainerGradientEnd] = Color.FromArgb(83, 83, 83); + rgbTable[KnownColors.SeparatorDark] = Color.FromArgb(145, 153, 164); + rgbTable[KnownColors.SeparatorLight] = Color.FromArgb(221, 224, 227); + rgbTable[KnownColors.StatusStripGradientBegin] = Color.FromArgb(76, 83, 92); + rgbTable[KnownColors.StatusStripGradientEnd] = Color.FromArgb(35, 38, 42); + rgbTable[KnownColors.StatusStripText] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.ToolStripBorder] = Color.FromArgb(76, 83, 92); + rgbTable[KnownColors.ToolStripContentPanelGradientBegin] = Color.FromArgb(82, 82, 82); + rgbTable[KnownColors.ToolStripContentPanelGradientEnd] = Color.FromArgb(10, 10, 10); + rgbTable[KnownColors.ToolStripDropDownBackground] = Color.FromArgb(250, 250, 250); + rgbTable[KnownColors.ToolStripGradientBegin] = Color.FromArgb(205, 208, 213); + rgbTable[KnownColors.ToolStripGradientEnd] = Color.FromArgb(148, 156, 166); + rgbTable[KnownColors.ToolStripGradientMiddle] = Color.FromArgb(188, 193, 200); + rgbTable[KnownColors.ToolStripPanelGradientBegin] = Color.FromArgb(83, 83, 83); + rgbTable[KnownColors.ToolStripPanelGradientEnd] = Color.FromArgb(83, 83, 83); + rgbTable[KnownColors.ToolStripText] = Color.FromArgb(0, 0, 0); + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007BlueColorTable.cs b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007BlueColorTable.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007BlueColorTable.cs @@ -0,0 +1,89 @@ +using System.Drawing; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + /// + /// Provides colors used for Microsoft Office 2007 blue display elements. + /// + public class Office2007BlueColorTable : BSE.Windows.Forms.OfficeColorTable + { + #region FieldsPrivate + private PanelColors m_panelColorTable; + #endregion + + #region Properties + /// + /// Gets the associated ColorTable for the XPanderControls + /// + public override PanelColors PanelColorTable + { + get + { + if (this.m_panelColorTable == null) + { + this.m_panelColorTable = new PanelColorsOffice2007Blue(); + } + return this.m_panelColorTable; + } + } + #endregion + + #region MethodsProtected + /// + /// Unitializes a color dictionary with defined colors + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + rgbTable[KnownColors.ButtonPressedBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.ButtonPressedGradientBegin] = Color.FromArgb(248, 181, 106); + rgbTable[KnownColors.ButtonPressedGradientEnd] = Color.FromArgb(255, 208, 134); + rgbTable[KnownColors.ButtonPressedGradientMiddle] = Color.FromArgb(251, 140, 60); + rgbTable[KnownColors.ButtonSelectedBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.ButtonSelectedGradientBegin] = Color.FromArgb(255, 245, 204); + rgbTable[KnownColors.ButtonSelectedGradientEnd] = Color.FromArgb(255, 219, 117); + rgbTable[KnownColors.ButtonSelectedGradientMiddle] = Color.FromArgb(255, 231, 162); + rgbTable[KnownColors.ButtonSelectedHighlightBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.CheckBackground] = Color.FromArgb(255, 227, 149); + rgbTable[KnownColors.CheckSelectedBackground] = Color.FromArgb(254, 128, 62); + rgbTable[KnownColors.GripDark] = Color.FromArgb(111, 157, 217); + rgbTable[KnownColors.GripLight] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.ImageMarginGradientBegin] = Color.FromArgb(233, 238, 238); + rgbTable[KnownColors.MenuBorder] = Color.FromArgb(134, 134, 134); + rgbTable[KnownColors.MenuItemBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.MenuItemPressedGradientBegin] = Color.FromArgb(227, 239, 255); + rgbTable[KnownColors.MenuItemPressedGradientEnd] = Color.FromArgb(152, 186, 230); + rgbTable[KnownColors.MenuItemPressedGradientMiddle] = Color.FromArgb(222, 236, 255); + rgbTable[KnownColors.MenuItemSelected] = Color.FromArgb(255, 238, 194); + rgbTable[KnownColors.MenuItemSelectedGradientBegin] = Color.FromArgb(255, 245, 204); + rgbTable[KnownColors.MenuItemSelectedGradientEnd] = Color.FromArgb(255, 223, 132); + rgbTable[KnownColors.MenuItemText] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.MenuStripGradientBegin] = Color.FromArgb(191, 219, 255); + rgbTable[KnownColors.MenuStripGradientEnd] = Color.FromArgb(191, 219, 255); + rgbTable[KnownColors.OverflowButtonGradientBegin] = Color.FromArgb(167, 204, 251); + rgbTable[KnownColors.OverflowButtonGradientEnd] = Color.FromArgb(101, 147, 207); + rgbTable[KnownColors.OverflowButtonGradientMiddle] = Color.FromArgb(167, 204, 251); + rgbTable[KnownColors.RaftingContainerGradientBegin] = Color.FromArgb(191, 219, 255); + rgbTable[KnownColors.RaftingContainerGradientEnd] = Color.FromArgb(191, 219, 255); + rgbTable[KnownColors.SeparatorDark] = Color.FromArgb(173, 209, 255); + rgbTable[KnownColors.SeparatorLight] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.StatusStripGradientBegin] = Color.FromArgb(227, 239, 255); + rgbTable[KnownColors.StatusStripGradientEnd] = Color.FromArgb(173, 209, 255); + rgbTable[KnownColors.StatusStripText] = Color.FromArgb(21, 66, 139); + rgbTable[KnownColors.ToolStripBorder] = Color.FromArgb(111, 157, 217); + rgbTable[KnownColors.ToolStripContentPanelGradientBegin] = Color.FromArgb(191, 219, 255); + rgbTable[KnownColors.ToolStripContentPanelGradientEnd] = Color.FromArgb(101, 145, 205); + rgbTable[KnownColors.ToolStripDropDownBackground] = Color.FromArgb(250, 250, 250); + rgbTable[KnownColors.ToolStripGradientBegin] = Color.FromArgb(227, 239, 255); + rgbTable[KnownColors.ToolStripGradientEnd] = Color.FromArgb(152, 186, 230); + rgbTable[KnownColors.ToolStripGradientMiddle] = Color.FromArgb(222, 236, 255); + rgbTable[KnownColors.ToolStripPanelGradientBegin] = Color.FromArgb(191, 219, 255); + rgbTable[KnownColors.ToolStripPanelGradientEnd] = Color.FromArgb(191, 219, 255); + rgbTable[KnownColors.ToolStripText] = Color.FromArgb(0, 0, 0); + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007Renderer.cs b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007Renderer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007Renderer.cs @@ -0,0 +1,245 @@ +/********************************************************************/ +/* Office 2007 Renderer Project */ +/* */ +/* Use the Office2007Renderer class as a custom renderer by */ +/* providing it to the ToolStripManager.Renderer property. Then */ +/* all tool strips, menu strips, status strips etc will be drawn */ +/* using the Office 2007 style renderer in your application. */ +/* */ +/* Author: Phil Wright */ +/* Website: www.componentfactory.com */ +/* Contact: phil.wright@componentfactory.com */ +/********************************************************************/ + +using System.Drawing; +using System.Drawing.Text; +using System.Drawing.Drawing2D; +using System.Windows.Forms; +using System.Collections.Generic; +using System.Diagnostics; + +namespace BSE.Windows.Forms +{ + /// + /// Draw ToolStrips using the Office 2007 themed appearance. + /// + public class Office2007Renderer : ToolStripProfessionalRenderer + { + #region FieldsPrivate + + private static int MarginInset; + private static Blend StatusStripBlend; + + #endregion + + #region MethodsPublic + static Office2007Renderer() + { + MarginInset = 2; + // One time creation of the blend for the status strip gradient brush + StatusStripBlend = new Blend(); + StatusStripBlend.Positions = new float[] { 0.0F, 0.2F, 0.3F, 0.4F, 0.8F, 1.0F }; + StatusStripBlend.Factors = new float[] { 0.3F, 0.4F, 0.5F, 1.0F, 0.8F, 0.7F }; + } + /// + /// Initialize a new instance of the Office2007Renderer class. + /// + public Office2007Renderer() + : base(new BSE.Windows.Forms.Office2007BlueColorTable()) + { + this.ColorTable.UseSystemColors = false; + } + /// + /// Initializes a new instance of the Office2007Renderer class. + /// + /// A to be used for painting. + public Office2007Renderer(ProfessionalColorTable professionalColorTable) + : base(professionalColorTable) + { + } + #endregion + + #region MethodsProtected + /// + /// Raises the RenderArrow event. + /// + /// A ToolStripArrowRenderEventArgs that contains the event data. + protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) + { + if (ColorTable.UseSystemColors == false) + { + ProfessionalColorTable colorTable = ColorTable as BSE.Windows.Forms.ProfessionalColorTable; + if (colorTable != null) + { + if ((e.Item.Owner.GetType() == typeof(MenuStrip)) && (e.Item.Selected == false) && e.Item.Pressed == false) + { + if (colorTable.MenuItemText != Color.Empty) + { + e.ArrowColor = colorTable.MenuItemText; + } + } + if ((e.Item.Owner.GetType() == typeof(StatusStrip)) && (e.Item.Selected == false) && e.Item.Pressed == false) + { + if (colorTable.StatusStripText != Color.Empty) + { + e.ArrowColor = colorTable.StatusStripText; + } + } + } + } + base.OnRenderArrow(e); + } + /// + /// Raises the RenderItemText event. + /// + /// A ToolStripItemTextRenderEventArgs that contains the event data. + protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) + { + if (ColorTable.UseSystemColors == false) + { + ProfessionalColorTable colorTable = ColorTable as BSE.Windows.Forms.ProfessionalColorTable; + if (colorTable != null) + { + if ((e.ToolStrip is MenuStrip) && (e.Item.Selected == false) && e.Item.Pressed == false) + { + if (colorTable.MenuItemText != Color.Empty) + { + e.TextColor = colorTable.MenuItemText; + } + } + if ((e.ToolStrip is StatusStrip) && (e.Item.Selected == false) && e.Item.Pressed == false) + { + if (colorTable.StatusStripText != Color.Empty) + { + e.TextColor = colorTable.StatusStripText; + } + } + } + } + base.OnRenderItemText(e); + } + /// + /// Raises the RenderToolStripContentPanelBackground event. + /// + /// An ToolStripContentPanelRenderEventArgs containing the event data. + protected override void OnRenderToolStripContentPanelBackground(ToolStripContentPanelRenderEventArgs e) + { + // Must call base class, otherwise the subsequent drawing does not appear! + base.OnRenderToolStripContentPanelBackground(e); + if (ColorTable.UseSystemColors == false) + { + // Cannot paint a zero sized area + if ((e.ToolStripContentPanel.Width > 0) && + (e.ToolStripContentPanel.Height > 0)) + { + using (LinearGradientBrush backBrush = new LinearGradientBrush(e.ToolStripContentPanel.ClientRectangle, + ColorTable.ToolStripContentPanelGradientBegin, + ColorTable.ToolStripContentPanelGradientEnd, + LinearGradientMode.Vertical)) + { + e.Graphics.FillRectangle(backBrush, e.ToolStripContentPanel.ClientRectangle); + } + } + } + } + /// + /// Raises the RenderSeparator event. + /// + /// An ToolStripSeparatorRenderEventArgs containing the event data. + protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e) + { + if (ColorTable.UseSystemColors == false) + { + e.Item.ForeColor = ColorTable.RaftingContainerGradientBegin; + } + base.OnRenderSeparator(e); + } + /// + /// Raises the RenderToolStripBackground event. + /// + /// An ToolStripRenderEventArgs containing the event data. + protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) + { + if (ColorTable.UseSystemColors == true) + { + base.OnRenderToolStripBackground(e); + } + else + { + if (e.ToolStrip is StatusStrip) + { + // We do not paint the top two pixel lines, so are drawn by the status strip border render method + //RectangleF backRectangle = new RectangleF(0, 1.5f, e.ToolStrip.Width, e.ToolStrip.Height - 2); + RectangleF backRectangle = new RectangleF(0, 0, e.ToolStrip.Width, e.ToolStrip.Height); + + // Cannot paint a zero sized area + if ((backRectangle.Width > 0) && (backRectangle.Height > 0)) + { + using (LinearGradientBrush backBrush = new LinearGradientBrush(backRectangle, + ColorTable.StatusStripGradientBegin, + ColorTable.StatusStripGradientEnd, + LinearGradientMode.Vertical)) + { + backBrush.Blend = StatusStripBlend; + e.Graphics.FillRectangle(backBrush, backRectangle); + } + } + } + else + { + base.OnRenderToolStripBackground(e); + } + } + } + /// + /// Raises the RenderImageMargin event. + /// + /// An ToolStripRenderEventArgs containing the event data. + protected override void OnRenderImageMargin(ToolStripRenderEventArgs e) + { + if (ColorTable.UseSystemColors == true) + { + base.OnRenderToolStripBackground(e); + } + else + { + if ((e.ToolStrip is ContextMenuStrip) || + (e.ToolStrip is ToolStripDropDownMenu)) + { + // Start with the total margin area + Rectangle marginRectangle = e.AffectedBounds; + + // Do we need to draw with separator on the opposite edge? + bool bIsRightToLeft = (e.ToolStrip.RightToLeft == RightToLeft.Yes); + + marginRectangle.Y += MarginInset; + marginRectangle.Height -= MarginInset * 2; + + // Reduce so it is inside the border + if (bIsRightToLeft == false) + { + marginRectangle.X += MarginInset; + } + else + { + marginRectangle.X += MarginInset / 2; + } + + // Draw the entire margine area in a solid color + using (SolidBrush backBrush = new SolidBrush( + ColorTable.ImageMarginGradientBegin)) + e.Graphics.FillRectangle(backBrush, marginRectangle); + } + else + { + base.OnRenderImageMargin(e); + } + } + } + + #endregion + + #region MethodsPrivate + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007SilverColorTable.cs b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007SilverColorTable.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/Office2007SilverColorTable.cs @@ -0,0 +1,88 @@ +using System.Drawing; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + /// + /// Provides colors used for Microsoft Office 2007 silver display elements. + /// + public class Office2007SilverColorTable : BSE.Windows.Forms.OfficeColorTable + { + #region FieldsPrivate + private PanelColors m_panelColorTable; + #endregion + + #region Properties + /// + /// Gets the associated ColorTable for the XPanderControls + /// + public override PanelColors PanelColorTable + { + get + { + if (this.m_panelColorTable == null) + { + this.m_panelColorTable = new PanelColorsOffice2007Silver(); + } + return this.m_panelColorTable; + } + } + #endregion + #region MethodsProtected + /// + /// Initializes a color dictionary with defined colors + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + rgbTable[KnownColors.ButtonPressedBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.ButtonPressedGradientBegin] = Color.FromArgb(248, 181, 106); + rgbTable[KnownColors.ButtonPressedGradientEnd] = Color.FromArgb(255, 208, 134); + rgbTable[KnownColors.ButtonPressedGradientMiddle] = Color.FromArgb(251, 140, 60); + rgbTable[KnownColors.ButtonSelectedBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.ButtonSelectedGradientBegin] = Color.FromArgb(255, 245, 204); + rgbTable[KnownColors.ButtonSelectedGradientEnd] = Color.FromArgb(255, 219, 117); + rgbTable[KnownColors.ButtonSelectedGradientMiddle] = Color.FromArgb(255, 232, 116); + rgbTable[KnownColors.ButtonSelectedHighlightBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.CheckBackground] = Color.FromArgb(255, 227, 149); + rgbTable[KnownColors.CheckSelectedBackground] = Color.FromArgb(254, 128, 62); + rgbTable[KnownColors.GripDark] = Color.FromArgb(84, 84, 117); + rgbTable[KnownColors.GripLight] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.ImageMarginGradientBegin] = Color.FromArgb(239, 239, 239); + rgbTable[KnownColors.MenuBorder] = Color.FromArgb(124, 124, 148); + rgbTable[KnownColors.MenuItemBorder] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.MenuItemPressedGradientBegin] = Color.FromArgb(232, 233, 241); + rgbTable[KnownColors.MenuItemPressedGradientEnd] = Color.FromArgb(186, 185, 205); + rgbTable[KnownColors.MenuItemPressedGradientMiddle] = Color.FromArgb(209, 209, 223); + rgbTable[KnownColors.MenuItemSelected] = Color.FromArgb(255, 238, 194); + rgbTable[KnownColors.MenuItemSelectedGradientBegin] = Color.FromArgb(255, 245, 204); + rgbTable[KnownColors.MenuItemSelectedGradientEnd] = Color.FromArgb(255, 223, 132); + rgbTable[KnownColors.MenuItemText] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.MenuStripGradientBegin] = Color.FromArgb(215, 215, 229); + rgbTable[KnownColors.MenuStripGradientEnd] = Color.FromArgb(243, 243, 247); + rgbTable[KnownColors.OverflowButtonGradientBegin] = Color.FromArgb(179, 178, 200); + rgbTable[KnownColors.OverflowButtonGradientEnd] = Color.FromArgb(118, 116, 146); + rgbTable[KnownColors.OverflowButtonGradientMiddle] = Color.FromArgb(152, 151, 177); + rgbTable[KnownColors.RaftingContainerGradientBegin] = Color.FromArgb(215, 215, 229); + rgbTable[KnownColors.RaftingContainerGradientEnd] = Color.FromArgb(243, 243, 247); + rgbTable[KnownColors.SeparatorDark] = Color.FromArgb(110, 109, 143); + rgbTable[KnownColors.SeparatorLight] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.StatusStripGradientBegin] = Color.FromArgb(235, 238, 250); + rgbTable[KnownColors.StatusStripGradientEnd] = Color.FromArgb(197, 199, 209); + rgbTable[KnownColors.StatusStripText] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.ToolStripBorder] = Color.FromArgb(124, 124, 148); + rgbTable[KnownColors.ToolStripContentPanelGradientBegin] = Color.FromArgb(207, 211, 220); + rgbTable[KnownColors.ToolStripContentPanelGradientEnd] = Color.FromArgb(155, 159, 166); + rgbTable[KnownColors.ToolStripDropDownBackground] = Color.FromArgb(250, 250, 250); + rgbTable[KnownColors.ToolStripGradientBegin] = Color.FromArgb(243, 244, 250); + rgbTable[KnownColors.ToolStripGradientEnd] = Color.FromArgb(153, 151, 181); + rgbTable[KnownColors.ToolStripGradientMiddle] = Color.FromArgb(218, 219, 231); + rgbTable[KnownColors.ToolStripPanelGradientBegin] = Color.FromArgb(215, 215, 229); + rgbTable[KnownColors.ToolStripPanelGradientEnd] = Color.FromArgb(243, 243, 247); + rgbTable[KnownColors.ToolStripText] = Color.FromArgb(0, 0, 0); + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Renderer/OfficeColorTable.cs b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/OfficeColorTable.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/OfficeColorTable.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BSE.Windows.Forms +{ + /// + /// Baseclass for a colortable for the + /// + public class OfficeColorTable : BSE.Windows.Forms.ProfessionalColorTable + { + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Renderer/ProfessionalColorTable.cs b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/ProfessionalColorTable.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Renderer/ProfessionalColorTable.cs @@ -0,0 +1,883 @@ +using System.Drawing; +using System.Windows.Forms; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms.VisualStyles; +using System; +using Microsoft.Win32; +using System.IO; + +namespace BSE.Windows.Forms +{ + /// + /// Provides colors used for Microsoft Office display elements. + /// + public class ProfessionalColorTable : System.Windows.Forms.ProfessionalColorTable + { + #region Enums + /// + /// Gets or sets the KnownColors appearance of the ProfessionalColorTable. + /// + public enum KnownColors + { + /// + /// The border color to use with the , , and colors. + /// + ButtonPressedBorder, + /// + /// The starting color of the gradient used when the button is pressed down. + /// + ButtonPressedGradientBegin, + /// + /// The end color of the gradient used when the button is pressed down. + /// + ButtonPressedGradientEnd, + /// + /// The middle color of the gradient used when the button is pressed down. + /// + ButtonPressedGradientMiddle, + /// + /// The starting color of the gradient used when the button is selected. + /// + ButtonSelectedGradientBegin, + /// + /// The border color to use with the ButtonSelectedGradientBegin, + /// ButtonSelectedGradientMiddle, + /// and ButtonSelectedGradientEnd colors. + /// + ButtonSelectedBorder, + /// + /// The end color of the gradient used when the button is selected. + /// + ButtonSelectedGradientEnd, + /// + /// The middle color of the gradient used when the button is selected. + /// + ButtonSelectedGradientMiddle, + /// + /// The border color to use with ButtonSelectedHighlight. + /// + ButtonSelectedHighlightBorder, + /// + /// The solid color to use when the check box is selected and gradients are being used. + /// + CheckBackground, + /// + /// The solid color to use when the check box is selected and gradients are being used. + /// + CheckSelectedBackground, + /// + /// The color to use for shadow effects on the grip or move handle. + /// + GripDark, + /// + /// The color to use for highlight effects on the grip or move handle. + /// + GripLight, + /// + /// The starting color of the gradient used in the image margin + /// of a ToolStripDropDownMenu. + /// + ImageMarginGradientBegin, + /// + /// The border color or a MenuStrip. + /// + MenuBorder, + /// + /// The border color to use with a ToolStripMenuItem. + /// + MenuItemBorder, + /// + /// The starting color of the gradient used when a top-level + /// ToolStripMenuItem is pressed down. + /// + MenuItemPressedGradientBegin, + /// + /// The end color of the gradient used when a top-level + /// ToolStripMenuItem is pressed down. + /// + MenuItemPressedGradientEnd, + /// + /// The middle color of the gradient used when a top-level + /// ToolStripMenuItem is pressed down. + /// + MenuItemPressedGradientMiddle, + /// + /// The solid color to use when a ToolStripMenuItem other + /// than the top-level ToolStripMenuItem is selected. + /// + MenuItemSelected, + /// + /// The starting color of the gradient used when the ToolStripMenuItem is selected. + /// + MenuItemSelectedGradientBegin, + /// + /// The end color of the gradient used when the ToolStripMenuItem is selected. + /// + MenuItemSelectedGradientEnd, + /// + /// The text color of a top-level ToolStripMenuItem. + /// + MenuItemText, + /// + /// The border color used when a top-level + /// ToolStripMenuItem is selected. + /// + MenuItemTopLevelSelectedBorder, + /// + /// The starting color of the gradient used when a top-level + /// ToolStripMenuItem is selected. + /// + MenuItemTopLevelSelectedGradientBegin, + /// + /// The end color of the gradient used when a top-level + /// ToolStripMenuItem is selected. + /// + MenuItemTopLevelSelectedGradientEnd, + /// + /// The middle color of the gradient used when a top-level + /// ToolStripMenuItem is selected. + /// + MenuItemTopLevelSelectedGradientMiddle, + /// + /// The starting color of the gradient used in the MenuStrip. + /// + MenuStripGradientBegin, + /// + /// The end color of the gradient used in the MenuStrip. + /// + MenuStripGradientEnd, + /// + /// The starting color of the gradient used in the ToolStripOverflowButton. + /// + OverflowButtonGradientBegin, + /// + /// The end color of the gradient used in the ToolStripOverflowButton. + /// + OverflowButtonGradientEnd, + /// + /// The middle color of the gradient used in the ToolStripOverflowButton. + /// + OverflowButtonGradientMiddle, + /// + /// The starting color of the gradient used in the ToolStripContainer. + /// + RaftingContainerGradientBegin, + /// + /// The end color of the gradient used in the ToolStripContainer. + /// + RaftingContainerGradientEnd, + /// + /// The color to use to for shadow effects on the ToolStripSeparator. + /// + SeparatorDark, + /// + /// The color to use to for highlight effects on the ToolStripSeparator. + /// + SeparatorLight, + /// + /// The starting color of the gradient used on the StatusStrip. + /// + StatusStripGradientBegin, + /// + /// The end color of the gradient used on the StatusStrip. + /// + StatusStripGradientEnd, + /// + /// The text color used on the StatusStrip. + /// + StatusStripText, + /// + /// The border color to use on the bottom edge of the ToolStrip. + /// + ToolStripBorder, + /// + /// The starting color of the gradient used in the ToolStripContentPanel. + /// + ToolStripContentPanelGradientBegin, + /// + /// The end color of the gradient used in the ToolStripContentPanel. + /// + ToolStripContentPanelGradientEnd, + /// + /// The solid background color of the ToolStripDropDown. + /// + ToolStripDropDownBackground, + /// + /// The starting color of the gradient used in the ToolStrip background. + /// + ToolStripGradientBegin, + /// + /// The end color of the gradient used in the ToolStrip background. + /// + ToolStripGradientEnd, + /// + /// The middle color of the gradient used in the ToolStrip background. + /// + ToolStripGradientMiddle, + /// + /// The starting color of the gradient used in the ToolStripPanel. + /// + ToolStripPanelGradientBegin, + /// + /// The end color of the gradient used in the ToolStripPanel. + /// + ToolStripPanelGradientEnd, + /// + /// The text color used on the ToolStrip. + /// + ToolStripText, + /// + /// + /// + LastKnownColor = SeparatorLight + } + + #endregion + + #region FieldsPrivate + + private Dictionary m_dictionaryRGBTable; + private PanelColors m_panelColorTable; + + #endregion + + #region Properties + /// + /// Gets the border color to use with the , , and colors. + /// + /// + /// A that is the border color to use with the , , and colors. + /// + public override Color ButtonPressedBorder + { + get + { + return this.FromKnownColor(KnownColors.ButtonPressedBorder); + } + } + /// + /// Gets the starting color of the gradient used when the button is pressed down. + /// + public override Color ButtonPressedGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.ButtonPressedGradientBegin); + } + } + /// + /// Gets the end color of the gradient used when the button is pressed down. + /// + public override Color ButtonPressedGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.ButtonPressedGradientEnd); + } + } + /// + /// Gets the middle color of the gradient used when the button is pressed down. + /// + public override Color ButtonPressedGradientMiddle + { + get + { + return this.FromKnownColor(KnownColors.ButtonPressedGradientMiddle); + } + } + /// + /// Gets the starting color of the gradient used when the button is selected. + /// + public override Color ButtonSelectedBorder + { + get + { + return this.FromKnownColor(KnownColors.ButtonSelectedBorder); + } + } + /// + /// Gets the starting color of the gradient used when the button is selected. + /// + public override Color ButtonSelectedGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.ButtonSelectedGradientBegin); + } + } + /// + /// Gets the end color of the gradient used when the button is selected. + /// + public override Color ButtonSelectedGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.ButtonSelectedGradientEnd); + } + } + /// + /// Gets the middle color of the gradient used when the button is selected. + /// + public override Color ButtonSelectedGradientMiddle + { + get + { + return this.FromKnownColor(KnownColors.ButtonSelectedGradientMiddle); + } + } + + /// + /// Gets the border color to use with ButtonSelectedHighlight. + /// + public override Color ButtonSelectedHighlightBorder + { + get + { + return this.FromKnownColor(KnownColors.ButtonSelectedHighlightBorder); + } + } + /// + /// Gets the solid color to use when the check box is selected and gradients are being used. + /// + public override Color CheckBackground + { + get + { + return this.FromKnownColor(KnownColors.CheckBackground); + } + } + /// + /// Gets the solid color to use when the check box is selected and gradients are being used. + /// + public override Color CheckSelectedBackground + { + get + { + return this.FromKnownColor(KnownColors.CheckSelectedBackground); + } + } + /// + /// Gets the color to use for shadow effects on the grip or move handle. + /// + public override Color GripDark + { + get + { + return this.FromKnownColor(KnownColors.GripDark); + } + } + /// + /// Gets the color to use for highlight effects on the grip or move handle. + /// + public override Color GripLight + { + get + { + return this.FromKnownColor(KnownColors.GripLight); + } + } + /// + /// Gets the starting color of the gradient used in the image margin of a ToolStripDropDownMenu. + /// + public override Color ImageMarginGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.ImageMarginGradientBegin); + } + } + /// + /// Gets the border color or a MenuStrip. + /// + public override Color MenuBorder + { + get + { + return this.FromKnownColor(KnownColors.MenuBorder); + } + } + /// + /// Gets the border color to use with a ToolStripMenuItem. + /// + public override Color MenuItemBorder + { + get + { + return this.FromKnownColor(KnownColors.MenuItemBorder); + } + } + /// + /// Gets the starting color of the gradient used when a top-level ToolStripMenuItem is pressed down. + /// + public override Color MenuItemPressedGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.MenuItemPressedGradientBegin); + } + } + /// + /// Gets the end color of the gradient used when a top-level ToolStripMenuItem is pressed down. + /// + public override Color MenuItemPressedGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.MenuItemPressedGradientEnd); + } + } + /// + /// Gets the middle color of the gradient used when a top-level ToolStripMenuItem is pressed down. + /// + public override Color MenuItemPressedGradientMiddle + { + get + { + return this.FromKnownColor(KnownColors.MenuItemPressedGradientMiddle); + } + } + /// + /// Gets the solid color to use when a ToolStripMenuItem other than the top-level ToolStripMenuItem is selected. + /// + public override Color MenuItemSelected + { + get + { + return this.FromKnownColor(KnownColors.MenuItemSelected); + } + } + /// + /// Gets the text color of a top-level ToolStripMenuItem. + /// + public virtual Color MenuItemText + { + get + { + return this.FromKnownColor(KnownColors.MenuItemText); + } + } + /// + /// Gets the border color used when a top-level + /// ToolStripMenuItem is selected. + /// + public virtual Color MenuItemTopLevelSelectedBorder + { + get + { + return this.FromKnownColor(KnownColors.MenuItemTopLevelSelectedBorder); + } + } + /// + /// Gets the starting color of the gradient used when a top-level + /// ToolStripMenuItem is selected. + /// + public virtual Color MenuItemTopLevelSelectedGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.MenuItemTopLevelSelectedGradientBegin); + } + } + /// + /// Gets the end color of the gradient used when a top-level + /// ToolStripMenuItem is selected. + /// + public virtual Color MenuItemTopLevelSelectedGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.MenuItemTopLevelSelectedGradientEnd); + } + } + /// + /// Gets the middle color of the gradient used when a top-level + /// ToolStripMenuItem is selected. + /// + public virtual Color MenuItemTopLevelSelectedGradientMiddle + { + get + { + return this.FromKnownColor(KnownColors.MenuItemTopLevelSelectedGradientMiddle); + } + } + /// + /// Gets the starting color of the gradient used when the ToolStripMenuItem is selected. + /// + public override Color MenuItemSelectedGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.MenuItemSelectedGradientBegin); + } + } + /// + /// Gets the end color of the gradient used when the ToolStripMenuItem is selected. + /// + public override Color MenuItemSelectedGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.MenuItemSelectedGradientEnd); + } + } + /// + /// Gets the starting color of the gradient used in the MenuStrip. + /// + public override Color MenuStripGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.MenuStripGradientBegin); + } + } + /// + /// Gets the end color of the gradient used in the MenuStrip. + /// + public override Color MenuStripGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.MenuStripGradientEnd); + } + } + /// + /// Gets the starting color of the gradient used in the ToolStripOverflowButton. + /// + public override Color OverflowButtonGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.OverflowButtonGradientBegin); + } + } + /// + /// Gets the end color of the gradient used in the ToolStripOverflowButton. + /// + public override Color OverflowButtonGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.OverflowButtonGradientEnd); + } + } + /// + /// Gets the middle color of the gradient used in the ToolStripOverflowButton. + /// + public override Color OverflowButtonGradientMiddle + { + get + { + return this.FromKnownColor(KnownColors.OverflowButtonGradientMiddle); + } + } + /// + /// Gets the starting color of the gradient used in the ToolStripContainer. + /// + public override Color RaftingContainerGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.RaftingContainerGradientBegin); + } + } + /// + /// Gets the end color of the gradient used in the ToolStripContainer. + /// + public override Color RaftingContainerGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.RaftingContainerGradientEnd); + } + } + /// + /// Gets the color to use to for shadow effects on the ToolStripSeparator. + /// + public override Color SeparatorDark + { + get + { + return this.FromKnownColor(KnownColors.SeparatorDark); + } + } + /// + /// Gets the color to use to for highlight effects on the ToolStripSeparator. + /// + public override Color SeparatorLight + { + get + { + return this.FromKnownColor(KnownColors.SeparatorLight); + } + } + /// + /// Gets the starting color of the gradient used on the StatusStrip. + /// + public override Color StatusStripGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.StatusStripGradientBegin); + } + } + /// + /// Gets the end color of the gradient used on the StatusStrip. + /// + public override Color StatusStripGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.StatusStripGradientEnd); + } + } + /// + /// Gets the text color used on the StatusStrip. + /// + public virtual Color StatusStripText + { + get + { + return this.FromKnownColor(KnownColors.StatusStripText); + } + } + /// + /// Gets the border color to use on the bottom edge of the ToolStrip. + /// + public override Color ToolStripBorder + { + get + { + return this.FromKnownColor(KnownColors.ToolStripBorder); + } + } + /// + /// Gets the starting color of the gradient used in the ToolStripContentPanel. + /// + public override Color ToolStripContentPanelGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.ToolStripContentPanelGradientBegin); + } + } + /// + /// Gets the end color of the gradient used in the ToolStripContentPanel. + /// + public override Color ToolStripContentPanelGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.ToolStripContentPanelGradientEnd); + } + } + /// + /// Gets the solid background color of the ToolStripDropDown. + /// + public override Color ToolStripDropDownBackground + { + get + { + return this.FromKnownColor(KnownColors.ToolStripDropDownBackground); + } + } + /// + /// Gets the starting color of the gradient used in the ToolStrip background. + /// + public override Color ToolStripGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.ToolStripGradientBegin); + } + } + /// + /// Gets the end color of the gradient used in the ToolStrip background. + /// + public override Color ToolStripGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.ToolStripGradientEnd); + } + } + /// + /// Gets the middle color of the gradient used in the ToolStrip background. + /// + public override Color ToolStripGradientMiddle + { + get + { + return this.FromKnownColor(KnownColors.ToolStripGradientMiddle); + } + } + /// + /// Gets the starting color of the gradient used in the ToolStripPanel. + /// + public override Color ToolStripPanelGradientBegin + { + get + { + return this.FromKnownColor(KnownColors.ToolStripPanelGradientBegin); + } + } + /// + /// Gets the end color of the gradient used in the ToolStripPanel. + /// + public override Color ToolStripPanelGradientEnd + { + get + { + return this.FromKnownColor(KnownColors.ToolStripPanelGradientEnd); + } + } + /// + /// Gets the text color used on the ToolStrip. + /// + public virtual Color ToolStripText + { + get + { + return this.FromKnownColor(KnownColors.ToolStripText); + } + } + /// + /// Gets the associated ColorTable for the XPanderControls + /// + public virtual PanelColors PanelColorTable + { + get + { + if (this.m_panelColorTable == null) + { + this.m_panelColorTable = new PanelColors(); + } + return this.m_panelColorTable; + } + } + /// + /// Gets or sets a value indicating whether to use System.Drawing.SystemColors rather than colors that match the current visual style. + /// + public new bool UseSystemColors + { + get { return base.UseSystemColors; } + set + { + if (value.Equals(base.UseSystemColors) == false) + { + base.UseSystemColors = value; + if (this.m_dictionaryRGBTable != null) + { + this.m_dictionaryRGBTable.Clear(); + this.m_dictionaryRGBTable = null; + } + } + } + } + internal Color FromKnownColor(KnownColors color) + { + return (Color)this.ColorTable[color]; + } + + private Dictionary ColorTable + { + get + { + if (this.m_dictionaryRGBTable == null) + { + this.m_dictionaryRGBTable = new Dictionary(0xd4); + if ((this.UseSystemColors == true) || (ToolStripManager.VisualStylesEnabled == false)) + { + InitBaseColors(this.m_dictionaryRGBTable); + } + else + { + InitColors(this.m_dictionaryRGBTable); + } + } + return this.m_dictionaryRGBTable; + } + } + + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the ProfessionalColorTable class. + /// + public ProfessionalColorTable() + { + } + + #endregion + + #region MethodsProtected + /// + /// Initialize a color Dictionary with defined colors + /// + /// Dictionary with defined colors + protected virtual void InitColors(Dictionary rgbTable) + { + InitBaseColors(rgbTable); + } + #endregion + + #region MethodsPrivate + + private void InitBaseColors(Dictionary rgbTable) + { + rgbTable[KnownColors.ButtonPressedBorder] = base.ButtonPressedBorder; + rgbTable[KnownColors.ButtonPressedGradientBegin] = base.ButtonPressedGradientBegin; + rgbTable[KnownColors.ButtonPressedGradientEnd] = base.ButtonPressedGradientEnd; + rgbTable[KnownColors.ButtonPressedGradientMiddle] = base.ButtonPressedGradientMiddle; + rgbTable[KnownColors.ButtonSelectedBorder] = base.ButtonSelectedBorder; + rgbTable[KnownColors.ButtonSelectedGradientBegin] = base.ButtonSelectedGradientBegin; + rgbTable[KnownColors.ButtonSelectedGradientEnd] = base.ButtonSelectedGradientEnd; + rgbTable[KnownColors.ButtonSelectedGradientMiddle] = base.ButtonSelectedGradientMiddle; + rgbTable[KnownColors.ButtonSelectedHighlightBorder] = base.ButtonSelectedHighlightBorder; + rgbTable[KnownColors.CheckBackground] = base.CheckBackground; + rgbTable[KnownColors.CheckSelectedBackground] = base.CheckSelectedBackground; + rgbTable[KnownColors.GripDark] = base.GripDark; + rgbTable[KnownColors.GripLight] = base.GripLight; + rgbTable[KnownColors.ImageMarginGradientBegin] = base.ImageMarginGradientBegin; + rgbTable[KnownColors.MenuBorder] = base.MenuBorder; + rgbTable[KnownColors.MenuItemBorder] = base.MenuItemBorder; + rgbTable[KnownColors.MenuItemPressedGradientBegin] = base.MenuItemPressedGradientBegin; + rgbTable[KnownColors.MenuItemPressedGradientEnd] = base.MenuItemPressedGradientEnd; + rgbTable[KnownColors.MenuItemPressedGradientMiddle] = base.MenuItemPressedGradientMiddle; + rgbTable[KnownColors.MenuItemSelected] = base.MenuItemSelected; + rgbTable[KnownColors.MenuItemSelectedGradientBegin] = base.MenuItemSelectedGradientBegin; + rgbTable[KnownColors.MenuItemSelectedGradientEnd] = base.MenuItemSelectedGradientEnd; + rgbTable[KnownColors.MenuItemText] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.MenuItemTopLevelSelectedBorder] = base.MenuItemBorder; + rgbTable[KnownColors.MenuItemTopLevelSelectedGradientBegin] = base.MenuItemSelected; + rgbTable[KnownColors.MenuItemTopLevelSelectedGradientEnd] = base.MenuItemSelected; + rgbTable[KnownColors.MenuItemTopLevelSelectedGradientMiddle] = base.MenuItemSelected; + rgbTable[KnownColors.MenuStripGradientBegin] = base.MenuStripGradientBegin; + rgbTable[KnownColors.MenuStripGradientEnd] = base.MenuStripGradientEnd; + rgbTable[KnownColors.OverflowButtonGradientBegin] = base.OverflowButtonGradientBegin; + rgbTable[KnownColors.OverflowButtonGradientEnd] = base.OverflowButtonGradientEnd; + rgbTable[KnownColors.OverflowButtonGradientMiddle] = base.OverflowButtonGradientMiddle; + rgbTable[KnownColors.RaftingContainerGradientBegin] = base.RaftingContainerGradientBegin; + rgbTable[KnownColors.RaftingContainerGradientEnd] = base.RaftingContainerGradientEnd; + rgbTable[KnownColors.SeparatorDark] = base.SeparatorDark; + rgbTable[KnownColors.SeparatorLight] = base.SeparatorLight; + rgbTable[KnownColors.StatusStripGradientBegin] = base.StatusStripGradientEnd; + rgbTable[KnownColors.StatusStripGradientEnd] = base.StatusStripGradientBegin; + rgbTable[KnownColors.StatusStripText] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.ToolStripBorder] = base.ToolStripBorder; + rgbTable[KnownColors.ToolStripContentPanelGradientBegin] = base.ToolStripContentPanelGradientBegin; + rgbTable[KnownColors.ToolStripContentPanelGradientEnd] = base.ToolStripContentPanelGradientEnd; + rgbTable[KnownColors.ToolStripDropDownBackground] = base.ToolStripDropDownBackground; + rgbTable[KnownColors.ToolStripGradientBegin] = base.ToolStripGradientBegin; + rgbTable[KnownColors.ToolStripGradientEnd] = base.ToolStripGradientEnd; + rgbTable[KnownColors.ToolStripGradientMiddle] = base.ToolStripGradientMiddle; + rgbTable[KnownColors.ToolStripPanelGradientBegin] = base.ToolStripPanelGradientBegin; + rgbTable[KnownColors.ToolStripPanelGradientEnd] = base.ToolStripPanelGradientEnd; + rgbTable[KnownColors.ToolStripText] = Color.FromArgb(0, 0, 0); + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Resources/ChevronDown.png b/Demo.WindowsForms/BSE.Windows.Forms/Resources/ChevronDown.png new file mode 100644 index 0000000000000000000000000000000000000000..ea2ac54810113e3e228c06afe9a4e7accb6ea5a5 GIT binary patch literal 185 zc%17D@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv|)93tET;x8AJdIE*qJY5_^DsCnJIsf6mJ+oi~=dpw> zk>?I%Y?g5qisV`M;r~RB9V$k=;_lm}ZidWI;%I;PzrN&5!e$<4o;;;pp)Zn}5B9b& ZFnDI9NETmP{vT)}gQu&X%Q~loCII*rI`sem diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Resources/ChevronLeft.png b/Demo.WindowsForms/BSE.Windows.Forms/Resources/ChevronLeft.png new file mode 100644 index 0000000000000000000000000000000000000000..bb51b5fd57528d89907050b7bbd1f739771fed0b GIT binary patch literal 156 zc%17D@N?(olHy`uVBq!ia0vp^AT}2V6Od#Ih`sfbuMWhF5YHlKj%NpXEaYpI=~&UL^5~U;*B#uoKRe%_~*a7 z(#0D-6;Bpinj!R}?Qu|Jfz%y`6f@<235*OZ-OAV3uhLrxG={;`)z4*}Q$iB}K_M?r diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Resources/ChevronRight.png b/Demo.WindowsForms/BSE.Windows.Forms/Resources/ChevronRight.png new file mode 100644 index 0000000000000000000000000000000000000000..b08f63974b84c3932498faba2a67f867e16356f9 GIT binary patch literal 164 zc%17D@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4aTa()7Bet#3xhBt!>ls-=2Tn4wZ^SyvV&YmugAr-fJCmiHuP~c$Ze^w-@ULyE?RepfdU(r6ZgDo!3 ze!+YR$*qas6hE?CH+{nH diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Resources/ChevronUp.png b/Demo.WindowsForms/BSE.Windows.Forms/Resources/ChevronUp.png new file mode 100644 index 0000000000000000000000000000000000000000..b253464be4998f0096ad0cb312ab3c83a8019f37 GIT binary patch literal 175 zc%17D@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv|)93tEz60*f>?*N5tJY5_^DsCnJIsf6mJ+oi~=WK<= zXNwMTC3am9HBJov^4~+HElDk=%RuCR`j7wevc@-b4hu*-m>UU6KVWF}v*vBH)cylB Ohr!d;&t;ucLK6T}t23Mc diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Resources/Collapse.jpg b/Demo.WindowsForms/BSE.Windows.Forms/Resources/Collapse.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9e770ef30912d6581c65c1b2dca97beecc8638b4 GIT binary patch literal 1429 zc%1ux7Z1V_{}xWnlrz)B@!gSOi&x6b&8OgaZ@Vl?p|S8YeE~ z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nB_I=A7WV7jAXeM6$fz^?Gf2 zd1z0_a;H#5v8#t7Y(hSUe3)vvDq-2m&`t9<_j(t5&06vJq}IgvBR#5?L6ZYlN|;TY z%zLD~z_D1YX6GVLaT@`Nbe5{Vsc)8^F1`8UyxI1na`RsOx&L%ydRYGvIo%(nYbuxz z%~QFs$NaIa(W7VCx%x+c@y&c>&-~-J^Q`Qhd3&TE=jsP;*tui&!COzKzPXjR(5&y< zuHF?XJK8*hEOXxP>Cmx@ofmxk@rTll5mMX!K9kz&W2es^eD}%G2d{$XC~S;~bTiF3 zwreiew1PPaPo=i}{ur>f^T3sbtw(|vcXa>Ay4)Kjx_I?e9v4-%zr7jTId}P)CT#V+ z6)>&-P_%6JL-E6$3qKaUs1t2_ClP+Ip7oEq*!0qe{~21VjGQ$#eK=C5-ghQzpZ&+V zZ$6(~QPF=Ss`c&Jz4ulY7km?R<*1(P_4(C~oYxjT8~nBz739CRT&8-ZPuXZ~>Dl;K z=i-jDwk{W0nP4zw<)M-fADh-{dR ztG)A4wqH=stCPDj-9D`hc6RUg*&4}qje}Fxz=Ngn4WIkNxV5t``&!%DKgcQ$-*0ts zt<|snum7A~8|<;=iey~MZ5^8>tB-Vkdi=ChVdcvc%1g7ki$3jGshOF!=Rd>xYrmy^ zw}!ht&dz<&S8HRMrY>|^=kg{YkuztNS=p!ZygR~ERroeE(5ct-%|nUU*Qt5)KZwoU wqU+{m_vOyEt-o|j{*=~F+!L70)xorC1s8h)=emrypDkCvG`)1PF6aME0L*G^@&Et; diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Resources/Expand_h.jpg b/Demo.WindowsForms/BSE.Windows.Forms/Resources/Expand_h.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1f6250277a0c1bb89703727c6521a1246eab2b74 GIT binary patch literal 1305 zc%1uxHEAm;@P_ z1sVSzVUTBFU}S|TV1NQfCT12^Hg*n9E^eTLtpW^8jLghTEX=H|EG$6TTA(}wiy*6z zqM;+3a9|?4QlW@Z(iUwW$pkka<)WpdpCN3cY31zV z>gMj@=@lFj8WtWA8I_!pnwFlCnN?g;T2@|BS=HRq+ScCD*)?hMl&RCE&zL!D(c&db zmn~nha@D5ITefc7zGLUELx+zXJ$C%W$y1juU%7hi`i+~n9zJ^f=!0ld(M2vX6_bamA3K@(?hu$BZ7RPyE$>q0SPv@HIum7rkA-Bfy@qUqvZRQhxSRWRz zy0mVp*xq$wy?e_K+Od9={4r7efWJictp5xh`*>fuJAJ(0 zoA&p9dY8ZFRwtKM=JP&lUvvJ$<)AC|>GqA=A0NL| zk$>>yiYQm{!~Hj(9~8{^eoy9y<6`d2={_Gqw|6IPj2Hgn|MB1E@?y2UALEbzdbfUM zX4Lr}ef@Vf=9#HUn_t~i{Ciwr|3huVGxG|2mLA!W^D}h^pWMF-PYyjQ`gQd~KX1ph z;J@8gQy1&-+LW6{RW=_uyFb7CY*9^}wAM+B#Si~&?1{W5t>4Eq?$g zuI|murFW#a&ilLd<@(Mz{oDTGAN4owcK>xfzU_JXqkhgzJH<(o>mG8JW`B;pdxR^- zwd2&kcNw=Vm2MM=TKBKbco{?D{0nLWPcf_cc@JWyZ2u>nZk58D-B@FE5$5-L}Hj@@oF9f0x#E1$l?;JC$WC?tAsS sb$Oo!OTnRTnLsx|5e5gY=qrJ)qDT3g>>u_&=~oy0lQsX*U%~%30r~zK(*OVf diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Resources/Resources.Designer.cs b/Demo.WindowsForms/BSE.Windows.Forms/Resources/Resources.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Resources/Resources.Designer.cs @@ -0,0 +1,172 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.1434 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace BSE.Windows.Forms.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BSE.Windows.Forms.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap ChevronDown { + get { + object obj = ResourceManager.GetObject("ChevronDown", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap ChevronLeft { + get { + object obj = ResourceManager.GetObject("ChevronLeft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap ChevronRight { + get { + object obj = ResourceManager.GetObject("ChevronRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap ChevronUp { + get { + object obj = ResourceManager.GetObject("ChevronUp", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap closePanel { + get { + object obj = ResourceManager.GetObject("closePanel", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Collapse { + get { + object obj = ResourceManager.GetObject("Collapse", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Collapse_h { + get { + object obj = ResourceManager.GetObject("Collapse_h", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Expand { + get { + object obj = ResourceManager.GetObject("Expand", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Expand_h { + get { + object obj = ResourceManager.GetObject("Expand_h", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized string similar to Parameter {0} can't be null. + /// + internal static string IDS_ArgumentException { + get { + return ResourceManager.GetString("IDS_ArgumentException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value of '{0}' is not valid for '{1}'. 'Value' should be between '{2}' and '{3}'. + ///Parameter name: {1}. + /// + internal static string IDS_InvalidBoundArgument { + get { + return ResourceManager.GetString("IDS_InvalidBoundArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value of '{0}' is not valid for '{1}'. 'Maximum' must be greater than or equal to 0. + ///Parameter name: {1}. + /// + internal static string IDS_InvalidLowBoundArgument { + get { + return ResourceManager.GetString("IDS_InvalidLowBoundArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value of '{0}' is not valid for '{1}'. '{1}' must be greater than or equal to {2}. + ///Parameter name: {1}. + /// + internal static string IDS_InvalidOperationExceptionInteger { + get { + return ResourceManager.GetString("IDS_InvalidOperationExceptionInteger", resourceCulture); + } + } + + internal static System.Drawing.Bitmap ListViewItemSorter { + get { + object obj = ResourceManager.GetObject("ListViewItemSorter", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Resources/Resources.resx b/Demo.WindowsForms/BSE.Windows.Forms/Resources/Resources.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Resources/Resources.resx @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\ChevronDown.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\ChevronLeft.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\ChevronRight.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\ChevronUp.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\closePanel.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\collapse.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\collapse_h.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\expand.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\resources\expand_h.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Parameter {0} can't be null + + + Value of '{0}' is not valid for '{1}'. '{1}' must be greater than or equal to {2}. +Parameter name: {1} + + + ..\Resources\ListViewItemSorter.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Value of '{0}' is not valid for '{1}'. 'Value' should be between '{2}' and '{3}'. +Parameter name: {1} + + + Value of '{0}' is not valid for '{1}'. 'Maximum' must be greater than or equal to 0. +Parameter name: {1} + + \ No newline at end of file diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Resources/closePanel.png b/Demo.WindowsForms/BSE.Windows.Forms/Resources/closePanel.png new file mode 100644 index 0000000000000000000000000000000000000000..07e7fae66146448e2bce12821728d8c4a1c2c212 GIT binary patch literal 196 zc%17D@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv|)93tFeDhyhiZvuq^JzX3_DsJ^oILOPOz`@M_tVmG3 zMDY8e>199kSue+>#*1E12yFhFG?9_Zb|(4b)}W3cOYZs{*LnoufAp; lo?0n-F4XC2%U>}&hQJBxGqtxHJ^>oe;OXk;vd$@?2>>)sKhppJ diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Splitter/Splitter.Designer.cs b/Demo.WindowsForms/BSE.Windows.Forms/Splitter/Splitter.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Splitter/Splitter.Designer.cs @@ -0,0 +1,36 @@ +namespace BSE.Windows.Forms +{ + partial class Splitter + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/Splitter/Splitter.cs b/Demo.WindowsForms/BSE.Windows.Forms/Splitter/Splitter.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/Splitter/Splitter.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + /// + /// Represents a splitter control that enables the user to resize docked controls. + /// + /// + /// The splitter control supports in difference to the the using + /// of a transparent backcolor. + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + [DesignTimeVisibleAttribute(true)] + [ToolboxBitmap(typeof(System.Windows.Forms.Splitter))] + public partial class Splitter : System.Windows.Forms.Splitter + { + #region MethodsPublic + /// + /// Initializes a new instance of the Splitter class. + /// + public Splitter() + { + //The System.Windows.Forms.Splitter doesn't suports a transparent backcolor + //With this, the using of a transparent backcolor is possible + SetStyle(ControlStyles.SupportsTransparentBackColor, true); + InitializeComponent(); + this.BackColor = Color.Transparent; + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/BasePanel.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/BasePanel.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/BasePanel.cs @@ -0,0 +1,1665 @@ +using System; +using System.Text; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; +using System.ComponentModel; +using Demo.WindowsForms.Properties; + +namespace BSE.Windows.Forms +{ + /// + /// Base class for the panel or xpanderpanel control. + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + [DesignTimeVisibleAttribute(false)] + public class BasePanel : ScrollableControl, IPanel + { + #region Constants + + /// + /// padding value for the panel + /// + public const int CaptionSpacing = 6; + + #endregion + + #region Events + /// + /// Occurs when the close icon in the caption of the panel or xpanderpanel is clicked. + /// + [Description("Occurs when the close icon in the caption of the panel or xpanderpanel is clicked.")] + public event EventHandler CloseClick; + /// + /// Occurs when the expand icon in the caption of the panel or xpanderpanel is clicked. + /// + [Description("Occurs when the expand icon in the caption of the panel or xpanderpanel is clicked.")] + public event EventHandler ExpandClick; + /// + /// Occurs when the panel or xpanderpanel expands. + /// + [Description("Occurs when the panel or xpanderpanel expands.")] + public event EventHandler PanelExpanding; + /// + /// Occurs when the panel or xpanderpanel collapse. + /// + [Description("Occurs when the panel or xpanderpanel collapse.")] + public event EventHandler PanelCollapsing; + /// + /// The PanelStyleChanged event occurs when PanelStyle flags have been changed. + /// + [Description("The PanelStyleChanged event occurs when PanelStyle flags have been changed.")] + public event EventHandler PanelStyleChanged; + /// + /// The ColorSchemeChanged event occurs when ColorScheme flags have been changed. + /// + [Description("The ColorSchemeChanged event occurs when ColorScheme flags have been changed.")] + public event EventHandler ColorSchemeChanged; + /// + /// Occurs when the value of the CustomColors property changes. + /// + [Description("Occurs when the value of the CustomColors property changes.")] + public event EventHandler CustomColorsChanged; + /// + /// Occurs when the value of the CaptionHeight property changes. + /// + [Description("Occurs when the value of the CaptionHeight property changes.")] + public event EventHandler CaptionHeightChanged; + /// + /// Occurs when the value of the CaptionBar HoverState changes. + /// + [Description("Occurs when the value of the CaptionBar HoverState changes.")] + public event EventHandler CaptionBarHoverStateChanged; + /// + /// Occurs when the value of the CloseIcon HoverState changes. + /// + [Description("Occurs when the value of the CloseIcon HoverState changes.")] + protected event EventHandler CloseIconHoverStateChanged; + /// + /// Occurs when the value of the ExpandIcon HoverState changes. + /// + [Description("Occurs when the value of the ExpandIcon HoverState changes.")] + protected event EventHandler ExpandIconHoverStateChanged; + #endregion + + #region FieldsPrivate + + private int m_iCaptionHeight; + private Font m_captionFont; + private Rectangle m_imageRectangle; + private bool m_bShowBorder; + private bool m_bExpand; + private Size m_imageSize; + private BSE.Windows.Forms.ColorScheme m_eColorScheme; + private PanelColors m_panelColors; + private PanelStyle m_ePanelStyle; + private Image m_image; + private HoverState m_hoverStateCaptionBar; + private HoverState m_hoverStateExpandIcon; + private string m_strToolTipTextExpandIconPanelExpanded; + private string m_strToolTipTextExpandIconPanelCollapsed; + private HoverState m_hoverStateCloseIcon; + private string m_strToolTipTextCloseIcon; + private bool m_bShowExpandIcon; + private bool m_bShowCloseIcon; + private System.Windows.Forms.ToolTip m_toolTip; + + #endregion + + #region FieldsProtected + /// + /// The rectangle that contains the expand panel icon + /// + protected Rectangle RectangleExpandIcon = Rectangle.Empty; + /// + /// The rectangle that contains the close panel icon + /// + protected Rectangle RectangleCloseIcon = Rectangle.Empty; + + #endregion + + #region Properties + /// + /// Gets or sets the style of the panel. + /// + [Description("Style of the panel")] + [DefaultValue(0)] + [Category("Appearance")] + public virtual BSE.Windows.Forms.PanelStyle PanelStyle + { + get + { + return this.m_ePanelStyle; + } + set + { + if(value.Equals(this.m_ePanelStyle) == false) + { + this.m_ePanelStyle = value; + OnPanelStyleChanged(this, new PanelStyleChangeEventArgs(this.m_ePanelStyle)); + } + } + } + /// + /// Gets or sets the image that is displayed on a Panels caption. + /// + [Description("Gets or sets the image that is displayed on a Panels caption.")] + [Category("Appearance")] + public Image Image + { + get + { + return this.m_image; + } + set + { + if(value != this.m_image) + { + this.m_image = value; + this.Invalidate(this.CaptionRectangle); + } + } + } + /// + /// Gets or sets the color schema which is used for the panel. + /// + [Description("ColorScheme of the Panel")] + [DefaultValue(BSE.Windows.Forms.ColorScheme.Professional)] + [Browsable(true)] + [Category("Appearance")] + public virtual BSE.Windows.Forms.ColorScheme ColorScheme + { + get + { + return this.m_eColorScheme; + } + set + { + if(value.Equals(this.m_eColorScheme) == false) + { + this.m_eColorScheme = value; + OnColorSchemeChanged(this, new ColorSchemeChangeEventArgs(this.m_eColorScheme)); + } + } + } + /// + /// Gets or sets the height of the panels caption. + /// + [Description("Gets or sets the height of the panels caption."), + DefaultValue(25), + Category("Appearance")] + public int CaptionHeight + { + get + { + return m_iCaptionHeight; + } + set + { + if(value < Constants.CaptionMinHeight) + { + throw new InvalidOperationException( + string.Format( + System.Globalization.CultureInfo.CurrentUICulture, + Resources.IDS_InvalidOperationExceptionInteger, value, "CaptionHeight", Constants.CaptionMinHeight)); + } + this.m_iCaptionHeight = value; + OnCaptionHeightChanged(this, EventArgs.Empty); + } + } + /// + /// Gets or sets the font of the text displayed on the caption. + /// + [Description("Gets or sets the font of the text displayed on the caption.")] + [DefaultValue(typeof(Font), "Microsoft Sans Serif; 8,25pt; style=Bold")] + [Category("Appearance")] + public Font CaptionFont + { + get + { + return this.m_captionFont; + } + set + { + if(value != null) + { + if(value.Equals(this.m_captionFont) == false) + { + this.m_captionFont = value; + this.Invalidate(this.CaptionRectangle); + } + } + } + } + /// + /// Expands the panel or xpanderpanel. + /// + [Description("Expand the panel or xpanderpanel")] + [DefaultValue(false)] + [Category("Appearance")] + [RefreshProperties(RefreshProperties.Repaint)] + public virtual bool Expand + { + get + { + return this.m_bExpand; + } + set + { + if(value.Equals(this.m_bExpand) == false) + { + this.m_bExpand = value; + if(this.m_bExpand == true) + { + OnPanelExpanding(this, new XPanderStateChangeEventArgs(this.m_bExpand)); + } + else + { + OnPanelCollapsing(this, new XPanderStateChangeEventArgs(this.m_bExpand)); + } + } + } + } + /// + /// Gets or sets a value indicating whether the control shows a border. + /// + [Description("Gets or sets a value indicating whether the control shows a border")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [DefaultValue(true)] + [Browsable(false)] + [Category("Appearance")] + public virtual bool ShowBorder + { + get + { + return this.m_bShowBorder; + } + set + { + if(value.Equals(this.m_bShowBorder) == false) + { + this.m_bShowBorder = value; + this.Invalidate(false); + } + } + } + /// + /// Gets or sets a value indicating whether the expand icon in a Panel or XPanderPanel is visible. + /// + [Description("Gets or sets a value indicating whether the expand icon in a Panel or XPanderPanel is visible.")] + [DefaultValue(false)] + [Category("Appearance")] + public virtual bool ShowExpandIcon + { + get + { + return this.m_bShowExpandIcon; + } + set + { + if(value.Equals(this.m_bShowExpandIcon) == false) + { + this.m_bShowExpandIcon = value; + this.Invalidate(false); + } + } + } + /// + /// Gets or sets the text that appears as a ToolTip on a panel when the mouse + /// movers over the closeicon. + /// + /// + /// Type: + /// A string representing the ToolTip text when the mouse moves over the closeicon. + /// + [Description("Specifies the text to show on a ToolTip when the mouse moves over the closeicon.")] + [Category("Behavior")] + public virtual string ToolTipTextCloseIcon + { + get + { + return this.m_strToolTipTextCloseIcon; + } + set + { + this.m_strToolTipTextCloseIcon = value; + } + } + /// + /// Gets or sets the text that appears as a ToolTip on a panel when the mouse + /// movers over the expandicon and the panel is collapsed. + /// + /// + /// Type: + /// A string representing the ToolTip text. + /// + [Description("Specifies the text to show on a ToolTip when the mouse moves over the expandicon and the panel is collapsed.")] + [Category("Behavior")] + public virtual string ToolTipTextExpandIconPanelCollapsed + { + get + { + return this.m_strToolTipTextExpandIconPanelCollapsed; + } + set + { + this.m_strToolTipTextExpandIconPanelCollapsed = value; + } + } + /// + /// Gets or sets the text that appears as a ToolTip on a panel when the mouse + /// movers over the expandicon and the panel is expanded. + /// + /// + /// Type: + /// A string representing the ToolTip text when the mouse moves over the expandicon and the panel is expanded. + /// + [Description("Specifies the text to show on a ToolTip when the mouse moves over the expandicon and the panel is expanded.")] + [Category("Behavior")] + public virtual string ToolTipTextExpandIconPanelExpanded + { + get + { + return this.m_strToolTipTextExpandIconPanelExpanded; + } + set + { + this.m_strToolTipTextExpandIconPanelExpanded = value; + } + } + /// + /// Gets or sets a value indicating whether the close icon in a Panel or XPanderPanel is visible. + /// + [Description("Gets or sets a value indicating whether the close icon in a Panel or XPanderPanel is visible.")] + [DefaultValue(false)] + [Category("Appearance")] + public virtual bool ShowCloseIcon + { + get + { + return this.m_bShowCloseIcon; + } + set + { + if(value.Equals(this.m_bShowCloseIcon) == false) + { + this.m_bShowCloseIcon = value; + this.Invalidate(false); + } + } + } + /// + /// Gets the panelcolors table. + /// + protected PanelColors PanelColors + { + get + { + return m_panelColors; + } + } + /// + /// Gets or sets the HoverState of the CaptionBar at a Panel or XPanderPanel. + /// + internal HoverState HoverStateCaptionBar + { + get + { + return this.m_hoverStateCaptionBar; + } + set + { + this.m_hoverStateCaptionBar = value; + } + } + /// + /// Gets or sets the HoverState of the CloseIcon in a captionbar at a Panel or XPanderPanel. + /// + internal HoverState HoverStateCloseIcon + { + get + { + return this.m_hoverStateCloseIcon; + } + set + { + this.m_hoverStateCloseIcon = value; + } + } + /// + /// Gets or sets the HoverState of the ExpandIcon in a captionbar at a Panel or XPanderPanel. + /// + internal HoverState HoverStateExpandIcon + { + get + { + return this.m_hoverStateExpandIcon; + } + set + { + this.m_hoverStateExpandIcon = value; + } + } + /// + /// Gets or sets the size of an image in the captionbar. + /// + internal Size ImageSize + { + get + { + return this.m_imageSize; + } + set + { + this.m_imageSize = value; + } + } + /// + /// Gets the size of a captionbar in a Panel or XPanderPanel + /// + internal Rectangle CaptionRectangle + { + get + { + return new Rectangle(0, 0, this.ClientRectangle.Width, this.CaptionHeight); + } + } + /// + /// Gets the Rectangle of an Image in a captionbar + /// + internal Rectangle ImageRectangle + { + get + { + if(this.m_imageRectangle == Rectangle.Empty) + { + this.m_imageRectangle = new Rectangle( + CaptionSpacing, + this.CaptionHeight, + this.m_imageSize.Width, + this.m_imageSize.Height); + } + return this.m_imageRectangle; + } + } + #endregion + + #region MethodsPublic + /// + /// Sets the PanelProperties for a Panel or XPanderPanel + /// + /// The PanelColors table + public virtual void SetPanelProperties(PanelColors panelColors) + { + if(panelColors == null) + { + throw new ArgumentException( + string.Format( + System.Globalization.CultureInfo.CurrentUICulture, + Resources.IDS_ArgumentException, + "panelColors")); + } + this.m_panelColors = panelColors; + this.ColorScheme = ColorScheme.Professional; + this.Invalidate(true); + } + #endregion + + #region MethodsProtected + /// + /// Initializes a new instance of the BasePanel class. + /// + protected BasePanel() + { + this.SetStyle(ControlStyles.ResizeRedraw, true); + this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); + this.SetStyle(ControlStyles.UserPaint, true); + this.SetStyle(ControlStyles.DoubleBuffer, true); + this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); + this.SetStyle(ControlStyles.ContainerControl, true); + this.CaptionFont = new Font(SystemFonts.CaptionFont.FontFamily, SystemFonts.CaptionFont.SizeInPoints - 1.0F, FontStyle.Bold); + this.CaptionHeight = 25; + this.PanelStyle = PanelStyle.Default; + this.m_panelColors = new PanelColors(this); + this.m_imageSize = new Size(16, 16); + this.m_imageRectangle = Rectangle.Empty; + this.m_toolTip = new System.Windows.Forms.ToolTip(); + + } + /// + /// Raises the TextChanged event. + /// + /// An EventArgs that contains the event data. + protected override void OnTextChanged(EventArgs e) + { + this.Invalidate(this.CaptionRectangle); + base.OnTextChanged(e); + } + /// + /// Raises the ColorScheme changed event + /// + /// The source of the event. + /// A EventArgs that contains the event data. + protected virtual void OnColorSchemeChanged(object sender, ColorSchemeChangeEventArgs e) + { + this.PanelColors.Clear(); + this.Invalidate(false); + if(this.ColorSchemeChanged != null) + { + this.ColorSchemeChanged(sender, e); + } + } + /// + /// Raises the MouseUp event + /// + /// A MouseEventArgs that contains data about the OnMouseUp event. + protected override void OnMouseUp(MouseEventArgs e) + { + if((this.ShowExpandIcon == true) && (this.RectangleExpandIcon.Contains(e.X, e.Y) == true)) + { + OnExpandClick(this, EventArgs.Empty); + } + if((this.ShowCloseIcon == true) && (this.RectangleCloseIcon.Contains(e.X, e.Y) == true)) + { + OnCloseClick(this, EventArgs.Empty); + } + base.OnMouseUp(e); + } + /// + /// Raises the MouseMove event + /// + /// A MouseEventArgs that contains the event data. + protected override void OnMouseMove(MouseEventArgs e) + { + if(this.CaptionRectangle.Contains(e.X, e.Y) == true) + { + if(this.m_hoverStateCaptionBar == HoverState.None) + { + this.m_hoverStateCaptionBar = HoverState.Hover; + OnCaptionBarHoverStateChanged(this, new HoverStateChangeEventArgs(this.m_hoverStateCaptionBar)); + } + } + else + { + if(this.m_hoverStateCaptionBar == HoverState.Hover) + { + this.m_hoverStateCaptionBar = HoverState.None; + OnCaptionBarHoverStateChanged(this, new HoverStateChangeEventArgs(this.m_hoverStateCaptionBar)); + } + } + + if((this.ShowExpandIcon == true) || (this.ShowCloseIcon == true)) + { + if(this.RectangleExpandIcon.Contains(e.X, e.Y) == true) + { + if(this.m_hoverStateExpandIcon == HoverState.None) + { + this.m_hoverStateExpandIcon = HoverState.Hover; + OnExpandIconHoverStateChanged(this, new HoverStateChangeEventArgs(this.m_hoverStateExpandIcon)); + } + } + else + { + if(this.m_hoverStateExpandIcon == HoverState.Hover) + { + this.m_hoverStateExpandIcon = HoverState.None; + OnExpandIconHoverStateChanged(this, new HoverStateChangeEventArgs(this.m_hoverStateExpandIcon)); + } + } + if(this.RectangleCloseIcon.Contains(e.X, e.Y) == true) + { + if(this.m_hoverStateCloseIcon == HoverState.None) + { + this.m_hoverStateCloseIcon = HoverState.Hover; + OnCloseIconHoverStateChanged(this, new HoverStateChangeEventArgs(this.m_hoverStateCloseIcon)); + } + } + else + { + if(this.m_hoverStateCloseIcon == HoverState.Hover) + { + this.m_hoverStateCloseIcon = HoverState.None; + OnCloseIconHoverStateChanged(this, new HoverStateChangeEventArgs(this.m_hoverStateCloseIcon)); + } + } + } + base.OnMouseMove(e); + } + /// + /// Raises the MouseLeave event. + /// + /// An EventArgs that contains the event data. + protected override void OnMouseLeave(EventArgs e) + { + if(this.m_hoverStateCaptionBar == HoverState.Hover) + { + this.m_hoverStateCaptionBar = HoverState.None; + OnCaptionBarHoverStateChanged(this, new HoverStateChangeEventArgs(this.m_hoverStateCaptionBar)); + } + if(this.m_hoverStateExpandIcon == HoverState.Hover) + { + this.m_hoverStateExpandIcon = HoverState.None; + OnExpandIconHoverStateChanged(this, new HoverStateChangeEventArgs(this.m_hoverStateExpandIcon)); + } + if(this.m_hoverStateCloseIcon == HoverState.Hover) + { + this.m_hoverStateCloseIcon = HoverState.None; + OnCloseIconHoverStateChanged(this, new HoverStateChangeEventArgs(this.m_hoverStateCloseIcon)); + } + base.OnMouseLeave(e); + } + /// + /// Raises the PanelExpanding event. + /// + /// The source of the event. + /// A XPanderStateChangeEventArgs that contains the event data. + protected virtual void OnPanelExpanding(object sender, XPanderStateChangeEventArgs e) + { + if(this.PanelExpanding != null) + { + this.PanelExpanding(sender, e); + } + } + /// + /// Raises the PanelCollapsing event. + /// + /// The source of the event. + /// A XPanderStateChangeEventArgs that contains the event data. + protected virtual void OnPanelCollapsing(object sender, XPanderStateChangeEventArgs e) + { + if(this.PanelCollapsing != null) + { + this.PanelCollapsing(sender, e); + } + } + /// + /// Raises the PanelStyle changed event. + /// + /// The source of the event. + /// A PanelStyleChangeEventArgs that contains the event data. + protected virtual void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e) + { + PanelStyle panelStyle = e.PanelStyle; + switch(panelStyle) + { + case PanelStyle.Default: + m_panelColors = new PanelColors(this); + break; + case PanelStyle.Office2007: + m_panelColors = new PanelColorsOffice2007Blue(this); + break; + } + Invalidate(true); + if(this.PanelStyleChanged != null) + { + this.PanelStyleChanged(sender, e); + } + } + /// + /// Raises the CloseClick event. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + protected virtual void OnCloseClick(object sender, EventArgs e) + { + if(this.CloseClick != null) + { + this.CloseClick(sender, e); + } + } + /// + /// Raises the ExpandClick event. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + protected virtual void OnExpandClick(object sender, EventArgs e) + { + this.Invalidate(false); + if(this.ExpandClick != null) + { + this.ExpandClick(sender, e); + } + } + /// + /// Raises the ExpandIconHoverState changed event. + /// + /// The source of the event. + /// A HoverStateChangeEventArgs that contains the event data. + protected virtual void OnExpandIconHoverStateChanged(object sender, HoverStateChangeEventArgs e) + { + if(e.HoverState == HoverState.Hover) + { + if(this.Cursor != Cursors.Hand) + { + this.Cursor = Cursors.Hand; + if(this.Expand == true) + { + if(this is Panel) + { + if(string.IsNullOrEmpty(this.m_strToolTipTextExpandIconPanelExpanded) == false) + { + this.m_toolTip.SetToolTip(this, this.m_strToolTipTextExpandIconPanelExpanded); + } + } + } + else + { + if(string.IsNullOrEmpty(this.m_strToolTipTextExpandIconPanelCollapsed) == false) + { + this.m_toolTip.SetToolTip(this, this.m_strToolTipTextExpandIconPanelCollapsed); + } + } + } + } + else + { + if(this.Cursor == Cursors.Hand) + { + this.m_toolTip.SetToolTip(this, string.Empty); + this.m_toolTip.Hide(this); + this.Cursor = Cursors.Default; + } + } + if(this.ExpandIconHoverStateChanged != null) + { + this.ExpandIconHoverStateChanged(sender, e); + } + } + /// + /// Raises the CaptionHeight changed event. + /// + /// The source of the event. + /// A EventArgs that contains the event data. + protected virtual void OnCaptionHeightChanged(object sender, EventArgs e) + { + OnLayout(new LayoutEventArgs(this, null)); + this.Invalidate(false); + if(this.CaptionHeightChanged != null) + { + this.CaptionHeightChanged(sender, e); + } + } + /// + /// Raises the CaptionBarHoverState changed event. + /// + /// The source of the event. + /// A HoverStateChangeEventArgs that contains the event data. + protected virtual void OnCaptionBarHoverStateChanged(object sender, HoverStateChangeEventArgs e) + { + if(this is XPanderPanel) + { + if(e.HoverState == HoverState.Hover) + { + if((this.ShowCloseIcon == false) && (this.ShowExpandIcon == false)) + { + if(this.Cursor != Cursors.Hand) + { + this.Cursor = Cursors.Hand; + } + } + } + else + { + if(this.Cursor == Cursors.Hand) + { + this.Cursor = Cursors.Default; + } + } + this.Invalidate(CaptionRectangle); + } + if(this.CaptionBarHoverStateChanged != null) + { + this.CaptionBarHoverStateChanged(sender, e); + } + } + /// + /// Raises the CloseIconHoverState changed event. + /// + /// The source of the event. + /// A HoverStateChangeEventArgs that contains the event data. + protected virtual void OnCloseIconHoverStateChanged(object sender, HoverStateChangeEventArgs e) + { + if(e.HoverState == HoverState.Hover) + { + if(this.Cursor != Cursors.Hand) + { + this.Cursor = Cursors.Hand; + } + if(string.IsNullOrEmpty(this.m_strToolTipTextCloseIcon) == false) + { + this.m_toolTip.SetToolTip(this, this.m_strToolTipTextCloseIcon); + } + } + else + { + if(this.Cursor == Cursors.Hand) + { + this.m_toolTip.SetToolTip(this, string.Empty); + this.m_toolTip.Hide(this); + this.Cursor = Cursors.Default; + } + } + if(this.CloseIconHoverStateChanged != null) + { + this.CloseIconHoverStateChanged(sender, e); + } + } + /// + /// Raises the CustomColors changed event. + /// + /// The source of the event. + /// A EventArgs that contains the event data. + protected virtual void OnCustomColorsChanged(object sender, EventArgs e) + { + if(this.ColorScheme == ColorScheme.Custom) + { + this.PanelColors.Clear(); + this.Invalidate(false); + } + if(this.CustomColorsChanged != null) + { + this.CustomColorsChanged(sender, e); + } + } + /// + /// Draws the specified text string on the specified caption surface; within the specified bounds; and in the specified font, color. + /// + /// The Graphics to draw on. + /// Rectangle structure that specifies the location of the drawn text. + /// Font that defines the text format of the string. + /// The color of the string + /// String to draw. + /// Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fonts. + /// The alignment of a text string relative to its layout rectangle. + protected static void DrawString( + Graphics graphics, + RectangleF layoutRectangle, + Font font, + Color fontColor, + string strText, + RightToLeft rightToLeft, + StringAlignment stringAlignment) + { + if(graphics == null) + { + throw new ArgumentException( + string.Format( + System.Globalization.CultureInfo.CurrentUICulture, + Resources.IDS_ArgumentException, + typeof(Graphics).Name)); + } + + using(SolidBrush stringBrush = new SolidBrush(fontColor)) + { + using(StringFormat stringFormat = new StringFormat()) + { + stringFormat.FormatFlags = StringFormatFlags.NoWrap; + if(rightToLeft == RightToLeft.Yes) + { + stringFormat.FormatFlags |= StringFormatFlags.DirectionRightToLeft; + } + stringFormat.Trimming = StringTrimming.EllipsisCharacter; + stringFormat.LineAlignment = StringAlignment.Center; + stringFormat.Alignment = stringAlignment; + graphics.DrawString(strText, font, stringBrush, layoutRectangle, stringFormat); + } + } + } + /// + /// Draws the icon image at the specified location. + /// + /// The Graphics to draw on. + /// icon image to draw. + /// A rectangle structure that specifies the bounds of the linear gradient. + /// The foreground color of this image + /// The vertical position for the icon image + protected static void DrawIcon(Graphics graphics, Image imgPanelIcon, Rectangle imageRectangle, Color foreColorImage, int iconPositionY) + { + if(graphics == null) + { + throw new ArgumentException( + string.Format( + System.Globalization.CultureInfo.CurrentUICulture, + Resources.IDS_ArgumentException, + typeof(Graphics).Name)); + } + if(imgPanelIcon == null) + { + throw new ArgumentException( + string.Format( + System.Globalization.CultureInfo.CurrentUICulture, + Resources.IDS_ArgumentException, + typeof(Image).Name)); + } + + int iconPositionX = imageRectangle.Left; + int iconWidth = imgPanelIcon.Width; + int iconHeight = imgPanelIcon.Height; + + Rectangle rectangleIcon = new Rectangle( + iconPositionX + (iconWidth / 2) - 1, + iconPositionY + (iconHeight / 2) - 1, + imgPanelIcon.Width, + imgPanelIcon.Height - 1); + + using(System.Drawing.Imaging.ImageAttributes imageAttribute = new System.Drawing.Imaging.ImageAttributes()) + { + imageAttribute.SetColorKey(Color.Magenta, Color.Magenta); + System.Drawing.Imaging.ColorMap colorMap = new System.Drawing.Imaging.ColorMap(); + colorMap.OldColor = Color.FromArgb(0, 60, 166); + colorMap.NewColor = foreColorImage; + imageAttribute.SetRemapTable(new System.Drawing.Imaging.ColorMap[] { colorMap }); + + graphics.DrawImage(imgPanelIcon, rectangleIcon, 0, 0, iconWidth, iconHeight, GraphicsUnit.Pixel, imageAttribute); + } + } + /// + /// Draws the specified Image at the specified location. + /// + /// The Graphics to draw on. + /// Image to draw. + /// Rectangle structure that specifies the location and size of the drawn image. + protected static void DrawImage(Graphics graphics, Image image, Rectangle imageRectangle) + { + if(graphics == null) + { + throw new ArgumentNullException( + string.Format( + System.Globalization.CultureInfo.CurrentUICulture, + Resources.IDS_ArgumentException, + typeof(Graphics).Name)); + } + if(image != null) + { + graphics.DrawImage(image, imageRectangle); + } + } + /// + /// Draws the text and image objects at the specified location. + /// + /// The Graphics to draw on. + /// The drawing rectangle on a panel's caption. + /// The spacing on a panel's caption + /// The rectangle of an image displayed on a panel's caption. + /// The image that is displayed on a panel's caption. + /// A value indicating whether control's elements are aligned to support locales using right-to-left fonts. + /// The font of the text displayed on a panel's caption. + /// The foreground color of the text displayed on a panel's caption. + /// The text which is associated with this caption. + protected static void DrawImagesAndText( + Graphics graphics, + Rectangle captionRectangle, + int iSpacing, + Rectangle imageRectangle, + Image image, + RightToLeft rightToLeft, + Font fontCaption, + Color captionForeColor, + string strCaptionText) + { + //DrawImages + int iTextPositionX1 = iSpacing; + int iTextPositionX2 = captionRectangle.Right - iSpacing; + + imageRectangle.Y = (captionRectangle.Height - imageRectangle.Height) / 2; + + if(rightToLeft == RightToLeft.No) + { + if(image != null) + { + DrawImage(graphics, image, imageRectangle); + iTextPositionX1 += imageRectangle.Width + iSpacing; + } + } + // + // Draw Caption text + // + Rectangle textRectangle = captionRectangle; + textRectangle.X = iTextPositionX1; + textRectangle.Width -= iTextPositionX1 + iSpacing; + if(rightToLeft == RightToLeft.Yes) + { + if(image != null) + { + Rectangle imageRectangleRight = imageRectangle; + imageRectangleRight.X = iTextPositionX2 - imageRectangle.Width; + DrawImage(graphics, image, imageRectangleRight); + iTextPositionX2 = imageRectangleRight.X - iSpacing; + } + } + textRectangle.Width = iTextPositionX2 - iTextPositionX1; + DrawString(graphics, textRectangle, fontCaption, captionForeColor, strCaptionText, rightToLeft, StringAlignment.Near); + + } + /// + /// Draws the text and image objects at the specified location. + /// + /// The Graphics to draw on. + /// The drawing rectangle on a panel's caption. + /// The spacing on a panel's caption + /// The rectangle of an image displayed on a panel's caption. + /// The image that is displayed on a panel's caption. + /// A value indicating whether control's elements are aligned to support locales using right-to-left fonts. + /// A value indicating whether the xpanderpanel is closable + /// A value indicating whether the close image is displayed + /// The close image that is displayed on a panel's caption. + /// The foreground color of the close image that is displayed on a panel's caption. + /// The rectangle of the close image that is displayed on a panel's caption. + /// A value indicating whether the expand image is displayed + /// The expand image that is displayed on a panel's caption. + /// The foreground color of the expand image displayed by this caption. + /// the rectangle of the expand image displayed by this caption. + /// The font of the text displayed on a panel's caption. + /// The foreground color of the text displayed on a panel's caption. + /// The text which is associated with this caption. + protected static void DrawImagesAndText( + Graphics graphics, + Rectangle captionRectangle, + int iSpacing, + Rectangle imageRectangle, + Image image, + RightToLeft rightToLeft, + bool bIsClosable, + bool bShowCloseIcon, + Image imageClosePanel, + Color foreColorCloseIcon, + ref Rectangle rectangleImageClosePanel, + bool bShowExpandIcon, + Image imageExandPanel, + Color foreColorExpandIcon, + ref Rectangle rectangleImageExandPanel, + Font fontCaption, + Color captionForeColor, + string strCaptionText) + { + //DrawImages + int iTextPositionX1 = iSpacing; + int iTextPositionX2 = captionRectangle.Right - iSpacing; + + imageRectangle.Y = (captionRectangle.Height - imageRectangle.Height) / 2; + + if(rightToLeft == RightToLeft.No) + { + if(image != null) + { + DrawImage(graphics, image, imageRectangle); + iTextPositionX1 += imageRectangle.Width + iSpacing; + iTextPositionX2 -= iTextPositionX1; + } + } + else + { + if((bShowCloseIcon == true) && (imageClosePanel != null)) + { + rectangleImageClosePanel = imageRectangle; + rectangleImageClosePanel.X = imageRectangle.X; + if(bIsClosable == true) + { + DrawIcon(graphics, imageClosePanel, rectangleImageClosePanel, foreColorCloseIcon, imageRectangle.Y); + } + iTextPositionX1 = rectangleImageClosePanel.X + rectangleImageClosePanel.Width; + } + if((bShowExpandIcon == true) && (imageExandPanel != null)) + { + rectangleImageExandPanel = imageRectangle; + rectangleImageExandPanel.X = imageRectangle.X; + if((bShowCloseIcon == true) && (imageClosePanel != null)) + { + rectangleImageExandPanel.X = iTextPositionX1 + (iSpacing / 2); + } + DrawIcon(graphics, imageExandPanel, rectangleImageExandPanel, foreColorExpandIcon, imageRectangle.Y); + iTextPositionX1 = rectangleImageExandPanel.X + rectangleImageExandPanel.Width; + } + } + // + // Draw Caption text + // + RectangleF textRectangle = captionRectangle; + textRectangle.X = iTextPositionX1; + textRectangle.Width -= iTextPositionX1 + iSpacing; + if(rightToLeft == RightToLeft.No) + { + if((bShowCloseIcon == true) && (imageClosePanel != null)) + { + rectangleImageClosePanel = imageRectangle; + rectangleImageClosePanel.X = captionRectangle.Right - iSpacing - imageRectangle.Width; + if(bIsClosable == true) + { + DrawIcon(graphics, imageClosePanel, rectangleImageClosePanel, foreColorCloseIcon, imageRectangle.Y); + } + iTextPositionX2 = rectangleImageClosePanel.X; + } + if((bShowExpandIcon == true) && (imageExandPanel != null)) + { + rectangleImageExandPanel = imageRectangle; + rectangleImageExandPanel.X = captionRectangle.Right - iSpacing - imageRectangle.Width; + if((bShowCloseIcon == true) && (imageClosePanel != null)) + { + rectangleImageExandPanel.X = iTextPositionX2 - (iSpacing / 2) - imageRectangle.Width; + } + DrawIcon(graphics, imageExandPanel, rectangleImageExandPanel, foreColorExpandIcon, imageRectangle.Y); + iTextPositionX2 = rectangleImageExandPanel.X; + } + if((bShowCloseIcon == true) + && (imageClosePanel != null) + && (bShowExpandIcon == true) + && (imageExandPanel != null)) + { + iTextPositionX2 -= iSpacing; + } + } + else + { + if(image != null) + { + Rectangle imageRectangleRight = imageRectangle; + imageRectangleRight.X = iTextPositionX2 - imageRectangle.Width; + DrawImage(graphics, image, imageRectangleRight); + iTextPositionX2 = imageRectangleRight.X - iSpacing; + } + } + textRectangle.Width = iTextPositionX2 - iTextPositionX1; + textRectangle.Y = (float) (captionRectangle.Height - fontCaption.Height) / 2 + 1; + textRectangle.Height = fontCaption.Height; + DrawString(graphics, textRectangle, fontCaption, captionForeColor, strCaptionText, rightToLeft, StringAlignment.Near); + + //if the XPanderPanel not closable then the RectangleCloseIcon must be empty + if(bIsClosable == false) + { + rectangleImageClosePanel = Rectangle.Empty; + } + } + /// + /// Draws the text and image objects at the specified location. + /// + /// The Graphics to draw on. + /// Specifies the position and manner in which a control is docked. + /// The spacing on a panel's caption + /// The rectangle of the panel's caption bar. + /// The rectangle that represents the client area of the panel. + /// The rectangle of an image displayed on a panel's caption. + /// The image that is displayed on a panel's caption. + /// A value indicating whether control's elements are aligned to support locales using right-to-left fonts. + /// A value indicating whether the close image is displayed + /// The close image that is displayed on a panel's caption. + /// The foreground color of the close image that is displayed on a panel's caption. + /// The rectangle of the close image that is displayed on a panel's caption. + /// A value indicating whether the expand image is displayed + /// A value indicating whether the panel is expanded or collapsed + /// The expand image that is displayed on a panel's caption. + /// The foreground color of the expand image displayed by this caption. + /// + /// The font of the text displayed on a panel's caption. + /// The foreground color of the text displayed on a panel's caption. + /// + /// The text which is associated with this caption. + protected static void DrawImagesAndText( + Graphics graphics, + DockStyle dockStyle, + int iSpacing, + Rectangle captionRectangle, + Rectangle panelRectangle, + Rectangle imageRectangle, + Image image, + RightToLeft rightToLeft, + bool bShowCloseIcon, + Image imageClosePanel, + Color foreColorCloseIcon, + ref Rectangle rectangleImageClosePanel, + bool bShowExpandIcon, + bool bIsExpanded, + Image imageExandPanel, + Color foreColorExpandPanel, + ref Rectangle rectangleImageExandPanel, + Font fontCaption, + Color captionForeColor, + Color collapsedForeColor, + string strCaptionText) + { + switch(dockStyle) + { + case DockStyle.Left: + case DockStyle.Right: + if(bIsExpanded == true) + { + DrawImagesAndText( + graphics, + captionRectangle, + iSpacing, + imageRectangle, + image, + rightToLeft, + true, + bShowCloseIcon, + imageClosePanel, + foreColorCloseIcon, + ref rectangleImageClosePanel, + bShowExpandIcon, + imageExandPanel, + foreColorExpandPanel, + ref rectangleImageExandPanel, + fontCaption, + captionForeColor, + strCaptionText); + } + else + { + rectangleImageClosePanel = Rectangle.Empty; + DrawVerticalImagesAndText( + graphics, + captionRectangle, + panelRectangle, + imageRectangle, + dockStyle, + image, + rightToLeft, + imageExandPanel, + foreColorExpandPanel, + ref rectangleImageExandPanel, + fontCaption, + collapsedForeColor, + strCaptionText); + } + break; + case DockStyle.Top: + case DockStyle.Bottom: + DrawImagesAndText( + graphics, + captionRectangle, + iSpacing, + imageRectangle, + image, + rightToLeft, + true, + bShowCloseIcon, + imageClosePanel, + foreColorCloseIcon, + ref rectangleImageClosePanel, + bShowExpandIcon, + imageExandPanel, + foreColorExpandPanel, + ref rectangleImageExandPanel, + fontCaption, + captionForeColor, + strCaptionText); + break; + } + } + /// + /// Renders the background of the caption bar + /// + /// The Graphics to draw on. + /// Rectangle structure that specifies the location of the caption bar. + /// The starting color of the gradient used on the caption bar + /// The middle color of the gradient used on the caption bar + /// The end color of the gradient used on the caption bar + /// Specifies the type of fill a Pen object uses to fill lines. + /// + protected static void RenderDoubleBackgroundGradient(Graphics graphics, Rectangle bounds, Color beginColor, Color middleColor, Color endColor, LinearGradientMode linearGradientMode, bool flipHorizontal) + { + int iUpperHeight = bounds.Height / 2; + int iLowerHeight = bounds.Height - iUpperHeight; + + RenderDoubleBackgroundGradient( + graphics, + bounds, + beginColor, + middleColor, + endColor, + iUpperHeight, + iLowerHeight, + linearGradientMode, + flipHorizontal); + } + /// + /// Renders the panel background + /// + /// The Graphics to draw on. + /// Rectangle structure that specifies the backgrounds location. + /// The starting color of the gradient used on the panel background + /// The end color of the gradient used on the panel background + /// Specifies the type of fill a Pen object uses to fill lines. + protected static void RenderBackgroundGradient(Graphics graphics, Rectangle bounds, Color beginColor, Color endColor, LinearGradientMode linearGradientMode) + { + if(graphics == null) + { + throw new ArgumentException( + string.Format( + System.Globalization.CultureInfo.CurrentUICulture, + Resources.IDS_ArgumentException, + typeof(Graphics).Name)); + } + if(IsZeroWidthOrHeight(bounds)) + { + return; + } + using(LinearGradientBrush linearGradientBrush = new LinearGradientBrush(bounds, beginColor, endColor, linearGradientMode)) + { + graphics.FillRectangle(linearGradientBrush, bounds); + } + } + /// + /// Renders the button background + /// + /// The Graphics to draw on. + /// Rectangle structure that specifies the backgrounds location. + /// The starting color of the gradient used on the button background + /// The middle color of the gradient used on the button background + /// The end color of the gradient used on the button background + protected static void RenderButtonBackground(Graphics graphics, Rectangle bounds, Color colorGradientBegin, Color colorGradientMiddle, Color colorGradientEnd) + { + RectangleF upperRectangle = bounds; + upperRectangle.Height = bounds.Height * 0.4f; + + using(LinearGradientBrush upperLinearGradientBrush = new LinearGradientBrush( + upperRectangle, + colorGradientBegin, + colorGradientMiddle, + LinearGradientMode.Vertical)) + { + if(upperLinearGradientBrush != null) + { + Blend blend = new Blend(); + blend.Positions = new float[] { 0.0F, 1.0F }; + blend.Factors = new float[] { 0.0F, 0.6F }; + upperLinearGradientBrush.Blend = blend; + graphics.FillRectangle(upperLinearGradientBrush, upperRectangle); + } + } + + RectangleF lowerRectangle = bounds; + lowerRectangle.Y = upperRectangle.Height; + lowerRectangle.Height = bounds.Height - upperRectangle.Height; + + using(LinearGradientBrush lowerLinearGradientBrush = new LinearGradientBrush( + lowerRectangle, + colorGradientMiddle, + colorGradientEnd, + LinearGradientMode.Vertical)) + { + if(lowerLinearGradientBrush != null) + { + graphics.FillRectangle(lowerLinearGradientBrush, lowerRectangle); + } + } + //At some captionheights there are drawing errors. This is the correction + RectangleF correctionRectangle = lowerRectangle; + correctionRectangle.Y -= 1; + correctionRectangle.Height = 2; + using(SolidBrush solidBrush = new SolidBrush(colorGradientMiddle)) + { + graphics.FillRectangle(solidBrush, correctionRectangle); + } + } + /// + /// Renders the flat button background + /// + /// The Graphics to draw on. + /// Rectangle structure that specifies the backgrounds location. + /// The starting color of the gradient used on the button background + /// The end color of the gradient used on the button background + /// A indicator that represents when the mouse cursor hovers over + protected static void RenderFlatButtonBackground(Graphics graphics, Rectangle bounds, Color colorGradientBegin, Color colorGradientEnd, bool bHover) + { + using(LinearGradientBrush gradientBrush = GetFlatGradientBackBrush(bounds, colorGradientBegin, colorGradientEnd, bHover)) + { + if(gradientBrush != null) + { + graphics.FillRectangle(gradientBrush, bounds); + } + } + } + + /// + /// Gets a GraphicsPath. + /// + /// Rectangle structure that specifies the backgrounds location. + /// The radius in the graphics path + /// the specified graphics path + protected static GraphicsPath GetPath(Rectangle bounds, int radius) + { + int x = bounds.X; + int y = bounds.Y; + int width = bounds.Width; + int height = bounds.Height; + GraphicsPath graphicsPath = new GraphicsPath(); + graphicsPath.AddArc(x, y, radius, radius, 180, 90); //Upper left corner + graphicsPath.AddArc(x + width - radius, y, radius, radius, 270, 90); //Upper right corner + graphicsPath.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90);//Lower right corner + graphicsPath.AddArc(x, y + height - radius, radius, radius, 90, 90); //Lower left corner + graphicsPath.CloseFigure(); + return graphicsPath; + } + /// + /// Gets a GraphicsPath with rounded corners on the upper side. + /// + /// Rectangle structure that specifies the backgrounds location. + /// The radius in the graphics path + /// the specified graphics path + protected static GraphicsPath GetUpperBackgroundPath(Rectangle bounds, int radius) + { + int x = bounds.X; + int y = bounds.Y; + int width = bounds.Width; + int height = bounds.Height; + GraphicsPath graphicsPath = new GraphicsPath(); + graphicsPath.AddLine(x, y + height, x, y - radius); //Left Line + graphicsPath.AddArc(x, y, radius, radius, 180, 90); //Upper left corner + graphicsPath.AddArc(x + width - radius, y, radius, radius, 270, 90);//Upper right corner + graphicsPath.AddLine(x + width, y + radius, x + width, y + height); //Right Line + graphicsPath.CloseFigure(); + return graphicsPath; + } + /// + /// Gets a GraphicsPath. + /// + /// Rectangle structure that specifies the backgrounds location. + /// The radius in the graphics path + /// The specified graphics path + protected static GraphicsPath GetBackgroundPath(Rectangle bounds, int radius) + { + int x = bounds.X; + int y = bounds.Y; + int width = bounds.Width; + int height = bounds.Height; + GraphicsPath graphicsPath = new GraphicsPath(); + graphicsPath.AddArc(x, y, radius, radius, 180, 90); //Upper left corner + graphicsPath.AddArc(x + width - radius, y, radius, radius, 270, 90); //Upper right corner + graphicsPath.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90);//Lower right corner + graphicsPath.AddArc(x, y + height - radius, radius, radius, 90, 90); //Lower left corner + graphicsPath.CloseFigure(); + return graphicsPath; + } + /// + /// Gets the linear GradientBackBrush for flat XPanderPanel captions. + /// + /// Rectangle structure that specifies the bounds of the linear gradient. + /// A Color structure that represents the starting color for the gradient. + /// A Color structure that represents the end color for the gradient. + /// A indicator that represents when the mouse cursor hovers over + /// + protected static LinearGradientBrush GetFlatGradientBackBrush(Rectangle bounds, Color colorGradientBegin, Color colorGradientEnd, bool bHover) + { + LinearGradientBrush linearGradientBrush = null; + Blend blend = new Blend(); + blend.Positions = new float[] { 0.0F, 0.2F, 0.3F, 0.4F, 0.5F, 0.6F, 0.7F, 0.8F, 1.0F }; + if(bHover == false) + { + blend.Factors = new float[] { 0.0F, 0.0F, 0.2F, 0.4F, 0.6F, 0.4F, 0.2F, 0.0F, 0.0F }; + } + else + { + blend.Factors = new float[] { 0.4F, 0.5F, 0.6F, 0.8F, 1.0F, 0.8F, 0.6F, 0.5F, 0.4F }; + } + linearGradientBrush = linearGradientBrush = new LinearGradientBrush(bounds, colorGradientBegin, colorGradientEnd, LinearGradientMode.Horizontal); + if(linearGradientBrush != null) + { + linearGradientBrush.Blend = blend; + } + return linearGradientBrush; + } + /// + /// Checks if the rectangle width or height is equal to 0. + /// + /// the rectangle to check + /// true if the with or height of the rectangle is 0 else false + protected static bool IsZeroWidthOrHeight(Rectangle rectangle) + { + if(rectangle.Width != 0) + { + return (rectangle.Height == 0); + } + return true; + } + #endregion + + #region MethodsPrivate + + private static void RenderDoubleBackgroundGradient(Graphics graphics, Rectangle bounds, Color beginColor, Color middleColor, Color endColor, int firstGradientWidth, int secondGradientWidth, LinearGradientMode mode, bool flipHorizontal) + { + if((bounds.Width != 0) && (bounds.Height != 0)) + { + Rectangle rectangle1 = bounds; + Rectangle rectangle2 = bounds; + bool flag1 = true; + if(mode == LinearGradientMode.Horizontal) + { + if(flipHorizontal) + { + Color color1 = endColor; + endColor = beginColor; + beginColor = color1; + } + rectangle2.Width = firstGradientWidth; + rectangle1.Width = secondGradientWidth + 1; + rectangle1.X = bounds.Right - rectangle1.Width; + flag1 = bounds.Width > (firstGradientWidth + secondGradientWidth); + } + else + { + rectangle2.Height = firstGradientWidth; + rectangle1.Height = secondGradientWidth + 1; + rectangle1.Y = bounds.Bottom - rectangle1.Height; + flag1 = bounds.Height > (firstGradientWidth + secondGradientWidth); + } + if(flag1) + { + using(Brush brush1 = new SolidBrush(middleColor)) + { + graphics.FillRectangle(brush1, bounds); + } + using(Brush brush2 = new LinearGradientBrush(rectangle2, beginColor, middleColor, mode)) + { + graphics.FillRectangle(brush2, rectangle2); + } + using(LinearGradientBrush brush3 = new LinearGradientBrush(rectangle1, middleColor, endColor, mode)) + { + if(mode == LinearGradientMode.Horizontal) + { + rectangle1.X++; + rectangle1.Width--; + } + else + { + rectangle1.Y++; + rectangle1.Height--; + } + graphics.FillRectangle(brush3, rectangle1); + return; + } + } + using(Brush brush4 = new LinearGradientBrush(bounds, beginColor, endColor, mode)) + { + graphics.FillRectangle(brush4, bounds); + } + } + } + + private static void DrawVerticalImagesAndText( + Graphics graphics, + Rectangle captionRectangle, + Rectangle panelRectangle, + Rectangle imageRectangle, + DockStyle dockStyle, + Image image, + RightToLeft rightToLeft, + Image imageExandPanel, + Color foreColorExpandPanel, + ref Rectangle rectangleImageExandPanel, + Font captionFont, + Color collapsedCaptionForeColor, + string strCaptionText) + { + imageRectangle.Y = (captionRectangle.Height - imageRectangle.Height) / 2; + + if(imageExandPanel != null) + { + rectangleImageExandPanel = imageRectangle; + rectangleImageExandPanel.X = (panelRectangle.Width - imageRectangle.Width) / 2; + DrawIcon(graphics, imageExandPanel, rectangleImageExandPanel, foreColorExpandPanel, imageRectangle.Y); + } + + int iTextPositionY1 = CaptionSpacing; + int iTextPositionY2 = panelRectangle.Height - CaptionSpacing; + + if(image != null) + { + imageRectangle.Y = iTextPositionY2 - imageRectangle.Height; + imageRectangle.X = (panelRectangle.Width - imageRectangle.Width) / 2; + DrawImage(graphics, image, imageRectangle); + iTextPositionY1 += imageRectangle.Height + CaptionSpacing; + } + + iTextPositionY2 -= captionRectangle.Height + iTextPositionY1; + + Rectangle textRectangle = new Rectangle( + iTextPositionY1, + panelRectangle.Y, + iTextPositionY2, + captionRectangle.Height); + + using(SolidBrush textBrush = new SolidBrush(collapsedCaptionForeColor)) + { + if(dockStyle == DockStyle.Left) + { + graphics.TranslateTransform(0, panelRectangle.Height); + graphics.RotateTransform(-90); + + DrawString( + graphics, + textRectangle, + captionFont, + collapsedCaptionForeColor, + strCaptionText, + rightToLeft, + StringAlignment.Center); + + graphics.ResetTransform(); + } + if(dockStyle == DockStyle.Right) + { + graphics.TranslateTransform(panelRectangle.Width, 0); + graphics.RotateTransform(90); + + DrawString( + graphics, + textRectangle, + captionFont, + collapsedCaptionForeColor, + strCaptionText, + rightToLeft, + StringAlignment.Center); + + graphics.ResetTransform(); + } + } + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/CaptionStyle.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/CaptionStyle.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/CaptionStyle.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BSE.Windows.Forms +{ + /// + /// Specifies constants that define the style of the caption in a XPanderPanel. + /// + /// Copyright 2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public enum CaptionStyle + { + /// + /// The normal style of a caption. + /// + Normal, + /// + /// The flat style of a caption. + /// + Flat + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/ColorScheme.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/ColorScheme.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/ColorScheme.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BSE.Windows.Forms +{ + /// + /// Contains information for the drawing of panels or xpanderpanels in a xpanderpanellist. + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public enum ColorScheme + { + /// + /// Draws the panels caption with ProfessionalColors + /// + Professional, + /// + /// Draws the panels caption with custom colors. + /// + Custom + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/ColorSchemeChangeEventArgs.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/ColorSchemeChangeEventArgs.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/ColorSchemeChangeEventArgs.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BSE.Windows.Forms +{ + /// + /// Provides data for the ColorSchemeChange event. + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class ColorSchemeChangeEventArgs : EventArgs + { + #region FieldsPrivate + + private ColorScheme m_eColorSchema; + + #endregion + + #region Properties + /// + /// Gets the color schema which is used for the panel. + /// + public ColorScheme ColorSchema + { + get { return this.m_eColorSchema; } + } + #endregion + + #region MethodsPublic + /// + /// Arguments used when a ColorSchemeChange event occurs. + /// + /// The color schema which is used for the panel. + public ColorSchemeChangeEventArgs(ColorScheme eColorSchema) + { + this.m_eColorSchema = eColorSchema; + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/Constants.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/Constants.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/Constants.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BSE.Windows.Forms +{ + /// + /// Contains the constants for the XPanderControls + /// + public static class Constants + { + /// + /// The minimum height for the captionbars in the panels + /// + public const int CaptionMinHeight = 18; + /// + /// Gets the thickness, in pixels, of a flat-style control border. + /// + public const int BorderThickness = 1; + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/CustomColors.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/CustomColors.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/CustomColors.cs @@ -0,0 +1,192 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.ComponentModel; + +namespace BSE.Windows.Forms +{ + /// + /// Base class for the custom colors at a panel or xpanderpanel control. + /// + /// + /// If you use the ColorScheme, this is the base class for the custom colors. + /// + /// Copyright © 2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + [TypeConverter(typeof(ExpandableObjectConverter))] + [Description("The colors used in a panel")] + public class CustomColors + { + #region Events + /// + /// Occurs when the value of the CustomColors property changes. + /// + [Description("Occurs when the value of the CustomColors property changes.")] + public event EventHandler CustomColorsChanged; + #endregion + + #region FieldsPrivate + private Color m_borderColor = System.Windows.Forms.ProfessionalColors.GripDark; + private Color m_captionCloseIcon = SystemColors.ControlText; + private Color m_captionExpandIcon = SystemColors.ControlText; + private Color m_captionGradientBegin = System.Windows.Forms.ProfessionalColors.ToolStripGradientBegin; + private Color m_captionGradientEnd = System.Windows.Forms.ProfessionalColors.ToolStripGradientEnd; + private Color m_captionGradientMiddle = System.Windows.Forms.ProfessionalColors.ToolStripGradientMiddle; + private Color m_captionText = SystemColors.ControlText; + private Color m_innerBorderColor = System.Windows.Forms.ProfessionalColors.GripLight; + + #endregion + + #region Properties + /// + /// Gets or sets the border color of a Panel or XPanderPanel. + /// + [Description("The border color of a Panel or XPanderPanel.")] + public virtual Color BorderColor + { + get { return this.m_borderColor; } + set + { + if (value.Equals(this.m_borderColor) == false) + { + this.m_borderColor = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the forecolor of a close icon in a Panel or XPanderPanel. + /// + [Description("The forecolor of a close icon in a Panel or XPanderPanel.")] + public virtual Color CaptionCloseIcon + { + get { return this.m_captionCloseIcon; } + set + { + if (value.Equals(this.m_captionCloseIcon) == false) + { + this.m_captionCloseIcon = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the forecolor of an expand icon in a Panel or XPanderPanel. + /// + [Description("The forecolor of an expand icon in a Panel or XPanderPanel.")] + public virtual Color CaptionExpandIcon + { + get { return this.m_captionExpandIcon; } + set + { + if (value.Equals(this.m_captionExpandIcon) == false) + { + this.m_captionExpandIcon = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the starting color of the gradient at the caption on a Panel or XPanderPanel. + /// + [Description("The starting color of the gradient at the caption on a Panel or XPanderPanel.")] + public virtual Color CaptionGradientBegin + { + get { return this.m_captionGradientBegin; } + set + { + if (value.Equals(this.m_captionGradientBegin) == false) + { + this.m_captionGradientBegin = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the end color of the gradient at the caption on a Panel or XPanderPanel. + /// + [Description("The end color of the gradient at the caption on a Panel or XPanderPanel")] + public virtual Color CaptionGradientEnd + { + get { return this.m_captionGradientEnd; } + set + { + if (value.Equals(this.m_captionGradientEnd) == false) + { + this.m_captionGradientEnd = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the middle color of the gradient at the caption on a Panel or XPanderPanel. + /// + [Description("The middle color of the gradient at the caption on a Panel or XPanderPanel.")] + public virtual Color CaptionGradientMiddle + { + get { return this.m_captionGradientMiddle; } + set + { + if (value.Equals(this.m_captionGradientMiddle) == false) + { + this.m_captionGradientMiddle = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the text color at the caption on a Panel or XPanderPanel. + /// + [Description("The text color at the caption on a Panel or XPanderPanel.")] + public virtual Color CaptionText + { + get { return this.m_captionText; } + set + { + if (value.Equals(this.m_captionText) == false) + { + this.m_captionText = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the inner border color of a Panel. + /// + [Description("The inner border color of a Panel.")] + public virtual Color InnerBorderColor + { + get { return this.m_innerBorderColor; } + set + { + if (value.Equals(this.m_innerBorderColor) == false) + { + this.m_innerBorderColor = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + #endregion + + #region MethodsProtected + /// + /// Raises the CustomColors changed event. + /// + /// The source of the event. + /// A EventArgs that contains the event data. + protected virtual void OnCustomColorsChanged(object sender, EventArgs e) + { + if (this.CustomColorsChanged != null) + { + this.CustomColorsChanged(sender, e); + } + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/CustomPanelColors.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/CustomPanelColors.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/CustomPanelColors.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.ComponentModel; + +namespace BSE.Windows.Forms +{ + /// + /// Class for the custom colors at a Panel control. + /// + /// Copyright © 2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class CustomPanelColors : CustomColors + { + #region FieldsPrivate + private Color m_captionSelectedGradientBegin = System.Windows.Forms.ProfessionalColors.ButtonSelectedGradientBegin; + private Color m_captionSelectedGradientEnd = System.Windows.Forms.ProfessionalColors.ButtonSelectedGradientEnd; + private Color m_collapsedCaptionText = SystemColors.ControlText; + private Color m_contentGradientBegin = System.Windows.Forms.ProfessionalColors.ToolStripContentPanelGradientBegin; + private Color m_contentGradientEnd = System.Windows.Forms.ProfessionalColors.ToolStripContentPanelGradientEnd; + #endregion + + #region Properties + /// + /// Gets or sets the starting color of the gradient used when the hover icon in the captionbar on the Panel is selected. + /// + [Description("The starting color of the hover icon in the captionbar on the Panel.")] + public virtual Color CaptionSelectedGradientBegin + { + get { return this.m_captionSelectedGradientBegin; } + set + { + if (value.Equals(this.m_captionSelectedGradientBegin) == false) + { + this.m_captionSelectedGradientBegin = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the end color of the gradient used when the hover icon in the captionbar on the Panel is selected. + /// + [Description("The end color of the hover icon in the captionbar on the Panel.")] + public virtual Color CaptionSelectedGradientEnd + { + get { return this.m_captionSelectedGradientEnd; } + set + { + if (value.Equals(this.m_captionSelectedGradientEnd) == false) + { + this.m_captionSelectedGradientEnd = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the text color of a Panel when it's collapsed. + /// + [Description("The text color of a Panel when it's collapsed.")] + public virtual Color CollapsedCaptionText + { + get { return this.m_collapsedCaptionText; } + set + { + if (value.Equals(this.m_collapsedCaptionText) == false) + { + this.m_collapsedCaptionText = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the starting color of the gradient used in the Panel. + /// + [Description("The starting color of the gradient used in the Panel.")] + public virtual Color ContentGradientBegin + { + get { return this.m_contentGradientBegin; } + set + { + if (value.Equals(this.m_contentGradientBegin) == false) + { + this.m_contentGradientBegin = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the end color of the gradient used in the Panel. + /// + [Description("The end color of the gradient used in the Panel.")] + public virtual Color ContentGradientEnd + { + get { return this.m_contentGradientEnd; } + set + { + if (value.Equals(this.m_contentGradientEnd) == false) + { + this.m_contentGradientEnd = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/CustomXPanderPanelColors.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/CustomXPanderPanelColors.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/CustomXPanderPanelColors.cs @@ -0,0 +1,248 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; +using System.Drawing; + +namespace BSE.Windows.Forms +{ + /// + /// Class for the custom colors at a XPanderPanel control. + /// + /// Copyright © 2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class CustomXPanderPanelColors : CustomColors + { + #region FieldsPrivate + private Color m_backColor = SystemColors.Control; + private Color m_flatCaptionGradientBegin = System.Windows.Forms.ProfessionalColors.ToolStripGradientMiddle; + private Color m_flatCaptionGradientEnd = System.Windows.Forms.ProfessionalColors.ToolStripGradientBegin; + private Color m_captionPressedGradientBegin = System.Windows.Forms.ProfessionalColors.ButtonPressedGradientBegin; + private Color m_captionPressedGradientEnd = System.Windows.Forms.ProfessionalColors.ButtonPressedGradientEnd; + private Color m_captionPressedGradientMiddle = System.Windows.Forms.ProfessionalColors.ButtonPressedGradientMiddle; + private Color m_captionCheckedGradientBegin = System.Windows.Forms.ProfessionalColors.ButtonCheckedGradientBegin; + private Color m_captionCheckedGradientEnd = System.Windows.Forms.ProfessionalColors.ButtonCheckedGradientEnd; + private Color m_captionCheckedGradientMiddle = System.Windows.Forms.ProfessionalColors.ButtonCheckedGradientMiddle; + private Color m_captionSelectedGradientBegin = System.Windows.Forms.ProfessionalColors.ButtonSelectedGradientBegin; + private Color m_captionSelectedGradientEnd = System.Windows.Forms.ProfessionalColors.ButtonSelectedGradientEnd; + private Color m_captionSelectedGradientMiddle = System.Windows.Forms.ProfessionalColors.ButtonSelectedGradientMiddle; + private Color m_captionSelectedText = SystemColors.ControlText; + #endregion + + #region Properties + /// + /// Gets or sets the backcolor of a XPanderPanel. + /// + [Description("The backcolor of a XPanderPanel.")] + public virtual Color BackColor + { + get { return this.m_backColor; } + set + { + if (value.Equals(this.m_backColor) == false) + { + this.m_backColor = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the starting color of the gradient on a flat XPanderPanel captionbar. + /// + [Description("The starting color of the gradient on a flat XPanderPanel captionbar.")] + public virtual Color FlatCaptionGradientBegin + { + get { return this.m_flatCaptionGradientBegin; } + set + { + if (value.Equals(this.m_flatCaptionGradientBegin) == false) + { + this.m_flatCaptionGradientBegin = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the end color of the gradient on a flat XPanderPanel captionbar. + /// + [Description("The end color of the gradient on a flat XPanderPanel captionbar.")] + public virtual Color FlatCaptionGradientEnd + { + get { return this.m_flatCaptionGradientEnd; } + set + { + if (value.Equals(this.m_flatCaptionGradientEnd) == false) + { + this.m_flatCaptionGradientEnd = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the starting color of the gradient used when the XPanderPanel is pressed down. + /// + [Description("The starting color of the gradient used when the XPanderPanel is pressed down.")] + public virtual Color CaptionPressedGradientBegin + { + get { return this.m_captionPressedGradientBegin; } + set + { + if (value.Equals(this.m_captionPressedGradientBegin) == false) + { + this.m_captionPressedGradientBegin = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the end color of the gradient used when the XPanderPanel is pressed down. + /// + [Description("The end color of the gradient used when the XPanderPanel is pressed down.")] + public virtual Color CaptionPressedGradientEnd + { + get { return this.m_captionPressedGradientEnd; } + set + { + if (value.Equals(this.m_captionPressedGradientEnd) == false) + { + this.m_captionPressedGradientEnd = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the middle color of the gradient used when the XPanderPanel is pressed down. + /// + [Description("The middle color of the gradient used when the XPanderPanel is pressed down.")] + public virtual Color CaptionPressedGradientMiddle + { + get { return this.m_captionPressedGradientMiddle; } + set + { + if (value.Equals(this.m_captionPressedGradientMiddle) == false) + { + this.m_captionPressedGradientMiddle = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the starting color of the gradient used when the XPanderPanel is checked. + /// + [Description("The starting color of the gradient used when the XPanderPanel is checked.")] + public virtual Color CaptionCheckedGradientBegin + { + get { return this.m_captionCheckedGradientBegin; } + set + { + if (value.Equals(this.m_captionCheckedGradientBegin) == false) + { + this.m_captionCheckedGradientBegin = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the end color of the gradient used when the XPanderPanel is checked. + /// + [Description("The end color of the gradient used when the XPanderPanel is checked.")] + public virtual Color CaptionCheckedGradientEnd + { + get { return this.m_captionCheckedGradientEnd; } + set + { + if (value.Equals(this.m_captionCheckedGradientEnd) == false) + { + this.m_captionCheckedGradientEnd = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the middle color of the gradient used when the XPanderPanel is checked. + /// + [Description("The middle color of the gradient used when the XPanderPanel is checked.")] + public virtual Color CaptionCheckedGradientMiddle + { + get { return this.m_captionCheckedGradientMiddle; } + set + { + if (value.Equals(this.m_captionCheckedGradientMiddle) == false) + { + this.m_captionCheckedGradientMiddle = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the starting color of the gradient used when the XPanderPanel is selected. + /// + [Description("The starting color of the gradient used when the XPanderPanel is selected.")] + public virtual Color CaptionSelectedGradientBegin + { + get { return this.m_captionSelectedGradientBegin; } + set + { + if (value.Equals(this.m_captionSelectedGradientBegin) == false) + { + this.m_captionSelectedGradientBegin = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the end color of the gradient used when the XPanderPanel is selected. + /// + [Description("The end color of the gradient used when the XPanderPanel is selected.")] + public virtual Color CaptionSelectedGradientEnd + { + get { return this.m_captionSelectedGradientEnd; } + set + { + if (value.Equals(this.m_captionSelectedGradientEnd) == false) + { + this.m_captionSelectedGradientEnd = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the middle color of the gradient used when the XPanderPanel is selected. + /// + [Description("The middle color of the gradient used when the XPanderPanel is selected.")] + public virtual Color CaptionSelectedGradientMiddle + { + get { return this.m_captionSelectedGradientMiddle; } + set + { + if (value.Equals(this.m_captionSelectedGradientMiddle) == false) + { + this.m_captionSelectedGradientMiddle = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets the text color used when the XPanderPanel is selected. + /// + [Description("The text color used when the XPanderPanel is selected.")] + public virtual Color CaptionSelectedText + { + get { return this.m_captionSelectedText; } + set + { + if (value.Equals(this.m_captionSelectedText) == false) + { + this.m_captionSelectedText = value; + OnCustomColorsChanged(this, EventArgs.Empty); + } + } + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/DisplayInformation.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/DisplayInformation.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/DisplayInformation.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Win32; +using System.Runtime.InteropServices; +using System.Windows.Forms; +using System.Windows.Forms.VisualStyles; +using System.IO; +using System.Text.RegularExpressions; + +namespace BSE.Windows.Forms +{ + static class DisplayInformation + { + #region FieldsPrivate + + [ThreadStatic] + private static bool m_bIsThemed; + private const string m_strRegExpression = @".*\.msstyles$"; + + #endregion + + #region Properties + + internal static bool IsThemed + { + get { return m_bIsThemed; } + } + #endregion + + #region MethodsPrivate + + static DisplayInformation() + { + SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(DisplayInformation.OnUserPreferenceChanged); + DisplayInformation.SetScheme(); + } + + private static void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) + { + DisplayInformation.SetScheme(); + } + + private static void SetScheme() + { + if (VisualStyleRenderer.IsSupported) + { + if (!VisualStyleInformation.IsEnabledByUser) + { + return; + } + StringBuilder stringBuilder = new StringBuilder(0x200); + int iResult = NativeMethods.GetCurrentThemeName(stringBuilder, stringBuilder.Capacity, null, 0, null, 0); + if (iResult == 0) + { + Regex regex = new Regex(m_strRegExpression); + m_bIsThemed = regex.IsMatch(Path.GetFileName(stringBuilder.ToString())); + } + } + } + #endregion + + static class NativeMethods + { + [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)] + public static extern int GetCurrentThemeName(StringBuilder pszThemeFileName, int dwMaxNameChars, StringBuilder pszColorBuff, int dwMaxColorChars, StringBuilder pszSizeBuff, int cchMaxSizeChars); + } + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/HoverState.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/HoverState.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/HoverState.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BSE.Windows.Forms +{ + /// + /// Specifies constants that define the hoverstate at the captionbar or a part of it on a Panel or XPanderPanel. + /// + /// Copyright 2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public enum HoverState + { + /// + /// The hoverstate in its normal state (none of the other states apply). + /// + None, + /// + /// The hoverstate over which a mouse pointer is resting. + /// + Hover + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/HoverStateChangeEventArgs.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/HoverStateChangeEventArgs.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/HoverStateChangeEventArgs.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BSE.Windows.Forms +{ + /// + /// Provides data for the HoverStateChange event. + /// + /// Copyright © 2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class HoverStateChangeEventArgs : EventArgs + { + #region FieldsPrivate + private HoverState m_hoverState; + #endregion + + #region Properties + /// + /// Gets the HoverState. + /// + public HoverState HoverState + { + get { return this.m_hoverState; } + } + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the HoverStateChangeEventArgs class. + /// + /// The values. + public HoverStateChangeEventArgs(HoverState hoverState) + { + this.m_hoverState = hoverState; + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/IPanel.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/IPanel.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/IPanel.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; + +namespace BSE.Windows.Forms +{ + /// + /// Used to group collections of controls. + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public interface IPanel + { + /// + /// Gets or sets the style of the panel. + /// + BSE.Windows.Forms.PanelStyle PanelStyle + { + get; + set; + } + /// + /// Gets or sets the color schema which is used for the panel. + /// + BSE.Windows.Forms.ColorScheme ColorScheme + { + get; + set; + } + /// + /// Gets or sets a value indicating whether the control shows a border + /// + bool ShowBorder + { + get; + set; + } + /// + /// Gets or sets a value indicating whether the expand icon in the caption bar is visible. + /// + bool ShowExpandIcon + { + get; + set; + } + /// + /// Gets or sets a value indicating whether the close icon in the caption bar is visible. + /// + bool ShowCloseIcon + { + get; + set; + } + /// + /// Expands the panel or xpanderpanel. + /// + bool Expand + { + get; + set; + } + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/Panel.Designer.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/Panel.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/Panel.Designer.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BSE.Windows.Forms +{ + partial class Panel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.Size = new System.Drawing.Size(200, 100); + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/Panel.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/Panel.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/Panel.cs @@ -0,0 +1,1091 @@ +using System; +using System.Collections; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Data; +using System.Windows.Forms; +using System.Windows.Forms.Design; +using Demo.WindowsForms.Properties; +using System.Diagnostics; + +namespace BSE.Windows.Forms +{ + #region Class Panel + /// + /// Used to group collections of controls. + /// + /// The Panel is a control that contains other controls. + /// You can use a Panel to group collections of controls such as the XPanderPanelList control. + /// On top of the Panel there is the captionbar. This captionbar may contain an image and text. + /// According to it's dockstyle and properties the panel is collapsable and/or closable. + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + [Designer(typeof(PanelDesigner)), + DesignTimeVisibleAttribute(true)] + [DefaultEvent("CloseClick")] + [ToolboxBitmap(typeof(System.Windows.Forms.Panel))] + public partial class Panel : BasePanel + { + #region FieldsPrivate + + private Rectangle m_restoreBounds; + private bool m_bShowTransparentBackground; + private bool m_bShowXPanderPanelProfessionalStyle; + private bool m_bShowCaptionbar; + private LinearGradientMode m_linearGradientMode; + private Image m_imageClosePanel; + private CustomPanelColors m_customColors; + private Image m_imgHoverBackground; + private System.Windows.Forms.Splitter m_associatedSplitter; + + #endregion + + #region Properties + /// + /// Gets or sets the associated Splitter. If there is a splitter associated to a panel, + /// the splitter visibility always changes when the visibilty of this panel changes. + /// + /// The associated + [Description("The associated Splitter.")] + [Category("Behavior")] + public virtual System.Windows.Forms.Splitter AssociatedSplitter + { + get + { + return this.m_associatedSplitter; + } + set + { + this.m_associatedSplitter = value; + } + } + /// + /// Gets the custom colors which are used for the panel. + /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + [Description("The custom colors which are used for the panel.")] + [Category("Appearance")] + public CustomPanelColors CustomColors + { + get + { + return this.m_customColors; + } + } + /// + /// Expands the panel. + /// + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public override bool Expand + { + get + { + return base.Expand; + } + set + { + base.Expand = value; + } + } + /// + /// LinearGradientMode of the panels background + /// + [Description("LinearGradientMode of the Panels background"), + DefaultValue(1), + Category("Appearance")] + public LinearGradientMode LinearGradientMode + { + get + { + return this.m_linearGradientMode; + } + set + { + if(value.Equals(this.m_linearGradientMode) == false) + { + this.m_linearGradientMode = value; + this.Invalidate(false); + } + } + } + /// + /// Gets or sets a value indicating whether the panels captionbar is displayed. + /// + /// + /// + /// private void btnShowHideCaptionbar_Click(object sender, EventArgs e) + /// { + /// //displaye or hides the captionbar at the top of the panel + /// panel6.ShowCaptionbar = !panel6.ShowCaptionbar; + /// } + /// + /// + [Description("A value indicating whether the panels captionbar is displayed.")] + [DefaultValue(true)] + [Category("Behavior")] + public bool ShowCaptionbar + { + get + { + return this.m_bShowCaptionbar; + } + set + { + if(value.Equals(this.m_bShowCaptionbar) == false) + { + this.m_bShowCaptionbar = value; + this.Invalidate(true); + } + } + } + /// + /// Gets or sets a value indicating whether the controls background is transparent. + /// + [Description("Gets or sets a value indicating whether the controls background is transparent")] + [DefaultValue(true)] + [Category("Behavior")] + public bool ShowTransparentBackground + { + get + { + return this.m_bShowTransparentBackground; + } + set + { + if(value.Equals(this.m_bShowTransparentBackground) == false) + { + this.m_bShowTransparentBackground = value; + this.Invalidate(false); + } + } + } + /// + /// Gets or sets a value indicating whether the controls caption professional colorscheme is the same then the XPanderPanels + /// + [Description("Gets or sets a value indicating whether the controls caption professional colorscheme is the same then the XPanderPanels")] + [DefaultValue(false)] + [Category("Behavior")] + public bool ShowXPanderPanelProfessionalStyle + { + get + { + return this.m_bShowXPanderPanelProfessionalStyle; + } + set + { + if(value.Equals(this.m_bShowXPanderPanelProfessionalStyle) == false) + { + this.m_bShowXPanderPanelProfessionalStyle = value; + this.Invalidate(false); + } + } + } + /// + /// Gets the size and location of the panel in it's normal expanded state. + /// + /// + /// A Rect that specifies the size and location of a panel before being either collapsed + /// + [Browsable(false)] + public Rectangle RestoreBounds + { + get + { + return this.m_restoreBounds; + } + } + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the Panel class. + /// + public Panel() + { + InitializeComponent(); + + this.CaptionFont = new Font(SystemFonts.CaptionFont.FontFamily, SystemFonts.CaptionFont.SizeInPoints + 2.75F, FontStyle.Bold); + this.BackColor = Color.Transparent; + this.ForeColor = SystemColors.ControlText; + this.ShowTransparentBackground = true; + this.ShowXPanderPanelProfessionalStyle = false; + this.ColorScheme = ColorScheme.Professional; + this.LinearGradientMode = LinearGradientMode.Vertical; + this.Expand = true; + this.CaptionHeight = 27; + this.ImageSize = new Size(18, 18); + this.m_bShowCaptionbar = true; + this.m_customColors = new CustomPanelColors(); + this.m_customColors.CustomColorsChanged += OnCustomColorsChanged; + } + /// + /// Sets the PanelProperties for the Panel + /// + /// The PanelColors table + public override void SetPanelProperties(PanelColors panelColors) + { + this.m_imgHoverBackground = null; + base.SetPanelProperties(panelColors); + } + /// + /// Gets the rectangle that represents the display area of the Panel. + /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public override Rectangle DisplayRectangle + { + get + { + Padding padding = this.Padding; + Rectangle displayRectangle = new Rectangle( + this.ClientRectangle.Left + padding.Left, + this.ClientRectangle.Top + padding.Top, + this.ClientRectangle.Width - padding.Left - padding.Right, + this.ClientRectangle.Height - padding.Top - padding.Bottom); + + if(this.m_bShowCaptionbar == true) + { + if(this.Controls.Count > 0) + { + XPanderPanelList xpanderPanelList = this.Controls[0] as XPanderPanelList; + if((xpanderPanelList != null) && (xpanderPanelList.Dock == DockStyle.Fill)) + { + displayRectangle = new Rectangle( + padding.Left, + this.CaptionHeight + padding.Top + Constants.BorderThickness, + this.ClientRectangle.Width - padding.Left - padding.Right, + this.ClientRectangle.Height - this.CaptionHeight - padding.Top - padding.Bottom - (2 * Constants.BorderThickness)); + } + else + { + displayRectangle = new Rectangle( + padding.Left + Constants.BorderThickness, + this.CaptionHeight + padding.Top + Constants.BorderThickness, + this.ClientRectangle.Width - padding.Left - padding.Right - (2 * Constants.BorderThickness), + this.ClientRectangle.Height - this.CaptionHeight - padding.Top - padding.Bottom - (2 * Constants.BorderThickness)); + } + } + } + return displayRectangle; + } + } + #endregion + + #region MethodsProtected + /// + /// Raises the ExpandClick event. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + protected override void OnExpandClick(object sender, EventArgs e) + { + this.Expand = !this.Expand; + base.OnExpandClick(sender, e); + } + /// + /// Raises the ExpandIconHoverState changed event. + /// + /// The source of the event. + /// A HoverStateChangeEventArgs that contains the event data. + protected override void OnExpandIconHoverStateChanged(object sender, HoverStateChangeEventArgs e) + { + Invalidate(this.RectangleExpandIcon); + base.OnExpandIconHoverStateChanged(sender, e); + } + /// + /// Raises the CloseIconHoverStat changed event. + /// + /// The source of the event. + /// A HoverStateChangeEventArgs that contains the event data. + protected override void OnCloseIconHoverStateChanged(object sender, HoverStateChangeEventArgs e) + { + Invalidate(this.RectangleCloseIcon); + base.OnCloseIconHoverStateChanged(sender, e); + } + /// + /// Paints the background of the control. + /// + /// A PaintEventArgs that contains information about the control to paint. + protected override void OnPaintBackground(PaintEventArgs pevent) + { + if(this.ShowTransparentBackground == true) + { + base.OnPaintBackground(pevent); + this.BackColor = Color.Transparent; + } + else + { + Rectangle rectangleBounds = this.ClientRectangle; + if(this.m_bShowCaptionbar == true) + { + this.BackColor = Color.Transparent; + rectangleBounds = new Rectangle( + this.ClientRectangle.Left, + this.ClientRectangle.Top + this.CaptionHeight, + this.ClientRectangle.Width, + this.ClientRectangle.Height - this.CaptionHeight); + } + RenderBackgroundGradient( + pevent.Graphics, + rectangleBounds, + this.PanelColors.PanelContentGradientBegin, + this.PanelColors.PanelContentGradientEnd, + this.LinearGradientMode); + } + } + /// + /// Raises the Paint event. + /// + /// A PaintEventArgs that contains the event data. + protected override void OnPaint(PaintEventArgs e) + { + PanelStyle panelStyle = this.PanelStyle; + if(this.m_bShowCaptionbar == false) + { + return; + } + + using(UseAntiAlias antiAlias = new UseAntiAlias(e.Graphics)) + { + Graphics graphics = e.Graphics; + using(UseClearTypeGridFit clearTypeGridFit = new UseClearTypeGridFit(graphics)) + { + Rectangle captionRectangle = this.CaptionRectangle; + Color colorGradientBegin = this.PanelColors.PanelCaptionGradientBegin; + Color colorGradientEnd = this.PanelColors.PanelCaptionGradientEnd; + Color colorGradientMiddle = this.PanelColors.PanelCaptionGradientMiddle; + Color colorText = this.PanelColors.PanelCaptionText; + bool bShowXPanderPanelProfessionalStyle = this.ShowXPanderPanelProfessionalStyle; + ColorScheme colorSchema = this.ColorScheme; + + if((bShowXPanderPanelProfessionalStyle == true) + && (colorSchema == ColorScheme.Professional) + && (panelStyle != PanelStyle.Office2007)) + { + colorGradientBegin = this.PanelColors.XPanderPanelCaptionGradientBegin; + colorGradientEnd = this.PanelColors.XPanderPanelCaptionGradientEnd; + colorGradientMiddle = this.PanelColors.XPanderPanelCaptionGradientMiddle; + colorText = this.PanelColors.XPanderPanelCaptionText; + } + + Image image = this.Image; + RightToLeft rightToLeft = this.RightToLeft; + Font captionFont = this.CaptionFont; + Rectangle clientRectangle = this.ClientRectangle; + string strText = this.Text; + DockStyle dockStyle = this.Dock; + bool bExpand = this.Expand; + if(this.m_imageClosePanel == null) + { + this.m_imageClosePanel = Resources.closePanel; + } + Color colorCloseIcon = this.PanelColors.PanelCaptionCloseIcon; + if(colorCloseIcon == Color.Empty) + { + colorCloseIcon = colorText; + } + bool bShowExpandIcon = this.ShowExpandIcon; + bool bShowCloseIcon = this.ShowCloseIcon; + + switch(panelStyle) + { + case BSE.Windows.Forms.PanelStyle.Default: + case PanelStyle.Office2007: + DrawStyleDefault(graphics, + captionRectangle, + colorGradientBegin, + colorGradientEnd, + colorGradientMiddle); + break; + } + + DrawBorder( + graphics, + clientRectangle, + captionRectangle, + this.PanelColors.BorderColor, + this.PanelColors.InnerBorderColor); + + if((dockStyle == DockStyle.Fill) || (dockStyle == DockStyle.None) || + ((bShowExpandIcon == false) && (bShowCloseIcon == false))) + { + DrawImagesAndText( + graphics, + captionRectangle, + CaptionSpacing, + this.ImageRectangle, + image, + rightToLeft, + captionFont, + colorText, + strText); + + return; + } + if((bShowExpandIcon == true) || (bShowCloseIcon == true)) + { + Image imageExpandPanel = GetExpandImage(dockStyle, bExpand); + + DrawImagesAndText( + graphics, + dockStyle, + CaptionSpacing, + captionRectangle, + clientRectangle, + this.ImageRectangle, + image, + rightToLeft, + bShowCloseIcon, + this.m_imageClosePanel, + colorCloseIcon, + ref this.RectangleCloseIcon, + bShowExpandIcon, + bExpand, + imageExpandPanel, + colorText, + ref this.RectangleExpandIcon, + captionFont, + colorText, + this.PanelColors.PanelCollapsedCaptionText, + strText); + + if(this.m_imgHoverBackground == null) + { + this.m_imgHoverBackground = GetPanelIconBackground( + graphics, + this.ImageRectangle, + this.PanelColors.PanelCaptionSelectedGradientBegin, + this.PanelColors.PanelCaptionSelectedGradientEnd); + } + if(this.m_imgHoverBackground != null) + { + Rectangle rectangleCloseIcon = this.RectangleCloseIcon; + if(rectangleCloseIcon != Rectangle.Empty) + { + if(this.HoverStateCloseIcon == HoverState.Hover) + { + graphics.DrawImage(this.m_imgHoverBackground, rectangleCloseIcon); + DrawIcon(graphics, this.m_imageClosePanel, rectangleCloseIcon, colorCloseIcon, rectangleCloseIcon.Y); + } + } + Rectangle rectangleExpandIcon = this.RectangleExpandIcon; + if(rectangleExpandIcon != Rectangle.Empty) + { + if(this.HoverStateExpandIcon == HoverState.Hover) + { + graphics.DrawImage(this.m_imgHoverBackground, rectangleExpandIcon); + DrawIcon(graphics, imageExpandPanel, rectangleExpandIcon, colorText, rectangleExpandIcon.Y); + } + } + } + } + } + } + } + /// + /// Raises the PanelCollapsing event. + /// + /// The source of the event. + /// A XPanderStateChangeEventArgs that contains the event data. + protected override void OnPanelCollapsing(object sender, XPanderStateChangeEventArgs e) + { + if((this.Dock == DockStyle.Left) || (this.Dock == DockStyle.Right)) + { + foreach(Control control in this.Controls) + { + control.Hide(); + } + } + + if((this.Dock == DockStyle.Left) || (this.Dock == DockStyle.Right)) + { + if(this.ClientRectangle.Width > this.CaptionHeight) + { + this.m_restoreBounds = this.ClientRectangle; + } + this.Width = this.CaptionHeight; + } + + if((this.Dock == DockStyle.Top) || (this.Dock == DockStyle.Bottom)) + { + if(this.ClientRectangle.Height > this.CaptionHeight) + { + this.m_restoreBounds = this.ClientRectangle; + } + this.Height = this.CaptionHeight; + } + + base.OnPanelCollapsing(sender, e); + } + /// + /// Raises the PanelExpanding event. + /// + /// The source of the event. + /// A XPanderStateChangeEventArgs that contains the event data. + protected override void OnPanelExpanding(object sender, XPanderStateChangeEventArgs e) + { + if((this.Dock == DockStyle.Left) || (this.Dock == DockStyle.Right)) + { + foreach(Control control in this.Controls) + { + control.Show(); + } + + //When ClientRectangle.Width > CaptionHeight the panel size has changed + //otherwise the captionclick event was executed + if(this.ClientRectangle.Width == this.CaptionHeight) + { + this.Width = this.m_restoreBounds.Width; + } + } + if((this.Dock == DockStyle.Top) || (this.Dock == DockStyle.Bottom)) + { + this.Height = this.m_restoreBounds.Height; + } + + base.OnPanelExpanding(sender, e); + } + /// + /// Raises the PanelStyleChanged event + /// + /// The source of the event. + /// A EventArgs that contains the event data. + protected override void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e) + { + OnLayout(new LayoutEventArgs(this, null)); + base.OnPanelStyleChanged(sender, e); + + } + /// + /// Raises the CreateControl method. + /// + protected override void OnCreateControl() + { + this.m_restoreBounds = this.ClientRectangle; + this.MinimumSize = new Size(this.CaptionHeight, this.CaptionHeight); + base.OnCreateControl(); + } + /// + /// Raises the Resize event. + /// + /// An EventArgs that contains the event data. + protected override void OnResize(EventArgs e) + { + if(this.ShowExpandIcon == true) + { + if(this.Expand == false) + { + if((this.Dock == DockStyle.Left) || (this.Dock == DockStyle.Right)) + { + if(this.Width > this.CaptionHeight) + { + this.Expand = true; + } + } + if((this.Dock == DockStyle.Top) || (this.Dock == DockStyle.Bottom)) + { + if(this.Height > this.CaptionHeight) + { + this.Expand = true; + } + } + } + else + { + if((this.Dock == DockStyle.Left) || (this.Dock == DockStyle.Right)) + { + if(this.Width == this.CaptionHeight) + { + this.Expand = false; + } + } + if((this.Dock == DockStyle.Top) || (this.Dock == DockStyle.Bottom)) + { + if(this.Height == this.CaptionHeight) + { + this.Expand = false; + } + } + } + } + base.OnResize(e); + } + /// + /// Raises the VisibleChanged event. + /// + /// An that contains the event data. + protected override void OnVisibleChanged(EventArgs e) + { + System.Windows.Forms.Splitter associatedSplitter = this.AssociatedSplitter; + if(associatedSplitter != null) + { + associatedSplitter.Visible = this.Visible; + } + base.OnVisibleChanged(e); + } + #endregion + + #region MethodsPrivate + /// + /// Gets the background for an panelicon image + /// + /// The Graphics to draw on. + /// + /// + /// + /// + private static Image GetPanelIconBackground(Graphics graphics, Rectangle rectanglePanelIcon, Color backgroundColorBegin, Color backgroundColorEnd) + { + Rectangle rectangle = rectanglePanelIcon; + rectangle.X = 0; + rectangle.Y = 0; + Image image = new Bitmap(rectanglePanelIcon.Width, rectanglePanelIcon.Height, graphics); + using(Graphics imageGraphics = Graphics.FromImage(image)) + { + RenderBackgroundGradient( + imageGraphics, + rectangle, + backgroundColorBegin, + backgroundColorEnd, + LinearGradientMode.Vertical); + } + return image; + } + + private static void DrawStyleDefault(Graphics graphics, + Rectangle captionRectangle, + Color colorGradientBegin, + Color colorGradientEnd, + Color colorGradientMiddle) + { + RenderDoubleBackgroundGradient( + graphics, + captionRectangle, + colorGradientBegin, + colorGradientMiddle, + colorGradientEnd, + LinearGradientMode.Vertical, + true); + } + + private static void DrawBorder( + Graphics graphics, + Rectangle panelRectangle, + Rectangle captionRectangle, + Color borderColor, + Color innerBorderColor) + { + using(Pen borderPen = new Pen(borderColor)) + { + // Draws the innerborder around the captionbar + Rectangle innerBorderRectangle = captionRectangle; + innerBorderRectangle.Width -= Constants.BorderThickness; + innerBorderRectangle.Offset(Constants.BorderThickness, Constants.BorderThickness); + ControlPaint.DrawBorder( + graphics, + innerBorderRectangle, + innerBorderColor, + ButtonBorderStyle.Solid); + + // Draws the outer border around the captionbar + ControlPaint.DrawBorder( + graphics, + panelRectangle, + borderColor, + ButtonBorderStyle.Solid); + + // Draws the line below the captionbar + graphics.DrawLine( + borderPen, + captionRectangle.X, + captionRectangle.Y + captionRectangle.Height, + captionRectangle.Width, + captionRectangle.Y + captionRectangle.Height); + + if(panelRectangle.Height == captionRectangle.Height) + { + return; + } + + // Draws the border lines around the whole panel + Rectangle panelBorderRectangle = panelRectangle; + panelBorderRectangle.Y = captionRectangle.Height; + panelBorderRectangle.Height -= captionRectangle.Height + (int) borderPen.Width; + panelBorderRectangle.Width -= (int) borderPen.Width; + Point[] points = + { + new Point(panelBorderRectangle.X, panelBorderRectangle.Y), + new Point(panelBorderRectangle.X, panelBorderRectangle.Y + panelBorderRectangle.Height), + new Point(panelBorderRectangle.X + panelBorderRectangle.Width ,panelBorderRectangle.Y + panelBorderRectangle.Height), + new Point(panelBorderRectangle.X + panelBorderRectangle.Width ,panelBorderRectangle.Y) + }; + graphics.DrawLines(borderPen, points); + } + } + + private static Image GetExpandImage(DockStyle dockStyle, bool bIsExpanded) + { + Image image = null; + if((dockStyle == DockStyle.Left) && (bIsExpanded == true)) + { + image = Resources.ChevronLeft; + } + else if((dockStyle == DockStyle.Left) && (bIsExpanded == false)) + { + image = Resources.ChevronRight; + } + else if((dockStyle == DockStyle.Right) && (bIsExpanded == true)) + { + image = Resources.ChevronRight; + } + else if((dockStyle == DockStyle.Right) && (bIsExpanded == false)) + { + image = Resources.ChevronLeft; + } + else if((dockStyle == DockStyle.Top) && (bIsExpanded == true)) + { + image = Resources.ChevronUp; + } + else if((dockStyle == DockStyle.Top) && (bIsExpanded == false)) + { + image = Resources.ChevronDown; + } + else if((dockStyle == DockStyle.Bottom) && (bIsExpanded == true)) + { + image = Resources.ChevronDown; + } + else if((dockStyle == DockStyle.Bottom) && (bIsExpanded == false)) + { + image = Resources.ChevronUp; + } + + return image; + } + + #endregion + } + + #endregion + + #region Class PanelDesigner + /// + /// Extends the design mode behavior of a Panel control that supports nested controls. + /// + internal class PanelDesigner : System.Windows.Forms.Design.ParentControlDesigner + { + #region FieldsPrivate + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the PanelDesigner class. + /// + public PanelDesigner() + { + } + /// + /// Initializes the designer with the specified component. + /// + /// + public override void Initialize(System.ComponentModel.IComponent component) + { + base.Initialize(component); + } + /// + /// Gets the design-time action lists supported by the component associated with the designer. + /// + public override DesignerActionListCollection ActionLists + { + get + { + // Create action list collection + DesignerActionListCollection actionLists = new DesignerActionListCollection(); + + // Add custom action list + actionLists.Add(new PanelDesignerActionList(this.Component)); + + // Return to the designer action service + return actionLists; + } + } + + #endregion + + #region MethodsProtected + /// + /// Called when the control that the designer is managing has painted + /// its surface so the designer can paint any additional adornments on + /// top of the control. + /// + /// A PaintEventArgs that provides data for the event. + protected override void OnPaintAdornments(PaintEventArgs e) + { + base.OnPaintAdornments(e); + } + + #endregion + } + + #endregion + + #region Class XPanderPanelListDesignerActionList + /// + /// Provides the class for types that define a list of items used to create a smart tag panel for the Panel. + /// + public class PanelDesignerActionList : DesignerActionList + { + #region Properties + /// + /// Gets or sets a value indicating whether the panels captionbar is displayed. + /// + public bool ShowCaptionbar + { + get + { + return this.Panel.ShowCaptionbar; + } + set + { + SetProperty("ShowCaptionbar", value); + } + } + /// + /// Gets or sets a value indicating whether the controls background is transparent. + /// + public bool ShowTransparentBackground + { + get + { + return this.Panel.ShowTransparentBackground; + } + set + { + SetProperty("ShowTransparentBackground", value); + } + } + /// + /// Gets or sets a value indicating whether the controls caption professional colorscheme is the same then the XPanderPanels + /// + public bool ShowXPanderPanelProfessionalStyle + { + get + { + return this.Panel.ShowXPanderPanelProfessionalStyle; + } + set + { + SetProperty("ShowXPanderPanelProfessionalStyle", value); + } + } + /// + /// Gets or sets a value indicating whether the expand icon of the panel is visible + /// + public bool ShowExpandIcon + { + get + { + return this.Panel.ShowExpandIcon; + } + set + { + SetProperty("ShowExpandIcon", value); + } + } + /// + /// Gets or sets a value indicating whether the close icon is visible + /// + public bool ShowCloseIcon + { + get + { + return this.Panel.ShowCloseIcon; + } + set + { + SetProperty("ShowCloseIcon", value); + } + } + /// + /// Gets or sets the style of the panel. + /// + public PanelStyle PanelStyle + { + get + { + return this.Panel.PanelStyle; + } + set + { + SetProperty("PanelStyle", value); + } + } + /// + /// Gets or sets the color schema which is used for the panel. + /// + public ColorScheme ColorScheme + { + get + { + return this.Panel.ColorScheme; + } + set + { + SetProperty("ColorScheme", value); + } + } + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the PanelDesignerActionList class. + /// + /// A component related to the DesignerActionList. + public PanelDesignerActionList(System.ComponentModel.IComponent component) + : base(component) + { + // Automatically display smart tag panel when + // design-time component is dropped onto the + // Windows Forms Designer + base.AutoShow = true; + } + /// + /// Returns the collection of DesignerActionItem objects contained in the list. + /// + /// A DesignerActionItem array that contains the items in this list. + public override DesignerActionItemCollection GetSortedActionItems() + { + // Create list to store designer action items + DesignerActionItemCollection actionItems = new DesignerActionItemCollection(); + + actionItems.Add( + new DesignerActionMethodItem( + this, + "ToggleDockStyle", + GetDockStyleText(), + "Design", + "Dock or undock this control in it's parent container.", + true)); + + actionItems.Add( + new DesignerActionPropertyItem( + "ShowTransparentBackground", + "Show transparent backcolor", + GetCategory(this.Panel, "ShowTransparentBackground"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "ShowXPanderPanelProfessionalStyle", + "Show the XPanderPanels professional colorscheme", + GetCategory(this.Panel, "ShowXPanderPanelProfessionalStyle"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "ShowCaptionbar", + "Show the captionbar on top of the panel", + GetCategory(this.Panel, "ShowCaptionbar"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "ShowExpandIcon", + "Show the expand panel icon (not at DockStyle.None or DockStyle.Fill)", + GetCategory(this.Panel, "ShowExpandIcon"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "ShowCloseIcon", + "Show the close panel icon (not at DockStyle.None or DockStyle.Fill)", + GetCategory(this.Panel, "ShowCloseIcon"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "PanelStyle", + "Select PanelStyle", + GetCategory(this.Panel, "PanelStyle"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "ColorScheme", + "Select ColorScheme", + GetCategory(this.Panel, "ColorScheme"))); + + return actionItems; + } + /// + /// Dock/Undock designer action method implementation + /// + public void ToggleDockStyle() + { + + // Toggle ClockControl's Dock property + if(this.Panel.Dock != DockStyle.Fill) + { + SetProperty("Dock", DockStyle.Fill); + } + else + { + SetProperty("Dock", DockStyle.None); + } + } + + #endregion + + #region MethodsPrivate + + // Helper method that returns an appropriate + // display name for the Dock/Undock property, + // based on the ClockControl's current Dock + // property value + private string GetDockStyleText() + { + if(this.Panel.Dock == DockStyle.Fill) + { + return "Undock in parent container"; + } + else + { + return "Dock in parent container"; + } + } + + private Panel Panel + { + get + { + return (Panel) this.Component; + } + } + + // Helper method to safely set a components property + private void SetProperty(string propertyName, object value) + { + // Get property + System.ComponentModel.PropertyDescriptor property + = System.ComponentModel.TypeDescriptor.GetProperties(this.Panel)[propertyName]; + // Set property value + property.SetValue(this.Panel, value); + } + + // Helper method to return the Category string from a + // CategoryAttribute assigned to a property exposed by + //the specified object + private static string GetCategory(object source, string propertyName) + { + System.Reflection.PropertyInfo property = source.GetType().GetProperty(propertyName); + CategoryAttribute attribute = (CategoryAttribute) property.GetCustomAttributes(typeof(CategoryAttribute), false)[0]; + if(attribute == null) + return null; + return attribute.Category; + } + + #endregion + } + + #endregion +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/Panel.resx b/Demo.WindowsForms/BSE.Windows.Forms/XPander/Panel.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/Panel.resx @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.0.0.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColors.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColors.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColors.cs @@ -0,0 +1,589 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Windows.Forms; +using System.Diagnostics; + +namespace BSE.Windows.Forms +{ + /// + /// Provides structures that are colors of a Panel or XPanderPanel display element. + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class PanelColors + { + #region Enums + /// + /// Gets or sets the KnownColors appearance of the ProfessionalColorTable. + /// + public enum KnownColors + { + /// + /// The border color of the panel. + /// + BorderColor, + /// + /// The forecolor of a close icon in a Panel. + /// + PanelCaptionCloseIcon, + /// + /// The forecolor of a expand icon in a Panel. + /// + PanelCaptionExpandIcon, + /// + /// The starting color of the gradient of the Panel. + /// + PanelCaptionGradientBegin, + /// + /// The end color of the gradient of the Panel. + /// + PanelCaptionGradientEnd, + /// + /// The middle color of the gradient of the Panel. + /// + PanelCaptionGradientMiddle, + /// + /// The starting color of the gradient used when the hover icon in the captionbar on the Panel is selected. + /// + PanelCaptionSelectedGradientBegin, + /// + /// The end color of the gradient used when the hover icon in the captionbar on the Panel is selected. + /// + PanelCaptionSelectedGradientEnd, + /// + /// The starting color of the gradient used in the Panel. + /// + PanelContentGradientBegin, + /// + /// The end color of the gradient used in the Panel. + /// + PanelContentGradientEnd, + /// + /// The text color of a Panel. + /// + PanelCaptionText, + /// + /// The text color of a Panel when it's collapsed. + /// + PanelCollapsedCaptionText, + /// + /// The inner border color of a Panel. + /// + InnerBorderColor, + /// + /// The backcolor of a XPanderPanel. + /// + XPanderPanelBackColor, + /// + /// The forecolor of a close icon in a XPanderPanel. + /// + XPanderPanelCaptionCloseIcon, + /// + /// The forecolor of a expand icon in a XPanderPanel. + /// + XPanderPanelCaptionExpandIcon, + /// + /// The text color of a XPanderPanel. + /// + XPanderPanelCaptionText, + /// + /// The starting color of the gradient of the XPanderPanel. + /// + XPanderPanelCaptionGradientBegin, + /// + /// The end color of the gradient of the XPanderPanel. + /// + XPanderPanelCaptionGradientEnd, + /// + /// The middle color of the gradient of the XPanderPanel. + /// + XPanderPanelCaptionGradientMiddle, + /// + /// The starting color of the gradient of a flat XPanderPanel. + /// + XPanderPanelFlatCaptionGradientBegin, + /// + /// The end color of the gradient of a flat XPanderPanel. + /// + XPanderPanelFlatCaptionGradientEnd, + /// + /// The starting color of the gradient used when the XPanderPanel is pressed down. + /// + XPanderPanelPressedCaptionBegin, + /// + /// The end color of the gradient used when the XPanderPanel is pressed down. + /// + XPanderPanelPressedCaptionEnd, + /// + /// The middle color of the gradient used when the XPanderPanel is pressed down. + /// + XPanderPanelPressedCaptionMiddle, + /// + /// The starting color of the gradient used when the XPanderPanel is checked. + /// + XPanderPanelCheckedCaptionBegin, + /// + /// The end color of the gradient used when the XPanderPanel is checked. + /// + XPanderPanelCheckedCaptionEnd, + /// + /// The middle color of the gradient used when the XPanderPanel is checked. + /// + XPanderPanelCheckedCaptionMiddle, + /// + /// The starting color of the gradient used when the XPanderPanel is selected. + /// + XPanderPanelSelectedCaptionBegin, + /// + /// The end color of the gradient used when the XPanderPanel is selected. + /// + XPanderPanelSelectedCaptionEnd, + /// + /// The middle color of the gradient used when the XPanderPanel is selected. + /// + XPanderPanelSelectedCaptionMiddle, + /// + /// The text color used when the XPanderPanel is selected. + /// + XPanderPanelSelectedCaptionText + } + #endregion + + #region FieldsPrivate + + private BasePanel m_basePanel; + private System.Windows.Forms.ProfessionalColorTable m_professionalColorTable; + private Dictionary m_dictionaryRGBTable; + private bool m_bUseSystemColors; + + #endregion + + #region Properties + /// + /// Gets the border color of a Panel or XPanderPanel. + /// + public virtual Color BorderColor + { + get { return this.FromKnownColor(KnownColors.BorderColor); } + } + /// + /// Gets the forecolor of a close icon in a Panel. + /// + public virtual Color PanelCaptionCloseIcon + { + get { return this.FromKnownColor(KnownColors.PanelCaptionCloseIcon); } + } + /// + /// Gets the forecolor of an expand icon in a Panel. + /// + public virtual Color PanelCaptionExpandIcon + { + get { return this.FromKnownColor(KnownColors.PanelCaptionExpandIcon); } + } + /// + /// Gets the starting color of the gradient of the Panel. + /// + public virtual Color PanelCaptionGradientBegin + { + get { return this.FromKnownColor(KnownColors.PanelCaptionGradientBegin); } + } + /// + /// Gets the end color of the gradient of the Panel. + /// + public virtual Color PanelCaptionGradientEnd + { + get { return this.FromKnownColor(KnownColors.PanelCaptionGradientEnd); } + } + /// + /// Gets the middle color of the gradient of the Panel. + /// + public virtual Color PanelCaptionGradientMiddle + { + get { return this.FromKnownColor(KnownColors.PanelCaptionGradientMiddle); } + } + /// + /// Gets the starting color of the gradient used when the hover icon in the captionbar on the Panel is selected. + /// + public virtual Color PanelCaptionSelectedGradientBegin + { + get { return this.FromKnownColor(KnownColors.PanelCaptionSelectedGradientBegin); } + } + /// + /// Gets the end color of the gradient used when the hover icon in the captionbar on the Panel is selected. + /// + public virtual Color PanelCaptionSelectedGradientEnd + { + get { return this.FromKnownColor(KnownColors.PanelCaptionSelectedGradientEnd); } + } + /// + /// Gets the text color of a Panel. + /// + public virtual Color PanelCaptionText + { + get { return this.FromKnownColor(KnownColors.PanelCaptionText); } + } + /// + /// Gets the text color of a Panel when it's collapsed. + /// + public virtual Color PanelCollapsedCaptionText + { + get { return this.FromKnownColor(KnownColors.PanelCollapsedCaptionText); } + } + /// + /// Gets the starting color of the gradient used in the Panel. + /// + public virtual Color PanelContentGradientBegin + { + get { return this.FromKnownColor(KnownColors.PanelContentGradientBegin); } + } + /// + /// Gets the end color of the gradient used in the Panel. + /// + public virtual Color PanelContentGradientEnd + { + get { return this.FromKnownColor(KnownColors.PanelContentGradientEnd); } + } + /// + /// Gets the inner border color of a Panel. + /// + public virtual Color InnerBorderColor + { + get { return this.FromKnownColor(KnownColors.InnerBorderColor); } + } + /// + /// Gets the backcolor of a XPanderPanel. + /// + public virtual Color XPanderPanelBackColor + { + get { return this.FromKnownColor(KnownColors.XPanderPanelBackColor); } + } + /// + /// Gets the forecolor of a close icon in a XPanderPanel. + /// + public virtual Color XPanderPanelCaptionCloseIcon + { + get { return this.FromKnownColor(KnownColors.XPanderPanelCaptionCloseIcon); } + } + /// + /// Gets the forecolor of an expand icon in a XPanderPanel. + /// + public virtual Color XPanderPanelCaptionExpandIcon + { + get { return this.FromKnownColor(KnownColors.XPanderPanelCaptionExpandIcon); } + } + /// + /// Gets the starting color of the gradient of the XPanderPanel. + /// + public virtual Color XPanderPanelCaptionGradientBegin + { + get { return this.FromKnownColor(KnownColors.XPanderPanelCaptionGradientBegin); } + } + /// + /// Gets the end color of the gradient of the XPanderPanel. + /// + public virtual Color XPanderPanelCaptionGradientEnd + { + get { return this.FromKnownColor(KnownColors.XPanderPanelCaptionGradientEnd); } + } + /// + /// Gets the middle color of the gradient on the XPanderPanel captionbar. + /// + public virtual Color XPanderPanelCaptionGradientMiddle + { + get { return this.FromKnownColor(KnownColors.XPanderPanelCaptionGradientMiddle); } + } + /// + /// Gets the text color of a XPanderPanel. + /// + public virtual Color XPanderPanelCaptionText + { + get { return this.FromKnownColor(KnownColors.XPanderPanelCaptionText); } + } + /// + /// Gets the starting color of the gradient on a flat XPanderPanel captionbar. + /// + public virtual Color XPanderPanelFlatCaptionGradientBegin + { + get { return this.FromKnownColor(KnownColors.XPanderPanelFlatCaptionGradientBegin); } + } + /// + /// Gets the end color of the gradient on a flat XPanderPanel captionbar. + /// + public virtual Color XPanderPanelFlatCaptionGradientEnd + { + get { return this.FromKnownColor(KnownColors.XPanderPanelFlatCaptionGradientEnd); } + } + /// + /// Gets the starting color of the gradient used when the XPanderPanel is pressed down. + /// + public virtual Color XPanderPanelPressedCaptionBegin + { + get { return this.FromKnownColor(KnownColors.XPanderPanelPressedCaptionBegin); } + } + /// + /// Gets the end color of the gradient used when the XPanderPanel is pressed down. + /// + public virtual Color XPanderPanelPressedCaptionEnd + { + get { return this.FromKnownColor(KnownColors.XPanderPanelPressedCaptionEnd); } + } + /// + /// Gets the middle color of the gradient used when the XPanderPanel is pressed down. + /// + public virtual Color XPanderPanelPressedCaptionMiddle + { + get { return this.FromKnownColor(KnownColors.XPanderPanelPressedCaptionMiddle); } + } + /// + /// Gets the starting color of the gradient used when the XPanderPanel is checked. + /// + public virtual Color XPanderPanelCheckedCaptionBegin + { + get { return this.FromKnownColor(KnownColors.XPanderPanelCheckedCaptionBegin); } + } + /// + /// Gets the end color of the gradient used when the XPanderPanel is checked. + /// + public virtual Color XPanderPanelCheckedCaptionEnd + { + get { return this.FromKnownColor(KnownColors.XPanderPanelCheckedCaptionEnd); } + } + /// + /// Gets the middle color of the gradient used when the XPanderPanel is checked. + /// + public virtual Color XPanderPanelCheckedCaptionMiddle + { + get { return this.FromKnownColor(KnownColors.XPanderPanelCheckedCaptionMiddle); } + } + /// + /// Gets the starting color of the gradient used when the XPanderPanel is selected. + /// + public virtual Color XPanderPanelSelectedCaptionBegin + { + get { return this.FromKnownColor(KnownColors.XPanderPanelSelectedCaptionBegin); } + } + /// + /// Gets the end color of the gradient used when the XPanderPanel is selected. + /// + public virtual Color XPanderPanelSelectedCaptionEnd + { + get { return this.FromKnownColor(KnownColors.XPanderPanelSelectedCaptionEnd); } + } + /// + /// Gets the middle color of the gradient used when the XPanderPanel is selected. + /// + public virtual Color XPanderPanelSelectedCaptionMiddle + { + get { return this.FromKnownColor(KnownColors.XPanderPanelSelectedCaptionMiddle); } + } + /// + /// Gets the text color used when the XPanderPanel is selected. + /// + public virtual Color XPanderPanelSelectedCaptionText + { + get { return this.FromKnownColor(KnownColors.XPanderPanelSelectedCaptionText); } + } + /// + /// Gets the associated PanelStyle for the XPanderControls + /// + public virtual PanelStyle PanelStyle + { + get { return PanelStyle.Default; } + } + /// + /// Gets or sets a value indicating whether to use System.Drawing.SystemColors rather than colors that match the current visual style. + /// + public bool UseSystemColors + { + get { return this.m_bUseSystemColors; } + set + { + if (value.Equals(this.m_bUseSystemColors) == false) + { + this.m_bUseSystemColors = value; + this.m_professionalColorTable.UseSystemColors = this.m_bUseSystemColors; + Clear(); + } + } + } + /// + /// Gets or sets the panel or xpanderpanel + /// + public BasePanel Panel + { + get { return this.m_basePanel; } + set { this.m_basePanel = value; } + } + internal Color FromKnownColor(KnownColors color) + { + return (Color)this.ColorTable[color]; + } + private Dictionary ColorTable + { + get + { + if (this.m_dictionaryRGBTable == null) + { + this.m_dictionaryRGBTable = new Dictionary(0xd4); + if ((this.m_basePanel != null) && (this.m_basePanel.ColorScheme == ColorScheme.Professional)) + { + if ((this.m_bUseSystemColors == true) || (ToolStripManager.VisualStylesEnabled == false)) + { + InitBaseColors(this.m_dictionaryRGBTable); + } + else + { + InitColors(this.m_dictionaryRGBTable); + } + } + else + { + InitCustomColors(this.m_dictionaryRGBTable); + } + } + return this.m_dictionaryRGBTable; + } + } + + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the PanelColors class. + /// + public PanelColors() + { + this.m_professionalColorTable = new System.Windows.Forms.ProfessionalColorTable(); + } + /// + /// Initialize a new instance of the PanelColors class. + /// + /// Base class for the panel or xpanderpanel control. + public PanelColors(BasePanel basePanel) : this() + { + this.m_basePanel = basePanel; + } + /// + /// Clears the current color table + /// + public void Clear() + { + ResetRGBTable(); + } + #endregion + + #region MethodsProtected + /// + /// Initialize a color Dictionary with defined colors + /// + /// Dictionary with defined colors + protected virtual void InitColors(Dictionary rgbTable) + { + InitBaseColors(rgbTable); + } + #endregion + + #region MethodsPrivate + + private void InitBaseColors(Dictionary rgbTable) + { + rgbTable[KnownColors.BorderColor] = this.m_professionalColorTable.GripDark; + rgbTable[KnownColors.InnerBorderColor] = this.m_professionalColorTable.GripLight; + rgbTable[KnownColors.PanelCaptionCloseIcon] = SystemColors.ControlText; + rgbTable[KnownColors.PanelCaptionExpandIcon] = SystemColors.ControlText; + rgbTable[KnownColors.PanelCaptionGradientBegin] = this.m_professionalColorTable.ToolStripGradientBegin; + rgbTable[KnownColors.PanelCaptionGradientEnd] = this.m_professionalColorTable.ToolStripGradientEnd; + rgbTable[KnownColors.PanelCaptionGradientMiddle] = this.m_professionalColorTable.ToolStripGradientMiddle; + rgbTable[KnownColors.PanelCaptionSelectedGradientBegin] = this.m_professionalColorTable.ButtonSelectedGradientBegin; + rgbTable[KnownColors.PanelCaptionSelectedGradientEnd] = this.m_professionalColorTable.ButtonSelectedGradientEnd; + rgbTable[KnownColors.PanelContentGradientBegin] = this.m_professionalColorTable.ToolStripContentPanelGradientBegin; + rgbTable[KnownColors.PanelContentGradientEnd] = this.m_professionalColorTable.ToolStripContentPanelGradientEnd; + rgbTable[KnownColors.PanelCaptionText] = SystemColors.ControlText; + rgbTable[KnownColors.PanelCollapsedCaptionText] = SystemColors.ControlText; + rgbTable[KnownColors.XPanderPanelBackColor] = this.m_professionalColorTable.ToolStripContentPanelGradientBegin; + rgbTable[KnownColors.XPanderPanelCaptionCloseIcon] = SystemColors.ControlText; + rgbTable[KnownColors.XPanderPanelCaptionExpandIcon] = SystemColors.ControlText; + rgbTable[KnownColors.XPanderPanelCaptionText] = SystemColors.ControlText; + rgbTable[KnownColors.XPanderPanelCaptionGradientBegin] = this.m_professionalColorTable.ToolStripGradientBegin; + rgbTable[KnownColors.XPanderPanelCaptionGradientEnd] = this.m_professionalColorTable.ToolStripGradientEnd; + rgbTable[KnownColors.XPanderPanelCaptionGradientMiddle] = this.m_professionalColorTable.ToolStripGradientMiddle; + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientBegin] = this.m_professionalColorTable.ToolStripGradientMiddle; + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientEnd] = this.m_professionalColorTable.ToolStripGradientBegin; + rgbTable[KnownColors.XPanderPanelPressedCaptionBegin] = this.m_professionalColorTable.ButtonPressedGradientBegin; + rgbTable[KnownColors.XPanderPanelPressedCaptionEnd] = this.m_professionalColorTable.ButtonPressedGradientEnd; + rgbTable[KnownColors.XPanderPanelPressedCaptionMiddle] = this.m_professionalColorTable.ButtonPressedGradientMiddle; + rgbTable[KnownColors.XPanderPanelCheckedCaptionBegin] = this.m_professionalColorTable.ButtonCheckedGradientBegin; + rgbTable[KnownColors.XPanderPanelCheckedCaptionEnd] = this.m_professionalColorTable.ButtonCheckedGradientEnd; + rgbTable[KnownColors.XPanderPanelCheckedCaptionMiddle] = this.m_professionalColorTable.ButtonCheckedGradientMiddle; + rgbTable[KnownColors.XPanderPanelSelectedCaptionBegin] = this.m_professionalColorTable.ButtonSelectedGradientBegin; + rgbTable[KnownColors.XPanderPanelSelectedCaptionEnd] = this.m_professionalColorTable.ButtonSelectedGradientEnd; + rgbTable[KnownColors.XPanderPanelSelectedCaptionMiddle] = this.m_professionalColorTable.ButtonSelectedGradientMiddle; + rgbTable[KnownColors.XPanderPanelSelectedCaptionText] = SystemColors.ControlText; + } + + private void InitCustomColors(Dictionary rgbTable) + { + Panel panel = this.m_basePanel as Panel; + if (panel != null) + { + rgbTable[KnownColors.BorderColor] = panel.CustomColors.BorderColor; + rgbTable[KnownColors.InnerBorderColor] = panel.CustomColors.InnerBorderColor; + rgbTable[KnownColors.PanelCaptionCloseIcon] = panel.CustomColors.CaptionCloseIcon; + rgbTable[KnownColors.PanelCaptionExpandIcon] = panel.CustomColors.CaptionExpandIcon; + rgbTable[KnownColors.PanelCaptionGradientBegin] = panel.CustomColors.CaptionGradientBegin; + rgbTable[KnownColors.PanelCaptionGradientEnd] = panel.CustomColors.CaptionGradientEnd; + rgbTable[KnownColors.PanelCaptionGradientMiddle] = panel.CustomColors.CaptionGradientMiddle; + rgbTable[KnownColors.PanelCaptionSelectedGradientBegin] = panel.CustomColors.CaptionSelectedGradientBegin; + rgbTable[KnownColors.PanelCaptionSelectedGradientEnd] = panel.CustomColors.CaptionSelectedGradientEnd; + rgbTable[KnownColors.PanelContentGradientBegin] = panel.CustomColors.ContentGradientBegin; + rgbTable[KnownColors.PanelContentGradientEnd] = panel.CustomColors.ContentGradientEnd; + rgbTable[KnownColors.PanelCaptionText] = panel.CustomColors.CaptionText; + rgbTable[KnownColors.PanelCollapsedCaptionText] = panel.CustomColors.CollapsedCaptionText; + } + + XPanderPanel xpanderPanel = this.m_basePanel as XPanderPanel; + if (xpanderPanel != null) + { + rgbTable[KnownColors.BorderColor] = xpanderPanel.CustomColors.BorderColor; + rgbTable[KnownColors.InnerBorderColor] = xpanderPanel.CustomColors.InnerBorderColor; + rgbTable[KnownColors.XPanderPanelBackColor] = xpanderPanel.CustomColors.BackColor; + rgbTable[KnownColors.XPanderPanelCaptionCloseIcon] = xpanderPanel.CustomColors.CaptionCloseIcon; + rgbTable[KnownColors.XPanderPanelCaptionExpandIcon] = xpanderPanel.CustomColors.CaptionExpandIcon; + rgbTable[KnownColors.XPanderPanelCaptionText] = xpanderPanel.CustomColors.CaptionText; + rgbTable[KnownColors.XPanderPanelCaptionGradientBegin] = xpanderPanel.CustomColors.CaptionGradientBegin; + rgbTable[KnownColors.XPanderPanelCaptionGradientEnd] = xpanderPanel.CustomColors.CaptionGradientEnd; + rgbTable[KnownColors.XPanderPanelCaptionGradientMiddle] = xpanderPanel.CustomColors.CaptionGradientMiddle; + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientBegin] = xpanderPanel.CustomColors.FlatCaptionGradientBegin; + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientEnd] = xpanderPanel.CustomColors.FlatCaptionGradientEnd; + rgbTable[KnownColors.XPanderPanelPressedCaptionBegin] = xpanderPanel.CustomColors.CaptionPressedGradientBegin; + rgbTable[KnownColors.XPanderPanelPressedCaptionEnd] = xpanderPanel.CustomColors.CaptionPressedGradientEnd; + rgbTable[KnownColors.XPanderPanelPressedCaptionMiddle] = xpanderPanel.CustomColors.CaptionPressedGradientMiddle; + rgbTable[KnownColors.XPanderPanelCheckedCaptionBegin] = xpanderPanel.CustomColors.CaptionCheckedGradientBegin; + rgbTable[KnownColors.XPanderPanelCheckedCaptionEnd] = xpanderPanel.CustomColors.CaptionCheckedGradientEnd; + rgbTable[KnownColors.XPanderPanelCheckedCaptionMiddle] = xpanderPanel.CustomColors.CaptionCheckedGradientMiddle; + rgbTable[KnownColors.XPanderPanelSelectedCaptionBegin] = xpanderPanel.CustomColors.CaptionSelectedGradientBegin; + rgbTable[KnownColors.XPanderPanelSelectedCaptionEnd] = xpanderPanel.CustomColors.CaptionSelectedGradientEnd; + rgbTable[KnownColors.XPanderPanelSelectedCaptionMiddle] = xpanderPanel.CustomColors.CaptionSelectedGradientMiddle; + rgbTable[KnownColors.XPanderPanelSelectedCaptionText] = xpanderPanel.CustomColors.CaptionSelectedText; + } + } + + private void ResetRGBTable() + { + if (this.m_dictionaryRGBTable != null) + { + this.m_dictionaryRGBTable.Clear(); + } + this.m_dictionaryRGBTable = null; + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsBlack.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsBlack.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsBlack.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + /// + /// Provide black theme colors for a Panel or XPanderPanel display element. + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class PanelColorsBlack : PanelColorsBse + { + #region FieldsPrivate + #endregion + + #region Properties + #endregion + + #region MethodsPublic + /// + /// Initialize a new instance of the PanelColorsBlack class. + /// + public PanelColorsBlack() + : base() + { + } + /// + /// Initialize a new instance of the PanelColorsBlack class. + /// + /// Base class for the panel or xpanderpanel control. + public PanelColorsBlack(BasePanel basePanel) + : base(basePanel) + { + } + + #endregion + + #region MethodsProtected + /// + /// Initialize a color Dictionary with defined colors + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + base.InitColors(rgbTable); + rgbTable[KnownColors.BorderColor] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.PanelCaptionCloseIcon] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.PanelCaptionExpandIcon] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.PanelCaptionGradientBegin] = Color.FromArgb(122, 122, 122); + rgbTable[KnownColors.PanelCaptionGradientEnd] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.PanelCaptionGradientMiddle] = Color.FromArgb(80, 80, 80); + rgbTable[KnownColors.PanelContentGradientBegin] = Color.FromArgb(240, 241, 242); + rgbTable[KnownColors.PanelContentGradientEnd] = Color.FromArgb(240, 241, 242); + rgbTable[KnownColors.PanelCaptionText] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.PanelCollapsedCaptionText] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.InnerBorderColor] = Color.FromArgb(185, 185, 185); + rgbTable[KnownColors.XPanderPanelBackColor] = Color.FromArgb(240, 241, 242); + rgbTable[KnownColors.XPanderPanelCaptionCloseIcon] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.XPanderPanelCaptionExpandIcon] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.XPanderPanelCaptionText] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.XPanderPanelCaptionGradientBegin] = Color.FromArgb(155, 155, 155); + rgbTable[KnownColors.XPanderPanelCaptionGradientEnd] = Color.FromArgb(47, 47, 47); + rgbTable[KnownColors.XPanderPanelCaptionGradientMiddle] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientBegin] = Color.FromArgb(90, 90, 90); + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientEnd] = Color.FromArgb(155, 155, 155); + } + + #endregion + + #region MethodsPrivate + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsBlue.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsBlue.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsBlue.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + /// + /// Provide black theme colors for a Panel or XPanderPanel display element. + /// + /// Copyright 2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class PanelColorsBlue : PanelColorsBse + { + #region FieldsPrivate + #endregion + + #region Properties + #endregion + + #region MethodsPublic + /// + /// Initialize a new instance of the PanelColorsBlack class. + /// + public PanelColorsBlue() + : base() + { + } + /// + /// Initialize a new instance of the PanelColorsBlack class. + /// + /// Base class for the panel or xpanderpanel control. + public PanelColorsBlue(BasePanel basePanel) + : base(basePanel) + { + } + + #endregion + + #region MethodsProtected + /// + /// Initialize a color Dictionary with defined colors + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + base.InitColors(rgbTable); + rgbTable[KnownColors.BorderColor] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.PanelCaptionCloseIcon] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.PanelCaptionExpandIcon] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.PanelCaptionGradientBegin] = Color.FromArgb(128, 128, 255); + rgbTable[KnownColors.PanelCaptionGradientEnd] = Color.FromArgb(0, 0, 128); + rgbTable[KnownColors.PanelCaptionGradientMiddle] = Color.FromArgb(0, 0, 139); + rgbTable[KnownColors.PanelContentGradientBegin] = Color.FromArgb(240, 241, 242); + rgbTable[KnownColors.PanelContentGradientEnd] = Color.FromArgb(240, 241, 242); + rgbTable[KnownColors.PanelCaptionText] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.PanelCollapsedCaptionText] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.InnerBorderColor] = Color.FromArgb(185, 185, 185); + rgbTable[KnownColors.XPanderPanelBackColor] = Color.FromArgb(240, 241, 242); + rgbTable[KnownColors.XPanderPanelCaptionCloseIcon] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.XPanderPanelCaptionExpandIcon] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.XPanderPanelCaptionText] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.XPanderPanelCaptionGradientBegin] = Color.FromArgb(128, 128, 255); + rgbTable[KnownColors.XPanderPanelCaptionGradientEnd] = Color.FromArgb(98, 98, 205); + rgbTable[KnownColors.XPanderPanelCaptionGradientMiddle] = Color.FromArgb(0, 0, 139); + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientBegin] = Color.FromArgb(111, 145, 255); + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientEnd] = Color.FromArgb(188, 205, 254); + } + + #endregion + + #region MethodsPrivate + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsBse.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsBse.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsBse.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; + +namespace BSE.Windows.Forms +{ + /// + /// Baseclass for a bse styled colortable. + /// + /// Copyright © 2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class PanelColorsBse : PanelColors + { + #region Properties + /// + /// Gets the associated PanelStyle for the XPanderControls + /// + public override PanelStyle PanelStyle + { + get { return PanelStyle.Office2007; } + } + #endregion + + #region MethodsPublic + /// + /// Initialize a new instance of the PanelColorsBse class. + /// + public PanelColorsBse() + : base() + { + } + /// + /// Initialize a new instance of the PanelColorsBse class. + /// + /// Base class for the panel or xpanderpanel control. + public PanelColorsBse(BasePanel basePanel) + : base(basePanel) + { + } + #endregion + + #region MethodsProtected + /// + /// Initialize a color Dictionary with defined Bse colors + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + base.InitColors(rgbTable); + rgbTable[KnownColors.PanelCaptionSelectedGradientBegin] = Color.FromArgb(156, 163, 254); + rgbTable[KnownColors.PanelCaptionSelectedGradientEnd] = Color.FromArgb(90, 98, 254); + rgbTable[KnownColors.XPanderPanelCheckedCaptionBegin] = Color.FromArgb(136, 144, 254); + rgbTable[KnownColors.XPanderPanelCheckedCaptionEnd] = Color.FromArgb(111, 145, 255); + rgbTable[KnownColors.XPanderPanelCheckedCaptionMiddle] = Color.FromArgb(42, 52, 254); + rgbTable[KnownColors.XPanderPanelPressedCaptionBegin] = Color.FromArgb(106, 109, 228); + rgbTable[KnownColors.XPanderPanelPressedCaptionEnd] = Color.FromArgb(88, 111, 226); + rgbTable[KnownColors.XPanderPanelPressedCaptionMiddle] = Color.FromArgb(39, 39, 217); + rgbTable[KnownColors.XPanderPanelSelectedCaptionBegin] = Color.FromArgb(156, 163, 254); + rgbTable[KnownColors.XPanderPanelSelectedCaptionEnd] = Color.FromArgb(139, 164, 255); + rgbTable[KnownColors.XPanderPanelSelectedCaptionMiddle] = Color.FromArgb(90, 98, 254); + rgbTable[KnownColors.XPanderPanelSelectedCaptionText] = Color.White; + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; + +namespace BSE.Windows.Forms +{ + /// + /// Baseclass for a office2007 styled colortable. + /// + /// Copyright © 2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class PanelColorsOffice : PanelColors + { + #region Properties + /// + /// Gets the associated PanelStyle for the XPanderControls + /// + public override PanelStyle PanelStyle + { + get { return PanelStyle.Office2007; } + } + #endregion + + #region MethodsPublic + /// + /// Initialize a new instance of the PanelColorsOffice class. + /// + public PanelColorsOffice() + : base() + { + } + /// + /// Initialize a new instance of the PanelColorsOffice class. + /// + /// Base class for the panel or xpanderpanel control. + public PanelColorsOffice(BasePanel basePanel) + : base(basePanel) + { + } + #endregion + + #region MethodsProtected + /// + /// Initialize a color Dictionary with defined Office2007 colors + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + base.InitColors(rgbTable); + rgbTable[KnownColors.PanelCaptionSelectedGradientBegin] = Color.FromArgb(255, 255, 220); + rgbTable[KnownColors.PanelCaptionSelectedGradientEnd] = Color.FromArgb(247, 193, 94); + rgbTable[KnownColors.XPanderPanelCheckedCaptionBegin] = Color.FromArgb(255, 217, 170); + rgbTable[KnownColors.XPanderPanelCheckedCaptionEnd] = Color.FromArgb(254, 225, 122); + rgbTable[KnownColors.XPanderPanelCheckedCaptionMiddle] = Color.FromArgb(255, 171, 63); + rgbTable[KnownColors.XPanderPanelPressedCaptionBegin] = Color.FromArgb(255, 189, 105); + rgbTable[KnownColors.XPanderPanelPressedCaptionEnd] = Color.FromArgb(254, 211, 100); + rgbTable[KnownColors.XPanderPanelPressedCaptionMiddle] = Color.FromArgb(251, 140, 60); + rgbTable[KnownColors.XPanderPanelSelectedCaptionBegin] = Color.FromArgb(255, 252, 222); + rgbTable[KnownColors.XPanderPanelSelectedCaptionEnd] = Color.FromArgb(255, 230, 158); + rgbTable[KnownColors.XPanderPanelSelectedCaptionMiddle] = Color.FromArgb(255, 215, 103); + rgbTable[KnownColors.XPanderPanelSelectedCaptionText] = Color.Black; + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice2007Black.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice2007Black.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice2007Black.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + /// + /// Provide Office 2007 Black theme colors + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class PanelColorsOffice2007Black : PanelColorsOffice + { + #region MethodsPublic + /// + /// Initialize a new instance of the PanelColorsOffice2007Black class. + /// + public PanelColorsOffice2007Black() + : base() + { + } + /// + /// Initialize a new instance of the PanelColorsOffice2007Black class. + /// + /// Base class for the panel or xpanderpanel control. + public PanelColorsOffice2007Black(BasePanel basePanel) + : base(basePanel) + { + } + + #endregion + + #region MethodsProtected + /// + /// Initialize a color Dictionary with defined colors + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + base.InitColors(rgbTable); + rgbTable[KnownColors.BorderColor] = Color.FromArgb(76, 83, 92); + rgbTable[KnownColors.InnerBorderColor] = Color.White; + rgbTable[KnownColors.PanelCaptionCloseIcon] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.PanelCaptionExpandIcon] = Color.FromArgb(101, 104, 112); + rgbTable[KnownColors.PanelCaptionGradientBegin] = Color.FromArgb(240, 241, 242); + rgbTable[KnownColors.PanelCaptionGradientEnd] = Color.FromArgb(189, 193, 200); + rgbTable[KnownColors.PanelCaptionGradientMiddle] = Color.FromArgb(216, 219, 223); + rgbTable[KnownColors.PanelContentGradientBegin] = Color.FromArgb(240, 241, 242); + rgbTable[KnownColors.PanelContentGradientEnd] = Color.FromArgb(240, 241, 242); + rgbTable[KnownColors.PanelCaptionText] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.PanelCollapsedCaptionText] = Color.FromArgb(0, 0, 0); + rgbTable[KnownColors.XPanderPanelBackColor] = Color.Transparent; + rgbTable[KnownColors.XPanderPanelCaptionCloseIcon] = Color.FromArgb(255, 255, 255); + rgbTable[KnownColors.XPanderPanelCaptionExpandIcon] = Color.FromArgb(101, 104, 112); + rgbTable[KnownColors.XPanderPanelCaptionText] = Color.FromArgb(55, 60, 67); + rgbTable[KnownColors.XPanderPanelCaptionGradientBegin] = Color.FromArgb(248, 248, 249); + rgbTable[KnownColors.XPanderPanelCaptionGradientEnd] = Color.FromArgb(219, 222, 226); + rgbTable[KnownColors.XPanderPanelCaptionGradientMiddle] = Color.FromArgb(200, 204, 209); + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientBegin] = Color.FromArgb(212, 215, 219); + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientEnd] = Color.FromArgb(253, 253, 254); + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice2007Blue.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice2007Blue.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice2007Blue.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + /// + /// Provide Office 2007 Blue Theme colors + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class PanelColorsOffice2007Blue : PanelColorsOffice + { + #region FieldsPrivate + #endregion + + #region Properties + #endregion + + #region MethodsPublic + /// + /// Initialize a new instance of the Office2007Colors class. + /// + public PanelColorsOffice2007Blue() + : base() + { + } + /// + /// Initialize a new instance of the Office2007Colors class. + /// + /// Base class for the panel or xpanderpanel control. + public PanelColorsOffice2007Blue(BasePanel basePanel) + : base(basePanel) + { + } + + #endregion + + #region MethodsProtected + /// + /// Initialize a color Dictionary with defined colors + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + base.InitColors(rgbTable); + rgbTable[KnownColors.BorderColor] = Color.FromArgb(101, 147, 207); + rgbTable[KnownColors.InnerBorderColor] = Color.White; + rgbTable[KnownColors.PanelCaptionCloseIcon] = Color.Black; + rgbTable[KnownColors.PanelCaptionExpandIcon] = Color.FromArgb(21, 66, 139); + rgbTable[KnownColors.PanelCaptionGradientBegin] = Color.FromArgb(227, 239, 255); + rgbTable[KnownColors.PanelCaptionGradientEnd] = Color.FromArgb(173, 209, 255); + rgbTable[KnownColors.PanelCaptionGradientMiddle] = Color.FromArgb(199, 224, 255); + rgbTable[KnownColors.PanelContentGradientBegin] = Color.FromArgb(227, 239, 255); + rgbTable[KnownColors.PanelContentGradientEnd] = Color.FromArgb(227, 239, 255); + rgbTable[KnownColors.PanelCaptionText] = Color.FromArgb(22, 65, 139); + rgbTable[KnownColors.PanelCollapsedCaptionText] = Color.FromArgb(21, 66, 139); + rgbTable[KnownColors.XPanderPanelBackColor] = Color.Transparent; + rgbTable[KnownColors.XPanderPanelCaptionCloseIcon] = Color.Black; + rgbTable[KnownColors.XPanderPanelCaptionExpandIcon] = Color.FromArgb(21, 66, 139); + rgbTable[KnownColors.XPanderPanelCaptionText] = Color.FromArgb(21, 66, 139); + rgbTable[KnownColors.XPanderPanelCaptionGradientBegin] = Color.FromArgb(227, 239, 255); + rgbTable[KnownColors.XPanderPanelCaptionGradientEnd] = Color.FromArgb(199, 224, 255); + rgbTable[KnownColors.XPanderPanelCaptionGradientMiddle] = Color.FromArgb(173, 209, 255); + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientBegin] = Color.FromArgb(214, 232, 255); + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientEnd] = Color.FromArgb(253, 253, 254); + } + + #endregion + + #region MethodsPrivate + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice2007Silver.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice2007Silver.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsOffice2007Silver.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + /// + /// Provide Office 2007 silver theme colors + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class PanelColorsOffice2007Silver : PanelColorsOffice + { + #region MethodsPublic + /// + /// Initialize a new instance of the PanelColorsOffice2007Silver class. + /// + public PanelColorsOffice2007Silver() + : base() + { + } + /// + /// Initialize a new instance of the PanelColorsOffice2007Silver class. + /// + /// Base class for the panel or xpanderpanel control. + public PanelColorsOffice2007Silver(BasePanel basePanel) + : base(basePanel) + { + } + + #endregion + + #region MethodsProtected + /// + /// Initialize a color Dictionary with defined colors + /// + /// Dictionary with defined colors + protected override void InitColors(Dictionary rgbTable) + { + base.InitColors(rgbTable); + rgbTable[KnownColors.BorderColor] = Color.FromArgb(111, 112, 116); + rgbTable[KnownColors.InnerBorderColor] = Color.White; + rgbTable[KnownColors.PanelCaptionCloseIcon] = Color.FromArgb(75, 79, 85); + rgbTable[KnownColors.PanelCaptionExpandIcon] = Color.FromArgb(101, 104, 112); + rgbTable[KnownColors.PanelCaptionGradientBegin] = Color.FromArgb(248, 248, 248); + rgbTable[KnownColors.PanelCaptionGradientEnd] = Color.FromArgb(199, 203, 209); + rgbTable[KnownColors.PanelCaptionGradientMiddle] = Color.FromArgb(218, 219, 231); + rgbTable[KnownColors.PanelContentGradientBegin] = Color.FromArgb(240, 241, 242); + rgbTable[KnownColors.PanelContentGradientEnd] = Color.FromArgb(240, 241, 242); + rgbTable[KnownColors.PanelCaptionText] = Color.FromArgb(21, 66, 139); + rgbTable[KnownColors.PanelCollapsedCaptionText] = Color.FromArgb(21, 66, 139); + rgbTable[KnownColors.XPanderPanelBackColor] = Color.Transparent; + rgbTable[KnownColors.XPanderPanelCaptionCloseIcon] = Color.FromArgb(75, 79, 85); + rgbTable[KnownColors.XPanderPanelCaptionExpandIcon] = Color.FromArgb(101, 104, 112); + rgbTable[KnownColors.XPanderPanelCaptionText] = Color.FromArgb(76, 83, 92); + rgbTable[KnownColors.XPanderPanelCaptionGradientBegin] = Color.FromArgb(235, 238, 250); + rgbTable[KnownColors.XPanderPanelCaptionGradientEnd] = Color.FromArgb(212, 216, 226); + rgbTable[KnownColors.XPanderPanelCaptionGradientMiddle] = Color.FromArgb(197, 199, 209); + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientBegin] = Color.FromArgb(213, 219, 231); + rgbTable[KnownColors.XPanderPanelFlatCaptionGradientEnd] = Color.FromArgb(253, 253, 254); + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsRed.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsRed.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelColorsRed.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Windows.Forms; + +namespace BSE.Windows.Forms +{ + ///// + ///// Provide red theme colors + ///// + ///// + ///// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + ///// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + ///// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + ///// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + ///// REMAINS UNCHANGED. + ///// + ///// Copyright 2006-2008 Uwe Eichkorn + //public class PanelColorsRed : PanelColors + //{ + // #region FieldsPrivate + // #endregion + + // #region Properties + // #endregion + + // #region MethodsPublic + // /// + // /// Initialize a new instance of the PanelColorsRed class. + // /// + // public PanelColorsRed() + // : base() + // { + // } + // /// + // /// Initialize a new instance of the PanelColorsRed class. + // /// + // /// Base class for the panel or xpanderpanel control. + // public PanelColorsRed(BasePanel basePanel) + // : base(basePanel) + // { + // } + + // #endregion + + // #region MethodsProtected + // /// + // /// Initialize a color Dictionary with defined colors + // /// + // /// Dictionary with defined colors + // protected override void InitColors(ref Dictionary rgbTable) + // { + // rgbTable[KnownColors.BorderColor] = Color.FromArgb(201, 6, 6); + // rgbTable[KnownColors.InnerBorderColor] = Color.FromArgb(255, 203, 203); + // rgbTable[KnownColors.PanelCaptionCloseIcon] = Color.FromArgb(255, 255, 255); + // rgbTable[KnownColors.PanelCaptionExpandIcon] = Color.FromArgb(255, 255, 255); + // rgbTable[KnownColors.PanelCaptionGradientBegin] = Color.FromArgb(255, 0, 0); + // rgbTable[KnownColors.PanelCaptionGradientEnd] = Color.FromArgb(192, 0, 0); + // rgbTable[KnownColors.PanelCaptionGradientMiddle] = Color.FromArgb(255, 0, 0); + // rgbTable[KnownColors.PanelContentGradientBegin] = Color.FromArgb(250, 232, 233); + // rgbTable[KnownColors.PanelContentGradientEnd] = Color.FromArgb(250, 232, 233); + // rgbTable[KnownColors.PanelCaptionText] = Color.FromArgb(255, 255, 255); + // rgbTable[KnownColors.PanelCollapsedCaptionText] = Color.FromArgb(192, 0, 0); + // rgbTable[KnownColors.XPanderPanelBackColor] = Color.FromArgb(255, 203, 203); + // rgbTable[KnownColors.XPanderPanelCaptionCloseIcon] = Color.FromArgb(255, 255, 255); + // rgbTable[KnownColors.XPanderPanelCaptionExpandIcon] = Color.FromArgb(255, 255, 255); + // rgbTable[KnownColors.XPanderPanelCaptionText] = Color.FromArgb(255, 255, 255); + // rgbTable[KnownColors.XPanderPanelCaptionGradientBegin] = Color.FromArgb(255, 0, 0); + // rgbTable[KnownColors.XPanderPanelCaptionGradientEnd] = Color.FromArgb(192, 0, 0); + // rgbTable[KnownColors.XPanderPanelCaptionGradientMiddle] = Color.FromArgb(255, 0, 0); + // rgbTable[KnownColors.XPanderPanelFlatCaptionGradientBegin] = Color.FromArgb(230, 0, 0); + // rgbTable[KnownColors.XPanderPanelFlatCaptionGradientEnd] = Color.FromArgb(255, 90, 90); + // rgbTable[KnownColors.XPanderPanelPressedCaptionBegin] = Color.FromArgb(255, 252, 222); + // rgbTable[KnownColors.XPanderPanelPressedCaptionEnd] = Color.FromArgb(255, 230, 158); + // rgbTable[KnownColors.XPanderPanelPressedCaptionMiddle] = Color.FromArgb(255, 215, 103); + // rgbTable[KnownColors.XPanderPanelSelectedCaptionBegin] = Color.FromArgb(255, 217, 170); + // rgbTable[KnownColors.XPanderPanelSelectedCaptionEnd] = Color.FromArgb(254, 225, 122); + // rgbTable[KnownColors.XPanderPanelSelectedCaptionMiddle] = Color.FromArgb(255, 171, 63); + // rgbTable[KnownColors.XPanderPanelSelectedCaptionText] = Color.FromArgb(0, 0, 0); + // } + + // #endregion + + // #region MethodsPrivate + // #endregion + //} +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelSettingsManager.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelSettingsManager.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelSettingsManager.cs @@ -0,0 +1,207 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using System.Collections; + +namespace BSE.Windows.Forms +{ + /// + /// Controls Panel and XPanderPanel rendering. + /// + /// + /// The following code example creates a and sets the panel properties for the forms controls collection, + /// + /// using System; + /// using System.Text; + /// using System.Windows.Forms; + /// + /// namespace BSE.Windows.Test + /// { + /// public class Form2 : Form + /// { + /// private BSE.Windows.Forms.Panel panel1; + /// + /// public Form2() + /// { + /// // Create and initialize a Panel. + /// this.panel1 = new BSE.Windows.Forms.Panel(); + /// this.panel1.Text = "panel1"; + /// // Set the panel background. + /// this.panel1.ShowTransparentBackground = false; + /// // Set the panel's DockStyle to DockStyle.Fill + /// this.panel1.Dock = DockStyle.Fill; + /// // Add the panel to the form + /// this.Controls.Add(this.panel1); + /// + /// // Create and initialize a ToolStripProfessionalRenderer. + /// ToolStripProfessionalRenderer renderer = new BSE.Windows.Forms.Office2007Renderer(); + /// // Add it to the ToolStripManager.Renderer + /// ToolStripManager.Renderer = renderer; + /// + /// // Get the ProfessionalColorTable colorTable for the current renderer. + /// BSE.Windows.Forms.ProfessionalColorTable colorTable = renderer.ColorTable as BSE.Windows.Forms.ProfessionalColorTable; + /// if (colorTable != null) + /// { + /// // Get the PanelColors panelColorTable for the current colortable. + /// BSE.Windows.Forms.PanelColors panelColorTable = colorTable.PanelColorTable; + /// if (panelColorTable != null) + /// { + /// // Set the panel properties for the form controls collection + /// BSE.Windows.Forms.PanelSettingsManager.SetPanelProperties(this.Controls, panelColorTable); + /// } + /// } + /// } + /// } + /// } + /// + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public static class PanelSettingsManager + { + #region MethodsPublic + /// + /// Sets the PanelStyle and PanelColors table in the given control collection. + /// + /// A collection of child controls. + /// The PanelColors table + public static void SetPanelProperties(Control.ControlCollection controls, PanelColors panelColors) + { + if (panelColors == null) + { + throw new ArgumentNullException("panelColors", + string.Format(System.Globalization.CultureInfo.InvariantCulture, + Demo.WindowsForms.Properties.Resources.IDS_ArgumentException, + "panelColors")); + } + + PanelStyle panelStyle = panelColors.PanelStyle; + SetPanelProperties(controls, panelStyle, panelColors); + } + /// + /// Sets the PanelStyle and PanelColors table in the given control collection. + /// + /// A collection of child controls + /// Style of the panel + /// The PanelColors table + public static void SetPanelProperties(Control.ControlCollection controls, PanelStyle panelStyle, PanelColors panelColors) + { + if (panelColors == null) + { + throw new ArgumentNullException("panelColors", + string.Format(System.Globalization.CultureInfo.InvariantCulture, + Demo.WindowsForms.Properties.Resources.IDS_ArgumentException, + "panelColors")); + } + + ArrayList panels = FindPanels(true, controls); + foreach (BasePanel panel in panels) + { + panel.PanelStyle = panelStyle; + panelColors.Panel = panel; + panel.SetPanelProperties(panelColors); + } + ArrayList xpanderPanelLists = FindPanelLists(true, controls); + foreach (XPanderPanelList xpanderPanelList in xpanderPanelLists) + { + xpanderPanelList.PanelStyle = panelStyle; + xpanderPanelList.PanelColors = panelColors; + } + } + /// + /// Sets the PanelStyle in the given control collection. + /// + /// a collection of child controls + /// Style of the panel + public static void SetPanelProperties(Control.ControlCollection controls, PanelStyle panelStyle) + { + ArrayList panels = FindPanels(true, controls); + if (panels != null) + { + foreach (BasePanel panel in panels) + { + panel.PanelStyle = panelStyle; + } + } + } + /// + /// Find all controls that derived from BasePanel. + /// + /// A value indicating whether the FindPanels method loops through all controls. + /// A collection of child controls. + /// A arraylist of derived types. + public static ArrayList FindPanels(bool searchAllChildren, Control.ControlCollection controlsToLookIn) + { + return FindControls(typeof(BasePanel), searchAllChildren, controlsToLookIn, new ArrayList()); + } + /// + /// Find all XPanderPanelLists. + /// + /// A value indicating whether the FindPanels method loops through all controls. + /// A collection of child controls. + /// + public static ArrayList FindPanelLists(bool searchAllChildren, Control.ControlCollection controlsToLookIn) + { + return FindControls(typeof(XPanderPanelList), searchAllChildren, controlsToLookIn, new ArrayList()); + } + #endregion + + #region MethodsPrivate + + private static ArrayList FindControls(Type baseType, bool searchAllChildren, Control.ControlCollection controlsToLookIn, ArrayList foundControls) + { + if ((controlsToLookIn == null) || (foundControls == null)) + { + return null; + } + try + { + for (int i = 0; i < controlsToLookIn.Count; i++) + { + if ((controlsToLookIn[i] != null) && baseType.IsAssignableFrom(controlsToLookIn[i].GetType())) + { + foundControls.Add(controlsToLookIn[i]); + } + } + if (searchAllChildren == false) + { + return foundControls; + } + for (int j = 0; j < controlsToLookIn.Count; j++) + { + if (((controlsToLookIn[j] != null) && !(controlsToLookIn[j] is Form)) && ((controlsToLookIn[j].Controls != null) && (controlsToLookIn[j].Controls.Count > 0))) + { + foundControls = FindControls(baseType, searchAllChildren, controlsToLookIn[j].Controls, foundControls); + } + } + } + catch (Exception exception) + { + if (IsCriticalException(exception)) + { + throw; + } + } + return foundControls; + } + + private static bool IsCriticalException(Exception exception) + { + return (((((exception is NullReferenceException) || + (exception is StackOverflowException)) || + ((exception is OutOfMemoryException) || + (exception is System.Threading.ThreadAbortException))) || + ((exception is ExecutionEngineException) || + (exception is IndexOutOfRangeException))) || + (exception is AccessViolationException)); + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelStyle.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelStyle.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelStyle.cs @@ -0,0 +1,26 @@ +using System; + +namespace BSE.Windows.Forms +{ + /// + /// Contains information about the style of the panels or xpanderpanels + /// + /// Copyright 2007-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public enum PanelStyle + { + /// + /// Draws the panels caption in the default office 2003 style. + /// + Default, + /// + /// Draws the panels caption in the office 2007 style. + /// + Office2007, + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelStyleChangeEventArgs.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelStyleChangeEventArgs.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/PanelStyleChangeEventArgs.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BSE.Windows.Forms +{ + /// + /// Provides data for the PanelStyleChange event. + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class PanelStyleChangeEventArgs : EventArgs + { + #region FieldsPrivate + + private PanelStyle m_ePanelStyle; + + #endregion + + #region Properties + /// + /// Gets the style of the panel. + /// + public PanelStyle PanelStyle + { + get { return this.m_ePanelStyle; } + } + + #endregion + + #region MethodsPublic + /// + /// Arguments used when a PanelStyleChange event occurs. + /// + /// the style of the panel. + public PanelStyleChangeEventArgs(PanelStyle ePanelStyle) + { + this.m_ePanelStyle = ePanelStyle; + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/UseAntiAlias.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/UseAntiAlias.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/UseAntiAlias.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace BSE.Windows.Forms +{ + /// + /// Set the SmoothingMode=AntiAlias until instance disposed. + /// + public class UseAntiAlias : IDisposable + { + #region FieldsPrivate + + private Graphics m_graphics; + private SmoothingMode m_smoothingMode; + + #endregion + + #region MethodsPublic + /// + /// Initialize a new instance of the UseAntiAlias class. + /// + /// Graphics instance. + public UseAntiAlias(Graphics graphics) + { + if(graphics == null) + { + throw new ArgumentNullException("graphics", + string.Format(System.Globalization.CultureInfo.InvariantCulture, + Demo.WindowsForms.Properties.Resources.IDS_ArgumentException, + "graphics")); + } + + this.m_graphics = graphics; + this.m_smoothingMode = m_graphics.SmoothingMode; + this.m_graphics.SmoothingMode = SmoothingMode.AntiAlias; + } + /// + /// destructor of the UseAntiAlias class. + /// + ~UseAntiAlias() + { + Dispose(false); + } + /// + /// Releases all resources used by the class. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + #endregion + + #region MethodsProtected + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected virtual void Dispose(bool disposing) + { + if(disposing == true) + { + //Revert the SmoothingMode back to original setting. + this.m_graphics.SmoothingMode = this.m_smoothingMode; + } + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/UseClearTypeGridFit.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/UseClearTypeGridFit.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/UseClearTypeGridFit.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Drawing.Text; + +namespace BSE.Windows.Forms +{ + /// + /// Set the TextRenderingHint.ClearTypeGridFit until instance disposed. + /// + public class UseClearTypeGridFit : IDisposable + { + #region FieldsPrivate + private Graphics m_graphics; + private TextRenderingHint m_textRenderingHint; + #endregion + + #region MethodsPublic + /// + /// Initialize a new instance of the UseClearTypeGridFit class. + /// + /// Graphics instance. + public UseClearTypeGridFit(Graphics graphics) + { + if (graphics == null) + { + throw new ArgumentNullException("graphics", + string.Format(System.Globalization.CultureInfo.InvariantCulture, + Demo.WindowsForms.Properties.Resources.IDS_ArgumentException, + "graphics")); + } + + this.m_graphics = graphics; + this.m_textRenderingHint = this.m_graphics.TextRenderingHint; + this.m_graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; + } + /// + /// destructor of the UseClearTypeGridFit class. + /// + ~UseClearTypeGridFit() + { + Dispose(false); + } + /// + /// Releases all resources used by the class. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + #endregion + + #region MethodsProtected + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected virtual void Dispose(bool disposing) + { + if (disposing == true) + { + //Revert the TextRenderingHint back to original setting. + this.m_graphics.TextRenderingHint = this.m_textRenderingHint; + } + } + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanel.Designer.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanel.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanel.Designer.cs @@ -0,0 +1,37 @@ +namespace BSE.Windows.Forms +{ + partial class XPanderPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.BackColor = System.Drawing.Color.FromArgb(214, 223, 247); + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanel.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanel.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanel.cs @@ -0,0 +1,986 @@ +using System; +using System.Collections; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Data; +using System.Windows.Forms; +using System.ComponentModel.Design; +using Demo.WindowsForms.Properties; + +namespace BSE.Windows.Forms +{ + #region Class XPanderPanel + /// + /// Used to group collections of controls. + /// + /// + /// XPanderPanel controls represent the expandable and collapsable panels in XPanderPanelList. + /// The XpanderPanel is a control that contains other controls. + /// You can use a XPanderPanel to group collections of controls such as the XPanderPanelList. + /// The order of xpanderpanels in the XPanderPanelList.XPanderPanels collection reflects the order + /// of xpanderpanels controls. To change the order of tabs in the control, you must change + /// their positions in the collection by removing them and inserting them at new indexes. + /// You can change the xpanderpanel's appearance. For example, to make it appear flat, + /// set the CaptionStyle property to CaptionStyle.Flat. + /// On top of the XPanderPanel there is the captionbar. + /// This captionbar may contain an image and text. According to it's properties the panel is closable. + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + [Designer(typeof(XPanderPanelDesigner))] + [DesignTimeVisible(false)] + public partial class XPanderPanel : BasePanel + { + #region EventsPublic + /// + /// The CaptionStyleChanged event occurs when CaptionStyle flags have been changed. + /// + [Description("The CaptionStyleChanged event occurs when CaptionStyle flags have been changed.")] + public event EventHandler CaptionStyleChanged; + #endregion + + #region Constants + #endregion + + #region FieldsPrivate + + private System.Drawing.Image m_imageChevron; + private System.Drawing.Image m_imageChevronUp; + private System.Drawing.Image m_imageChevronDown; + private CustomXPanderPanelColors m_customColors; + private System.Drawing.Image m_imageClosePanel; + private bool m_bIsClosable = true; + private CaptionStyle m_captionStyle; + + #endregion + + #region Properties + /// + /// Gets or sets a value indicating whether the expand icon in a XPanderPanel is visible. + /// + [Description("Gets or sets a value indicating whether the expand icon in a XPanderPanel is visible.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [DefaultValue(false)] + [Browsable(false)] + [Category("Appearance")] + public override bool ShowExpandIcon + { + get + { + return base.ShowExpandIcon; + } + set + { + base.ShowExpandIcon = value; + } + } + /// + /// Gets or sets a value indicating whether the close icon in a XPanderPanel is visible. + /// + [Description("Gets or sets a value indicating whether the close icon in a XPanderPanel is visible.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [DefaultValue(false)] + [Browsable(false)] + [Category("Appearance")] + public override bool ShowCloseIcon + { + get + { + return base.ShowCloseIcon; + } + set + { + base.ShowCloseIcon = value; + } + } + /// + /// Gets the custom colors which are used for the XPanderPanel. + /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + [Description("The custom colors which are used for the XPanderPanel.")] + [Category("Appearance")] + public CustomXPanderPanelColors CustomColors + { + get + { + return this.m_customColors; + } + } + /// + /// Gets or sets the style of the caption (not for PanelStyle.Aqua). + /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Browsable(false)] + public CaptionStyle CaptionStyle + { + get + { + return this.m_captionStyle; + } + set + { + if(value.Equals(this.m_captionStyle) == false) + { + this.m_captionStyle = value; + OnCaptionStyleChanged(this, EventArgs.Empty); + } + } + } + /// + /// Gets or sets a value indicating whether this XPanderPanel is closable. + /// + [Description("Gets or sets a value indicating whether this XPanderPanel is closable.")] + [DefaultValue(true)] + [Category("Appearance")] + public bool IsClosable + { + get + { + return this.m_bIsClosable; + } + set + { + if(value.Equals(this.m_bIsClosable) == false) + { + this.m_bIsClosable = value; + this.Invalidate(false); + } + } + } + /// + /// Gets or sets the height and width of the XPanderPanel. + /// + [Browsable(false)] + public new Size Size + { + get + { + return base.Size; + } + set + { + base.Size = value; + } + } + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the XPanderPanel class. + /// + public XPanderPanel() + { + InitializeComponent(); + + this.BackColor = Color.Transparent; + this.CaptionStyle = CaptionStyle.Normal; + this.ForeColor = SystemColors.ControlText; + this.Height = this.CaptionHeight; + this.ShowBorder = true; + this.m_customColors = new CustomXPanderPanelColors(); + this.m_customColors.CustomColorsChanged += OnCustomColorsChanged; + } + + /// + /// Gets the rectangle that represents the display area of the XPanderPanel. + /// + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public override Rectangle DisplayRectangle + { + get + { + Padding padding = this.Padding; + + Rectangle displayRectangle = new Rectangle( + padding.Left + Constants.BorderThickness, + padding.Top + this.CaptionHeight, + this.ClientRectangle.Width - padding.Left - padding.Right - (2 * Constants.BorderThickness), + this.ClientRectangle.Height - this.CaptionHeight - padding.Top - padding.Bottom); + + if(this.Controls.Count > 0) + { + XPanderPanelList xpanderPanelList = this.Controls[0] as XPanderPanelList; + if((xpanderPanelList != null) && (xpanderPanelList.Dock == DockStyle.Fill)) + { + displayRectangle = new Rectangle( + padding.Left, + padding.Top + this.CaptionHeight, + this.ClientRectangle.Width - padding.Left - padding.Right, + this.ClientRectangle.Height - this.CaptionHeight - padding.Top - padding.Bottom - Constants.BorderThickness); + } + } + return displayRectangle; + } + } + #endregion + + #region MethodsProtected + /// + /// Paints the background of the control. + /// + /// A PaintEventArgs that contains information about the control to paint. + protected override void OnPaintBackground(PaintEventArgs pevent) + { + base.OnPaintBackground(pevent); + base.BackColor = Color.Transparent; + Color backColor = this.PanelColors.XPanderPanelBackColor; + if((backColor != Color.Empty) && backColor != Color.Transparent) + { + Rectangle rectangle = new Rectangle( + 0, + this.CaptionHeight, + this.ClientRectangle.Width, + this.ClientRectangle.Height - this.CaptionHeight); + + using(SolidBrush backgroundBrush = new SolidBrush(backColor)) + { + pevent.Graphics.FillRectangle(backgroundBrush, rectangle); + } + } + } + /// + /// Raises the Paint event. + /// + /// A PaintEventArgs that contains the event data. + protected override void OnPaint(PaintEventArgs e) + { + if(IsZeroWidthOrHeight(this.CaptionRectangle) == true) + { + return; + } + + using(UseAntiAlias antiAlias = new UseAntiAlias(e.Graphics)) + { + Graphics graphics = e.Graphics; + using(UseClearTypeGridFit clearTypeGridFit = new UseClearTypeGridFit(graphics)) + { + bool bExpand = this.Expand; + bool bShowBorder = this.ShowBorder; + Color borderColor = this.PanelColors.BorderColor; + Rectangle borderRectangle = this.ClientRectangle; + + switch(this.PanelStyle) + { + case PanelStyle.Default: + case PanelStyle.Office2007: + DrawCaptionbar(graphics, bExpand, bShowBorder, this.PanelStyle); + CalculatePanelHeights(); + DrawBorders(graphics, this); + break; + } + } + } + } + /// + /// Raises the PanelExpanding event. + /// + /// The source of the event. + /// A XPanderStateChangeEventArgs that contains the event data. + protected override void OnPanelExpanding(object sender, XPanderStateChangeEventArgs e) + { + bool bExpand = e.Expand; + if(bExpand == true) + { + this.Expand = bExpand; + this.Invalidate(false); + } + base.OnPanelExpanding(sender, e); + } + /// + /// Raises the CaptionStyleChanged event. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + protected virtual void OnCaptionStyleChanged(object sender, EventArgs e) + { + this.Invalidate(this.CaptionRectangle); + if(this.CaptionStyleChanged != null) + { + this.CaptionStyleChanged(sender, e); + } + } + /// + /// Raises the MouseUp event. + /// + /// A MouseEventArgs that contains data about the OnMouseUp event. + protected override void OnMouseUp(MouseEventArgs e) + { + if(this.CaptionRectangle.Contains(e.X, e.Y) == true) + { + if((this.ShowCloseIcon == false) && (this.ShowExpandIcon == false)) + { + OnExpandClick(this, EventArgs.Empty); + } + else if((this.ShowCloseIcon == true) && (this.ShowExpandIcon == false)) + { + if(this.RectangleCloseIcon.Contains(e.X, e.Y) == false) + { + OnExpandClick(this, EventArgs.Empty); + } + } + if(this.ShowExpandIcon == true) + { + if(this.RectangleExpandIcon.Contains(e.X, e.Y) == true) + { + OnExpandClick(this, EventArgs.Empty); + } + } + if((this.ShowCloseIcon == true) && (this.m_bIsClosable == true)) + { + if(this.RectangleCloseIcon.Contains(e.X, e.Y) == true) + { + OnCloseClick(this, EventArgs.Empty); + } + } + } + } + /// + /// Raises the VisibleChanged event. + /// + /// An EventArgs that contains the event data. + protected override void OnVisibleChanged(EventArgs e) + { + base.OnVisibleChanged(e); + + if(this.DesignMode == true) + { + return; + } + if(this.Visible == false) + { + if(this.Expand == true) + { + this.Expand = false; + foreach(Control control in this.Parent.Controls) + { + BSE.Windows.Forms.XPanderPanel xpanderPanel = + control as BSE.Windows.Forms.XPanderPanel; + + if(xpanderPanel != null) + { + if(xpanderPanel.Visible == true) + { + xpanderPanel.Expand = true; + return; + } + } + } + } + } +#if DEBUG + //System.Diagnostics.Trace.WriteLine("Visibility: " + this.Name + this.Visible); +#endif + CalculatePanelHeights(); + } + + #endregion + + #region MethodsPrivate + + private void DrawCaptionbar(Graphics graphics, bool bExpand, bool bShowBorder, PanelStyle panelStyle) + { + Rectangle captionRectangle = this.CaptionRectangle; + Color colorGradientBegin = this.PanelColors.XPanderPanelCaptionGradientBegin; + Color colorGradientEnd = this.PanelColors.XPanderPanelCaptionGradientEnd; + Color colorGradientMiddle = this.PanelColors.XPanderPanelCaptionGradientMiddle; + Color colorText = this.PanelColors.XPanderPanelCaptionText; + Color foreColorCloseIcon = this.PanelColors.XPanderPanelCaptionCloseIcon; + Color foreColorExpandIcon = this.PanelColors.XPanderPanelCaptionExpandIcon; + bool bHover = this.HoverStateCaptionBar == HoverState.Hover ? true : false; + + if(this.m_imageClosePanel == null) + { + this.m_imageClosePanel = Resources.closePanel; + } + if(this.m_imageChevronUp == null) + { + this.m_imageChevronUp = Resources.ChevronUp; + } + if(this.m_imageChevronDown == null) + { + this.m_imageChevronDown = Resources.ChevronDown; + } + + this.m_imageChevron = this.m_imageChevronDown; + if(bExpand == true) + { + this.m_imageChevron = this.m_imageChevronUp; + } + + if(this.m_captionStyle == CaptionStyle.Normal) + { + if(bHover == true) + { + colorGradientBegin = this.PanelColors.XPanderPanelSelectedCaptionBegin; + colorGradientEnd = this.PanelColors.XPanderPanelSelectedCaptionEnd; + colorGradientMiddle = this.PanelColors.XPanderPanelSelectedCaptionMiddle; + if(bExpand == true) + { + colorGradientBegin = this.PanelColors.XPanderPanelPressedCaptionBegin; + colorGradientEnd = this.PanelColors.XPanderPanelPressedCaptionEnd; + colorGradientMiddle = this.PanelColors.XPanderPanelPressedCaptionMiddle; + } + colorText = this.PanelColors.XPanderPanelSelectedCaptionText; + foreColorCloseIcon = colorText; + foreColorExpandIcon = colorText; + } + else + { + if(bExpand == true) + { + colorGradientBegin = this.PanelColors.XPanderPanelCheckedCaptionBegin; + colorGradientEnd = this.PanelColors.XPanderPanelCheckedCaptionEnd; + colorGradientMiddle = this.PanelColors.XPanderPanelCheckedCaptionMiddle; + colorText = this.PanelColors.XPanderPanelSelectedCaptionText; + foreColorCloseIcon = colorText; + foreColorExpandIcon = colorText; + } + } + if(panelStyle != PanelStyle.Office2007) + { + RenderDoubleBackgroundGradient( + graphics, + captionRectangle, + colorGradientBegin, + colorGradientMiddle, + colorGradientEnd, + LinearGradientMode.Vertical, + false); + } + else + { + RenderButtonBackground( + graphics, + captionRectangle, + colorGradientBegin, + colorGradientMiddle, + colorGradientEnd); + } + } + else + { + Color colorFlatGradientBegin = this.PanelColors.XPanderPanelFlatCaptionGradientBegin; + Color colorFlatGradientEnd = this.PanelColors.XPanderPanelFlatCaptionGradientEnd; + Color colorInnerBorder = this.PanelColors.InnerBorderColor; + colorText = this.PanelColors.XPanderPanelCaptionText; + foreColorExpandIcon = colorText; + + RenderFlatButtonBackground(graphics, captionRectangle, colorFlatGradientBegin, colorFlatGradientEnd, bHover); + DrawInnerBorders(graphics, this); + } + + DrawImagesAndText( + graphics, + captionRectangle, + CaptionSpacing, + this.ImageRectangle, + this.Image, + this.RightToLeft, + this.m_bIsClosable, + this.ShowCloseIcon, + this.m_imageClosePanel, + foreColorCloseIcon, + ref this.RectangleCloseIcon, + this.ShowExpandIcon, + this.m_imageChevron, + foreColorExpandIcon, + ref this.RectangleExpandIcon, + this.CaptionFont, + colorText, + this.Text); + } + + private static void DrawBorders(Graphics graphics, XPanderPanel xpanderPanel) + { + if(xpanderPanel.ShowBorder == true) + { + using(GraphicsPath graphicsPath = new GraphicsPath()) + { + using(Pen borderPen = new Pen(xpanderPanel.PanelColors.BorderColor, Constants.BorderThickness)) + { + Rectangle captionRectangle = xpanderPanel.CaptionRectangle; + Rectangle borderRectangle = captionRectangle; + + if(xpanderPanel.Expand == true) + { + borderRectangle = xpanderPanel.ClientRectangle; + + graphics.DrawLine( + borderPen, + captionRectangle.Left, + captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness, + captionRectangle.Left + captionRectangle.Width, + captionRectangle.Top + captionRectangle.Height - Constants.BorderThickness); + } + + XPanderPanelList xpanderPanelList = xpanderPanel.Parent as XPanderPanelList; + if((xpanderPanelList != null) && (xpanderPanelList.Dock == DockStyle.Fill)) + { + BSE.Windows.Forms.Panel panel = xpanderPanelList.Parent as BSE.Windows.Forms.Panel; + XPanderPanel parentXPanderPanel = xpanderPanelList.Parent as XPanderPanel; + if(((panel != null) && (panel.Padding == new Padding(0))) || + ((parentXPanderPanel != null) && (parentXPanderPanel.Padding == new Padding(0)))) + { + if(xpanderPanel.Top != 0) + { + graphicsPath.AddLine( + borderRectangle.Left, + borderRectangle.Top, + borderRectangle.Left + captionRectangle.Width, + borderRectangle.Top); + } + + // Left vertical borderline + graphics.DrawLine(borderPen, + borderRectangle.Left, + borderRectangle.Top, + borderRectangle.Left, + borderRectangle.Top + borderRectangle.Height); + + // Right vertical borderline + graphics.DrawLine(borderPen, + borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, + borderRectangle.Top, + borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, + borderRectangle.Top + borderRectangle.Height); + } + else + { + // Upper horizontal borderline only at the top xpanderPanel + if(xpanderPanel.Top == 0) + { + graphicsPath.AddLine( + borderRectangle.Left, + borderRectangle.Top, + borderRectangle.Left + borderRectangle.Width, + borderRectangle.Top); + } + + // Left vertical borderline + graphicsPath.AddLine( + borderRectangle.Left, + borderRectangle.Top, + borderRectangle.Left, + borderRectangle.Top + borderRectangle.Height); + + //Lower horizontal borderline + graphicsPath.AddLine( + borderRectangle.Left, + borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness, + borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, + borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness); + + // Right vertical borderline + graphicsPath.AddLine( + borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, + borderRectangle.Top, + borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, + borderRectangle.Top + borderRectangle.Height); + } + } + else + { + // Upper horizontal borderline only at the top xpanderPanel + if(xpanderPanel.Top == 0) + { + graphicsPath.AddLine( + borderRectangle.Left, + borderRectangle.Top, + borderRectangle.Left + borderRectangle.Width, + borderRectangle.Top); + } + + // Left vertical borderline + graphicsPath.AddLine( + borderRectangle.Left, + borderRectangle.Top, + borderRectangle.Left, + borderRectangle.Top + borderRectangle.Height); + + //Lower horizontal borderline + graphicsPath.AddLine( + borderRectangle.Left, + borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness, + borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, + borderRectangle.Top + borderRectangle.Height - Constants.BorderThickness); + + // Right vertical borderline + graphicsPath.AddLine( + borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, + borderRectangle.Top, + borderRectangle.Left + borderRectangle.Width - Constants.BorderThickness, + borderRectangle.Top + borderRectangle.Height); + } + } + using(Pen borderPen = new Pen(xpanderPanel.PanelColors.BorderColor, Constants.BorderThickness)) + { + graphics.DrawPath(borderPen, graphicsPath); + } + } + } + } + + + private static void DrawInnerBorders(Graphics graphics, XPanderPanel xpanderPanel) + { + if(xpanderPanel.ShowBorder == true) + { + using(GraphicsPath graphicsPath = new GraphicsPath()) + { + Rectangle captionRectangle = xpanderPanel.CaptionRectangle; + XPanderPanelList xpanderPanelList = xpanderPanel.Parent as XPanderPanelList; + if((xpanderPanelList != null) && (xpanderPanelList.Dock == DockStyle.Fill)) + { + BSE.Windows.Forms.Panel panel = xpanderPanelList.Parent as BSE.Windows.Forms.Panel; + XPanderPanel parentXPanderPanel = xpanderPanelList.Parent as XPanderPanel; + if(((panel != null) && (panel.Padding == new Padding(0))) || + ((parentXPanderPanel != null) && (parentXPanderPanel.Padding == new Padding(0)))) + { + //Left vertical borderline + graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + captionRectangle.Height, captionRectangle.X, captionRectangle.Y + Constants.BorderThickness); + if(xpanderPanel.Top == 0) + { + //Upper horizontal borderline + graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y, captionRectangle.X + captionRectangle.Width, captionRectangle.Y); + } + else + { + //Upper horizontal borderline + graphicsPath.AddLine(captionRectangle.X, captionRectangle.Y + Constants.BorderThickness, captionRectangle.X + captionRectangle.Width, captionRectangle.Y + Constants.BorderThickness); + } + } + } + else + { + //Left vertical borderline + graphicsPath.AddLine(captionRectangle.X + Constants.BorderThickness, captionRectangle.Y + captionRectangle.Height, captionRectangle.X + Constants.BorderThickness, captionRectangle.Y); + if(xpanderPanel.Top == 0) + { + //Upper horizontal borderline + graphicsPath.AddLine(captionRectangle.X + Constants.BorderThickness, captionRectangle.Y + Constants.BorderThickness, captionRectangle.X + captionRectangle.Width - Constants.BorderThickness, captionRectangle.Y + Constants.BorderThickness); + } + else + { + //Upper horizontal borderline + graphicsPath.AddLine(captionRectangle.X + Constants.BorderThickness, captionRectangle.Y, captionRectangle.X + captionRectangle.Width - Constants.BorderThickness, captionRectangle.Y); + } + } + + using(Pen borderPen = new Pen(xpanderPanel.PanelColors.InnerBorderColor)) + { + graphics.DrawPath(borderPen, graphicsPath); + } + } + } + } + + private void CalculatePanelHeights() + { + if(this.Parent == null) + { + return; + } + + int iPanelHeight = this.Parent.Padding.Top; + + foreach(Control control in this.Parent.Controls) + { + BSE.Windows.Forms.XPanderPanel xpanderPanel = + control as BSE.Windows.Forms.XPanderPanel; + + if((xpanderPanel != null) && (xpanderPanel.Visible == true)) + { + iPanelHeight += xpanderPanel.CaptionHeight; + } + } + + iPanelHeight += this.Parent.Padding.Bottom; + + foreach(Control control in this.Parent.Controls) + { + BSE.Windows.Forms.XPanderPanel xpanderPanel = + control as BSE.Windows.Forms.XPanderPanel; + + if(xpanderPanel != null) + { + if(xpanderPanel.Expand == true) + { + xpanderPanel.Height = this.Parent.Height + + xpanderPanel.CaptionHeight + - iPanelHeight; + } + else + { + xpanderPanel.Height = xpanderPanel.CaptionHeight; + } + } + } + + int iTop = this.Parent.Padding.Top; + foreach(Control control in this.Parent.Controls) + { + BSE.Windows.Forms.XPanderPanel xpanderPanel = + control as BSE.Windows.Forms.XPanderPanel; + + if((xpanderPanel != null) && (xpanderPanel.Visible == true)) + { + xpanderPanel.Top = iTop; + iTop += xpanderPanel.Height; + } + } + } + + #endregion + } + + #endregion + + #region Class XPanderPanelDesigner + /// + /// Designer class for extending the design mode behavior of a XPanderPanel control + /// + internal class XPanderPanelDesigner : System.Windows.Forms.Design.ScrollableControlDesigner + { + #region FieldsPrivate + + private Pen m_borderPen = new Pen(Color.FromKnownColor(KnownColor.ControlDarkDark)); + private System.Windows.Forms.Design.Behavior.Adorner m_adorner; + + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the XPanderPanelDesigner class. + /// + public XPanderPanelDesigner() + { + this.m_borderPen.DashStyle = DashStyle.Dash; + } + /// + /// Initializes the designer with the specified component. + /// + /// The IComponent to associate with the designer. + public override void Initialize(IComponent component) + { + base.Initialize(component); + XPanderPanel xpanderPanel = Control as XPanderPanel; + if(xpanderPanel != null) + { + this.m_adorner = new System.Windows.Forms.Design.Behavior.Adorner(); + BehaviorService.Adorners.Add(this.m_adorner); + this.m_adorner.Glyphs.Add(new XPanderPanelCaptionGlyph(BehaviorService, xpanderPanel)); + } + } + #endregion + + #region MethodsProtected + /// + /// Releases the unmanaged resources used by the XPanderPanelDesigner, + /// and optionally releases the managed resources. + /// + /// true to release both managed and unmanaged resources; + /// false to release only unmanaged resources. + protected override void Dispose(bool disposing) + { + try + { + if(disposing) + { + if(this.m_borderPen != null) + { + this.m_borderPen.Dispose(); + } + if(this.m_adorner != null) + { + if(BehaviorService != null) + { + BehaviorService.Adorners.Remove(this.m_adorner); + } + } + } + } + finally + { + base.Dispose(disposing); + } + } + /// + /// Receives a call when the control that the designer is managing has painted its surface so the designer can + /// paint any additional adornments on top of the xpanderpanel. + /// + /// A PaintEventArgs the designer can use to draw on the xpanderpanel. + protected override void OnPaintAdornments(PaintEventArgs e) + { + base.OnPaintAdornments(e); + e.Graphics.DrawRectangle( + this.m_borderPen, + 0, + 0, + this.Control.Width - 2, + this.Control.Height - 2); + } + /// + /// Allows a designer to change or remove items from the set of properties that it exposes through a TypeDescriptor. + /// + /// The properties for the class of the component. + protected override void PostFilterProperties(IDictionary properties) + { + base.PostFilterProperties(properties); + properties.Remove("AccessibilityObject"); + properties.Remove("AccessibleDefaultActionDescription"); + properties.Remove("AccessibleDescription"); + properties.Remove("AccessibleName"); + properties.Remove("AccessibleRole"); + properties.Remove("AllowDrop"); + properties.Remove("Anchor"); + properties.Remove("AntiAliasing"); + properties.Remove("AutoScroll"); + properties.Remove("AutoScrollMargin"); + properties.Remove("AutoScrollMinSize"); + properties.Remove("BackColor"); + properties.Remove("BackgroundImage"); + properties.Remove("BackgroundImageLayout"); + properties.Remove("CausesValidation"); + properties.Remove("ContextMenuStrip"); + properties.Remove("Dock"); + properties.Remove("GenerateMember"); + properties.Remove("ImeMode"); + properties.Remove("Location"); + properties.Remove("MaximumSize"); + properties.Remove("MinimumSize"); + } + + #endregion + } + #endregion + + #region Class XPanderPanelCaptionGlyph + /// + /// Represents a single user interface (UI) entity managed by an Adorner. + /// + internal class XPanderPanelCaptionGlyph : System.Windows.Forms.Design.Behavior.Glyph + { + #region FieldsPrivate + + private XPanderPanel m_xpanderPanel; + private System.Windows.Forms.Design.Behavior.BehaviorService m_behaviorService; + + #endregion + + #region Properties + /// + /// Gets the bounds of the Glyph. + /// + public override Rectangle Bounds + { + get + { + Point edge = this.m_behaviorService.ControlToAdornerWindow(this.m_xpanderPanel); + Rectangle bounds = new Rectangle( + edge.X, + edge.Y, + this.m_xpanderPanel.Width, + this.m_xpanderPanel.CaptionHeight); + + return bounds; + } + } + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the CaptionGlyph class. + /// + /// + /// + public XPanderPanelCaptionGlyph(System.Windows.Forms.Design.Behavior.BehaviorService behaviorService, XPanderPanel xpanderPanel) + : + base(new XPanderPanelCaptionClickBehavior(xpanderPanel)) + { + this.m_behaviorService = behaviorService; + this.m_xpanderPanel = xpanderPanel; + } + /// + /// Provides hit test logic. + /// + /// A point to hit-test. + /// A Cursor if the Glyph is associated with p; otherwise, a null reference + public override Cursor GetHitTest(Point p) + { + // GetHitTest is called to see if the point is + // within this glyph. This gives us a chance to decide + // what cursor to show. Returning null from here means + // the mouse pointer is not currently inside of the glyph. + // Returning a valid cursor here indicates the pointer is + // inside the glyph, and also enables our Behavior property + // as the active behavior. + if((this.m_xpanderPanel != null) && (this.m_xpanderPanel.Expand == false) && (Bounds.Contains(p))) + { + return Cursors.Hand; + } + + return null; + } + /// + /// Provides paint logic. + /// + /// A PaintEventArgs that contains the event data. + public override void Paint(PaintEventArgs pe) + { + } + + #endregion + } + + #endregion + + #region Class XPanderPanelCaptionClickBehavior + /// + /// Designer behaviour when the user clicks in the glyph on the XPanderPanel caption + /// + internal class XPanderPanelCaptionClickBehavior : System.Windows.Forms.Design.Behavior.Behavior + { + #region FieldsPrivate + private XPanderPanel m_xpanderPanel; + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the Behavior class. + /// + /// XPanderPanel for this behaviour + public XPanderPanelCaptionClickBehavior(XPanderPanel xpanderPanel) + { + this.m_xpanderPanel = xpanderPanel; + } + /// + /// Called when any mouse-down message enters the adorner window of the BehaviorService. + /// + /// A Glyph. + /// A MouseButtons value indicating which button was clicked. + /// The location at which the click occurred. + /// true if the message was handled; otherwise, false. + public override bool OnMouseDown(System.Windows.Forms.Design.Behavior.Glyph g, MouseButtons button, Point mouseLoc) + { + if((this.m_xpanderPanel != null) && (this.m_xpanderPanel.Expand == false)) + { + XPanderPanelList xpanderPanelList = this.m_xpanderPanel.Parent as XPanderPanelList; + if(xpanderPanelList != null) + { + xpanderPanelList.Expand(this.m_xpanderPanel); + this.m_xpanderPanel.Invalidate(false); + } + } + return true; // indicating we processed this event. + } + #endregion + } + + #endregion +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanel.resx b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanel.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanel.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + False + + + True + + + True + + + 80 + + + (Default) + + + False + + + Private + + + XPanderPanel + + + 8, 8 + + \ No newline at end of file diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanelList.Designer.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanelList.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanelList.Designer.cs @@ -0,0 +1,38 @@ +namespace BSE.Windows.Forms +{ + partial class XPanderPanelList + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.Size = new System.Drawing.Size(200, 100); + this.Name = "xPanderPanelList"; + } + + #endregion + } +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanelList.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanelList.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanelList.cs @@ -0,0 +1,1409 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.Design; +using System.Drawing; +using System.Drawing.Design; +using System.Drawing.Drawing2D; +using System.Data; +using System.Windows.Forms; +using Demo.WindowsForms.Properties; + +namespace BSE.Windows.Forms +{ + #region Class XPanderPanelList + /// + /// Manages a related set of xpanderpanels. + /// + /// + /// The XPanderPanelList contains XPanderPanels, which are represented by XPanderPanel + /// objects that you can add through the XPanderPanels property. + /// The order of XPanderPanel objects reflects the order the xpanderpanels appear + /// in the XPanderPanelList control. + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + [Designer(typeof(XPanderPanelListDesigner)), + DesignTimeVisibleAttribute(true)] + [ToolboxBitmap(typeof(System.Windows.Forms.Panel))] + public partial class XPanderPanelList : ScrollableControl + { + #region Events + /// + /// The PanelStyleChanged event occurs when PanelStyle flags have been changed. + /// + [Description("The PanelStyleChanged event occurs when PanelStyle flags have been changed.")] + public event EventHandler PanelStyleChanged; + /// + /// The CaptionStyleChanged event occurs when CaptionStyle flags have been changed. + /// + [Description("The CaptionStyleChanged event occurs when CaptionStyle flags have been changed.")] + public event EventHandler CaptionStyleChanged; + /// + /// The ColorSchemeChanged event occurs when ColorScheme flags have been changed. + /// + [Description("The ColorSchemeChanged event occurs when ColorScheme flags have been changed.")] + public event EventHandler ColorSchemeChanged; + /// + /// Occurs when the value of the CaptionHeight property changes. + /// + [Description("Occurs when the value of the CaptionHeight property changes.")] + public event EventHandler CaptionHeightChanged; + #endregion + + #region FieldsPrivate + + private bool m_bShowBorder; + private bool m_bShowGradientBackground; + private bool m_bShowExpandIcon; + private bool m_bShowCloseIcon; + private int m_iCaptionHeight; + private LinearGradientMode m_linearGradientMode; + private System.Drawing.Color m_colorGradientBackground; + private CaptionStyle m_captionStyle; + private BSE.Windows.Forms.PanelStyle m_ePanelStyle; + private BSE.Windows.Forms.ColorScheme m_eColorScheme; + private XPanderPanelCollection m_xpanderPanels; + private PanelColors m_panelColors; + + #endregion + + #region Properties + /// + /// Gets the collection of xpanderpanels in this xpanderpanellist. + /// + /// The following code example creates a XPanderPanel and adds it to the XPanderPanels collection, + /// + /// private void btnAddXPanderPanel_Click(object sender, EventArgs e) + /// { + /// if (xPanderPanelList3 != null) + /// { + /// // Create and initialize a XPanderPanel. + /// BSE.Windows.Forms.XPanderPanel xpanderPanel = new BSE.Windows.Forms.XPanderPanel(); + /// xpanderPanel.Text = "new XPanderPanel"; + /// // and add it to the XPanderPanels collection + /// xPanderPanelList3.XPanderPanels.Add(xpanderPanel); + /// } + /// } + /// + /// + [RefreshProperties(RefreshProperties.Repaint), + Category("Collections"), + Browsable(true), + Description("Collection containing all the XPanderPanels for the xpanderpanellist.")] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + [Editor(typeof(XPanderPanelCollectionEditor), typeof(UITypeEditor))] + public XPanderPanelCollection XPanderPanels + { + get + { + return this.m_xpanderPanels; + } + } + /// + /// Specifies the style of the panels in this xpanderpanellist. + /// + [Description("Specifies the style of the xpanderpanels in this xpanderpanellist."), + DefaultValue(BSE.Windows.Forms.PanelStyle.Default), + Category("Appearance")] + public BSE.Windows.Forms.PanelStyle PanelStyle + { + get + { + return this.m_ePanelStyle; + } + set + { + if(value != this.m_ePanelStyle) + { + this.m_ePanelStyle = value; + OnPanelStyleChanged(this, new PanelStyleChangeEventArgs(this.m_ePanelStyle)); + } + } + } + /// + /// Gets or sets the Panelcolors table. + /// + public PanelColors PanelColors + { + get + { + return this.m_panelColors; + } + set + { + this.m_panelColors = value; + } + } + /// + /// Specifies the colorscheme of the xpanderpanels in the xpanderpanellist + /// + [Description("The colorscheme of the xpanderpanels in the xpanderpanellist")] + [DefaultValue(BSE.Windows.Forms.ColorScheme.Professional)] + [Category("Appearance")] + public ColorScheme ColorScheme + { + get + { + return this.m_eColorScheme; + } + set + { + if(value != this.m_eColorScheme) + { + this.m_eColorScheme = value; + OnColorSchemeChanged(this, new ColorSchemeChangeEventArgs(this.m_eColorScheme)); + } + } + } + /// + /// Gets or sets the style of the captionbar. + /// + [Description("The style of the captionbar.")] + [Category("Appearance")] + public CaptionStyle CaptionStyle + { + get + { + return this.m_captionStyle; + } + set + { + this.m_captionStyle = value; + OnCaptionStyleChanged(this, EventArgs.Empty); + } + } + /// + /// LinearGradientMode of the background in the xpanderpanellist + /// + [Description("LinearGradientMode of the background in the xpanderpanellist"), + DefaultValue(LinearGradientMode.Vertical), + Category("Appearance")] + public LinearGradientMode LinearGradientMode + { + get + { + return this.m_linearGradientMode; + } + set + { + if(value != this.m_linearGradientMode) + { + this.m_linearGradientMode = value; + this.Invalidate(false); + } + } + } + /// + /// Gets or sets a value indicating whether a xpanderpanellist's gradient background is shown. + /// + [Description("Gets or sets a value indicating whether a xpanderpanellist's gradient background is shown."), + DefaultValue(false), + Category("Appearance")] + public bool ShowGradientBackground + { + get + { + return this.m_bShowGradientBackground; + } + set + { + if(value != this.m_bShowGradientBackground) + { + this.m_bShowGradientBackground = value; + this.Invalidate(false); + } + } + } + /// + /// Gets or sets a value indicating whether a xpanderpanellist's border is shown + /// + [Description("Gets or sets a value indicating whether a xpanderpanellist's border is shown"), + DefaultValue(true), + Category("Appearance")] + public bool ShowBorder + { + get + { + return this.m_bShowBorder; + } + set + { + if(value != this.m_bShowBorder) + { + this.m_bShowBorder = value; + foreach(XPanderPanel xpanderPanel in this.XPanderPanels) + { + xpanderPanel.ShowBorder = this.m_bShowBorder; + } + this.Invalidate(false); + } + } + } + /// + /// Gets or sets a value indicating whether the expand icon of the xpanderpanels in this xpanderpanellist are visible. + /// + [Description("Gets or sets a value indicating whether the expand icon of the xpanderpanels in this xpanderpanellist are visible."), + DefaultValue(false), + Category("Appearance")] + public bool ShowExpandIcon + { + get + { + return this.m_bShowExpandIcon; + } + set + { + if(value != this.m_bShowExpandIcon) + { + this.m_bShowExpandIcon = value; + foreach(XPanderPanel xpanderPanel in this.XPanderPanels) + { + xpanderPanel.ShowExpandIcon = this.m_bShowExpandIcon; + } + } + } + } + /// + /// Gets or sets a value indicating whether the close icon of the xpanderpanels in this xpanderpanellist are visible. + /// + [Description("Gets or sets a value indicating whether the close icon of the xpanderpanels in this xpanderpanellist are visible."), + DefaultValue(false), + Category("Appearance")] + public bool ShowCloseIcon + { + get + { + return this.m_bShowCloseIcon; + } + set + { + if(value != this.m_bShowCloseIcon) + { + this.m_bShowCloseIcon = value; + foreach(XPanderPanel xpanderPanel in this.XPanderPanels) + { + xpanderPanel.ShowCloseIcon = this.m_bShowCloseIcon; + } + } + } + } + /// + /// Gradientcolor background in this xpanderpanellist + /// + [Description("Gradientcolor background in this xpanderpanellist"), + DefaultValue(false), + Category("Appearance")] + public System.Drawing.Color GradientBackground + { + get + { + return this.m_colorGradientBackground; + } + set + { + if(value != this.m_colorGradientBackground) + { + this.m_colorGradientBackground = value; + this.Invalidate(false); + } + } + } + /// + /// Gets or sets the height of the XpanderPanels in this XPanderPanelList. + /// + [Description("Gets or sets the height of the XpanderPanels in this XPanderPanelList. "), + DefaultValue(25), + Category("Appearance")] + public int CaptionHeight + { + get + { + return m_iCaptionHeight; + } + set + { + if(value < Constants.CaptionMinHeight) + { + throw new InvalidOperationException( + string.Format( + System.Globalization.CultureInfo.CurrentUICulture, + Resources.IDS_InvalidOperationExceptionInteger, value, "CaptionHeight", Constants.CaptionMinHeight)); + } + this.m_iCaptionHeight = value; + OnCaptionHeightChanged(this, EventArgs.Empty); + } + } + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the XPanderPanelList class. + /// + public XPanderPanelList() + { + // Dieser Aufruf ist fr den Windows Form-Designer erforderlich. + SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.ResizeRedraw, false); + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + SetStyle(ControlStyles.SupportsTransparentBackColor, true); + + InitializeComponent(); + + this.m_xpanderPanels = new XPanderPanelCollection(this); + + this.ShowBorder = true; + this.PanelStyle = PanelStyle.Default; + this.LinearGradientMode = LinearGradientMode.Vertical; + this.CaptionHeight = 25; + } + /// + /// Expands the specified XPanderPanel + /// + /// The XPanderPanel to expand + /// + /// + /// private void btnExpandXPander_Click(object sender, EventArgs e) + /// { + /// // xPanderPanel10 is not null + /// if (xPanderPanel10 != null) + /// { + /// BSE.Windows.Forms.XPanderPanelList panelList = xPanderPanel10.Parent as BSE.Windows.Forms.XPanderPanelList; + /// // and it's parent panelList is not null + /// if (panelList != null) + /// { + /// // expands xPanderPanel10 in it's panelList. + /// panelList.Expand(xPanderPanel10); + /// } + /// } + /// } + /// + /// + public void Expand(BasePanel panel) + { + if(panel == null) + { + throw new ArgumentNullException("panel", + string.Format(System.Globalization.CultureInfo.InvariantCulture, + Demo.WindowsForms.Properties.Resources.IDS_ArgumentException, + "panel")); + } + + XPanderPanel xpanderPanel = panel as XPanderPanel; + if(xpanderPanel != null) + { + foreach(XPanderPanel tmpXPanderPanel in this.m_xpanderPanels) + { + if(tmpXPanderPanel.Equals(xpanderPanel) == false) + { + tmpXPanderPanel.Expand = false; + } + } + PropertyDescriptor propertyDescriptor = TypeDescriptor.GetProperties(xpanderPanel)["Expand"]; + if(propertyDescriptor != null) + { + propertyDescriptor.SetValue(xpanderPanel, true); + } + } + } + #endregion + + #region MethodsProtected + /// + /// Paints the background of the xpanderpanellist. + /// + /// A PaintEventArgs that contains information about the control to paint. + protected override void OnPaintBackground(PaintEventArgs pevent) + { + base.OnPaintBackground(pevent); + if(this.m_bShowGradientBackground == true) + { + Rectangle rectangle = new Rectangle(0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height); + using(LinearGradientBrush linearGradientBrush = new LinearGradientBrush( + rectangle, + this.BackColor, + this.GradientBackground, + this.LinearGradientMode)) + { + pevent.Graphics.FillRectangle(linearGradientBrush, rectangle); + } + } + } + /// + /// Raises the ControlAdded event. + /// + /// A ControlEventArgs that contains the event data. + protected override void OnControlAdded(System.Windows.Forms.ControlEventArgs e) + { + base.OnControlAdded(e); + BSE.Windows.Forms.XPanderPanel xpanderPanel = e.Control as BSE.Windows.Forms.XPanderPanel; + if(xpanderPanel != null) + { + if(xpanderPanel.Expand == true) + { + foreach(XPanderPanel tmpXPanderPanel in this.XPanderPanels) + { + if(tmpXPanderPanel != xpanderPanel) + { + tmpXPanderPanel.Expand = false; + tmpXPanderPanel.Height = xpanderPanel.CaptionHeight; + } + } + } + xpanderPanel.Parent = this; + xpanderPanel.Anchor = ((System.Windows.Forms.AnchorStyles) (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + xpanderPanel.Left = this.Padding.Left; + xpanderPanel.Width = this.ClientRectangle.Width - this.Padding.Left - this.Padding.Right; + xpanderPanel.PanelStyle = this.PanelStyle; + xpanderPanel.ColorScheme = this.ColorScheme; + if(this.PanelColors != null) + { + xpanderPanel.SetPanelProperties(this.PanelColors); + } + xpanderPanel.ShowBorder = this.ShowBorder; + xpanderPanel.ShowCloseIcon = this.m_bShowCloseIcon; + xpanderPanel.ShowExpandIcon = this.m_bShowExpandIcon; + xpanderPanel.CaptionStyle = this.m_captionStyle; + xpanderPanel.Top = this.GetTopPosition(); + xpanderPanel.PanelStyleChanged += new EventHandler(XpanderPanelPanelStyleChanged); + xpanderPanel.ExpandClick += new EventHandler(this.XPanderPanelExpandClick); + xpanderPanel.CloseClick += new EventHandler(this.XPanderPanelCloseClick); + } + else + { + throw new InvalidOperationException("Can only add BSE.Windows.Forms.XPanderPanel"); + } + } + /// + /// Raises the ControlRemoved event. + /// + /// A ControlEventArgs that contains the event data. + protected override void OnControlRemoved(System.Windows.Forms.ControlEventArgs e) + { + base.OnControlRemoved(e); + + BSE.Windows.Forms.XPanderPanel xpanderPanel = + e.Control as BSE.Windows.Forms.XPanderPanel; + + if(xpanderPanel != null) + { + xpanderPanel.PanelStyleChanged -= new EventHandler(XpanderPanelPanelStyleChanged); + xpanderPanel.ExpandClick -= new EventHandler(this.XPanderPanelExpandClick); + xpanderPanel.CloseClick -= new EventHandler(this.XPanderPanelCloseClick); + } + } + /// + /// Raises the Resize event. + /// + /// An EventArgs that contains the event data. + protected override void OnResize(System.EventArgs e) + { + base.OnResize(e); + int iXPanderPanelCaptionHeight = 0; + + if(this.m_xpanderPanels != null) + { + foreach(XPanderPanel xpanderPanel in this.m_xpanderPanels) + { + xpanderPanel.Width = this.ClientRectangle.Width - this.Padding.Left - this.Padding.Right; + if(xpanderPanel.Visible == false) + { + iXPanderPanelCaptionHeight -= xpanderPanel.CaptionHeight; + } + iXPanderPanelCaptionHeight += xpanderPanel.CaptionHeight; + } + + foreach(XPanderPanel xpanderPanel in this.m_xpanderPanels) + { + if(xpanderPanel.Expand == true) + { + xpanderPanel.Height = this.Height - iXPanderPanelCaptionHeight - this.Padding.Top - this.Padding.Bottom + xpanderPanel.CaptionHeight; + return; + } + } + } + } + /// + /// Raises the PanelStyle changed event + /// + /// The source of the event. + /// A PanelStyleChangeEventArgs that contains the event data. + protected virtual void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e) + { + PanelStyle panelStyle = e.PanelStyle; + this.Padding = new System.Windows.Forms.Padding(0); + + foreach(XPanderPanel xpanderPanel in this.XPanderPanels) + { + PropertyDescriptorCollection propertyDescriptorCollection = TypeDescriptor.GetProperties(xpanderPanel); + if(propertyDescriptorCollection.Count > 0) + { + PropertyDescriptor propertyDescriptorPanelStyle = propertyDescriptorCollection["PanelStyle"]; + if(propertyDescriptorPanelStyle != null) + { + propertyDescriptorPanelStyle.SetValue(xpanderPanel, panelStyle); + } + PropertyDescriptor propertyDescriptorLeft = propertyDescriptorCollection["Left"]; + if(propertyDescriptorLeft != null) + { + propertyDescriptorLeft.SetValue(xpanderPanel, this.Padding.Left); + } + PropertyDescriptor propertyDescriptorWidth = propertyDescriptorCollection["Width"]; + if(propertyDescriptorWidth != null) + { + propertyDescriptorWidth.SetValue( + xpanderPanel, + this.ClientRectangle.Width + - this.Padding.Left + - this.Padding.Right); + } + + } + } + if(this.PanelStyleChanged != null) + { + this.PanelStyleChanged(sender, e); + } + } + /// + /// Raises the ColorScheme changed event + /// + /// The source of the event. + /// A EventArgs that contains the event data. + protected virtual void OnColorSchemeChanged(object sender, ColorSchemeChangeEventArgs e) + { + ColorScheme eColorScheme = e.ColorSchema; + foreach(XPanderPanel xpanderPanel in this.XPanderPanels) + { + PropertyDescriptor propertyDescriptor = TypeDescriptor.GetProperties(xpanderPanel)["ColorScheme"]; + if(propertyDescriptor != null) + { + propertyDescriptor.SetValue(xpanderPanel, eColorScheme); + } + } + if(this.ColorSchemeChanged != null) + { + this.ColorSchemeChanged(sender, e); + } + } + /// + /// Raises the CaptionHeight changed event + /// + /// The source of the event. + /// A EventArgs that contains the event data. + protected virtual void OnCaptionHeightChanged(object sender, EventArgs e) + { + foreach(XPanderPanel xpanderPanel in this.XPanderPanels) + { + PropertyDescriptor propertyDescriptor = TypeDescriptor.GetProperties(xpanderPanel)["CaptionHeight"]; + if(propertyDescriptor != null) + { + propertyDescriptor.SetValue(xpanderPanel, this.m_iCaptionHeight); + } + } + if(this.CaptionHeightChanged != null) + { + this.CaptionHeightChanged(sender, e); + } + } + /// + /// Raises the CaptionStyleChanged changed event + /// + /// The source of the event. + /// A EventArgs that contains the event data. + protected virtual void OnCaptionStyleChanged(object sender, EventArgs e) + { + foreach(XPanderPanel xpanderPanel in this.XPanderPanels) + { + PropertyDescriptor propertyDescriptor = TypeDescriptor.GetProperties(xpanderPanel)["CaptionStyle"]; + if(propertyDescriptor != null) + { + propertyDescriptor.SetValue(xpanderPanel, this.m_captionStyle); + } + } + if(this.CaptionStyleChanged != null) + { + this.CaptionStyleChanged(sender, e); + } + } + #endregion + + #region MethodsPrivate + + private void XPanderPanelExpandClick(object sender, EventArgs e) + { + BSE.Windows.Forms.XPanderPanel xpanderPanel = sender as BSE.Windows.Forms.XPanderPanel; + if(xpanderPanel != null) + { + this.Expand(xpanderPanel); + } + } + + private void XPanderPanelCloseClick(object sender, EventArgs e) + { + BSE.Windows.Forms.XPanderPanel xpanderPanel = sender as BSE.Windows.Forms.XPanderPanel; + if(xpanderPanel != null) + { + this.Controls.Remove(xpanderPanel); + } + } + + private void XpanderPanelPanelStyleChanged(object sender, PanelStyleChangeEventArgs e) + { + PanelStyle panelStyle = e.PanelStyle; + if(panelStyle != this.m_ePanelStyle) + { + this.PanelStyle = panelStyle; + } + } + + private int GetTopPosition() + { + int iTopPosition = this.Padding.Top; + int iNextTopPosition = 0; + + //The next top position is the highest top value + that controls height, with a + //little vertical spacing thrown in for good measure + IEnumerator enumerator = this.XPanderPanels.GetEnumerator(); + while(enumerator.MoveNext()) + { + XPanderPanel xpanderPanel = (XPanderPanel) enumerator.Current; + + if(xpanderPanel.Visible == true) + { + if(iNextTopPosition == this.Padding.Top) + { + iTopPosition = this.Padding.Top; + } + else + { + iTopPosition = iNextTopPosition; + } + iNextTopPosition = iTopPosition + xpanderPanel.Height; + } + } + return iTopPosition; + } + #endregion + } + + #endregion + + #region Class XPanderPanelListDesigner + + /// + /// Extends the design mode behavior of a XPanderPanelList control that supports nested controls. + /// + internal class XPanderPanelListDesigner : System.Windows.Forms.Design.ParentControlDesigner + { + #region FieldsPrivate + + private Pen m_borderPen = new Pen(Color.FromKnownColor(KnownColor.ControlDarkDark)); + private XPanderPanelList m_xpanderPanelList; + + #endregion + + #region MethodsPublic + /// + /// nitializes a new instance of the XPanderPanelListDesigner class. + /// + public XPanderPanelListDesigner() + { + this.m_borderPen.DashStyle = DashStyle.Dash; + } + /// + /// Initializes the designer with the specified component. + /// + /// The IComponent to associate with the designer. + public override void Initialize(System.ComponentModel.IComponent component) + { + base.Initialize(component); + this.m_xpanderPanelList = (XPanderPanelList) this.Control; + //Disable the autoscroll feature for the control during design time. The control + //itself sets this property to true when it initializes at run time. Trying to position + //controls in this control with the autoscroll property set to True is problematic. + this.m_xpanderPanelList.AutoScroll = false; + } + /// + /// This member overrides ParentControlDesigner.ActionLists + /// + public override DesignerActionListCollection ActionLists + { + get + { + // Create action list collection + DesignerActionListCollection actionLists = new DesignerActionListCollection(); + + // Add custom action list + actionLists.Add(new XPanderPanelListDesignerActionList(this.Component)); + + // Return to the designer action service + return actionLists; + } + } + + #endregion + + #region MethodsProtected + /// + /// Releases the unmanaged resources used by the XPanderPanelDesigner, + /// and optionally releases the managed resources. + /// + /// true to release both managed and unmanaged resources; + /// false to release only unmanaged resources. + protected override void Dispose(bool disposing) + { + try + { + if(disposing) + { + if(this.m_borderPen != null) + { + this.m_borderPen.Dispose(); + } + } + } + finally + { + base.Dispose(disposing); + } + } + /// + /// Receives a call when the control that the designer is managing has painted its surface so the designer can + /// paint any additional adornments on top of the xpanderpanel. + /// + /// A PaintEventArgs the designer can use to draw on the xpanderpanel. + protected override void OnPaintAdornments(PaintEventArgs e) + { + base.OnPaintAdornments(e); + e.Graphics.DrawRectangle(this.m_borderPen, 0, 0, this.m_xpanderPanelList.Width - 2, this.m_xpanderPanelList.Height - 2); + } + + #endregion + } + + #endregion + + #region Class XPanderPanelListDesignerActionList + + /// + /// Provides the class for types that define a list of items used to create a smart tag panel for the XPanderPanelList. + /// + public class XPanderPanelListDesignerActionList : DesignerActionList + { + #region Properties + + /// + /// Gets a collecion of XPanderPanel objects + /// + [Editor(typeof(XPanderPanelCollectionEditor), typeof(UITypeEditor))] + public XPanderPanelCollection XPanderPanels + { + get + { + return this.XPanderPanelList.XPanderPanels; + } + } + /// + /// Gets or sets the style of the panel. + /// + public PanelStyle PanelStyle + { + get + { + return this.XPanderPanelList.PanelStyle; + } + set + { + SetProperty("PanelStyle", value); + } + } + /// + /// Gets or sets the color schema which is used for the panel. + /// + public ColorScheme ColorScheme + { + get + { + return this.XPanderPanelList.ColorScheme; + } + set + { + SetProperty("ColorScheme", value); + } + } + /// + /// Gets or sets the style of the caption (not for PanelStyle.Aqua). + /// + public CaptionStyle CaptionStyle + { + get + { + return this.XPanderPanelList.CaptionStyle; + } + set + { + SetProperty("CaptionStyle", value); + } + } + /// + /// Gets or sets a value indicating whether the control shows a border. + /// + public bool ShowBorder + { + get + { + return this.XPanderPanelList.ShowBorder; + } + set + { + SetProperty("ShowBorder", value); + } + } + /// + /// Gets or sets a value indicating whether the expand icon is visible + /// + public bool ShowExpandIcon + { + get + { + return this.XPanderPanelList.ShowExpandIcon; + } + set + { + SetProperty("ShowExpandIcon", value); + } + } + /// + /// Gets or sets a value indicating whether the close icon is visible + /// + public bool ShowCloseIcon + { + get + { + return this.XPanderPanelList.ShowCloseIcon; + } + set + { + SetProperty("ShowCloseIcon", value); + } + } + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the XPanderPanelListDesignerActionList class. + /// + /// A component related to the DesignerActionList. + public XPanderPanelListDesignerActionList(System.ComponentModel.IComponent component) + : base(component) + { + // Automatically display smart tag panel when + // design-time component is dropped onto the + // Windows Forms Designer + base.AutoShow = true; + } + /// + /// Returns the collection of DesignerActionItem objects contained in the list. + /// + /// A DesignerActionItem array that contains the items in this list. + public override DesignerActionItemCollection GetSortedActionItems() + { + // Create list to store designer action items + DesignerActionItemCollection actionItems = new DesignerActionItemCollection(); + + actionItems.Add( + new DesignerActionMethodItem( + this, + "ToggleDockStyle", + GetDockStyleText(), + "Design", + "Dock or undock this control in it's parent container.", + true)); + + actionItems.Add( + new DesignerActionPropertyItem( + "ShowBorder", + "Show Border", + GetCategory(this.XPanderPanelList, "ShowBorder"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "ShowExpandIcon", + "Show ExpandIcon", + GetCategory(this.XPanderPanelList, "ShowExpandIcon"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "ShowCloseIcon", + "Show CloseIcon", + GetCategory(this.XPanderPanelList, "ShowCloseIcon"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "PanelStyle", + "Select PanelStyle", + GetCategory(this.XPanderPanelList, "PanelStyle"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "ColorScheme", + "Select ColorScheme", + GetCategory(this.XPanderPanelList, "ColorScheme"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "CaptionStyle", + "Select CaptionStyle", + GetCategory(this.XPanderPanelList, "CaptionStyle"))); + + actionItems.Add( + new DesignerActionPropertyItem( + "XPanderPanels", + "Edit XPanderPanels", + GetCategory(this.XPanderPanelList, "XPanderPanels"))); + + return actionItems; + } + /// + /// Dock/Undock designer action method implementation + /// + public void ToggleDockStyle() + { + // Toggle ClockControl's Dock property + if(this.XPanderPanelList.Dock != DockStyle.Fill) + { + SetProperty("Dock", DockStyle.Fill); + } + else + { + SetProperty("Dock", DockStyle.None); + } + } + + #endregion + + #region MethodsPrivate + /// + /// Helper method that returns an appropriate display name for the Dock/Undock property, + /// based on the ClockControl's current Dock property value + /// + /// the string to display + private string GetDockStyleText() + { + if(this.XPanderPanelList.Dock == DockStyle.Fill) + { + return "Undock in parent container"; + } + else + { + return "Dock in parent container"; + } + } + + private XPanderPanelList XPanderPanelList + { + get + { + return (XPanderPanelList) this.Component; + } + } + + // Helper method to safely set a components property + private void SetProperty(string propertyName, object value) + { + // Get property + System.ComponentModel.PropertyDescriptor property + = System.ComponentModel.TypeDescriptor.GetProperties(this.XPanderPanelList)[propertyName]; + // Set property value + property.SetValue(this.XPanderPanelList, value); + } + // Helper method to return the Category string from a + // CategoryAttribute assigned to a property exposed by + //the specified object + private static string GetCategory(object source, string propertyName) + { + System.Reflection.PropertyInfo property = source.GetType().GetProperty(propertyName); + CategoryAttribute attribute = (CategoryAttribute) property.GetCustomAttributes(typeof(CategoryAttribute), false)[0]; + if(attribute == null) + { + return null; + } + else + { + return attribute.Category; + } + } + + #endregion + } + + #endregion + + #region Class XPanderPanelCollection + + /// + /// Contains a collection of XPanderPanel objects. + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")] + public sealed class XPanderPanelCollection : IList, ICollection, IEnumerable + { + + #region FieldsPrivate + + private XPanderPanelList m_xpanderPanelList; + private Control.ControlCollection m_controlCollection; + + #endregion + + #region Constructor + + internal XPanderPanelCollection(XPanderPanelList xpanderPanelList) + { + this.m_xpanderPanelList = xpanderPanelList; + this.m_controlCollection = this.m_xpanderPanelList.Controls; + } + + #endregion + + #region Properties + /// + /// Gets or sets a XPanderPanel in the collection. + /// + /// The zero-based index of the XPanderPanel to get or set. + /// The xPanderPanel at the specified index. + public XPanderPanel this[int index] + { + get + { + return (XPanderPanel) this.m_controlCollection[index] as XPanderPanel; + } + } + + #endregion + + #region MethodsPublic + /// + /// Determines whether the XPanderPanelCollection contains a specific XPanderPanel + /// + /// The XPanderPanel to locate in the XPanderPanelCollection + /// true if the XPanderPanelCollection contains the specified value; otherwise, false. + public bool Contains(XPanderPanel xpanderPanel) + { + return this.m_controlCollection.Contains(xpanderPanel); + } + /// + /// Adds a XPanderPanel to the collection. + /// + /// The XPanderPanel to add. + public void Add(XPanderPanel xpanderPanel) + { + this.m_controlCollection.Add(xpanderPanel); + this.m_xpanderPanelList.Invalidate(); + + } + /// + /// Removes the first occurrence of a specific XPanderPanel from the XPanderPanelCollection + /// + /// The XPanderPanel to remove from the XPanderPanelCollection + public void Remove(XPanderPanel xpanderPanel) + { + this.m_controlCollection.Remove(xpanderPanel); + } + /// + /// Removes all the XPanderPanels from the collection. + /// + public void Clear() + { + this.m_controlCollection.Clear(); + } + /// + /// Gets the number of XPanderPanels in the collection. + /// + public int Count + { + get + { + return this.m_controlCollection.Count; + } + } + /// + /// Gets a value indicating whether the collection is read-only. + /// + public bool IsReadOnly + { + get + { + return this.m_controlCollection.IsReadOnly; + } + } + /// + /// Returns an enumeration of all the XPanderPanels in the collection. + /// + /// + public IEnumerator GetEnumerator() + { + return this.m_controlCollection.GetEnumerator(); + } + /// + /// Returns the index of the specified XPanderPanel in the collection. + /// + /// The xpanderPanel to find the index of. + /// The index of the xpanderPanel, or -1 if the xpanderPanel is not in the ControlCollection instance. + public int IndexOf(XPanderPanel xpanderPanel) + { + return this.m_controlCollection.IndexOf(xpanderPanel); + } + /// + /// Removes the XPanderPanel at the specified index from the collection. + /// + /// The zero-based index of the xpanderPanel to remove from the ControlCollection instance. + public void RemoveAt(int index) + { + this.m_controlCollection.RemoveAt(index); + } + /// + /// Inserts an XPanderPanel to the collection at the specified index. + /// + /// The zero-based index at which value should be inserted. + /// The XPanderPanel to insert into the Collection. + public void Insert(int index, XPanderPanel xpanderPanel) + { + ((IList) this).Insert(index, (object) xpanderPanel); + } + /// + /// Copies the elements of the collection to an Array, starting at a particular Array index. + /// + /// The one-dimensional Array that is the destination of the elements copied from ICollection. + /// The Array must have zero-based indexing. + /// + /// The zero-based index in array at which copying begins. + public void CopyTo(XPanderPanel[] xpanderPanels, int index) + { + this.m_controlCollection.CopyTo(xpanderPanels, index); + } + + #endregion + + #region Interface ICollection + /// + /// Gets the number of elements contained in the ICollection. + /// + int ICollection.Count + { + get + { + return this.Count; + } + } + /// + /// Gets a value indicating whether access to the ICollection is synchronized + /// + bool ICollection.IsSynchronized + { + get + { + return ((ICollection) this.m_controlCollection).IsSynchronized; + } + } + /// + /// Gets an object that can be used to synchronize access to the ICollection. + /// + object ICollection.SyncRoot + { + get + { + return ((ICollection) this.m_controlCollection).SyncRoot; + } + } + /// + /// Copies the elements of the ICollection to an Array, starting at a particular Array index. + /// + /// The one-dimensional Array that is the destination of the elements copied from ICollection. The Array must have zero-based indexing. + /// The zero-based index in array at which copying begins. + void ICollection.CopyTo(Array array, int index) + { + ((ICollection) this.m_controlCollection).CopyTo(array, index); + } + + #endregion + + #region Interface IList + /// + /// Gets or sets the element at the specified index. + /// + /// The zero-based index of the element to get or set. + /// The element at the specified index. + object IList.this[int index] + { + get + { + return this.m_controlCollection[index]; + } + set + { + } + } + /// + /// Adds an item to the IList. + /// + /// The Object to add to the IList. + /// The position into which the new element was inserted. + int IList.Add(object value) + { + XPanderPanel xpanderPanel = value as XPanderPanel; + if(xpanderPanel == null) + { + throw new ArgumentException(string.Format(System.Globalization.CultureInfo.CurrentUICulture, + Resources.IDS_ArgumentException, + typeof(XPanderPanel).Name)); + } + this.Add(xpanderPanel); + return this.IndexOf(xpanderPanel); + } + /// + /// Determines whether the IList contains a specific value. + /// + /// The Object to locate in the IList. + /// true if the Object is found in the IList; otherwise, false. + bool IList.Contains(object value) + { + return this.Contains(value as XPanderPanel); + } + /// + /// Determines the index of a specific item in the IList. + /// + /// The Object to locate in the IList. + /// The index of value if found in the list; otherwise, -1. + int IList.IndexOf(object value) + { + return this.IndexOf(value as XPanderPanel); + } + /// + /// Inserts an item to the IList at the specified index. + /// + /// The zero-based index of the item to insert. + /// The Object to insert into the IList. + void IList.Insert(int index, object value) + { + if((value is XPanderPanel) == false) + { + throw new ArgumentException( + string.Format(System.Globalization.CultureInfo.CurrentUICulture, + Resources.IDS_ArgumentException, + typeof(XPanderPanel).Name)); + } + } + /// + /// Removes the first occurrence of a specific object from the IList. + /// + /// The Object to remove from the IList. + void IList.Remove(object value) + { + this.Remove(value as XPanderPanel); + } + /// + /// Removes the IList item at the specified index. + /// + /// The zero-based index of the item to remove. + void IList.RemoveAt(int index) + { + this.RemoveAt(index); + } + /// + /// Gets a value indicating whether the IList is read-only. + /// + bool IList.IsReadOnly + { + get + { + return this.IsReadOnly; + } + } + /// + /// Gets a value indicating whether the IList has a fixed size. + /// + bool IList.IsFixedSize + { + get + { + return ((IList) this.m_controlCollection).IsFixedSize; + } + } + + #endregion + } + + #endregion + + #region Class XPanderPanelCollectionEditor + /// + /// Provides a user interface that can edit most types of collections at design time. + /// + internal class XPanderPanelCollectionEditor : CollectionEditor + { + #region FieldsPrivate + + private CollectionForm m_collectionForm; + + #endregion + + #region MethodsPublic + /// + /// Initializes a new instance of the XPanderPanelCollectionEditor class + /// using the specified collection type. + /// + /// The type of the collection for this editor to edit. + public XPanderPanelCollectionEditor(Type type) + : base(type) + { + } + + #endregion + + #region MethodsProtected + /// + /// Creates a new form to display and edit the current collection. + /// + /// A CollectionEditor.CollectionForm to provide as the user interface for editing the collection. + protected override CollectionForm CreateCollectionForm() + { + this.m_collectionForm = base.CreateCollectionForm(); + return this.m_collectionForm; + } + /// + /// Creates a new instance of the specified collection item type. + /// + /// The type of item to create. + /// A new instance of the specified object. + protected override Object CreateInstance(Type ItemType) + { + /* you can create the new instance yourself + * ComplexItem ci=new ComplexItem(2,"ComplexItem",null); + * we know for sure that the itemType it will always be ComplexItem + *but this time let it to do the job... + */ + + BSE.Windows.Forms.XPanderPanel xpanderPanel = + (BSE.Windows.Forms.XPanderPanel) base.CreateInstance(ItemType); + + if(this.Context.Instance != null) + { + xpanderPanel.Expand = true; + } + return xpanderPanel; + } + + #endregion + } + + #endregion +} diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanelList.resx b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanelList.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderPanelList.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + False + + + True + + + True + + + 80 + + + (Default) + + + False + + + XPanderPanelList + + + Private + + + 8, 8 + + \ No newline at end of file diff --git a/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderStateChangeEventArgs.cs b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderStateChangeEventArgs.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/BSE.Windows.Forms/XPander/XPanderStateChangeEventArgs.cs @@ -0,0 +1,47 @@ +using System; + +namespace BSE.Windows.Forms +{ + /// + /// Provides data for the XPanderStateChange event. + /// + /// Copyright 2006-2008 Uwe Eichkorn + /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY + /// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + /// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR + /// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER + /// REMAINS UNCHANGED. + /// + public class XPanderStateChangeEventArgs : EventArgs + { + #region FieldsPrivate + + private bool m_bExpand; + + #endregion + + #region Properties + + /// + /// Gets a value indicating whether the panel expands. + /// + public bool Expand + { + get {return m_bExpand;} + } + + #endregion + + #region MethodsPublic + /// + /// arguments used when a XPanderStateChange event occurs. + /// + /// Gets a value indicating whether the panel expands. + public XPanderStateChangeEventArgs(bool bExpand) + { + this.m_bExpand = bExpand; + } + + #endregion + } +} diff --git a/Demo.WindowsForms/CustomMarkers/GMapMarkerCircle.cs b/Demo.WindowsForms/CustomMarkers/GMapMarkerCircle.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/CustomMarkers/GMapMarkerCircle.cs @@ -0,0 +1,103 @@ + +namespace Demo.WindowsForms.CustomMarkers +{ + using System; + using System.Drawing; + using System.Runtime.Serialization; + using GMap.NET; + using GMap.NET.WindowsForms; + +#if !PocketPC + [Serializable] + public class GMapMarkerCircle : GMapMarker, ISerializable +#else + public class GMapMarkerCircle : GMapMarker +#endif + { + /// + /// In Meters + /// + public int Radius; + + /// + /// specifies how the outline is painted + /// + [NonSerialized] +#if !PocketPC + public Pen Stroke = new Pen(Color.FromArgb(155, Color.MidnightBlue)); +#else + public Pen Stroke = new Pen(Color.MidnightBlue); +#endif + + /// + /// background color + /// + [NonSerialized] +#if !PocketPC + public Brush Fill = new SolidBrush(Color.FromArgb(155, Color.AliceBlue)); +#else + public Brush Fill = new System.Drawing.SolidBrush(Color.AliceBlue); +#endif + + /// + /// is filled + /// + public bool IsFilled = true; + + public GMapMarkerCircle(PointLatLng p) + : base(p) + { + Radius = 100; // 100m + IsHitTestVisible = false; + } + + public override void OnRender(Graphics g) + { + int R = (int)((Radius) / Overlay.Control.MapProvider.Projection.GetGroundResolution((int)Overlay.Control.Zoom, Position.Lat)) * 2; + + if(IsFilled) + { + g.FillEllipse(Fill, new System.Drawing.Rectangle(LocalPosition.X - R / 2, LocalPosition.Y - R / 2, R, R)); + } + g.DrawEllipse(Stroke, new System.Drawing.Rectangle(LocalPosition.X - R / 2, LocalPosition.Y - R / 2, R, R)); + } + + public override void Dispose() + { + if(Stroke != null) + { + Stroke.Dispose(); + Stroke = null; + } + + if(Fill != null) + { + Fill.Dispose(); + Fill = null; + } + + base.Dispose(); + } + +#if !PocketPC + + #region ISerializable Members + + void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) + { + base.GetObjectData(info, context); + + // TODO: Radius, IsFilled + } + + protected GMapMarkerCircle(SerializationInfo info, StreamingContext context) + : base(info, context) + { + // TODO: Radius, IsFilled + } + + #endregion + +#endif + } +} diff --git a/Demo.WindowsForms/CustomMarkers/GMapMarkerRect.cs b/Demo.WindowsForms/CustomMarkers/GMapMarkerRect.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/CustomMarkers/GMapMarkerRect.cs @@ -0,0 +1,68 @@ + +namespace Demo.WindowsForms.CustomMarkers +{ + using System.Drawing; + using GMap.NET.WindowsForms; + using GMap.NET.WindowsForms.Markers; + using GMap.NET; + using System; + using System.Runtime.Serialization; + using System.Drawing.Drawing2D; + + [Serializable] + public class GMapMarkerRect : GMapMarker, ISerializable + { + [NonSerialized] + public Pen Pen; + + [NonSerialized] + public GMarkerGoogle InnerMarker; + + public GMapMarkerRect(PointLatLng p) + : base(p) + { + Pen = new Pen(Brushes.Blue, 5); + + // do not forget set Size of the marker + // if so, you shall have no event on it ;} + Size = new System.Drawing.Size(111, 111); + Offset = new System.Drawing.Point(-Size.Width / 2, -Size.Height / 2); + } + + public override void OnRender(Graphics g) + { + g.DrawRectangle(Pen, new System.Drawing.Rectangle(LocalPosition.X, LocalPosition.Y, Size.Width, Size.Height)); + } + + public override void Dispose() + { + if(Pen != null) + { + Pen.Dispose(); + Pen = null; + } + + if(InnerMarker != null) + { + InnerMarker.Dispose(); + InnerMarker = null; + } + + base.Dispose(); + } + + #region ISerializable Members + + void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) + { + base.GetObjectData(info, context); + } + + protected GMapMarkerRect(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + + #endregion + } +} diff --git a/Demo.WindowsForms/Demo.WindowsForms.csproj b/Demo.WindowsForms/Demo.WindowsForms.csproj new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Demo.WindowsForms.csproj @@ -0,0 +1,307 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {A2E07A76-8B2C-41A2-B23E-EA31AE94D706} + WinExe + Properties + Demo.WindowsForms + Demo.WindowsForms + v2.0 + 512 + Resources\ImageReady.ico + + + + + 3.5 + + false + + C:\Users\mkanning\Desktop\deploy\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 1 + 1.0.0.%2a + false + true + true + + + true + + + sn.snk + + + + LocalIntranet + + + true + + + + + Properties\app.manifest + + + true + bin\Debug\ + TRACE;DEBUG;MONO_disabled; SQLite + true + full + AnyCPU + ..\Build\Debug\Demo.WindowsForms.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + false + false + + + ..\Build\Release\ + TRACE;MONO_disabled; SQLite + true + true + AnyCPU + ..\Build\Release\Demo.WindowsForms.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + false + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + false + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + false + + + A665DE2AD17B057C0F5ABA33202071825CBAC9B0 + + + Demo.WindowsForms_TemporaryKey.pfx + + + true + + + + False + ..\GMap.NET.Core\bin\Debug\GMap.NET.Core.dll + + + False + ..\GMap.NET.WindowsForms\bin\Debug\GMap.NET.WindowsForms.dll + + + False + ..\References\Windows\Mono.Data.SqliteClient.dll + False + + + + + False + ..\References\Windows\System.Data.SQLite.DLL + False + + + + + + + + + + Properties\VersionInfo.cs + + + Component + + + ProgressBar.cs + + + Component + + + + + + + + + + + + + Component + + + Splitter.cs + + + Component + + + + + + + + + + + + + Component + + + Panel.cs + + + + + + + + + + + + + + + + Component + + + XPanderPanel.cs + + + Component + + + XPanderPanelList.cs + + + + + Form + + + MainForm.cs + + + + Form + + + Message.cs + + + Form + + + StaticImage.cs + + + True + True + Resources.resx + + + + UserControl + + + + + + + + Panel.cs + Designer + + + XPanderPanel.cs + Designer + + + XPanderPanelList.cs + Designer + + + MainForm.cs + Designer + + + Message.cs + + + StaticImage.cs + Designer + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Demo.WindowsForms/Demo.WindowsForms.csproj.user b/Demo.WindowsForms/Demo.WindowsForms.csproj.user new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Demo.WindowsForms.csproj.user @@ -0,0 +1,14 @@ + + + + false + + + + + + + en-US + false + + \ No newline at end of file diff --git a/Demo.WindowsForms/Demo.WindowsForms.sln b/Demo.WindowsForms/Demo.WindowsForms.sln new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Demo.WindowsForms.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C# Express 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.WindowsForms", "Demo.WindowsForms.csproj", "{A2E07A76-8B2C-41A2-B23E-EA31AE94D706}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2E07A76-8B2C-41A2-B23E-EA31AE94D706}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Demo.WindowsForms/Demo.WindowsForms_TemporaryKey.pfx b/Demo.WindowsForms/Demo.WindowsForms_TemporaryKey.pfx new file mode 100644 index 0000000000000000000000000000000000000000..cc5b70858dcfbfd8164f397d0e8e5a9d313b8850 GIT binary patch literal 1700 zc$`&}dpMM77{=cj<8vAclXDK$tX;=JbI`CvOj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;PoXGcg= zN0!g)(@liN{`wB*zVk|TYPl-xo3s+623FAz->pmF3l}v>uSKliWXcwUd$I+SXWKUp zeNyUIy!$+VxMj=C(F1`aCb#O% zgHh?|RJDZW)Vb*HF01&cz^6pElZ{I0$q}1|GBQ)!UiaW!IXGnOQjpc5n;50JKgPWm zj_$~LwcrD7o9tz}Tz|Jyb}af1Tc2?Y?kXDep$=8Qq1iCjTH1ug>y4DpTqXhhs=9A! ze%u9Wap#aDUACB4UQkRXehmUeKc0p&_*Q8<3=P)r@6+;+tV>NP2;WoinYW*?|fO44LX`AwPM)fPVo|7Top# diff --git a/Demo.WindowsForms/Forms/MainForm.Designer.cs b/Demo.WindowsForms/Forms/MainForm.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Forms/MainForm.Designer.cs @@ -0,0 +1,2194 @@ +namespace Demo.WindowsForms +{ + partial class MainForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.tabMap = new System.Windows.Forms.TabPage(); + this.panel4 = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.btnTest = new System.Windows.Forms.Button(); + this.tabControl = new System.Windows.Forms.TabControl(); + this.tabGraphs = new System.Windows.Forms.TabPage(); + this.pnlDataListDisplay = new System.Windows.Forms.Panel(); + this.tboxChartData = new System.Windows.Forms.TextBox(); + this.lblChartData = new System.Windows.Forms.Label(); + this.tboxCurrent = new System.Windows.Forms.TextBox(); + this.lblCurrent = new System.Windows.Forms.Label(); + this.tboxMin = new System.Windows.Forms.TextBox(); + this.lblAverage = new System.Windows.Forms.Label(); + this.tboxMax = new System.Windows.Forms.TextBox(); + this.lblMax = new System.Windows.Forms.Label(); + this.tboxAverage = new System.Windows.Forms.TextBox(); + this.lblMin = new System.Windows.Forms.Label(); + this.ctnParentChartHolder = new System.Windows.Forms.SplitContainer(); + this.ctnTopChartHolder = new System.Windows.Forms.SplitContainer(); + this.lblTopLeftChartTitle = new System.Windows.Forms.Label(); + this.chrtTopLeft = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.lblTopRightChartTitle = new System.Windows.Forms.Label(); + this.chrtTopRight = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.ctnBottomChartHolder = new System.Windows.Forms.SplitContainer(); + this.lblBottomLeftChartTitle = new System.Windows.Forms.Label(); + this.chrtBottomLeft = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.lblBottomRightChartTitle = new System.Windows.Forms.Label(); + this.chrtBottomRight = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.tabData = new System.Windows.Forms.TabPage(); + this.gboxSlaveData = new System.Windows.Forms.GroupBox(); + this.textBox16 = new System.Windows.Forms.TextBox(); + this.label26 = new System.Windows.Forms.Label(); + this.textBox17 = new System.Windows.Forms.TextBox(); + this.label27 = new System.Windows.Forms.Label(); + this.label28 = new System.Windows.Forms.Label(); + this.textBox15 = new System.Windows.Forms.TextBox(); + this.label25 = new System.Windows.Forms.Label(); + this.textBox14 = new System.Windows.Forms.TextBox(); + this.label24 = new System.Windows.Forms.Label(); + this.textBox13 = new System.Windows.Forms.TextBox(); + this.label23 = new System.Windows.Forms.Label(); + this.label22 = new System.Windows.Forms.Label(); + this.textBox12 = new System.Windows.Forms.TextBox(); + this.label21 = new System.Windows.Forms.Label(); + this.textBox11 = new System.Windows.Forms.TextBox(); + this.label19 = new System.Windows.Forms.Label(); + this.textBox10 = new System.Windows.Forms.TextBox(); + this.label18 = new System.Windows.Forms.Label(); + this.textBox9 = new System.Windows.Forms.TextBox(); + this.label17 = new System.Windows.Forms.Label(); + this.textBox8 = new System.Windows.Forms.TextBox(); + this.label15 = new System.Windows.Forms.Label(); + this.textBox7 = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.label20 = new System.Windows.Forms.Label(); + this.gboxMasterData = new System.Windows.Forms.GroupBox(); + this.textBox6 = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.textBox5 = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.textBox4 = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.label16 = new System.Windows.Forms.Label(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.tboxMessageBox = new System.Windows.Forms.TextBox(); + this.MainMap = new Demo.WindowsForms.Map(); + this.splitter1 = new BSE.Windows.Forms.Splitter(); + this.panelMenu = new BSE.Windows.Forms.Panel(); + this.xPanderPanelList1 = new BSE.Windows.Forms.XPanderPanelList(); + this.xPanderPanelMain = new BSE.Windows.Forms.XPanderPanel(); + this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); + this.groupBox8 = new System.Windows.Forms.GroupBox(); + this.btnZoomCenter = new System.Windows.Forms.Button(); + this.xboxPlacemarkInfo = new System.Windows.Forms.CheckBox(); + this.btnClearAll = new System.Windows.Forms.Button(); + this.btnAddMarker = new System.Windows.Forms.Button(); + this.groupBox7 = new System.Windows.Forms.GroupBox(); + this.buttonExportToGpx = new System.Windows.Forms.Button(); + this.MobileLogTo = new System.Windows.Forms.DateTimePicker(); + this.lblClear = new System.Windows.Forms.Label(); + this.btnClearPolygons = new System.Windows.Forms.Button(); + this.MobileLogFrom = new System.Windows.Forms.DateTimePicker(); + this.btnMobileLog = new System.Windows.Forms.Button(); + this.buttonSetEnd = new System.Windows.Forms.Button(); + this.buttonSetStart = new System.Windows.Forms.Button(); + this.btnClearRoutes = new System.Windows.Forms.Button(); + this.btnAddRoute = new System.Windows.Forms.Button(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.btnLoadGPX = new System.Windows.Forms.Button(); + this.btnGetStatic = new System.Windows.Forms.Button(); + this.xboxGrid = new System.Windows.Forms.CheckBox(); + this.btnSaveView = new System.Windows.Forms.Button(); + this.lblMode = new System.Windows.Forms.Label(); + this.comboBoxMode = new System.Windows.Forms.ComboBox(); + this.xboxCanDrag = new System.Windows.Forms.CheckBox(); + this.xboxCurrentMarker = new System.Windows.Forms.CheckBox(); + this.lblMapType = new System.Windows.Forms.Label(); + this.comboBoxMapType = new System.Windows.Forms.ComboBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.lblGoTo = new System.Windows.Forms.Label(); + this.textBoxGeo = new System.Windows.Forms.TextBox(); + this.btnReload = new System.Windows.Forms.Button(); + this.btnGoToCoords = new System.Windows.Forms.Button(); + this.lblLng = new System.Windows.Forms.Label(); + this.lblLat = new System.Windows.Forms.Label(); + this.textBoxLng = new System.Windows.Forms.TextBox(); + this.textBoxLat = new System.Windows.Forms.TextBox(); + this.cboxCollectData = new System.Windows.Forms.CheckBox(); + this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); + this.btnZoomIn = new System.Windows.Forms.Button(); + this.trackBarZoomLevel = new System.Windows.Forms.TrackBar(); + this.btnZoomOut = new System.Windows.Forms.Button(); + this.xPanderPanelInfo = new BSE.Windows.Forms.XPanderPanel(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.textBoxZoomCurrent = new System.Windows.Forms.TextBox(); + this.textBoxrouteCount = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.textBoxLngCurrent = new System.Windows.Forms.TextBox(); + this.textBoxMarkerCount = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.textBoxLatCurrent = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.xPanderPanelCache = new BSE.Windows.Forms.XPanderPanel(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.textBoxCacheSize = new System.Windows.Forms.TextBox(); + this.textBoxCacheStatus = new System.Windows.Forms.TextBox(); + this.button10 = new System.Windows.Forms.Button(); + this.textBoxMemory = new System.Windows.Forms.TextBox(); + this.checkBoxUseRouteCache = new System.Windows.Forms.CheckBox(); + this.button9 = new System.Windows.Forms.Button(); + this.button11 = new System.Windows.Forms.Button(); + this.label10 = new System.Windows.Forms.Label(); + this.button2 = new System.Windows.Forms.Button(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.button17 = new System.Windows.Forms.Button(); + this.tabMap.SuspendLayout(); + this.panel4.SuspendLayout(); + this.panel2.SuspendLayout(); + this.tabControl.SuspendLayout(); + this.tabGraphs.SuspendLayout(); + this.pnlDataListDisplay.SuspendLayout(); + this.ctnParentChartHolder.Panel1.SuspendLayout(); + this.ctnParentChartHolder.Panel2.SuspendLayout(); + this.ctnParentChartHolder.SuspendLayout(); + this.ctnTopChartHolder.Panel1.SuspendLayout(); + this.ctnTopChartHolder.Panel2.SuspendLayout(); + this.ctnTopChartHolder.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.chrtTopLeft)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.chrtTopRight)).BeginInit(); + this.ctnBottomChartHolder.Panel1.SuspendLayout(); + this.ctnBottomChartHolder.Panel2.SuspendLayout(); + this.ctnBottomChartHolder.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.chrtBottomLeft)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.chrtBottomRight)).BeginInit(); + this.tabData.SuspendLayout(); + this.gboxSlaveData.SuspendLayout(); + this.gboxMasterData.SuspendLayout(); + this.panelMenu.SuspendLayout(); + this.xPanderPanelList1.SuspendLayout(); + this.xPanderPanelMain.SuspendLayout(); + this.tableLayoutPanel4.SuspendLayout(); + this.tableLayoutPanel5.SuspendLayout(); + this.groupBox8.SuspendLayout(); + this.groupBox7.SuspendLayout(); + this.groupBox5.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.tableLayoutPanel6.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.trackBarZoomLevel)).BeginInit(); + this.xPanderPanelInfo.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.xPanderPanelCache.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // tabMap + // + this.tabMap.Controls.Add(this.panel4); + this.tabMap.Location = new System.Drawing.Point(4, 22); + this.tabMap.Name = "tabMap"; + this.tabMap.Padding = new System.Windows.Forms.Padding(3); + this.tabMap.Size = new System.Drawing.Size(862, 701); + this.tabMap.TabIndex = 0; + this.tabMap.Text = "Map"; + this.tabMap.UseVisualStyleBackColor = true; + // + // panel4 + // + this.panel4.Controls.Add(this.panel2); + this.panel4.Controls.Add(this.splitter1); + this.panel4.Controls.Add(this.panelMenu); + this.panel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel4.Location = new System.Drawing.Point(3, 3); + this.panel4.Margin = new System.Windows.Forms.Padding(2); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(856, 695); + this.panel4.TabIndex = 44; + // + // panel2 + // + this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel2.Controls.Add(this.btnTest); + this.panel2.Controls.Add(this.MainMap); + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(628, 826); + this.panel2.TabIndex = 41; + // + // btnTest + // + this.btnTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnTest.Location = new System.Drawing.Point(587, 669); + this.btnTest.Name = "btnTest"; + this.btnTest.Size = new System.Drawing.Size(41, 26); + this.btnTest.TabIndex = 32; + this.btnTest.Text = "Test"; + this.btnTest.UseVisualStyleBackColor = true; + this.btnTest.Click += new System.EventHandler(this.btnTest_Click); + // + // tabControl + // + this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tabControl.Controls.Add(this.tabMap); + this.tabControl.Controls.Add(this.tabGraphs); + this.tabControl.Controls.Add(this.tabData); + this.tabControl.Location = new System.Drawing.Point(13, 13); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.Size = new System.Drawing.Size(870, 727); + this.tabControl.TabIndex = 45; + // + // tabGraphs + // + this.tabGraphs.Controls.Add(this.pnlDataListDisplay); + this.tabGraphs.Controls.Add(this.ctnParentChartHolder); + this.tabGraphs.Location = new System.Drawing.Point(4, 22); + this.tabGraphs.Name = "tabGraphs"; + this.tabGraphs.Padding = new System.Windows.Forms.Padding(3); + this.tabGraphs.Size = new System.Drawing.Size(862, 701); + this.tabGraphs.TabIndex = 2; + this.tabGraphs.Text = "Graphs"; + this.tabGraphs.UseVisualStyleBackColor = true; + // + // pnlDataListDisplay + // + this.pnlDataListDisplay.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pnlDataListDisplay.Controls.Add(this.tboxChartData); + this.pnlDataListDisplay.Controls.Add(this.lblChartData); + this.pnlDataListDisplay.Controls.Add(this.tboxCurrent); + this.pnlDataListDisplay.Controls.Add(this.lblCurrent); + this.pnlDataListDisplay.Controls.Add(this.tboxMin); + this.pnlDataListDisplay.Controls.Add(this.lblAverage); + this.pnlDataListDisplay.Controls.Add(this.tboxMax); + this.pnlDataListDisplay.Controls.Add(this.lblMax); + this.pnlDataListDisplay.Controls.Add(this.tboxAverage); + this.pnlDataListDisplay.Controls.Add(this.lblMin); + this.pnlDataListDisplay.Location = new System.Drawing.Point(6, 6); + this.pnlDataListDisplay.Name = "pnlDataListDisplay"; + this.pnlDataListDisplay.Size = new System.Drawing.Size(850, 26); + this.pnlDataListDisplay.TabIndex = 29; + // + // tboxChartData + // + this.tboxChartData.Enabled = false; + this.tboxChartData.Location = new System.Drawing.Point(85, 3); + this.tboxChartData.Name = "tboxChartData"; + this.tboxChartData.Size = new System.Drawing.Size(100, 20); + this.tboxChartData.TabIndex = 29; + // + // lblChartData + // + this.lblChartData.AutoSize = true; + this.lblChartData.Location = new System.Drawing.Point(3, 6); + this.lblChartData.Name = "lblChartData"; + this.lblChartData.Size = new System.Drawing.Size(76, 13); + this.lblChartData.TabIndex = 28; + this.lblChartData.Text = "Data for Chart:"; + // + // tboxCurrent + // + this.tboxCurrent.Enabled = false; + this.tboxCurrent.Location = new System.Drawing.Point(241, 3); + this.tboxCurrent.Name = "tboxCurrent"; + this.tboxCurrent.Size = new System.Drawing.Size(100, 20); + this.tboxCurrent.TabIndex = 24; + // + // lblCurrent + // + this.lblCurrent.AutoSize = true; + this.lblCurrent.Location = new System.Drawing.Point(191, 6); + this.lblCurrent.Name = "lblCurrent"; + this.lblCurrent.Size = new System.Drawing.Size(44, 13); + this.lblCurrent.TabIndex = 20; + this.lblCurrent.Text = "Current:"; + // + // tboxMin + // + this.tboxMin.BackColor = System.Drawing.SystemColors.Window; + this.tboxMin.Enabled = false; + this.tboxMin.ForeColor = System.Drawing.SystemColors.WindowText; + this.tboxMin.Location = new System.Drawing.Point(684, 3); + this.tboxMin.Name = "tboxMin"; + this.tboxMin.Size = new System.Drawing.Size(100, 20); + this.tboxMin.TabIndex = 27; + // + // lblAverage + // + this.lblAverage.AutoSize = true; + this.lblAverage.Location = new System.Drawing.Point(347, 6); + this.lblAverage.Name = "lblAverage"; + this.lblAverage.Size = new System.Drawing.Size(50, 13); + this.lblAverage.TabIndex = 21; + this.lblAverage.Text = "Average:"; + // + // tboxMax + // + this.tboxMax.Enabled = false; + this.tboxMax.Location = new System.Drawing.Point(545, 3); + this.tboxMax.Name = "tboxMax"; + this.tboxMax.Size = new System.Drawing.Size(100, 20); + this.tboxMax.TabIndex = 26; + // + // lblMax + // + this.lblMax.AutoSize = true; + this.lblMax.Location = new System.Drawing.Point(509, 6); + this.lblMax.Name = "lblMax"; + this.lblMax.Size = new System.Drawing.Size(30, 13); + this.lblMax.TabIndex = 22; + this.lblMax.Text = "Max:"; + // + // tboxAverage + // + this.tboxAverage.Enabled = false; + this.tboxAverage.Location = new System.Drawing.Point(403, 3); + this.tboxAverage.Name = "tboxAverage"; + this.tboxAverage.Size = new System.Drawing.Size(100, 20); + this.tboxAverage.TabIndex = 25; + // + // lblMin + // + this.lblMin.AutoSize = true; + this.lblMin.Location = new System.Drawing.Point(651, 6); + this.lblMin.Name = "lblMin"; + this.lblMin.Size = new System.Drawing.Size(27, 13); + this.lblMin.TabIndex = 23; + this.lblMin.Text = "Min:"; + // + // ctnParentChartHolder + // + this.ctnParentChartHolder.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.ctnParentChartHolder.Location = new System.Drawing.Point(6, 38); + this.ctnParentChartHolder.Name = "ctnParentChartHolder"; + this.ctnParentChartHolder.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // ctnParentChartHolder.Panel1 + // + this.ctnParentChartHolder.Panel1.Controls.Add(this.ctnTopChartHolder); + // + // ctnParentChartHolder.Panel2 + // + this.ctnParentChartHolder.Panel2.Controls.Add(this.ctnBottomChartHolder); + this.ctnParentChartHolder.Size = new System.Drawing.Size(850, 436); + this.ctnParentChartHolder.SplitterDistance = 197; + this.ctnParentChartHolder.TabIndex = 28; + // + // ctnTopChartHolder + // + this.ctnTopChartHolder.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.ctnTopChartHolder.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ctnTopChartHolder.Location = new System.Drawing.Point(3, 3); + this.ctnTopChartHolder.Name = "ctnTopChartHolder"; + // + // ctnTopChartHolder.Panel1 + // + this.ctnTopChartHolder.Panel1.Controls.Add(this.lblTopLeftChartTitle); + this.ctnTopChartHolder.Panel1.Controls.Add(this.chrtTopLeft); + // + // ctnTopChartHolder.Panel2 + // + this.ctnTopChartHolder.Panel2.Controls.Add(this.lblTopRightChartTitle); + this.ctnTopChartHolder.Panel2.Controls.Add(this.chrtTopRight); + this.ctnTopChartHolder.Size = new System.Drawing.Size(844, 191); + this.ctnTopChartHolder.SplitterDistance = 407; + this.ctnTopChartHolder.TabIndex = 0; + // + // lblTopLeftChartTitle + // + this.lblTopLeftChartTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lblTopLeftChartTitle.AutoSize = true; + this.lblTopLeftChartTitle.Location = new System.Drawing.Point(3, 164); + this.lblTopLeftChartTitle.Name = "lblTopLeftChartTitle"; + this.lblTopLeftChartTitle.Size = new System.Drawing.Size(42, 13); + this.lblTopLeftChartTitle.TabIndex = 2; + this.lblTopLeftChartTitle.Text = "Altitude"; + // + // chrtTopLeft + // + this.chrtTopLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.chrtTopLeft.Location = new System.Drawing.Point(3, 3); + this.chrtTopLeft.Name = "chrtTopLeft"; + this.chrtTopLeft.Size = new System.Drawing.Size(399, 173); + this.chrtTopLeft.TabIndex = 1; + this.chrtTopLeft.Text = "chart4"; + this.chrtTopLeft.Click += new System.EventHandler(this.chrtTopLeft_Click); + // + // lblTopRightChartTitle + // + this.lblTopRightChartTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lblTopRightChartTitle.AutoSize = true; + this.lblTopRightChartTitle.Location = new System.Drawing.Point(3, 164); + this.lblTopRightChartTitle.Name = "lblTopRightChartTitle"; + this.lblTopRightChartTitle.Size = new System.Drawing.Size(47, 13); + this.lblTopRightChartTitle.TabIndex = 1; + this.lblTopRightChartTitle.Text = "Humidity"; + // + // chrtTopRight + // + this.chrtTopRight.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.chrtTopRight.Location = new System.Drawing.Point(3, 3); + this.chrtTopRight.Name = "chrtTopRight"; + this.chrtTopRight.Size = new System.Drawing.Size(425, 173); + this.chrtTopRight.TabIndex = 0; + this.chrtTopRight.Text = "chart4"; + this.chrtTopRight.Click += new System.EventHandler(this.chrtTopRight_Click); + // + // ctnBottomChartHolder + // + this.ctnBottomChartHolder.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.ctnBottomChartHolder.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ctnBottomChartHolder.Location = new System.Drawing.Point(3, 3); + this.ctnBottomChartHolder.Name = "ctnBottomChartHolder"; + // + // ctnBottomChartHolder.Panel1 + // + this.ctnBottomChartHolder.Panel1.Controls.Add(this.lblBottomLeftChartTitle); + this.ctnBottomChartHolder.Panel1.Controls.Add(this.chrtBottomLeft); + // + // ctnBottomChartHolder.Panel2 + // + this.ctnBottomChartHolder.Panel2.Controls.Add(this.lblBottomRightChartTitle); + this.ctnBottomChartHolder.Panel2.Controls.Add(this.chrtBottomRight); + this.ctnBottomChartHolder.Size = new System.Drawing.Size(844, 229); + this.ctnBottomChartHolder.SplitterDistance = 407; + this.ctnBottomChartHolder.TabIndex = 0; + // + // lblBottomLeftChartTitle + // + this.lblBottomLeftChartTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lblBottomLeftChartTitle.AutoSize = true; + this.lblBottomLeftChartTitle.Location = new System.Drawing.Point(3, 202); + this.lblBottomLeftChartTitle.Name = "lblBottomLeftChartTitle"; + this.lblBottomLeftChartTitle.Size = new System.Drawing.Size(48, 13); + this.lblBottomLeftChartTitle.TabIndex = 1; + this.lblBottomLeftChartTitle.Text = "Pressure"; + // + // chrtBottomLeft + // + this.chrtBottomLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.chrtBottomLeft.Location = new System.Drawing.Point(3, 3); + this.chrtBottomLeft.Name = "chrtBottomLeft"; + this.chrtBottomLeft.Size = new System.Drawing.Size(399, 211); + this.chrtBottomLeft.TabIndex = 0; + this.chrtBottomLeft.Text = "chart2"; + this.chrtBottomLeft.Click += new System.EventHandler(this.chrtBottomLeft_Click); + // + // lblBottomRightChartTitle + // + this.lblBottomRightChartTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lblBottomRightChartTitle.AutoSize = true; + this.lblBottomRightChartTitle.Location = new System.Drawing.Point(3, 202); + this.lblBottomRightChartTitle.Name = "lblBottomRightChartTitle"; + this.lblBottomRightChartTitle.Size = new System.Drawing.Size(28, 13); + this.lblBottomRightChartTitle.TabIndex = 2; + this.lblBottomRightChartTitle.Text = "Map"; + // + // chrtBottomRight + // + this.chrtBottomRight.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.chrtBottomRight.Location = new System.Drawing.Point(3, 3); + this.chrtBottomRight.Name = "chrtBottomRight"; + this.chrtBottomRight.Size = new System.Drawing.Size(425, 211); + this.chrtBottomRight.TabIndex = 1; + this.chrtBottomRight.Text = "chart2"; + this.chrtBottomRight.Click += new System.EventHandler(this.chrtBottomRight_Click); + // + // tabData + // + this.tabData.Controls.Add(this.gboxSlaveData); + this.tabData.Controls.Add(this.gboxMasterData); + this.tabData.Location = new System.Drawing.Point(4, 22); + this.tabData.Name = "tabData"; + this.tabData.Padding = new System.Windows.Forms.Padding(10); + this.tabData.Size = new System.Drawing.Size(862, 701); + this.tabData.TabIndex = 3; + this.tabData.Text = "Data"; + this.tabData.UseVisualStyleBackColor = true; + // + // gboxSlaveData + // + this.gboxSlaveData.Controls.Add(this.textBox16); + this.gboxSlaveData.Controls.Add(this.label26); + this.gboxSlaveData.Controls.Add(this.textBox17); + this.gboxSlaveData.Controls.Add(this.label27); + this.gboxSlaveData.Controls.Add(this.label28); + this.gboxSlaveData.Controls.Add(this.textBox15); + this.gboxSlaveData.Controls.Add(this.label25); + this.gboxSlaveData.Controls.Add(this.textBox14); + this.gboxSlaveData.Controls.Add(this.label24); + this.gboxSlaveData.Controls.Add(this.textBox13); + this.gboxSlaveData.Controls.Add(this.label23); + this.gboxSlaveData.Controls.Add(this.label22); + this.gboxSlaveData.Controls.Add(this.textBox12); + this.gboxSlaveData.Controls.Add(this.label21); + this.gboxSlaveData.Controls.Add(this.textBox11); + this.gboxSlaveData.Controls.Add(this.label19); + this.gboxSlaveData.Controls.Add(this.textBox10); + this.gboxSlaveData.Controls.Add(this.label18); + this.gboxSlaveData.Controls.Add(this.textBox9); + this.gboxSlaveData.Controls.Add(this.label17); + this.gboxSlaveData.Controls.Add(this.textBox8); + this.gboxSlaveData.Controls.Add(this.label15); + this.gboxSlaveData.Controls.Add(this.textBox7); + this.gboxSlaveData.Controls.Add(this.label8); + this.gboxSlaveData.Controls.Add(this.label20); + this.gboxSlaveData.Location = new System.Drawing.Point(259, 13); + this.gboxSlaveData.Name = "gboxSlaveData"; + this.gboxSlaveData.Padding = new System.Windows.Forms.Padding(10); + this.gboxSlaveData.Size = new System.Drawing.Size(297, 438); + this.gboxSlaveData.TabIndex = 1; + this.gboxSlaveData.TabStop = false; + this.gboxSlaveData.Text = "Slave Modules"; + // + // textBox16 + // + this.textBox16.Location = new System.Drawing.Point(146, 378); + this.textBox16.Name = "textBox16"; + this.textBox16.Size = new System.Drawing.Size(100, 20); + this.textBox16.TabIndex = 41; + // + // label26 + // + this.label26.AutoSize = true; + this.label26.Location = new System.Drawing.Point(40, 381); + this.label26.Margin = new System.Windows.Forms.Padding(30, 7, 5, 7); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(69, 13); + this.label26.TabIndex = 40; + this.label26.Text = "Battery Level"; + // + // textBox17 + // + this.textBox17.Location = new System.Drawing.Point(146, 351); + this.textBox17.Name = "textBox17"; + this.textBox17.Size = new System.Drawing.Size(100, 20); + this.textBox17.TabIndex = 39; + // + // label27 + // + this.label27.AutoSize = true; + this.label27.Location = new System.Drawing.Point(40, 354); + this.label27.Margin = new System.Windows.Forms.Padding(30, 7, 5, 7); + this.label27.Name = "label27"; + this.label27.Size = new System.Drawing.Size(98, 13); + this.label27.TabIndex = 38; + this.label27.Text = "Board Temperature"; + // + // label28 + // + this.label28.AutoSize = true; + this.label28.Location = new System.Drawing.Point(15, 327); + this.label28.Margin = new System.Windows.Forms.Padding(5, 7, 5, 7); + this.label28.Name = "label28"; + this.label28.Size = new System.Drawing.Size(81, 13); + this.label28.TabIndex = 37; + this.label28.Text = "Camera Module"; + // + // textBox15 + // + this.textBox15.Location = new System.Drawing.Point(146, 297); + this.textBox15.Name = "textBox15"; + this.textBox15.Size = new System.Drawing.Size(100, 20); + this.textBox15.TabIndex = 36; + // + // label25 + // + this.label25.AutoSize = true; + this.label25.Location = new System.Drawing.Point(40, 300); + this.label25.Margin = new System.Windows.Forms.Padding(30, 7, 5, 7); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(52, 13); + this.label25.TabIndex = 35; + this.label25.Text = "Radiation"; + // + // textBox14 + // + this.textBox14.Location = new System.Drawing.Point(146, 270); + this.textBox14.Name = "textBox14"; + this.textBox14.Size = new System.Drawing.Size(100, 20); + this.textBox14.TabIndex = 34; + // + // label24 + // + this.label24.AutoSize = true; + this.label24.Location = new System.Drawing.Point(40, 273); + this.label24.Margin = new System.Windows.Forms.Padding(30, 7, 5, 7); + this.label24.Name = "label24"; + this.label24.Size = new System.Drawing.Size(69, 13); + this.label24.TabIndex = 33; + this.label24.Text = "Battery Level"; + // + // textBox13 + // + this.textBox13.Location = new System.Drawing.Point(146, 243); + this.textBox13.Name = "textBox13"; + this.textBox13.Size = new System.Drawing.Size(100, 20); + this.textBox13.TabIndex = 32; + // + // label23 + // + this.label23.AutoSize = true; + this.label23.Location = new System.Drawing.Point(40, 246); + this.label23.Margin = new System.Windows.Forms.Padding(30, 7, 5, 7); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(98, 13); + this.label23.TabIndex = 31; + this.label23.Text = "Board Temperature"; + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(15, 219); + this.label22.Margin = new System.Windows.Forms.Padding(5, 7, 5, 7); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(76, 13); + this.label22.TabIndex = 30; + this.label22.Text = "Geiger Module"; + // + // textBox12 + // + this.textBox12.Location = new System.Drawing.Point(146, 189); + this.textBox12.Name = "textBox12"; + this.textBox12.Size = new System.Drawing.Size(100, 20); + this.textBox12.TabIndex = 29; + // + // label21 + // + this.label21.AutoSize = true; + this.label21.Location = new System.Drawing.Point(40, 192); + this.label21.Margin = new System.Windows.Forms.Padding(30, 7, 5, 7); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(42, 13); + this.label21.TabIndex = 28; + this.label21.Text = "Altitude"; + // + // textBox11 + // + this.textBox11.Location = new System.Drawing.Point(146, 108); + this.textBox11.Name = "textBox11"; + this.textBox11.Size = new System.Drawing.Size(100, 20); + this.textBox11.TabIndex = 27; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(40, 111); + this.label19.Margin = new System.Windows.Forms.Padding(30, 7, 5, 7); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(82, 13); + this.label19.TabIndex = 26; + this.label19.Text = "Air Temperature"; + // + // textBox10 + // + this.textBox10.Location = new System.Drawing.Point(146, 135); + this.textBox10.Name = "textBox10"; + this.textBox10.Size = new System.Drawing.Size(100, 20); + this.textBox10.TabIndex = 25; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(40, 138); + this.label18.Margin = new System.Windows.Forms.Padding(30, 7, 5, 7); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(47, 13); + this.label18.TabIndex = 24; + this.label18.Text = "Humidity"; + // + // textBox9 + // + this.textBox9.Location = new System.Drawing.Point(146, 162); + this.textBox9.Name = "textBox9"; + this.textBox9.Size = new System.Drawing.Size(100, 20); + this.textBox9.TabIndex = 23; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(40, 165); + this.label17.Margin = new System.Windows.Forms.Padding(30, 7, 5, 7); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(48, 13); + this.label17.TabIndex = 22; + this.label17.Text = "Pressure"; + // + // textBox8 + // + this.textBox8.Location = new System.Drawing.Point(146, 81); + this.textBox8.Name = "textBox8"; + this.textBox8.Size = new System.Drawing.Size(100, 20); + this.textBox8.TabIndex = 21; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(40, 84); + this.label15.Margin = new System.Windows.Forms.Padding(30, 7, 5, 7); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(69, 13); + this.label15.TabIndex = 20; + this.label15.Text = "Battery Level"; + // + // textBox7 + // + this.textBox7.Location = new System.Drawing.Point(146, 54); + this.textBox7.Name = "textBox7"; + this.textBox7.Size = new System.Drawing.Size(100, 20); + this.textBox7.TabIndex = 19; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(40, 57); + this.label8.Margin = new System.Windows.Forms.Padding(30, 7, 5, 7); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(98, 13); + this.label8.TabIndex = 18; + this.label8.Text = "Board Temperature"; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(15, 30); + this.label20.Margin = new System.Windows.Forms.Padding(5, 7, 5, 7); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(101, 13); + this.label20.TabIndex = 18; + this.label20.Text = "Atmosphere Module"; + // + // gboxMasterData + // + this.gboxMasterData.Controls.Add(this.textBox6); + this.gboxMasterData.Controls.Add(this.label7); + this.gboxMasterData.Controls.Add(this.label6); + this.gboxMasterData.Controls.Add(this.textBox5); + this.gboxMasterData.Controls.Add(this.label3); + this.gboxMasterData.Controls.Add(this.textBox4); + this.gboxMasterData.Controls.Add(this.label2); + this.gboxMasterData.Controls.Add(this.textBox3); + this.gboxMasterData.Controls.Add(this.label16); + this.gboxMasterData.Controls.Add(this.textBox2); + this.gboxMasterData.Controls.Add(this.textBox1); + this.gboxMasterData.Controls.Add(this.label1); + this.gboxMasterData.Location = new System.Drawing.Point(13, 13); + this.gboxMasterData.Name = "gboxMasterData"; + this.gboxMasterData.Padding = new System.Windows.Forms.Padding(10); + this.gboxMasterData.Size = new System.Drawing.Size(240, 329); + this.gboxMasterData.TabIndex = 0; + this.gboxMasterData.TabStop = false; + this.gboxMasterData.Text = "Master Module"; + // + // textBox6 + // + this.textBox6.Location = new System.Drawing.Point(120, 162); + this.textBox6.Name = "textBox6"; + this.textBox6.Size = new System.Drawing.Size(100, 20); + this.textBox6.TabIndex = 17; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(14, 165); + this.label7.Margin = new System.Windows.Forms.Padding(5, 7, 5, 7); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(67, 13); + this.label7.TabIndex = 16; + this.label7.Text = "GPS Altitude"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(15, 138); + this.label6.Margin = new System.Windows.Forms.Padding(5, 7, 5, 7); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(44, 13); + this.label6.TabIndex = 15; + this.label6.Text = "Velocity"; + // + // textBox5 + // + this.textBox5.Location = new System.Drawing.Point(121, 135); + this.textBox5.Name = "textBox5"; + this.textBox5.Size = new System.Drawing.Size(100, 20); + this.textBox5.TabIndex = 14; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(14, 111); + this.label3.Margin = new System.Windows.Forms.Padding(5, 7, 5, 7); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(54, 13); + this.label3.TabIndex = 13; + this.label3.Text = "Longitude"; + // + // textBox4 + // + this.textBox4.Location = new System.Drawing.Point(120, 108); + this.textBox4.Name = "textBox4"; + this.textBox4.Size = new System.Drawing.Size(100, 20); + this.textBox4.TabIndex = 12; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(15, 84); + this.label2.Margin = new System.Windows.Forms.Padding(5, 7, 5, 7); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(45, 13); + this.label2.TabIndex = 11; + this.label2.Text = "Latitude"; + // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point(121, 81); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(100, 20); + this.textBox3.TabIndex = 10; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(14, 57); + this.label16.Margin = new System.Windows.Forms.Padding(5, 7, 5, 7); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(69, 13); + this.label16.TabIndex = 9; + this.label16.Text = "Battery Level"; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(120, 54); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(100, 20); + this.textBox2.TabIndex = 8; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(120, 24); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(100, 20); + this.textBox1.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(15, 30); + this.label1.Margin = new System.Windows.Forms.Padding(5, 7, 5, 7); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(98, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Board Temperature"; + // + // tboxMessageBox + // + this.tboxMessageBox.AcceptsReturn = true; + this.tboxMessageBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tboxMessageBox.BackColor = System.Drawing.SystemColors.ScrollBar; + this.tboxMessageBox.Location = new System.Drawing.Point(12, 746); + this.tboxMessageBox.Multiline = true; + this.tboxMessageBox.Name = "tboxMessageBox"; + this.tboxMessageBox.ReadOnly = true; + this.tboxMessageBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.tboxMessageBox.Size = new System.Drawing.Size(871, 73); + this.tboxMessageBox.TabIndex = 30; + // + // MainMap + // + this.MainMap.Bearing = 0F; + this.MainMap.CanDragMap = true; + this.MainMap.Dock = System.Windows.Forms.DockStyle.Fill; + this.MainMap.EmptyTileColor = System.Drawing.Color.Navy; + this.MainMap.GrayScaleMode = false; + this.MainMap.HelperLineOption = GMap.NET.WindowsForms.HelperLineOptions.DontShow; + this.MainMap.LevelsKeepInMemmory = 5; + this.MainMap.Location = new System.Drawing.Point(0, 0); + this.MainMap.MarkersEnabled = true; + this.MainMap.MaxZoom = 17; + this.MainMap.MinZoom = 2; + this.MainMap.MouseWheelZoomType = GMap.NET.MouseWheelZoomType.MousePositionAndCenter; + this.MainMap.Name = "MainMap"; + this.MainMap.NegativeMode = false; + this.MainMap.PolygonsEnabled = true; + this.MainMap.RetryLoadTile = 0; + this.MainMap.RoutesEnabled = true; + this.MainMap.ScaleMode = GMap.NET.WindowsForms.ScaleModes.Integer; + this.MainMap.SelectedAreaFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(65)))), ((int)(((byte)(105)))), ((int)(((byte)(225))))); + this.MainMap.ShowTileGridLines = false; + this.MainMap.Size = new System.Drawing.Size(628, 826); + this.MainMap.TabIndex = 0; + this.MainMap.Zoom = 0D; + // + // splitter1 + // + this.splitter1.BackColor = System.Drawing.Color.Transparent; + this.splitter1.Dock = System.Windows.Forms.DockStyle.Right; + this.splitter1.Enabled = false; + this.splitter1.Location = new System.Drawing.Point(626, 0); + this.splitter1.Margin = new System.Windows.Forms.Padding(2); + this.splitter1.MinExtra = 390; + this.splitter1.MinSize = 390; + this.splitter1.Name = "splitter1"; + this.splitter1.Size = new System.Drawing.Size(2, 695); + this.splitter1.TabIndex = 42; + this.splitter1.TabStop = false; + // + // panelMenu + // + this.panelMenu.AssociatedSplitter = this.splitter1; + this.panelMenu.BackColor = System.Drawing.Color.Transparent; + this.panelMenu.CaptionFont = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.panelMenu.CaptionHeight = 27; + this.panelMenu.Controls.Add(this.xPanderPanelList1); + this.panelMenu.CustomColors.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(184)))), ((int)(((byte)(184))))); + this.panelMenu.CustomColors.CaptionCloseIcon = System.Drawing.SystemColors.ControlText; + this.panelMenu.CustomColors.CaptionExpandIcon = System.Drawing.SystemColors.ControlText; + this.panelMenu.CustomColors.CaptionGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); + this.panelMenu.CustomColors.CaptionGradientEnd = System.Drawing.SystemColors.ButtonFace; + this.panelMenu.CustomColors.CaptionGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248))))); + this.panelMenu.CustomColors.CaptionSelectedGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.panelMenu.CustomColors.CaptionSelectedGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.panelMenu.CustomColors.CaptionText = System.Drawing.SystemColors.ControlText; + this.panelMenu.CustomColors.CollapsedCaptionText = System.Drawing.SystemColors.ControlText; + this.panelMenu.CustomColors.ContentGradientBegin = System.Drawing.SystemColors.ButtonFace; + this.panelMenu.CustomColors.ContentGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); + this.panelMenu.CustomColors.InnerBorderColor = System.Drawing.SystemColors.Window; + this.panelMenu.Dock = System.Windows.Forms.DockStyle.Right; + this.panelMenu.ForeColor = System.Drawing.SystemColors.ControlText; + this.panelMenu.Image = null; + this.panelMenu.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; + this.panelMenu.Location = new System.Drawing.Point(628, 0); + this.panelMenu.Margin = new System.Windows.Forms.Padding(2); + this.panelMenu.MinimumSize = new System.Drawing.Size(27, 27); + this.panelMenu.Name = "panelMenu"; + this.panelMenu.PanelStyle = BSE.Windows.Forms.PanelStyle.Office2007; + this.panelMenu.ShowExpandIcon = true; + this.panelMenu.Size = new System.Drawing.Size(228, 695); + this.panelMenu.TabIndex = 40; + this.panelMenu.Text = "Menu"; + this.panelMenu.ToolTipTextCloseIcon = null; + this.panelMenu.ToolTipTextExpandIconPanelCollapsed = "maximize"; + this.panelMenu.ToolTipTextExpandIconPanelExpanded = "minimize"; + // + // xPanderPanelList1 + // + this.xPanderPanelList1.CaptionStyle = BSE.Windows.Forms.CaptionStyle.Flat; + this.xPanderPanelList1.Controls.Add(this.xPanderPanelMain); + this.xPanderPanelList1.Controls.Add(this.xPanderPanelInfo); + this.xPanderPanelList1.Controls.Add(this.xPanderPanelCache); + this.xPanderPanelList1.Dock = System.Windows.Forms.DockStyle.Fill; + this.xPanderPanelList1.GradientBackground = System.Drawing.Color.Empty; + this.xPanderPanelList1.Location = new System.Drawing.Point(0, 28); + this.xPanderPanelList1.Margin = new System.Windows.Forms.Padding(2); + this.xPanderPanelList1.Name = "xPanderPanelList1"; + this.xPanderPanelList1.PanelColors = null; + this.xPanderPanelList1.PanelStyle = BSE.Windows.Forms.PanelStyle.Office2007; + this.xPanderPanelList1.ShowExpandIcon = true; + this.xPanderPanelList1.Size = new System.Drawing.Size(228, 666); + this.xPanderPanelList1.TabIndex = 0; + this.xPanderPanelList1.Text = "xPanderPanelList1"; + // + // xPanderPanelMain + // + this.xPanderPanelMain.CaptionFont = new System.Drawing.Font("Segoe UI", 8F, System.Drawing.FontStyle.Bold); + this.xPanderPanelMain.Controls.Add(this.tableLayoutPanel4); + this.xPanderPanelMain.CustomColors.BackColor = System.Drawing.SystemColors.Control; + this.xPanderPanelMain.CustomColors.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(184)))), ((int)(((byte)(184))))); + this.xPanderPanelMain.CustomColors.CaptionCheckedGradientBegin = System.Drawing.Color.Empty; + this.xPanderPanelMain.CustomColors.CaptionCheckedGradientEnd = System.Drawing.Color.Empty; + this.xPanderPanelMain.CustomColors.CaptionCheckedGradientMiddle = System.Drawing.Color.Empty; + this.xPanderPanelMain.CustomColors.CaptionCloseIcon = System.Drawing.SystemColors.ControlText; + this.xPanderPanelMain.CustomColors.CaptionExpandIcon = System.Drawing.SystemColors.ControlText; + this.xPanderPanelMain.CustomColors.CaptionGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); + this.xPanderPanelMain.CustomColors.CaptionGradientEnd = System.Drawing.SystemColors.ButtonFace; + this.xPanderPanelMain.CustomColors.CaptionGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248))))); + this.xPanderPanelMain.CustomColors.CaptionPressedGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelMain.CustomColors.CaptionPressedGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelMain.CustomColors.CaptionPressedGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelMain.CustomColors.CaptionSelectedGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelMain.CustomColors.CaptionSelectedGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelMain.CustomColors.CaptionSelectedGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelMain.CustomColors.CaptionSelectedText = System.Drawing.SystemColors.ControlText; + this.xPanderPanelMain.CustomColors.CaptionText = System.Drawing.SystemColors.ControlText; + this.xPanderPanelMain.CustomColors.FlatCaptionGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248))))); + this.xPanderPanelMain.CustomColors.FlatCaptionGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); + this.xPanderPanelMain.CustomColors.InnerBorderColor = System.Drawing.SystemColors.Window; + this.xPanderPanelMain.Expand = true; + this.xPanderPanelMain.ForeColor = System.Drawing.SystemColors.ControlText; + this.xPanderPanelMain.Image = null; + this.xPanderPanelMain.IsClosable = false; + this.xPanderPanelMain.Margin = new System.Windows.Forms.Padding(2); + this.xPanderPanelMain.Name = "xPanderPanelMain"; + this.xPanderPanelMain.PanelStyle = BSE.Windows.Forms.PanelStyle.Office2007; + this.xPanderPanelMain.Size = new System.Drawing.Size(228, 616); + this.xPanderPanelMain.TabIndex = 0; + this.xPanderPanelMain.Text = "map"; + this.xPanderPanelMain.ToolTipTextCloseIcon = null; + this.xPanderPanelMain.ToolTipTextExpandIconPanelCollapsed = null; + this.xPanderPanelMain.ToolTipTextExpandIconPanelExpanded = null; + this.xPanderPanelMain.Click += new System.EventHandler(this.xPanderPanel1_Click); + // + // tableLayoutPanel4 + // + this.tableLayoutPanel4.ColumnCount = 2; + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 48F)); + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 49.27536F)); + this.tableLayoutPanel4.Controls.Add(this.tableLayoutPanel5, 1, 0); + this.tableLayoutPanel4.Controls.Add(this.tableLayoutPanel6, 0, 0); + this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel4.Location = new System.Drawing.Point(1, 25); + this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(2); + this.tableLayoutPanel4.Name = "tableLayoutPanel4"; + this.tableLayoutPanel4.RowCount = 1; + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel4.Size = new System.Drawing.Size(226, 591); + this.tableLayoutPanel4.TabIndex = 38; + // + // tableLayoutPanel5 + // + this.tableLayoutPanel5.ColumnCount = 1; + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel5.Controls.Add(this.groupBox8, 0, 3); + this.tableLayoutPanel5.Controls.Add(this.groupBox7, 0, 2); + this.tableLayoutPanel5.Controls.Add(this.groupBox5, 0, 1); + this.tableLayoutPanel5.Controls.Add(this.groupBox3, 0, 0); + this.tableLayoutPanel5.Controls.Add(this.cboxCollectData, 0, 4); + this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel5.Location = new System.Drawing.Point(48, 0); + this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0, 0, 2, 2); + this.tableLayoutPanel5.Name = "tableLayoutPanel5"; + this.tableLayoutPanel5.RowCount = 5; + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 6F)); + this.tableLayoutPanel5.Size = new System.Drawing.Size(176, 589); + this.tableLayoutPanel5.TabIndex = 30; + // + // groupBox8 + // + this.groupBox8.Controls.Add(this.btnZoomCenter); + this.groupBox8.Controls.Add(this.xboxPlacemarkInfo); + this.groupBox8.Controls.Add(this.btnClearAll); + this.groupBox8.Controls.Add(this.btnAddMarker); + this.groupBox8.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox8.Location = new System.Drawing.Point(3, 450); + this.groupBox8.Name = "groupBox8"; + this.groupBox8.Size = new System.Drawing.Size(170, 74); + this.groupBox8.TabIndex = 37; + this.groupBox8.TabStop = false; + this.groupBox8.Text = "markers"; + // + // btnZoomCenter + // + this.btnZoomCenter.Location = new System.Drawing.Point(6, 45); + this.btnZoomCenter.Name = "btnZoomCenter"; + this.btnZoomCenter.Size = new System.Drawing.Size(82, 24); + this.btnZoomCenter.TabIndex = 15; + this.btnZoomCenter.Text = "Zoom Center"; + this.btnZoomCenter.UseVisualStyleBackColor = true; + this.btnZoomCenter.Click += new System.EventHandler(this.button7_Click); + // + // xboxPlacemarkInfo + // + this.xboxPlacemarkInfo.AutoSize = true; + this.xboxPlacemarkInfo.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.xboxPlacemarkInfo.Checked = true; + this.xboxPlacemarkInfo.CheckState = System.Windows.Forms.CheckState.Checked; + this.xboxPlacemarkInfo.Location = new System.Drawing.Point(94, 19); + this.xboxPlacemarkInfo.Name = "xboxPlacemarkInfo"; + this.xboxPlacemarkInfo.Size = new System.Drawing.Size(72, 17); + this.xboxPlacemarkInfo.TabIndex = 14; + this.xboxPlacemarkInfo.Text = "place info"; + this.xboxPlacemarkInfo.UseVisualStyleBackColor = true; + // + // btnClearAll + // + this.btnClearAll.Location = new System.Drawing.Point(94, 45); + this.btnClearAll.Name = "btnClearAll"; + this.btnClearAll.Size = new System.Drawing.Size(63, 24); + this.btnClearAll.TabIndex = 13; + this.btnClearAll.Text = "Clear All"; + this.btnClearAll.UseVisualStyleBackColor = true; + this.btnClearAll.Click += new System.EventHandler(this.btnClearMarkers_Click); + // + // btnAddMarker + // + this.btnAddMarker.Location = new System.Drawing.Point(6, 15); + this.btnAddMarker.Name = "btnAddMarker"; + this.btnAddMarker.Size = new System.Drawing.Size(82, 24); + this.btnAddMarker.TabIndex = 12; + this.btnAddMarker.Text = "Add Marker"; + this.btnAddMarker.UseVisualStyleBackColor = true; + this.btnAddMarker.Click += new System.EventHandler(this.btnAddMarker_Click); + // + // groupBox7 + // + this.groupBox7.Controls.Add(this.buttonExportToGpx); + this.groupBox7.Controls.Add(this.MobileLogTo); + this.groupBox7.Controls.Add(this.lblClear); + this.groupBox7.Controls.Add(this.btnClearPolygons); + this.groupBox7.Controls.Add(this.MobileLogFrom); + this.groupBox7.Controls.Add(this.btnMobileLog); + this.groupBox7.Controls.Add(this.buttonSetEnd); + this.groupBox7.Controls.Add(this.buttonSetStart); + this.groupBox7.Controls.Add(this.btnClearRoutes); + this.groupBox7.Controls.Add(this.btnAddRoute); + this.groupBox7.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox7.Location = new System.Drawing.Point(3, 289); + this.groupBox7.Name = "groupBox7"; + this.groupBox7.Size = new System.Drawing.Size(170, 155); + this.groupBox7.TabIndex = 35; + this.groupBox7.TabStop = false; + this.groupBox7.Text = "routing"; + // + // buttonExportToGpx + // + this.buttonExportToGpx.Location = new System.Drawing.Point(124, 78); + this.buttonExportToGpx.Margin = new System.Windows.Forms.Padding(2); + this.buttonExportToGpx.Name = "buttonExportToGpx"; + this.buttonExportToGpx.Size = new System.Drawing.Size(37, 37); + this.buttonExportToGpx.TabIndex = 48; + this.buttonExportToGpx.Text = "to GPX"; + this.buttonExportToGpx.UseVisualStyleBackColor = true; + this.buttonExportToGpx.Click += new System.EventHandler(this.buttonExportToGpx_Click); + // + // MobileLogTo + // + this.MobileLogTo.CustomFormat = "yyyy\'.\'MM\'.\'dd HH\':\'mm"; + this.MobileLogTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.MobileLogTo.Location = new System.Drawing.Point(9, 99); + this.MobileLogTo.Margin = new System.Windows.Forms.Padding(2); + this.MobileLogTo.Name = "MobileLogTo"; + this.MobileLogTo.ShowCheckBox = true; + this.MobileLogTo.Size = new System.Drawing.Size(110, 20); + this.MobileLogTo.TabIndex = 47; + // + // lblClear + // + this.lblClear.AutoSize = true; + this.lblClear.Location = new System.Drawing.Point(9, 128); + this.lblClear.Name = "lblClear"; + this.lblClear.Size = new System.Drawing.Size(34, 13); + this.lblClear.TabIndex = 46; + this.lblClear.Text = "Clear:"; + // + // btnClearPolygons + // + this.btnClearPolygons.Location = new System.Drawing.Point(104, 124); + this.btnClearPolygons.Name = "btnClearPolygons"; + this.btnClearPolygons.Size = new System.Drawing.Size(56, 24); + this.btnClearPolygons.TabIndex = 45; + this.btnClearPolygons.Text = "Polygons"; + this.btnClearPolygons.UseVisualStyleBackColor = true; + this.btnClearPolygons.Click += new System.EventHandler(this.btnClearPolygons_Click); + // + // MobileLogFrom + // + this.MobileLogFrom.CustomFormat = "yyyy\'.\'MM\'.\'dd HH\':\'mm"; + this.MobileLogFrom.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.MobileLogFrom.Location = new System.Drawing.Point(9, 78); + this.MobileLogFrom.Margin = new System.Windows.Forms.Padding(2); + this.MobileLogFrom.Name = "MobileLogFrom"; + this.MobileLogFrom.ShowCheckBox = true; + this.MobileLogFrom.Size = new System.Drawing.Size(110, 20); + this.MobileLogFrom.TabIndex = 44; + this.MobileLogFrom.Value = new System.DateTime(2010, 5, 10, 15, 41, 0, 0); + // + // btnMobileLog + // + this.btnMobileLog.Location = new System.Drawing.Point(88, 49); + this.btnMobileLog.Name = "btnMobileLog"; + this.btnMobileLog.Size = new System.Drawing.Size(73, 24); + this.btnMobileLog.TabIndex = 43; + this.btnMobileLog.Text = "Mobile log..."; + this.btnMobileLog.UseVisualStyleBackColor = true; + this.btnMobileLog.Click += new System.EventHandler(this.btnMobileLog_Click); + // + // buttonSetEnd + // + this.buttonSetEnd.Location = new System.Drawing.Point(88, 19); + this.buttonSetEnd.Name = "buttonSetEnd"; + this.buttonSetEnd.Size = new System.Drawing.Size(73, 24); + this.buttonSetEnd.TabIndex = 42; + this.buttonSetEnd.Text = "set End"; + this.buttonSetEnd.UseVisualStyleBackColor = true; + this.buttonSetEnd.Click += new System.EventHandler(this.buttonSetEnd_Click); + // + // buttonSetStart + // + this.buttonSetStart.Location = new System.Drawing.Point(9, 19); + this.buttonSetStart.Name = "buttonSetStart"; + this.buttonSetStart.Size = new System.Drawing.Size(73, 24); + this.buttonSetStart.TabIndex = 41; + this.buttonSetStart.Text = "set Start"; + this.buttonSetStart.UseVisualStyleBackColor = true; + this.buttonSetStart.Click += new System.EventHandler(this.buttonSetStart_Click); + // + // btnClearRoutes + // + this.btnClearRoutes.Location = new System.Drawing.Point(45, 124); + this.btnClearRoutes.Name = "btnClearRoutes"; + this.btnClearRoutes.Size = new System.Drawing.Size(55, 24); + this.btnClearRoutes.TabIndex = 34; + this.btnClearRoutes.Text = "Routes"; + this.btnClearRoutes.UseVisualStyleBackColor = true; + this.btnClearRoutes.Click += new System.EventHandler(this.btnClearRoutes_Click); + // + // btnAddRoute + // + this.btnAddRoute.Location = new System.Drawing.Point(9, 49); + this.btnAddRoute.Name = "btnAddRoute"; + this.btnAddRoute.Size = new System.Drawing.Size(73, 24); + this.btnAddRoute.TabIndex = 33; + this.btnAddRoute.Text = "Add Route"; + this.btnAddRoute.UseVisualStyleBackColor = true; + this.btnAddRoute.Click += new System.EventHandler(this.btnAddRoute_Click); + // + // groupBox5 + // + this.groupBox5.Controls.Add(this.btnLoadGPX); + this.groupBox5.Controls.Add(this.btnGetStatic); + this.groupBox5.Controls.Add(this.xboxGrid); + this.groupBox5.Controls.Add(this.btnSaveView); + this.groupBox5.Controls.Add(this.lblMode); + this.groupBox5.Controls.Add(this.comboBoxMode); + this.groupBox5.Controls.Add(this.xboxCanDrag); + this.groupBox5.Controls.Add(this.xboxCurrentMarker); + this.groupBox5.Controls.Add(this.lblMapType); + this.groupBox5.Controls.Add(this.comboBoxMapType); + this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox5.Location = new System.Drawing.Point(3, 137); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(170, 146); + this.groupBox5.TabIndex = 31; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "gmap"; + // + // btnLoadGPX + // + this.btnLoadGPX.Location = new System.Drawing.Point(92, 92); + this.btnLoadGPX.Name = "btnLoadGPX"; + this.btnLoadGPX.Size = new System.Drawing.Size(69, 24); + this.btnLoadGPX.TabIndex = 49; + this.btnLoadGPX.Text = "GPX..."; + this.btnLoadGPX.UseVisualStyleBackColor = true; + this.btnLoadGPX.Click += new System.EventHandler(this.btnLoadGPX_Click); + // + // btnGetStatic + // + this.btnGetStatic.Location = new System.Drawing.Point(9, 117); + this.btnGetStatic.Margin = new System.Windows.Forms.Padding(2); + this.btnGetStatic.Name = "btnGetStatic"; + this.btnGetStatic.Size = new System.Drawing.Size(73, 24); + this.btnGetStatic.TabIndex = 41; + this.btnGetStatic.Text = "Get Static"; + this.btnGetStatic.UseVisualStyleBackColor = true; + this.btnGetStatic.Click += new System.EventHandler(this.btnGetStatic_Click); + // + // xboxGrid + // + this.xboxGrid.AutoSize = true; + this.xboxGrid.Location = new System.Drawing.Point(104, 74); + this.xboxGrid.Margin = new System.Windows.Forms.Padding(2); + this.xboxGrid.Name = "xboxGrid"; + this.xboxGrid.Size = new System.Drawing.Size(45, 17); + this.xboxGrid.TabIndex = 40; + this.xboxGrid.Text = "Grid"; + this.xboxGrid.UseVisualStyleBackColor = true; + this.xboxGrid.CheckedChanged += new System.EventHandler(this.checkBoxDebug_CheckedChanged); + // + // btnSaveView + // + this.btnSaveView.Location = new System.Drawing.Point(92, 117); + this.btnSaveView.Margin = new System.Windows.Forms.Padding(2); + this.btnSaveView.Name = "btnSaveView"; + this.btnSaveView.Size = new System.Drawing.Size(69, 24); + this.btnSaveView.TabIndex = 39; + this.btnSaveView.Text = "Save View"; + this.btnSaveView.UseVisualStyleBackColor = true; + this.btnSaveView.Click += new System.EventHandler(this.btnSaveView_Click); + // + // lblMode + // + this.lblMode.AutoSize = true; + this.lblMode.Location = new System.Drawing.Point(132, 49); + this.lblMode.Name = "lblMode"; + this.lblMode.Size = new System.Drawing.Size(34, 13); + this.lblMode.TabIndex = 38; + this.lblMode.Text = "Mode"; + // + // comboBoxMode + // + this.comboBoxMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxMode.FormattingEnabled = true; + this.comboBoxMode.Location = new System.Drawing.Point(8, 46); + this.comboBoxMode.Name = "comboBoxMode"; + this.comboBoxMode.Size = new System.Drawing.Size(123, 21); + this.comboBoxMode.TabIndex = 37; + this.comboBoxMode.DropDownClosed += new System.EventHandler(this.comboBoxMode_DropDownClosed); + // + // xboxCanDrag + // + this.xboxCanDrag.AutoSize = true; + this.xboxCanDrag.Checked = true; + this.xboxCanDrag.CheckState = System.Windows.Forms.CheckState.Checked; + this.xboxCanDrag.Location = new System.Drawing.Point(9, 95); + this.xboxCanDrag.Name = "xboxCanDrag"; + this.xboxCanDrag.Size = new System.Drawing.Size(73, 17); + this.xboxCanDrag.TabIndex = 36; + this.xboxCanDrag.Text = "Drag Map"; + this.xboxCanDrag.UseVisualStyleBackColor = true; + this.xboxCanDrag.CheckedChanged += new System.EventHandler(this.checkBoxCanDrag_CheckedChanged); + // + // xboxCurrentMarker + // + this.xboxCurrentMarker.AutoSize = true; + this.xboxCurrentMarker.Checked = true; + this.xboxCurrentMarker.CheckState = System.Windows.Forms.CheckState.Checked; + this.xboxCurrentMarker.Location = new System.Drawing.Point(9, 73); + this.xboxCurrentMarker.Name = "xboxCurrentMarker"; + this.xboxCurrentMarker.Size = new System.Drawing.Size(96, 17); + this.xboxCurrentMarker.TabIndex = 35; + this.xboxCurrentMarker.Text = "Current Marker"; + this.xboxCurrentMarker.UseVisualStyleBackColor = true; + this.xboxCurrentMarker.CheckedChanged += new System.EventHandler(this.checkBoxCurrentMarker_CheckedChanged); + // + // lblMapType + // + this.lblMapType.AutoSize = true; + this.lblMapType.Location = new System.Drawing.Point(132, 22); + this.lblMapType.Name = "lblMapType"; + this.lblMapType.Size = new System.Drawing.Size(55, 13); + this.lblMapType.TabIndex = 31; + this.lblMapType.Text = "Map Type"; + // + // comboBoxMapType + // + this.comboBoxMapType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxMapType.FormattingEnabled = true; + this.comboBoxMapType.Location = new System.Drawing.Point(8, 19); + this.comboBoxMapType.Name = "comboBoxMapType"; + this.comboBoxMapType.Size = new System.Drawing.Size(123, 21); + this.comboBoxMapType.TabIndex = 9; + this.comboBoxMapType.DropDownClosed += new System.EventHandler(this.comboBoxMapType_DropDownClosed); + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.lblGoTo); + this.groupBox3.Controls.Add(this.textBoxGeo); + this.groupBox3.Controls.Add(this.btnReload); + this.groupBox3.Controls.Add(this.btnGoToCoords); + this.groupBox3.Controls.Add(this.lblLng); + this.groupBox3.Controls.Add(this.lblLat); + this.groupBox3.Controls.Add(this.textBoxLng); + this.groupBox3.Controls.Add(this.textBoxLat); + this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox3.Location = new System.Drawing.Point(3, 3); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(170, 128); + this.groupBox3.TabIndex = 28; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "coordinates"; + // + // lblGoTo + // + this.lblGoTo.AutoSize = true; + this.lblGoTo.Location = new System.Drawing.Point(132, 74); + this.lblGoTo.Name = "lblGoTo"; + this.lblGoTo.Size = new System.Drawing.Size(37, 13); + this.lblGoTo.TabIndex = 11; + this.lblGoTo.Text = "Go To"; + // + // textBoxGeo + // + this.textBoxGeo.Location = new System.Drawing.Point(9, 71); + this.textBoxGeo.Name = "textBoxGeo"; + this.textBoxGeo.Size = new System.Drawing.Size(122, 20); + this.textBoxGeo.TabIndex = 10; + this.textBoxGeo.Text = "lietuva vilnius"; + this.textBoxGeo.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxGeo_KeyPress); + // + // btnReload + // + this.btnReload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnReload.Location = new System.Drawing.Point(85, 98); + this.btnReload.Name = "btnReload"; + this.btnReload.Size = new System.Drawing.Size(74, 24); + this.btnReload.TabIndex = 9; + this.btnReload.Text = "Reload"; + this.btnReload.UseVisualStyleBackColor = true; + this.btnReload.Click += new System.EventHandler(this.btnReload_Click); + // + // btnGoToCoords + // + this.btnGoToCoords.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnGoToCoords.Location = new System.Drawing.Point(9, 98); + this.btnGoToCoords.Name = "btnGoToCoords"; + this.btnGoToCoords.Size = new System.Drawing.Size(72, 24); + this.btnGoToCoords.TabIndex = 8; + this.btnGoToCoords.Text = "GoTo !"; + this.btnGoToCoords.UseVisualStyleBackColor = true; + this.btnGoToCoords.Click += new System.EventHandler(this.btnGoToCoords_Click); + // + // lblLng + // + this.lblLng.AutoSize = true; + this.lblLng.Location = new System.Drawing.Point(132, 48); + this.lblLng.Name = "lblLng"; + this.lblLng.Size = new System.Drawing.Size(54, 13); + this.lblLng.TabIndex = 3; + this.lblLng.Text = "Longitude"; + // + // lblLat + // + this.lblLat.AutoSize = true; + this.lblLat.Location = new System.Drawing.Point(132, 22); + this.lblLat.Name = "lblLat"; + this.lblLat.Size = new System.Drawing.Size(45, 13); + this.lblLat.TabIndex = 2; + this.lblLat.Text = "Latitude"; + // + // textBoxLng + // + this.textBoxLng.Location = new System.Drawing.Point(9, 45); + this.textBoxLng.Name = "textBoxLng"; + this.textBoxLng.Size = new System.Drawing.Size(122, 20); + this.textBoxLng.TabIndex = 1; + this.textBoxLng.Text = "-83.809848"; + // + // textBoxLat + // + this.textBoxLat.Location = new System.Drawing.Point(9, 19); + this.textBoxLat.Name = "textBoxLat"; + this.textBoxLat.Size = new System.Drawing.Size(122, 20); + this.textBoxLat.TabIndex = 0; + this.textBoxLat.Text = "39.751248"; + // + // cboxCollectData + // + this.cboxCollectData.AutoSize = true; + this.cboxCollectData.Location = new System.Drawing.Point(3, 530); + this.cboxCollectData.Name = "cboxCollectData"; + this.cboxCollectData.Size = new System.Drawing.Size(84, 17); + this.cboxCollectData.TabIndex = 38; + this.cboxCollectData.Text = "Collect Data"; + this.cboxCollectData.UseVisualStyleBackColor = true; + // + // tableLayoutPanel6 + // + this.tableLayoutPanel6.ColumnCount = 1; + this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel6.Controls.Add(this.btnZoomIn, 0, 0); + this.tableLayoutPanel6.Controls.Add(this.trackBarZoomLevel, 0, 1); + this.tableLayoutPanel6.Controls.Add(this.btnZoomOut, 0, 2); + this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel6.Location = new System.Drawing.Point(2, 2); + this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(2); + this.tableLayoutPanel6.Name = "tableLayoutPanel6"; + this.tableLayoutPanel6.RowCount = 3; + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel6.Size = new System.Drawing.Size(44, 587); + this.tableLayoutPanel6.TabIndex = 31; + // + // btnZoomIn + // + this.btnZoomIn.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnZoomIn.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnZoomIn.Location = new System.Drawing.Point(0, 0); + this.btnZoomIn.Margin = new System.Windows.Forms.Padding(0); + this.btnZoomIn.Name = "btnZoomIn"; + this.btnZoomIn.Size = new System.Drawing.Size(45, 27); + this.btnZoomIn.TabIndex = 0; + this.btnZoomIn.Text = "+"; + this.btnZoomIn.UseVisualStyleBackColor = true; + this.btnZoomIn.Click += new System.EventHandler(this.buttonZoomUp_Click); + // + // trackBarZoomLevel + // + this.trackBarZoomLevel.BackColor = System.Drawing.Color.AliceBlue; + this.trackBarZoomLevel.Dock = System.Windows.Forms.DockStyle.Fill; + this.trackBarZoomLevel.LargeChange = 1; + this.trackBarZoomLevel.Location = new System.Drawing.Point(0, 27); + this.trackBarZoomLevel.Margin = new System.Windows.Forms.Padding(0); + this.trackBarZoomLevel.Maximum = 1700; + this.trackBarZoomLevel.Minimum = 1; + this.trackBarZoomLevel.Name = "trackBarZoomLevel"; + this.trackBarZoomLevel.Orientation = System.Windows.Forms.Orientation.Vertical; + this.trackBarZoomLevel.Size = new System.Drawing.Size(45, 533); + this.trackBarZoomLevel.TabIndex = 29; + this.trackBarZoomLevel.TickFrequency = 100; + this.trackBarZoomLevel.TickStyle = System.Windows.Forms.TickStyle.TopLeft; + this.trackBarZoomLevel.Value = 15; + this.trackBarZoomLevel.ValueChanged += new System.EventHandler(this.trackBar1_ValueChanged); + // + // btnZoomOut + // + this.btnZoomOut.Dock = System.Windows.Forms.DockStyle.Fill; + this.btnZoomOut.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnZoomOut.Location = new System.Drawing.Point(0, 560); + this.btnZoomOut.Margin = new System.Windows.Forms.Padding(0); + this.btnZoomOut.Name = "btnZoomOut"; + this.btnZoomOut.Size = new System.Drawing.Size(45, 27); + this.btnZoomOut.TabIndex = 1; + this.btnZoomOut.Text = "-"; + this.btnZoomOut.UseVisualStyleBackColor = true; + this.btnZoomOut.Click += new System.EventHandler(this.buttonZoomDown_Click); + // + // xPanderPanelInfo + // + this.xPanderPanelInfo.CaptionFont = new System.Drawing.Font("Segoe UI", 8F, System.Drawing.FontStyle.Bold); + this.xPanderPanelInfo.Controls.Add(this.tableLayoutPanel2); + this.xPanderPanelInfo.CustomColors.BackColor = System.Drawing.SystemColors.Control; + this.xPanderPanelInfo.CustomColors.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(184)))), ((int)(((byte)(184))))); + this.xPanderPanelInfo.CustomColors.CaptionCheckedGradientBegin = System.Drawing.Color.Empty; + this.xPanderPanelInfo.CustomColors.CaptionCheckedGradientEnd = System.Drawing.Color.Empty; + this.xPanderPanelInfo.CustomColors.CaptionCheckedGradientMiddle = System.Drawing.Color.Empty; + this.xPanderPanelInfo.CustomColors.CaptionCloseIcon = System.Drawing.SystemColors.ControlText; + this.xPanderPanelInfo.CustomColors.CaptionExpandIcon = System.Drawing.SystemColors.ControlText; + this.xPanderPanelInfo.CustomColors.CaptionGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); + this.xPanderPanelInfo.CustomColors.CaptionGradientEnd = System.Drawing.SystemColors.ButtonFace; + this.xPanderPanelInfo.CustomColors.CaptionGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248))))); + this.xPanderPanelInfo.CustomColors.CaptionPressedGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelInfo.CustomColors.CaptionPressedGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelInfo.CustomColors.CaptionPressedGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelInfo.CustomColors.CaptionSelectedGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelInfo.CustomColors.CaptionSelectedGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelInfo.CustomColors.CaptionSelectedGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelInfo.CustomColors.CaptionSelectedText = System.Drawing.SystemColors.ControlText; + this.xPanderPanelInfo.CustomColors.CaptionText = System.Drawing.SystemColors.ControlText; + this.xPanderPanelInfo.CustomColors.FlatCaptionGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248))))); + this.xPanderPanelInfo.CustomColors.FlatCaptionGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); + this.xPanderPanelInfo.CustomColors.InnerBorderColor = System.Drawing.SystemColors.Window; + this.xPanderPanelInfo.ForeColor = System.Drawing.SystemColors.ControlText; + this.xPanderPanelInfo.Image = null; + this.xPanderPanelInfo.Margin = new System.Windows.Forms.Padding(2); + this.xPanderPanelInfo.Name = "xPanderPanelInfo"; + this.xPanderPanelInfo.PanelStyle = BSE.Windows.Forms.PanelStyle.Office2007; + this.xPanderPanelInfo.Size = new System.Drawing.Size(228, 25); + this.xPanderPanelInfo.TabIndex = 3; + this.xPanderPanelInfo.Text = "info"; + this.xPanderPanelInfo.ToolTipTextCloseIcon = null; + this.xPanderPanelInfo.ToolTipTextExpandIconPanelCollapsed = null; + this.xPanderPanelInfo.ToolTipTextExpandIconPanelExpanded = null; + this.xPanderPanelInfo.Click += new System.EventHandler(this.xPanderPanelInfo_Click); + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.ColumnCount = 3; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 15F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 15F)); + this.tableLayoutPanel2.Controls.Add(this.textBoxZoomCurrent, 1, 7); + this.tableLayoutPanel2.Controls.Add(this.textBoxrouteCount, 1, 11); + this.tableLayoutPanel2.Controls.Add(this.label12, 1, 10); + this.tableLayoutPanel2.Controls.Add(this.label9, 1, 6); + this.tableLayoutPanel2.Controls.Add(this.textBoxLngCurrent, 1, 4); + this.tableLayoutPanel2.Controls.Add(this.textBoxMarkerCount, 1, 9); + this.tableLayoutPanel2.Controls.Add(this.label11, 1, 8); + this.tableLayoutPanel2.Controls.Add(this.label4, 1, 3); + this.tableLayoutPanel2.Controls.Add(this.textBoxLatCurrent, 1, 2); + this.tableLayoutPanel2.Controls.Add(this.label5, 1, 1); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel2.Location = new System.Drawing.Point(1, 25); + this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(2); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 13; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(226, 0); + this.tableLayoutPanel2.TabIndex = 14; + // + // textBoxZoomCurrent + // + this.textBoxZoomCurrent.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBoxZoomCurrent.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBoxZoomCurrent.Location = new System.Drawing.Point(18, 142); + this.textBoxZoomCurrent.Name = "textBoxZoomCurrent"; + this.textBoxZoomCurrent.ReadOnly = true; + this.textBoxZoomCurrent.Size = new System.Drawing.Size(190, 28); + this.textBoxZoomCurrent.TabIndex = 8; + this.textBoxZoomCurrent.Text = "15"; + // + // textBoxrouteCount + // + this.textBoxrouteCount.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBoxrouteCount.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBoxrouteCount.Location = new System.Drawing.Point(18, 236); + this.textBoxrouteCount.Name = "textBoxrouteCount"; + this.textBoxrouteCount.ReadOnly = true; + this.textBoxrouteCount.Size = new System.Drawing.Size(190, 28); + this.textBoxrouteCount.TabIndex = 12; + this.textBoxrouteCount.Text = "..."; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(18, 220); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(39, 13); + this.label12.TabIndex = 13; + this.label12.Text = "routes:"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(18, 126); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(35, 13); + this.label9.TabIndex = 9; + this.label9.Text = "zoom:"; + // + // textBoxLngCurrent + // + this.textBoxLngCurrent.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBoxLngCurrent.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBoxLngCurrent.Location = new System.Drawing.Point(18, 79); + this.textBoxLngCurrent.Name = "textBoxLngCurrent"; + this.textBoxLngCurrent.ReadOnly = true; + this.textBoxLngCurrent.Size = new System.Drawing.Size(190, 28); + this.textBoxLngCurrent.TabIndex = 5; + this.textBoxLngCurrent.Text = "..."; + // + // textBoxMarkerCount + // + this.textBoxMarkerCount.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBoxMarkerCount.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBoxMarkerCount.Location = new System.Drawing.Point(18, 189); + this.textBoxMarkerCount.Name = "textBoxMarkerCount"; + this.textBoxMarkerCount.ReadOnly = true; + this.textBoxMarkerCount.Size = new System.Drawing.Size(190, 28); + this.textBoxMarkerCount.TabIndex = 10; + this.textBoxMarkerCount.Text = "..."; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(18, 173); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(47, 13); + this.label11.TabIndex = 11; + this.label11.Text = "markers:"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(18, 63); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(24, 13); + this.label4.TabIndex = 7; + this.label4.Text = "lng:"; + // + // textBoxLatCurrent + // + this.textBoxLatCurrent.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBoxLatCurrent.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBoxLatCurrent.Location = new System.Drawing.Point(18, 32); + this.textBoxLatCurrent.Name = "textBoxLatCurrent"; + this.textBoxLatCurrent.ReadOnly = true; + this.textBoxLatCurrent.Size = new System.Drawing.Size(190, 28); + this.textBoxLatCurrent.TabIndex = 4; + this.textBoxLatCurrent.Text = "..."; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(18, 16); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(21, 13); + this.label5.TabIndex = 6; + this.label5.Text = "lat:"; + // + // xPanderPanelCache + // + this.xPanderPanelCache.CaptionFont = new System.Drawing.Font("Segoe UI", 8F, System.Drawing.FontStyle.Bold); + this.xPanderPanelCache.Controls.Add(this.tableLayoutPanel1); + this.xPanderPanelCache.CustomColors.BackColor = System.Drawing.SystemColors.Control; + this.xPanderPanelCache.CustomColors.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(184)))), ((int)(((byte)(184))))); + this.xPanderPanelCache.CustomColors.CaptionCheckedGradientBegin = System.Drawing.Color.Empty; + this.xPanderPanelCache.CustomColors.CaptionCheckedGradientEnd = System.Drawing.Color.Empty; + this.xPanderPanelCache.CustomColors.CaptionCheckedGradientMiddle = System.Drawing.Color.Empty; + this.xPanderPanelCache.CustomColors.CaptionCloseIcon = System.Drawing.SystemColors.ControlText; + this.xPanderPanelCache.CustomColors.CaptionExpandIcon = System.Drawing.SystemColors.ControlText; + this.xPanderPanelCache.CustomColors.CaptionGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); + this.xPanderPanelCache.CustomColors.CaptionGradientEnd = System.Drawing.SystemColors.ButtonFace; + this.xPanderPanelCache.CustomColors.CaptionGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248))))); + this.xPanderPanelCache.CustomColors.CaptionPressedGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelCache.CustomColors.CaptionPressedGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelCache.CustomColors.CaptionPressedGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelCache.CustomColors.CaptionSelectedGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelCache.CustomColors.CaptionSelectedGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelCache.CustomColors.CaptionSelectedGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); + this.xPanderPanelCache.CustomColors.CaptionSelectedText = System.Drawing.SystemColors.ControlText; + this.xPanderPanelCache.CustomColors.CaptionText = System.Drawing.SystemColors.ControlText; + this.xPanderPanelCache.CustomColors.FlatCaptionGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248))))); + this.xPanderPanelCache.CustomColors.FlatCaptionGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); + this.xPanderPanelCache.CustomColors.InnerBorderColor = System.Drawing.SystemColors.Window; + this.xPanderPanelCache.ForeColor = System.Drawing.SystemColors.ControlText; + this.xPanderPanelCache.Image = null; + this.xPanderPanelCache.IsClosable = false; + this.xPanderPanelCache.Margin = new System.Windows.Forms.Padding(2); + this.xPanderPanelCache.Name = "xPanderPanelCache"; + this.xPanderPanelCache.PanelStyle = BSE.Windows.Forms.PanelStyle.Office2007; + this.xPanderPanelCache.Size = new System.Drawing.Size(228, 25); + this.xPanderPanelCache.TabIndex = 4; + this.xPanderPanelCache.Text = "cache"; + this.xPanderPanelCache.ToolTipTextCloseIcon = null; + this.xPanderPanelCache.ToolTipTextExpandIconPanelCollapsed = null; + this.xPanderPanelCache.ToolTipTextExpandIconPanelExpanded = null; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 3; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 15F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 15F)); + this.tableLayoutPanel1.Controls.Add(this.textBoxCacheSize, 1, 12); + this.tableLayoutPanel1.Controls.Add(this.textBoxCacheStatus, 1, 15); + this.tableLayoutPanel1.Controls.Add(this.button10, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.textBoxMemory, 1, 9); + this.tableLayoutPanel1.Controls.Add(this.checkBoxUseRouteCache, 1, 17); + this.tableLayoutPanel1.Controls.Add(this.button9, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.button11, 1, 3); + this.tableLayoutPanel1.Controls.Add(this.label10, 1, 8); + this.tableLayoutPanel1.Controls.Add(this.button2, 1, 5); + this.tableLayoutPanel1.Controls.Add(this.label13, 1, 14); + this.tableLayoutPanel1.Controls.Add(this.label14, 1, 11); + this.tableLayoutPanel1.Controls.Add(this.button17, 1, 6); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(1, 25); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 19; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 16F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(226, 0); + this.tableLayoutPanel1.TabIndex = 41; + // + // textBoxCacheSize + // + this.textBoxCacheSize.Dock = System.Windows.Forms.DockStyle.Top; + this.textBoxCacheSize.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBoxCacheSize.Location = new System.Drawing.Point(18, 238); + this.textBoxCacheSize.Name = "textBoxCacheSize"; + this.textBoxCacheSize.ReadOnly = true; + this.textBoxCacheSize.Size = new System.Drawing.Size(190, 28); + this.textBoxCacheSize.TabIndex = 49; + this.textBoxCacheSize.Text = "..."; + // + // textBoxCacheStatus + // + this.textBoxCacheStatus.Dock = System.Windows.Forms.DockStyle.Top; + this.textBoxCacheStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBoxCacheStatus.Location = new System.Drawing.Point(18, 301); + this.textBoxCacheStatus.Name = "textBoxCacheStatus"; + this.textBoxCacheStatus.ReadOnly = true; + this.textBoxCacheStatus.Size = new System.Drawing.Size(190, 28); + this.textBoxCacheStatus.TabIndex = 46; + this.textBoxCacheStatus.Text = "..."; + // + // button10 + // + this.button10.Dock = System.Windows.Forms.DockStyle.Fill; + this.button10.Location = new System.Drawing.Point(18, 19); + this.button10.Name = "button10"; + this.button10.Size = new System.Drawing.Size(190, 20); + this.button10.TabIndex = 5; + this.button10.Text = "Import"; + this.button10.UseVisualStyleBackColor = true; + // + // textBoxMemory + // + this.textBoxMemory.Dock = System.Windows.Forms.DockStyle.Top; + this.textBoxMemory.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBoxMemory.Location = new System.Drawing.Point(18, 175); + this.textBoxMemory.Name = "textBoxMemory"; + this.textBoxMemory.ReadOnly = true; + this.textBoxMemory.Size = new System.Drawing.Size(190, 28); + this.textBoxMemory.TabIndex = 39; + this.textBoxMemory.Text = "..."; + // + // checkBoxUseRouteCache + // + this.checkBoxUseRouteCache.AutoSize = true; + this.checkBoxUseRouteCache.Checked = true; + this.checkBoxUseRouteCache.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxUseRouteCache.Location = new System.Drawing.Point(18, 351); + this.checkBoxUseRouteCache.Name = "checkBoxUseRouteCache"; + this.checkBoxUseRouteCache.Size = new System.Drawing.Size(160, 17); + this.checkBoxUseRouteCache.TabIndex = 2; + this.checkBoxUseRouteCache.Text = "cache routing/geocodig/etc"; + this.checkBoxUseRouteCache.UseVisualStyleBackColor = true; + // + // button9 + // + this.button9.Dock = System.Windows.Forms.DockStyle.Fill; + this.button9.Location = new System.Drawing.Point(18, 45); + this.button9.Name = "button9"; + this.button9.Size = new System.Drawing.Size(190, 20); + this.button9.TabIndex = 4; + this.button9.Text = "Export"; + this.button9.UseVisualStyleBackColor = true; + // + // button11 + // + this.button11.Dock = System.Windows.Forms.DockStyle.Fill; + this.button11.Location = new System.Drawing.Point(18, 71); + this.button11.Name = "button11"; + this.button11.Size = new System.Drawing.Size(190, 20); + this.button11.TabIndex = 38; + this.button11.Text = "Prefetch selected area"; + this.button11.UseVisualStyleBackColor = true; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(18, 159); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(111, 13); + this.label10.TabIndex = 40; + this.label10.Text = "memory cache usage:"; + // + // button2 + // + this.button2.Dock = System.Windows.Forms.DockStyle.Fill; + this.button2.Location = new System.Drawing.Point(18, 97); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(190, 20); + this.button2.TabIndex = 43; + this.button2.Text = "Clear tiles in disk cache"; + this.button2.UseVisualStyleBackColor = true; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(18, 285); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(93, 13); + this.label13.TabIndex = 44; + this.label13.Text = "disk cache status:"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(18, 222); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(83, 13); + this.label14.TabIndex = 47; + this.label14.Text = "disk cache size:"; + // + // button17 + // + this.button17.Dock = System.Windows.Forms.DockStyle.Fill; + this.button17.Location = new System.Drawing.Point(17, 122); + this.button17.Margin = new System.Windows.Forms.Padding(2); + this.button17.Name = "button17"; + this.button17.Size = new System.Drawing.Size(192, 19); + this.button17.TabIndex = 50; + this.button17.Text = "Open cache location"; + this.button17.UseVisualStyleBackColor = true; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.AliceBlue; + this.ClientSize = new System.Drawing.Size(895, 828); + this.Controls.Add(this.tboxMessageBox); + this.Controls.Add(this.tabControl); + this.KeyPreview = true; + this.MinimumSize = new System.Drawing.Size(554, 105); + this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "GMap.NET - Great Maps for Windows Forms"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.Load += new System.EventHandler(this.MainForm_Load); + this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.MainForm_KeyPress); + this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.MainForm_KeyUp); + this.tabMap.ResumeLayout(false); + this.panel4.ResumeLayout(false); + this.panel2.ResumeLayout(false); + this.tabControl.ResumeLayout(false); + this.tabGraphs.ResumeLayout(false); + this.pnlDataListDisplay.ResumeLayout(false); + this.pnlDataListDisplay.PerformLayout(); + this.ctnParentChartHolder.Panel1.ResumeLayout(false); + this.ctnParentChartHolder.Panel2.ResumeLayout(false); + this.ctnParentChartHolder.ResumeLayout(false); + this.ctnTopChartHolder.Panel1.ResumeLayout(false); + this.ctnTopChartHolder.Panel1.PerformLayout(); + this.ctnTopChartHolder.Panel2.ResumeLayout(false); + this.ctnTopChartHolder.Panel2.PerformLayout(); + this.ctnTopChartHolder.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.chrtTopLeft)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.chrtTopRight)).EndInit(); + this.ctnBottomChartHolder.Panel1.ResumeLayout(false); + this.ctnBottomChartHolder.Panel1.PerformLayout(); + this.ctnBottomChartHolder.Panel2.ResumeLayout(false); + this.ctnBottomChartHolder.Panel2.PerformLayout(); + this.ctnBottomChartHolder.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.chrtBottomLeft)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.chrtBottomRight)).EndInit(); + this.tabData.ResumeLayout(false); + this.gboxSlaveData.ResumeLayout(false); + this.gboxSlaveData.PerformLayout(); + this.gboxMasterData.ResumeLayout(false); + this.gboxMasterData.PerformLayout(); + this.panelMenu.ResumeLayout(false); + this.xPanderPanelList1.ResumeLayout(false); + this.xPanderPanelMain.ResumeLayout(false); + this.tableLayoutPanel4.ResumeLayout(false); + this.tableLayoutPanel5.ResumeLayout(false); + this.tableLayoutPanel5.PerformLayout(); + this.groupBox8.ResumeLayout(false); + this.groupBox8.PerformLayout(); + this.groupBox7.ResumeLayout(false); + this.groupBox7.PerformLayout(); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.tableLayoutPanel6.ResumeLayout(false); + this.tableLayoutPanel6.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.trackBarZoomLevel)).EndInit(); + this.xPanderPanelInfo.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.xPanderPanelCache.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TabPage tabMap; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.Panel panel2; + internal Map MainMap; + private BSE.Windows.Forms.Splitter splitter1; + private BSE.Windows.Forms.Panel panelMenu; + private BSE.Windows.Forms.XPanderPanelList xPanderPanelList1; + private BSE.Windows.Forms.XPanderPanel xPanderPanelMain; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; + private System.Windows.Forms.GroupBox groupBox8; + private System.Windows.Forms.Button btnZoomCenter; + private System.Windows.Forms.CheckBox xboxPlacemarkInfo; + private System.Windows.Forms.Button btnClearAll; + private System.Windows.Forms.Button btnAddMarker; + private System.Windows.Forms.GroupBox groupBox7; + private System.Windows.Forms.Button buttonExportToGpx; + private System.Windows.Forms.DateTimePicker MobileLogTo; + private System.Windows.Forms.Label lblClear; + private System.Windows.Forms.Button btnClearPolygons; + private System.Windows.Forms.DateTimePicker MobileLogFrom; + private System.Windows.Forms.Button btnMobileLog; + private System.Windows.Forms.Button buttonSetEnd; + private System.Windows.Forms.Button buttonSetStart; + private System.Windows.Forms.Button btnClearRoutes; + private System.Windows.Forms.Button btnAddRoute; + private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.Button btnLoadGPX; + private System.Windows.Forms.Button btnGetStatic; + private System.Windows.Forms.CheckBox xboxGrid; + private System.Windows.Forms.Button btnSaveView; + private System.Windows.Forms.Label lblMode; + private System.Windows.Forms.ComboBox comboBoxMode; + private System.Windows.Forms.CheckBox xboxCanDrag; + private System.Windows.Forms.CheckBox xboxCurrentMarker; + private System.Windows.Forms.Label lblMapType; + private System.Windows.Forms.ComboBox comboBoxMapType; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.Label lblGoTo; + private System.Windows.Forms.TextBox textBoxGeo; + private System.Windows.Forms.Button btnReload; + private System.Windows.Forms.Button btnGoToCoords; + private System.Windows.Forms.Label lblLng; + private System.Windows.Forms.Label lblLat; + private System.Windows.Forms.TextBox textBoxLng; + private System.Windows.Forms.TextBox textBoxLat; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6; + private System.Windows.Forms.Button btnZoomIn; + private System.Windows.Forms.TrackBar trackBarZoomLevel; + private System.Windows.Forms.Button btnZoomOut; + private BSE.Windows.Forms.XPanderPanel xPanderPanelInfo; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.TextBox textBoxZoomCurrent; + private System.Windows.Forms.TextBox textBoxrouteCount; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox textBoxLngCurrent; + private System.Windows.Forms.TextBox textBoxMarkerCount; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox textBoxLatCurrent; + private System.Windows.Forms.Label label5; + private BSE.Windows.Forms.XPanderPanel xPanderPanelCache; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.TextBox textBoxCacheSize; + private System.Windows.Forms.TextBox textBoxCacheStatus; + private System.Windows.Forms.Button button10; + private System.Windows.Forms.TextBox textBoxMemory; + private System.Windows.Forms.CheckBox checkBoxUseRouteCache; + private System.Windows.Forms.Button button9; + private System.Windows.Forms.Button button11; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Button button17; + private System.Windows.Forms.TabControl tabControl; + private System.Windows.Forms.TabPage tabGraphs; + private System.Windows.Forms.Panel pnlDataListDisplay; + private System.Windows.Forms.Button btnTest; + internal System.Windows.Forms.TextBox tboxChartData; + internal System.Windows.Forms.Label lblChartData; + internal System.Windows.Forms.TextBox tboxCurrent; + internal System.Windows.Forms.Label lblCurrent; + internal System.Windows.Forms.TextBox tboxMin; + internal System.Windows.Forms.Label lblAverage; + internal System.Windows.Forms.TextBox tboxMax; + internal System.Windows.Forms.Label lblMax; + internal System.Windows.Forms.TextBox tboxAverage; + internal System.Windows.Forms.Label lblMin; + private System.Windows.Forms.SplitContainer ctnParentChartHolder; + private System.Windows.Forms.SplitContainer ctnTopChartHolder; + private System.Windows.Forms.Label lblTopLeftChartTitle; + private System.Windows.Forms.DataVisualization.Charting.Chart chrtTopLeft; + private System.Windows.Forms.Label lblTopRightChartTitle; + private System.Windows.Forms.DataVisualization.Charting.Chart chrtTopRight; + private System.Windows.Forms.SplitContainer ctnBottomChartHolder; + private System.Windows.Forms.Label lblBottomLeftChartTitle; + private System.Windows.Forms.DataVisualization.Charting.Chart chrtBottomLeft; + private System.Windows.Forms.Label lblBottomRightChartTitle; + private System.Windows.Forms.DataVisualization.Charting.Chart chrtBottomRight; + private System.Windows.Forms.TextBox tboxMessageBox; + private System.Windows.Forms.TabPage tabData; + private System.Windows.Forms.GroupBox gboxSlaveData; + private System.Windows.Forms.GroupBox gboxMasterData; + private System.Windows.Forms.TextBox textBox6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox textBox5; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox textBox4; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBox16; + private System.Windows.Forms.Label label26; + private System.Windows.Forms.TextBox textBox17; + private System.Windows.Forms.Label label27; + private System.Windows.Forms.Label label28; + private System.Windows.Forms.TextBox textBox15; + private System.Windows.Forms.Label label25; + private System.Windows.Forms.TextBox textBox14; + private System.Windows.Forms.Label label24; + private System.Windows.Forms.TextBox textBox13; + private System.Windows.Forms.Label label23; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.TextBox textBox12; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.TextBox textBox11; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.TextBox textBox10; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.TextBox textBox9; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.TextBox textBox8; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.TextBox textBox7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.CheckBox cboxCollectData; + + + } +} + diff --git a/Demo.WindowsForms/Forms/MainForm.cs b/Demo.WindowsForms/Forms/MainForm.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Forms/MainForm.cs @@ -0,0 +1,2819 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Globalization; +using System.IO; +using System.Net; +using System.Net.NetworkInformation; +using System.Threading; +using System.Windows.Forms; +using System.Xml; +using Demo.WindowsForms.CustomMarkers; +using GMap.NET; +using GMap.NET.MapProviders; +using GMap.NET.WindowsForms; +using GMap.NET.WindowsForms.Markers; +using GMap.NET.WindowsForms.ToolTips; +using System.IO.Ports; +using System.Data; +using System.Text; +//using System.Linq; + +namespace Demo.WindowsForms +{ + public partial class MainForm : Form + { + // layers + readonly GMapOverlay top = new GMapOverlay(); + internal readonly GMapOverlay objects = new GMapOverlay("objects"); + internal readonly GMapOverlay routes = new GMapOverlay("routes"); + //internal readonly GMapOverlay polygons = new GMapOverlay("polygons"); + + // marker + GMarkerGoogle currentMarker; + + // polygons + //GMapPolygon polygon; + + // etc + readonly Random rnd = new Random(); + readonly DescendingComparer ComparerIpStatus = new DescendingComparer(); + GMapMarkerRect CurentRectMarker = null; + string mobileGpsLog = string.Empty; + bool isMouseDown = false; + PointLatLng start; + PointLatLng end; + + public MainForm() + { + InitializeComponent(); + + if (!DesignMode) + { + // add your custom map db provider + //GMap.NET.CacheProviders.MySQLPureImageCache ch = new GMap.NET.CacheProviders.MySQLPureImageCache(); + //ch.ConnectionString = @"server=sql2008;User Id=trolis;Persist Security Info=True;database=gmapnetcache;password=trolis;"; + //MainMap.Manager.SecondaryCache = ch; + + // set your proxy here if need + //GMapProvider.WebProxy = new WebProxy("10.2.0.100", 8080); + //GMapProvider.WebProxy.Credentials = new NetworkCredential("ogrenci@bilgeadam.com", "bilgeada"); + + // set cache mode only if no internet avaible + if (!Stuff.PingNetwork("pingtest.net")) + { + MainMap.Manager.Mode = AccessMode.CacheOnly; + MessageBox.Show("No internet connection available, going to CacheOnly mode.", "GMap.NET - Demo.WindowsForms", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + + // config map - MDKEdit - init values ?? + MainMap.MapProvider = GMapProviders.OpenStreetMap; + MainMap.Position = new PointLatLng(39.751248, -83.809848); + MainMap.MinZoom = 0; + MainMap.MaxZoom = 24; + MainMap.Zoom = 15; + + //MainMap.ScaleMode = ScaleModes.Fractional; + + // map events + { + MainMap.OnPositionChanged += new PositionChanged(MainMap_OnPositionChanged); + + MainMap.OnTileLoadStart += new TileLoadStart(MainMap_OnTileLoadStart); + MainMap.OnTileLoadComplete += new TileLoadComplete(MainMap_OnTileLoadComplete); + + MainMap.OnMapZoomChanged += new MapZoomChanged(MainMap_OnMapZoomChanged); + MainMap.OnMapTypeChanged += new MapTypeChanged(MainMap_OnMapTypeChanged); + + MainMap.OnMarkerClick += new MarkerClick(MainMap_OnMarkerClick); + MainMap.OnMarkerEnter += new MarkerEnter(MainMap_OnMarkerEnter); + MainMap.OnMarkerLeave += new MarkerLeave(MainMap_OnMarkerLeave); + + MainMap.OnPolygonEnter += new PolygonEnter(MainMap_OnPolygonEnter); + MainMap.OnPolygonLeave += new PolygonLeave(MainMap_OnPolygonLeave); + + MainMap.OnRouteEnter += new RouteEnter(MainMap_OnRouteEnter); + MainMap.OnRouteLeave += new RouteLeave(MainMap_OnRouteLeave); + + MainMap.Manager.OnTileCacheComplete += new TileCacheComplete(OnTileCacheComplete); + MainMap.Manager.OnTileCacheStart += new TileCacheStart(OnTileCacheStart); + MainMap.Manager.OnTileCacheProgress += new TileCacheProgress(OnTileCacheProgress); + } + + MainMap.MouseMove += new MouseEventHandler(MainMap_MouseMove); + MainMap.MouseDown += new MouseEventHandler(MainMap_MouseDown); + MainMap.MouseUp += new MouseEventHandler(MainMap_MouseUp); + MainMap.MouseDoubleClick += new MouseEventHandler(MainMap_MouseDoubleClick); + + // get map types +#if !MONO // mono doesn't handle it, so we 'lost' provider list ;] + comboBoxMapType.ValueMember = "Name"; + comboBoxMapType.DataSource = GMapProviders.List; + comboBoxMapType.SelectedItem = MainMap.MapProvider; +#endif + // acccess mode + comboBoxMode.DataSource = Enum.GetValues(typeof(AccessMode)); + comboBoxMode.SelectedItem = MainMap.Manager.Mode; + + // get position + textBoxLat.Text = MainMap.Position.Lat.ToString(CultureInfo.InvariantCulture); + textBoxLng.Text = MainMap.Position.Lng.ToString(CultureInfo.InvariantCulture); + + // get cache modes + checkBoxUseRouteCache.Checked = MainMap.Manager.UseRouteCache; + + MobileLogFrom.Value = DateTime.Today; + MobileLogTo.Value = DateTime.Now; + + // get zoom + trackBarZoomLevel.Minimum = MainMap.MinZoom * 100; + trackBarZoomLevel.Maximum = MainMap.MaxZoom * 100; + trackBarZoomLevel.TickFrequency = 100; + +#if DEBUG + xboxGrid.Checked = true; +#endif + + ToolStripManager.Renderer = new BSE.Windows.Forms.Office2007Renderer(); + + #region -- demo workers -- + //// flight demo + //{ + // flightWorker.DoWork += new DoWorkEventHandler(flight_DoWork); + // flightWorker.ProgressChanged += new ProgressChangedEventHandler(flight_ProgressChanged); + // flightWorker.WorkerSupportsCancellation = true; + // flightWorker.WorkerReportsProgress = true; + //} + + //// vehicle demo + //{ + // transportWorker.DoWork += new DoWorkEventHandler(transport_DoWork); + // transportWorker.ProgressChanged += new ProgressChangedEventHandler(transport_ProgressChanged); + // transportWorker.WorkerSupportsCancellation = true; + // transportWorker.WorkerReportsProgress = true; + //} + + // Connections + //{ + // connectionsWorker.DoWork += new DoWorkEventHandler(connectionsWorker_DoWork); + // connectionsWorker.ProgressChanged += new ProgressChangedEventHandler(connectionsWorker_ProgressChanged); + // connectionsWorker.WorkerSupportsCancellation = true; + // connectionsWorker.WorkerReportsProgress = true; + + // ipInfoSearchWorker.DoWork += new DoWorkEventHandler(ipInfoSearchWorker_DoWork); + // ipInfoSearchWorker.WorkerSupportsCancellation = true; + + // iptracerWorker.DoWork += new DoWorkEventHandler(iptracerWorker_DoWork); + // iptracerWorker.WorkerSupportsCancellation = true; + + // //GridConnections.AutoGenerateColumns = false; + + // IpCache.CacheLocation = MainMap.CacheLocation; + //} + + // perf + timerPerf.Tick += new EventHandler(timer_Tick); + #endregion + + // add custom layers + { + MainMap.Overlays.Add(routes); + //MainMap.Overlays.Add(polygons); + MainMap.Overlays.Add(objects); + MainMap.Overlays.Add(top); + + routes.Routes.CollectionChanged += new GMap.NET.ObjectModel.NotifyCollectionChangedEventHandler(Routes_CollectionChanged); + objects.Markers.CollectionChanged += new GMap.NET.ObjectModel.NotifyCollectionChangedEventHandler(Markers_CollectionChanged); + } + + // set current marker + currentMarker = new GMarkerGoogle(MainMap.Position, GMarkerGoogleType.arrow); + currentMarker.IsHitTestVisible = false; + top.Markers.Add(currentMarker); + + //MainMap.VirtualSizeEnabled = true; + //if(false) + { + // add my city location for demo + //GeoCoderStatusCode status = GeoCoderStatusCode.Unknow; + { + //PointLatLng? pos = GMapProviders.GoogleMap.GetPoint("Lithuania, Vilnius", out status); + //if (pos != null && status == GeoCoderStatusCode.G_GEO_SUCCESS) + //{ + // currentMarker.Position = pos.Value; + + // // - MDKEdit + // //GMapMarker myCity = new GMarkerGoogle(pos.Value, GMarkerGoogleType.green_small); + // //myCity.ToolTipMode = MarkerTooltipMode.Always; + // //myCity.ToolTipText = "Welcome to Lithuania! ;}"; + // //objects.Markers.Add(myCity); + //} + } + + // add some points in lithuania - MDKEdit + //AddLocationLithuania("Kaunas"); + //AddLocationLithuania("Klaipėda"); + //AddLocationLithuania("Šiauliai"); + //AddLocationLithuania("Panevėžys"); + + if (objects.Markers.Count > 0) + { + MainMap.ZoomAndCenterMarkers(null); + } + + //RegeneratePolygon(); + + try + { + GMapOverlay overlay = DeepClone(objects); + Debug.WriteLine("ISerializable status for markers: OK"); + + //GMapOverlay overlay2 = DeepClone(polygons); + //Debug.WriteLine("ISerializable status for polygons: OK"); + + GMapOverlay overlay3 = DeepClone(routes); + Debug.WriteLine("ISerializable status for routes: OK"); + } + catch (Exception ex) + { + Debug.WriteLine("ISerializable failure: " + ex.Message); + +#if DEBUG + if (Debugger.IsAttached) + { + Debugger.Break(); + } +#endif + } + } + } + } + + public T DeepClone(T obj) + { + using (var ms = new System.IO.MemoryStream()) + { + var formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); + + formatter.Serialize(ms, obj); + + ms.Position = 0; + + return (T)formatter.Deserialize(ms); + } + } + + void Markers_CollectionChanged(object sender, GMap.NET.ObjectModel.NotifyCollectionChangedEventArgs e) + { + textBoxMarkerCount.Text = objects.Markers.Count.ToString(); + } + + void Routes_CollectionChanged(object sender, GMap.NET.ObjectModel.NotifyCollectionChangedEventArgs e) + { + textBoxrouteCount.Text = routes.Routes.Count.ToString(); + } + + #region -- performance test -- + + double NextDouble(Random rng, double min, double max) + { + return min + (rng.NextDouble() * (max - min)); + } + + int tt = 0; + void timer_Tick(object sender, EventArgs e) + { + var pos = new PointLatLng(NextDouble(rnd, MainMap.ViewArea.Top, MainMap.ViewArea.Bottom), NextDouble(rnd, MainMap.ViewArea.Left, MainMap.ViewArea.Right)); + GMapMarker m = new GMarkerGoogle(pos, GMarkerGoogleType.green_pushpin); + { + m.ToolTipText = (tt++).ToString(); + m.ToolTipMode = MarkerTooltipMode.Always; + } + + objects.Markers.Add(m); + + if (tt >= 333) + { + timerPerf.Stop(); + tt = 0; + } + } + + System.Windows.Forms.Timer timerPerf = new System.Windows.Forms.Timer(); + #endregion + + #region -- flight demo -- + //BackgroundWorker flightWorker = new BackgroundWorker(); + + //readonly List flights = new List(); + //readonly Dictionary flightMarkers = new Dictionary(); + + //bool firstLoadFlight = true; + //GMapMarker currentFlight; + + //void flight_ProgressChanged(object sender, ProgressChangedEventArgs e) + //{ + // // stops immediate marker/route/polygon invalidations; + // // call Refresh to perform single refresh and reset invalidation state + // MainMap.HoldInvalidation = true; + + // lock (flights) + // { + // foreach (FlightRadarData d in flights) + // { + // GMapMarker marker; + + // if (!flightMarkers.TryGetValue(d.Id, out marker)) + // { + // marker = new GMarkerGoogle(d.point, GMarkerGoogleType.blue_small); + // marker.Tag = d.Id; + // marker.ToolTipMode = MarkerTooltipMode.OnMouseOver; + // //(marker as GMapMarkerGoogleGreen).Bearing = (float?)d.bearing; + + // flightMarkers[d.Id] = marker; + // objects.Markers.Add(marker); + // } + // else + // { + // marker.Position = d.point; + // //(marker as GMapMarkerGoogleGreen).Bearing = (float?)d.bearing; + // } + // marker.ToolTipText = d.name + ", " + d.altitude + ", " + d.speed; + + // if (currentFlight != null && currentFlight == marker) + // { + // MainMap.Position = marker.Position; + // //MainMap.Bearing = (float)d.bearing; + // } + // } + // } + + // if (firstLoadFlight) + // { + // MainMap.Zoom = 5; + // MainMap.SetZoomToFitRect(new RectLatLng(54.4955675218741, -0.966796875, 28.916015625, 13.3830987326932)); + // firstLoadFlight = false; + // } + // MainMap.Refresh(); + //} + + //void flight_DoWork(object sender, DoWorkEventArgs e) + //{ + // bool restartSesion = true; + + // while (!flightWorker.CancellationPending) + // { + // try + // { + // lock (flights) + // { + // Stuff.GetFlightRadarData(flights, lastPosition, lastZoom, restartSesion); + + // if (flights.Count > 0 && restartSesion) + // { + // restartSesion = false; + // } + // } + + // flightWorker.ReportProgress(100); + // } + // catch (Exception ex) + // { + // Debug.WriteLine("flight_DoWork: " + ex.ToString()); + // } + // Thread.Sleep(5 * 1000); + // } + + // flightMarkers.Clear(); + //} + + #endregion + + #region -- transport demo -- + //BackgroundWorker transportWorker = new BackgroundWorker(); + + //#region -- old vehicle demo -- + //readonly List trolleybus = new List(); + //readonly Dictionary trolleybusMarkers = new Dictionary(); + + //readonly List bus = new List(); + //readonly Dictionary busMarkers = new Dictionary(); + //#endregion + + //bool firstLoadTrasport = true; + //GMapMarker currentTransport; + + //void transport_ProgressChanged(object sender, ProgressChangedEventArgs e) + //{ + // // stops immediate marker/route/polygon invalidations; + // // call Refresh to perform single refresh and reset invalidation state + // MainMap.HoldInvalidation = true; + + // #region -- vehicle demo -- + // lock (trolleybus) + // { + // foreach (VehicleData d in trolleybus) + // { + // GMapMarker marker; + + // if (!trolleybusMarkers.TryGetValue(d.Id, out marker)) + // { + // marker = new GMarkerGoogle(new PointLatLng(d.Lat, d.Lng), GMarkerGoogleType.red_small); + // marker.Tag = d.Id; + // marker.ToolTipMode = MarkerTooltipMode.OnMouseOver; + + // trolleybusMarkers[d.Id] = marker; + // objects.Markers.Add(marker); + // } + // else + // { + // marker.Position = new PointLatLng(d.Lat, d.Lng); + // (marker as GMarkerGoogle).Bearing = (float?)d.Bearing; + // } + // marker.ToolTipText = "Trolley " + d.Line + (d.Bearing.HasValue ? ", bearing: " + d.Bearing.Value.ToString() : string.Empty) + ", " + d.Time; + + // if (currentTransport != null && currentTransport == marker) + // { + // MainMap.Position = marker.Position; + // if (d.Bearing.HasValue) + // { + // MainMap.Bearing = (float)d.Bearing.Value; + // } + // } + // } + // } + + // lock (bus) + // { + // foreach (VehicleData d in bus) + // { + // GMapMarker marker; + + // if (!busMarkers.TryGetValue(d.Id, out marker)) + // { + // marker = new GMarkerGoogle(new PointLatLng(d.Lat, d.Lng), GMarkerGoogleType.green_small); + // marker.Tag = d.Id; + // marker.ToolTipMode = MarkerTooltipMode.OnMouseOver; + + // busMarkers[d.Id] = marker; + // objects.Markers.Add(marker); + // } + // else + // { + // marker.Position = new PointLatLng(d.Lat, d.Lng); + // (marker as GMarkerGoogle).Bearing = (float?)d.Bearing; + // } + // marker.ToolTipText = "Bus " + d.Line + (d.Bearing.HasValue ? ", bearing: " + d.Bearing.Value.ToString() : string.Empty) + ", " + d.Time; + + // if (currentTransport != null && currentTransport == marker) + // { + // MainMap.Position = marker.Position; + // if (d.Bearing.HasValue) + // { + // MainMap.Bearing = (float)d.Bearing.Value; + // } + // } + // } + // } + // #endregion + + // if (firstLoadTrasport) + // { + // MainMap.Zoom = 5; + // MainMap.ZoomAndCenterMarkers("objects"); + // firstLoadTrasport = false; + // } + // MainMap.Refresh(); + //} + + //void transport_DoWork(object sender, DoWorkEventArgs e) + //{ + // while (!transportWorker.CancellationPending) + // { + // try + // { + // #region -- old vehicle demo -- + // lock (trolleybus) + // { + // Stuff.GetVilniusTransportData(TransportType.TrolleyBus, string.Empty, trolleybus); + // } + + // lock (bus) + // { + // Stuff.GetVilniusTransportData(TransportType.Bus, string.Empty, bus); + // } + // #endregion + + // transportWorker.ReportProgress(100); + // } + // catch (Exception ex) + // { + // Debug.WriteLine("transport_DoWork: " + ex.ToString()); + // } + // Thread.Sleep(2 * 1000); + // } + + // trolleybusMarkers.Clear(); + // busMarkers.Clear(); + //} + + #endregion + + #region -- tcp/ip connections demo -- + // BackgroundWorker connectionsWorker = new BackgroundWorker(); + // BackgroundWorker ipInfoSearchWorker = new BackgroundWorker(); + // BackgroundWorker iptracerWorker = new BackgroundWorker(); + + // readonly Dictionary TcpState = new Dictionary(); + // readonly Dictionary TcpTracePoints = new Dictionary(); + // readonly Dictionary> TraceRoutes = new Dictionary>(); + + // readonly List TcpStateNeedLocationInfo = new List(); + // readonly Queue TcpStateNeedtraceInfo = new Queue(); + + // volatile bool TryTraceConnection = false; + // GMapMarker lastTcpmarker; + // readonly SQLiteIpCache IpCache = new SQLiteIpCache(); + + // readonly Dictionary tcpConnections = new Dictionary(); + // readonly Dictionary tcpRoutes = new Dictionary(); + + // readonly List CountryStatusView = new List(); + // readonly SortedDictionary CountryStatus = new SortedDictionary(); + + // readonly List SelectedCountries = new List(); + // readonly Dictionary ProcessList = new Dictionary(); + + // void ipInfoSearchWorker_DoWork(object sender, DoWorkEventArgs e) + // { + // while (!ipInfoSearchWorker.CancellationPending) + // { + // try + // { + // string iplist = string.Empty; + + // lock (TcpStateNeedLocationInfo) + // { + // //int count = 0; + // foreach (var info in TcpStateNeedLocationInfo) + // { + // if (iplist.Length > 0) + // { + // iplist += ","; + // } + // iplist += info; + + // //if(count++ >= 1) + // { + // break; + // } + // } + // } + + // // fill location info + // if (!string.IsNullOrEmpty(iplist)) + // { + // List ips = GetIpHostInfo(iplist); + // foreach (var i in ips) + // { + // lock (TcpState) + // { + // IpInfo info; + // if (TcpState.TryGetValue(i.Ip, out info)) + // { + // info.CountryName = i.CountryName; + // info.RegionName = i.RegionName; + // info.City = i.City; + // info.Latitude = i.Latitude; + // info.Longitude = i.Longitude; + // info.TracePoint = false; + + // if (info.CountryName != "Reserved") + // { + // info.Ip = i.Ip; + + // // add host for tracing + // lock (TcpStateNeedtraceInfo) + // { + // if (!TcpStateNeedtraceInfo.Contains(i.Ip)) + // { + // TcpStateNeedtraceInfo.Enqueue(i.Ip); + // } + // } + // } + + // lock (TcpStateNeedLocationInfo) + // { + // TcpStateNeedLocationInfo.Remove(i.Ip); + + // Debug.WriteLine("TcpStateNeedLocationInfo: " + TcpStateNeedLocationInfo.Count + " left..."); + // } + // } + // } + // } + // ips.Clear(); + // } + // else + // { + // break; + // } + // } + // catch (Exception ex) + // { + // Debug.WriteLine("ipInfoSearchWorker_DoWork: " + ex.ToString()); + // } + // Thread.Sleep(1111); + // } + // Debug.WriteLine("ipInfoSearchWorker_DoWork: QUIT"); + // } + + // void iptracerWorker_DoWork(object sender, DoWorkEventArgs e) + // { + // while (!iptracerWorker.CancellationPending) + // { + // try + // { + // string Ip = string.Empty; + // int count = 0; + // lock (TcpStateNeedtraceInfo) + // { + // count = TcpStateNeedtraceInfo.Count; + // if (count > 0) + // { + // Ip = TcpStateNeedtraceInfo.Dequeue(); + // } + // } + + // if (!string.IsNullOrEmpty(Ip)) + // { + // string tracertIps = string.Empty; + + // List tracert; + + // bool contains = false; + // lock (TraceRoutes) + // { + // contains = TraceRoutes.TryGetValue(Ip, out tracert); + // } + + // if (!contains) + // { + // Debug.WriteLine("GetTraceRoute: " + Ip + ", left " + count); + + // tracert = TraceRoute.GetTraceRoute(Ip); + // if (tracert != null) + // { + // if (tracert[tracert.Count - 1].Status == IPStatus.Success) + // { + // foreach (var t in tracert) + // { + // if (!t.ToString().StartsWith("192.168.") && !t.ToString().StartsWith("127.0.")) + // { + // if (tracertIps.Length > 0) + // { + // tracertIps += ","; + // } + // tracertIps += t.Address.ToString(); + // } + // } + + // if (!string.IsNullOrEmpty(tracertIps)) + // { + // List tinfo = GetIpHostInfo(tracertIps); + // if (tinfo.Count > 0) + // { + // for (int i = 0; i < tinfo.Count; i++) + // { + // IpInfo ti = tinfo[i]; + // ti.TracePoint = true; + + // if (ti.CountryName != "Reserved") + // { + // lock (TcpTracePoints) + // { + // TcpTracePoints[ti.Ip] = ti; + // } + // } + // } + // tinfo.Clear(); + + // lock (TraceRoutes) + // { + // TraceRoutes[Ip] = tracert; + // } + // } + // } + // } + // else + // { + // // move failed, eque itself again + // lock (TcpStateNeedtraceInfo) + // { + // TcpStateNeedtraceInfo.Enqueue(Ip); + // } + // } + // } + // } + // } + // else + // { + // break; + // } + // } + // catch (Exception ex) + // { + // Debug.WriteLine("iptracerWorker_DoWork: " + ex.ToString()); + // } + // Thread.Sleep(3333); + // } + // Debug.WriteLine("iptracerWorker_DoWork: QUIT"); + // } + + // void connectionsWorker_DoWork(object sender, DoWorkEventArgs e) + // { + //#if !MONO + // IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties(); + + // while (!connectionsWorker.CancellationPending) + // { + // try + // { + // #region -- xml -- + // // http://ipinfodb.com/ip_location_api.php + + // // http://ipinfodb.com/ip_query2.php?ip=74.125.45.100,206.190.60.37&timezone=false + + // // + // // + // // + // // 74.125.45.100 + // // OK + // // US + // // United States + // // 06 + // // California + // // Mountain View + // // 94043 + // // 37.4192 + // // -122.057 + // // + // #endregion + + // lock (TcpState) + // { + // //TcpConnectionInformation[] tcpInfoList = properties.GetActiveTcpConnections(); + // //foreach(TcpConnectionInformation i in tcpInfoList) + // //{ + + // //} + + // CountryStatus.Clear(); + // ManagedIpHelper.UpdateExtendedTcpTable(false); + + // foreach (TcpRow i in ManagedIpHelper.TcpRows) + // { + // #region -- update TcpState -- + // string Ip = i.RemoteEndPoint.Address.ToString(); + + // // exclude local network + // if (!Ip.StartsWith("192.168.") && !Ip.StartsWith("127.0.")) + // { + // IpInfo info; + // if (!TcpState.TryGetValue(Ip, out info)) + // { + // info = new IpInfo(); + // TcpState[Ip] = info; + + // // request location info + // lock (TcpStateNeedLocationInfo) + // { + // if (!TcpStateNeedLocationInfo.Contains(Ip)) + // { + // TcpStateNeedLocationInfo.Add(Ip); + + // if (!ipInfoSearchWorker.IsBusy) + // { + // ipInfoSearchWorker.RunWorkerAsync(); + // } + // } + // } + // } + + // info.State = i.State; + // info.Port = i.RemoteEndPoint.Port; + // info.StatusTime = DateTime.Now; + + // try + // { + // Process p; + // if (!ProcessList.TryGetValue(i.ProcessId, out p)) + // { + // p = Process.GetProcessById(i.ProcessId); + // ProcessList[i.ProcessId] = p; + // } + // info.ProcessName = p.ProcessName; + // } + // catch + // { + // } + + // if (!string.IsNullOrEmpty(info.CountryName)) + // { + // if (!CountryStatus.ContainsKey(info.CountryName)) + // { + // CountryStatus[info.CountryName] = 1; + // } + // else + // { + // CountryStatus[info.CountryName]++; + // } + // } + // } + // #endregion + // } + // } + + // // launch tracer if needed + // if (TryTraceConnection) + // { + // if (!iptracerWorker.IsBusy) + // { + // lock (TcpStateNeedtraceInfo) + // { + // if (TcpStateNeedtraceInfo.Count > 0) + // { + // iptracerWorker.RunWorkerAsync(); + // } + // } + // } + // } + + // connectionsWorker.ReportProgress(100); + // } + // catch (Exception ex) + // { + // Debug.WriteLine("connectionsWorker_DoWork: " + ex.ToString()); + // } + // Thread.Sleep(3333); + // } + // tcpConnections.Clear(); + //#endif + // } + + // //void connectionsWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) + // //{ + // // try + // // { + // // // stops immediate marker/route/polygon invalidations; + // // // call Refresh to perform single refresh and reset invalidation state + // // MainMap.HoldInvalidation = true; + + // // SelectedCountries.Clear(); + // // //Int32 SelectedCountriesCount = GridConnections.Rows.GetRowCount(DataGridViewElementStates.Selected); + // // //if(SelectedCountriesCount > 0) + // // //{ + // // // for(int i = 0; i < SelectedCountriesCount; i++) + // // // { + // // // string country = GridConnections.SelectedRows[i].Cells[0].Value as string; + // // // SelectedCountries.Add(country); + // // // } + // // //} + // // // + // // //ComparerIpStatus.SortOnlyCountryName = !(SelectedCountriesCount == 0); + + // // lock(TcpState) + // // { + // // bool snap = true; + // // foreach(var tcp in TcpState) + // // { + // // GMapMarker marker; + + // // if(!tcpConnections.TryGetValue(tcp.Key, out marker)) + // // { + // // if(!string.IsNullOrEmpty(tcp.Value.Ip)) + // // { + // // marker = new GMarkerGoogle(new PointLatLng(tcp.Value.Latitude, tcp.Value.Longitude), GMarkerGoogleType.green_small); + // // marker.ToolTipMode = MarkerTooltipMode.OnMouseOver; + // // marker.Tag = tcp.Value.CountryName; + + // // tcpConnections[tcp.Key] = marker; + // // { + // // if(!(SelectedCountriesCount > 0 && !SelectedCountries.Contains(tcp.Value.CountryName))) + // // { + // // objects.Markers.Add(marker); + + // // UpdateMarkerTcpIpToolTip(marker, tcp.Value, "(" + objects.Markers.Count + ") "); + + // // if(snap) + // // { + // // if(checkBoxTcpIpSnap.Checked && !MainMap.IsDragging) + // // { + // // MainMap.Position = marker.Position; + // // } + // // snap = false; + + // // if(lastTcpmarker != null) + // // { + // // marker.ToolTipMode = MarkerTooltipMode.Always; + // // lastTcpmarker.ToolTipMode = MarkerTooltipMode.OnMouseOver; + // // } + + // // lastTcpmarker = marker; + // // } + // // } + // // } + // // } + // // } + // // else + // // { + // // if((DateTime.Now - tcp.Value.StatusTime > TimeSpan.FromSeconds(8)) || (SelectedCountriesCount > 0 && !SelectedCountries.Contains(tcp.Value.CountryName))) + // // { + // // objects.Markers.Remove(marker); + + // // GMapRoute route; + // // if(tcpRoutes.TryGetValue(tcp.Key, out route)) + // // { + // // routes.Routes.Remove(route); + // // } + + // // lock(TcpStateNeedLocationInfo) + // // { + // // bool r = TcpStateNeedLocationInfo.Remove(tcp.Key); + // // if(r) + // // { + // // Debug.WriteLine("TcpStateNeedLocationInfo: removed " + tcp.Key + " " + r); + // // } + // // } + // // } + // // else + // // { + // // marker.Position = new PointLatLng(tcp.Value.Latitude, tcp.Value.Longitude); + // // if(!objects.Markers.Contains(marker)) + // // { + // // objects.Markers.Add(marker); + // // } + // // UpdateMarkerTcpIpToolTip(marker, tcp.Value, string.Empty); + + // // if(TryTraceConnection) + // // { + // // // routes + // // GMapRoute route; + // // if(!this.tcpRoutes.TryGetValue(tcp.Key, out route)) + // // { + // // lock(TraceRoutes) + // // { + // // List tr; + // // if(TraceRoutes.TryGetValue(tcp.Key, out tr)) + // // { + // // if(tr != null) + // // { + // // List points = new List(); + // // foreach(var add in tr) + // // { + // // IpInfo info; + + // // lock(TcpTracePoints) + // // { + // // if(TcpTracePoints.TryGetValue(add.Address.ToString(), out info)) + // // { + // // if(!string.IsNullOrEmpty(info.Ip)) + // // { + // // points.Add(new PointLatLng(info.Latitude, info.Longitude)); + // // } + // // } + // // } + // // } + + // // if(points.Count > 0) + // // { + // // route = new GMapRoute(points, tcp.Value.CountryName); + + // // route.Stroke = new Pen(GetRandomColor()); + // // route.Stroke.Width = 4; + // // route.Stroke.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot; + + // // route.Stroke.StartCap = LineCap.NoAnchor; + // // route.Stroke.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor; + // // route.Stroke.LineJoin = LineJoin.Round; + + // // routes.Routes.Add(route); + // // tcpRoutes[tcp.Key] = route; + // // } + // // } + // // } + // // } + // // } + // // else + // // { + // // if(!routes.Routes.Contains(route)) + // // { + // // routes.Routes.Add(route); + // // } + // // } + // // } + // // } + // // } + // // } + + // // // update grid data + // // if(panelMenu.Expand && xPanderPanelLive.Expand) + // // { + // // bool empty = CountryStatusView.Count == 0; + + // // if(!ComparerIpStatus.SortOnlyCountryName) + // // { + // // CountryStatusView.Clear(); + // // } + + // // foreach(var c in CountryStatus) + // // { + // // IpStatus s = new IpStatus(); + // // { + // // s.CountryName = c.Key; + // // s.ConnectionsCount = c.Value; + // // } + + // // if(ComparerIpStatus.SortOnlyCountryName) + // // { + // // int idx = CountryStatusView.FindIndex(p => p.CountryName == c.Key); + // // if(idx >= 0) + // // { + // // CountryStatusView[idx] = s; + // // } + // // } + // // else + // // { + // // CountryStatusView.Add(s); + // // } + // // } + + // // CountryStatusView.Sort(ComparerIpStatus); + + // // GridConnections.RowCount = CountryStatusView.Count; + // // GridConnections.Refresh(); + + // // if(empty) + // // { + // // GridConnections.ClearSelection(); + // // } + // // } + // // } + + // // MainMap.Refresh(); + // // } + // // catch(Exception ex) + // // { + // // Debug.WriteLine(ex.ToString()); + // // } + // //} + + // //void GridConnections_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) + // //{ + // // if(e.RowIndex >= CountryStatusView.Count) + // // return; + + // // IpStatus val = CountryStatusView[e.RowIndex]; + + // // switch(GridConnections.Columns[e.ColumnIndex].Name) + // // { + // // case "CountryName": + // // e.Value = val.CountryName; + // // break; + + // // case "ConnectionsCount": + // // e.Value = val.ConnectionsCount; + // // break; + // // } + // //} + + // Color GetRandomColor() + // { + // byte r = Convert.ToByte(rnd.Next(0, 111)); + // byte g = Convert.ToByte(rnd.Next(0, 111)); + // byte b = Convert.ToByte(rnd.Next(0, 111)); + + // return Color.FromArgb(144, r, g, b); + // } + + // void UpdateMarkerTcpIpToolTip(GMapMarker marker, IpInfo tcp, string info) + // { + // marker.ToolTipText = tcp.State.ToString(); + + // if (!string.IsNullOrEmpty(tcp.ProcessName)) + // { + // marker.ToolTipText += " by " + tcp.ProcessName; + // } + + // if (!string.IsNullOrEmpty(tcp.CountryName)) + // { + // marker.ToolTipText += "\n" + tcp.CountryName; + // } + + // if (!string.IsNullOrEmpty(tcp.City)) + // { + // marker.ToolTipText += ", " + tcp.City; + // } + // else + // { + // if (!string.IsNullOrEmpty(tcp.RegionName)) + // { + // marker.ToolTipText += ", " + tcp.RegionName; + // } + // } + + // marker.ToolTipText += "\n" + tcp.Ip + ":" + tcp.Port + "\n" + info; + // } + + // List GetIpHostInfo(string iplist) + // { + // List ret = new List(); + // bool retry = false; + + // string iplistNew = string.Empty; + + // string[] ips = iplist.Split(','); + // foreach (var ip in ips) + // { + // IpInfo val = IpCache.GetDataFromCache(ip); + // if (val != null) + // { + // ret.Add(val); + // } + // else + // { + // if (iplistNew.Length > 0) + // { + // iplistNew += ","; + // } + // iplistNew += ip; + // } + // } + + // if (!string.IsNullOrEmpty(iplistNew)) + // { + // Debug.WriteLine("GetIpHostInfo: " + iplist); + + // string reqUrl = string.Format("http://api.ipinfodb.com/v2/ip_query.php?key=fbea1992ab11f7125064590a417a8461ccaf06728798c718dbd2809b31a7a5e0&ip={0}&timezone=false", iplistNew); + + // while (true) + // { + // ret.Clear(); + // try + // { + // HttpWebRequest httpReq = HttpWebRequest.Create(reqUrl) as HttpWebRequest; + // { + // string result = string.Empty; + // using (HttpWebResponse response = httpReq.GetResponse() as HttpWebResponse) + // { + // using (StreamReader reader = new StreamReader(response.GetResponseStream(), System.Text.Encoding.UTF8)) + // { + // result = reader.ReadToEnd(); + // } + // response.Close(); + // } + + // XmlDocument x = new XmlDocument(); + // x.LoadXml(result); + + // XmlNodeList nodes = x.SelectNodes("/Response"); + // foreach (XmlNode node in nodes) + // { + // string Ip = node.SelectSingleNode("Ip").InnerText; + + // IpInfo info = new IpInfo(); + // { + // info.Ip = Ip; + // info.CountryName = node.SelectSingleNode("CountryName").InnerText; + // info.RegionName = node.SelectSingleNode("RegionName").InnerText; + // info.City = node.SelectSingleNode("City").InnerText; + // info.Latitude = double.Parse(node.SelectSingleNode("Latitude").InnerText, CultureInfo.InvariantCulture); + // info.Longitude = double.Parse(node.SelectSingleNode("Longitude").InnerText, CultureInfo.InvariantCulture); + // info.CacheTime = DateTime.Now; + + // ret.Add(info); + // } + + // IpCache.PutDataToCache(Ip, info); + // } + // } + + // break; + // } + // catch (Exception ex) + // { + // if (retry) // fail in retry too, full stop ;} + // { + // break; + // } + // retry = true; + // reqUrl = string.Format("http://backup.ipinfodb.com/v2/ip_query.php?key=fbea1992ab11f7125064590a417a8461ccaf06728798c718dbd2809b31a7a5e0&ip={0}&timezone=false", iplist); + // Debug.WriteLine("GetIpHostInfo: " + ex.Message + ", retry on backup server..."); + // } + // } + // } + // return ret; + // } + + #endregion + + #region -- some functions -- + + //void RegeneratePolygon() + //{ + // List polygonPoints = new List(); + + // foreach (GMapMarker m in objects.Markers) + // { + // if (m is GMapMarkerRect) + // { + // m.Tag = polygonPoints.Count; + // polygonPoints.Add(m.Position); + // } + // } + + // if (polygon == null) + // { + // polygon = new GMapPolygon(polygonPoints, "polygon test"); + // polygon.IsHitTestVisible = true; + // polygons.Polygons.Add(polygon); + // } + // else + // { + // polygon.Points.Clear(); + // polygon.Points.AddRange(polygonPoints); + + // if (polygons.Polygons.Count == 0) + // { + // polygons.Polygons.Add(polygon); + // } + // else + // { + // MainMap.UpdatePolygonLocalPosition(polygon); + // } + // } + //} + + // load mobile gps log + void AddGpsMobileLogRoutes(string file) + { + try + { + DateTime? date = null; + DateTime? dateEnd = null; + + if (MobileLogFrom.Checked) + { + date = MobileLogFrom.Value.ToUniversalTime(); + } + + if (MobileLogTo.Checked) + { + dateEnd = MobileLogTo.Value.ToUniversalTime(); + } + + var log = Stuff.GetRoutesFromMobileLog(file, date, dateEnd, 3.3); + + if (routes != null) + { + List track = new List(); + + var sessions = new List>(log); + + PointLatLng lastPoint = PointLatLng.Empty; + + foreach (var session in sessions) + { + // connect to last session with direct line + if (!lastPoint.IsEmpty && session.Count > 0) + { + track.Clear(); + track.Add(lastPoint); + track.Add(session[0].Position); + + GMapRoute grl = new GMapRoute(track, ""); + grl.Stroke.Color = Color.Red; + grl.Stroke.Width = 2.0f; + routes.Routes.Add(grl); + } + + track.Clear(); + + foreach (var point in session) + { + track.Add(point.Position); + } + + if (track.Count > 0) + { + lastPoint = track[track.Count - 1]; + } + else + { + lastPoint = PointLatLng.Empty; + } + + GMapRoute gr = new GMapRoute(track, ""); + routes.Routes.Add(gr); + } + + sessions.Clear(); + sessions = null; + + track.Clear(); + track = null; + } + } + catch (Exception ex) + { + Debug.WriteLine("AddGpsMobileLogRoutes: " + ex.ToString()); + } + } + + /// + /// adds marker using geocoder + /// + /// + void AddLocationLithuania(string place) + { + GeoCoderStatusCode status = GeoCoderStatusCode.Unknow; + PointLatLng? pos = GMapProviders.GoogleMap.GetPoint("Lithuania, " + place, out status); + if (pos != null && status == GeoCoderStatusCode.G_GEO_SUCCESS) + { + GMarkerGoogle m = new GMarkerGoogle(pos.Value, GMarkerGoogleType.green); + m.ToolTip = new GMapRoundedToolTip(m); + + GMapMarkerRect mBorders = new GMapMarkerRect(pos.Value); + { + mBorders.InnerMarker = m; + mBorders.ToolTipText = place; + mBorders.ToolTipMode = MarkerTooltipMode.Always; + } + + objects.Markers.Add(m); + objects.Markers.Add(mBorders); + } + } + + #endregion + + #region -- map events -- + + void OnTileCacheComplete() + { + Debug.WriteLine("OnTileCacheComplete"); + long size = 0; + int db = 0; + try + { + DirectoryInfo di = new DirectoryInfo(MainMap.CacheLocation); + var dbs = di.GetFiles("*.gmdb", SearchOption.AllDirectories); + foreach (var d in dbs) + { + size += d.Length; + db++; + } + } + catch + { + } + + if (!IsDisposed) + { + MethodInvoker m = delegate + { + textBoxCacheSize.Text = string.Format(CultureInfo.InvariantCulture, "{0} db in {1:00} MB", db, size / (1024.0 * 1024.0)); + textBoxCacheStatus.Text = "all tiles saved!"; + }; + Invoke(m); + } + } + + void OnTileCacheStart() + { + Debug.WriteLine("OnTileCacheStart"); + + if (!IsDisposed) + { + MethodInvoker m = delegate + { + textBoxCacheStatus.Text = "saving tiles..."; + }; + // MDKEdit + //Invoke(m); + } + } + + void OnTileCacheProgress(int left) + { + if (!IsDisposed) + { + MethodInvoker m = delegate + { + textBoxCacheStatus.Text = left + " tile to save..."; + }; + Invoke(m); + } + } + + void MainMap_OnMarkerLeave(GMapMarker item) + { + if (item is GMapMarkerRect) + { + CurentRectMarker = null; + + GMapMarkerRect rc = item as GMapMarkerRect; + rc.Pen.Color = Color.Blue; + + Debug.WriteLine("OnMarkerLeave: " + item.Position); + } + } + + void MainMap_OnMarkerEnter(GMapMarker item) + { + if (item is GMapMarkerRect) + { + GMapMarkerRect rc = item as GMapMarkerRect; + rc.Pen.Color = Color.Red; + + CurentRectMarker = rc; + + Debug.WriteLine("OnMarkerEnter: " + item.Position); + } + } + + GMapPolygon currentPolygon = null; + void MainMap_OnPolygonLeave(GMapPolygon item) + { + currentPolygon = null; + item.Stroke.Color = Color.MidnightBlue; + Debug.WriteLine("OnPolygonLeave: " + item.Name); + } + + void MainMap_OnPolygonEnter(GMapPolygon item) + { + currentPolygon = item; + item.Stroke.Color = Color.Red; + Debug.WriteLine("OnPolygonEnter: " + item.Name); + } + + GMapRoute currentRoute = null; + void MainMap_OnRouteLeave(GMapRoute item) + { + currentRoute = null; + item.Stroke.Color = Color.MidnightBlue; + Debug.WriteLine("OnRouteLeave: " + item.Name); + } + + void MainMap_OnRouteEnter(GMapRoute item) + { + currentRoute = item; + item.Stroke.Color = Color.Red; + Debug.WriteLine("OnRouteEnter: " + item.Name); + } + + void MainMap_OnMapTypeChanged(GMapProvider type) + { + comboBoxMapType.SelectedItem = type; + + trackBarZoomLevel.Minimum = MainMap.MinZoom * 100; + trackBarZoomLevel.Maximum = MainMap.MaxZoom * 100; + + //if(rbtnFlight.Checked) + //{ + // MainMap.ZoomAndCenterMarkers("objects"); + //} + } + + void MainMap_MouseUp(object sender, MouseEventArgs e) + { + // MDKAdd + textBoxLatCurrent.Text = currentMarker.Position.Lat.ToString(); + textBoxLngCurrent.Text = currentMarker.Position.Lng.ToString(); + if (e.Button == MouseButtons.Left) + { + isMouseDown = false; + } + } + + // add demo circle + void MainMap_MouseDoubleClick(object sender, MouseEventArgs e) + { + var cc = new GMapMarkerCircle(MainMap.FromLocalToLatLng(e.X, e.Y)); + objects.Markers.Add(cc); + } + + void MainMap_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + isMouseDown = true; + + if (currentMarker.IsVisible) + { + currentMarker.Position = MainMap.FromLocalToLatLng(e.X, e.Y); + // MDKAdd + textBoxLatCurrent.Text = currentMarker.Position.Lat.ToString(); + textBoxLngCurrent.Text = currentMarker.Position.Lng.ToString(); + + var px = MainMap.MapProvider.Projection.FromLatLngToPixel(currentMarker.Position.Lat, currentMarker.Position.Lng, (int)MainMap.Zoom); + var tile = MainMap.MapProvider.Projection.FromPixelToTileXY(px); + + Debug.WriteLine("MouseDown: geo: " + currentMarker.Position + " | px: " + px + " | tile: " + tile); + } + } + } + + // move current marker with left holding + void MainMap_MouseMove(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left && isMouseDown) + { + if (CurentRectMarker == null) + { + if (currentMarker.IsVisible) + { + // MDKAdd + textBoxLatCurrent.Text = currentMarker.Position.Lat.ToString(); + textBoxLngCurrent.Text = currentMarker.Position.Lng.ToString(); + + currentMarker.Position = MainMap.FromLocalToLatLng(e.X, e.Y); + } + } + else // move rect marker + { + PointLatLng pnew = MainMap.FromLocalToLatLng(e.X, e.Y); + + int? pIndex = (int?)CurentRectMarker.Tag; + if (pIndex.HasValue) + { + //if (pIndex < polygon.Points.Count) + //{ + // polygon.Points[pIndex.Value] = pnew; + // MainMap.UpdatePolygonLocalPosition(polygon); + //} + } + + if (currentMarker.IsVisible) + { + currentMarker.Position = pnew; + // MDKAdd + textBoxLatCurrent.Text = currentMarker.Position.Lat.ToString(); + textBoxLngCurrent.Text = currentMarker.Position.Lng.ToString(); + } + CurentRectMarker.Position = pnew; + + if (CurentRectMarker.InnerMarker != null) + { + CurentRectMarker.InnerMarker.Position = pnew; + } + } + + MainMap.Refresh(); // force instant invalidation + // MDKAdd + textBoxLatCurrent.Refresh(); + textBoxLngCurrent.Refresh(); + } + } + + // MapZoomChanged + void MainMap_OnMapZoomChanged() + { + trackBarZoomLevel.Value = (int)(MainMap.Zoom * 100.0); + textBoxZoomCurrent.Text = MainMap.Zoom.ToString(); + } + + // click on some marker + void MainMap_OnMarkerClick(GMapMarker item, MouseEventArgs e) + { + if (e.Button == System.Windows.Forms.MouseButtons.Left) + { + if (item is GMapMarkerRect) + { + GeoCoderStatusCode status; + var pos = GMapProviders.GoogleMap.GetPlacemark(item.Position, out status); + if (status == GeoCoderStatusCode.G_GEO_SUCCESS && pos != null) + { + GMapMarkerRect v = item as GMapMarkerRect; + { + v.ToolTipText = pos.Value.Address; + } + MainMap.Invalidate(false); + } + } + else + { + //if (item.Tag != null) + //{ + // if (currentTransport != null) + // { + // currentTransport.ToolTipMode = MarkerTooltipMode.OnMouseOver; + // currentTransport = null; + // } + // currentTransport = item; + // currentTransport.ToolTipMode = MarkerTooltipMode.Always; + //} + } + } + } + + // loader start loading tiles + void MainMap_OnTileLoadStart() + { + MethodInvoker m = delegate() + { + panelMenu.Text = "Menu: loading tiles..."; + }; + try + { + BeginInvoke(m); + } + catch + { + } + } + + // loader end loading tiles + void MainMap_OnTileLoadComplete(long ElapsedMilliseconds) + { + MainMap.ElapsedMilliseconds = ElapsedMilliseconds; + + MethodInvoker m = delegate() + { + panelMenu.Text = "Menu, last load in " + MainMap.ElapsedMilliseconds + "ms"; + + textBoxMemory.Text = string.Format(CultureInfo.InvariantCulture, "{0:0.00} MB of {1:0.00} MB", MainMap.Manager.MemoryCache.Size, MainMap.Manager.MemoryCache.Capacity); + }; + try + { + BeginInvoke(m); + } + catch + { + } + } + + // current point changed + void MainMap_OnPositionChanged(PointLatLng point) + { + textBoxLatCurrent.Text = point.Lat.ToString(CultureInfo.InvariantCulture); + textBoxLngCurrent.Text = point.Lng.ToString(CultureInfo.InvariantCulture); + + //lock (flights) + //{ + // lastPosition = point; + // lastZoom = (int)MainMap.Zoom; + //} + } + + //PointLatLng lastPosition; + //int lastZoom; + + // center markers on start + private void MainForm_Load(object sender, EventArgs e) + { + trackBarZoomLevel.Value = (int)MainMap.Zoom * 100; + Activate(); + TopMost = true; + TopMost = false; + + PrepareGraphs(); + } + #endregion + + #region -- menu panels expanders -- + private void xPanderPanel1_Click(object sender, EventArgs e) + { + xPanderPanelList1.Expand(xPanderPanelMain); + } + + private void xPanderPanelCache_Click(object sender, EventArgs e) + { + xPanderPanelList1.Expand(xPanderPanelCache); + } + + private void xPanderPanelInfo_Click(object sender, EventArgs e) + { + xPanderPanelList1.Expand(xPanderPanelInfo); + } + #endregion + + #region -- ui events -- + + bool UserAcceptedLicenseOnce = false; + + // change map type + private void comboBoxMapType_DropDownClosed(object sender, EventArgs e) + { + if (!UserAcceptedLicenseOnce) + { + if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "License.txt")) + { + string ctn = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "License.txt"); + int li = ctn.IndexOf("License"); + string txt = ctn.Substring(li); + + var d = new Demo.WindowsForms.Forms.Message(); + d.richTextBox1.Text = txt; + + if (DialogResult.Yes == d.ShowDialog()) + { + UserAcceptedLicenseOnce = true; + this.Text += " - license accepted by " + Environment.UserName + " at " + DateTime.Now; + } + } + else + { + // user deleted License.txt ;} + UserAcceptedLicenseOnce = true; + } + } + + if (UserAcceptedLicenseOnce) + { + MainMap.MapProvider = comboBoxMapType.SelectedItem as GMapProvider; + } + else + { + MainMap.MapProvider = GMapProviders.OpenStreetMap; + comboBoxMapType.SelectedItem = MainMap.MapProvider; + } + } + + // change mdoe + private void comboBoxMode_DropDownClosed(object sender, EventArgs e) + { + MainMap.Manager.Mode = (AccessMode)comboBoxMode.SelectedValue; + MainMap.ReloadMap(); + } + + // zoom + private void trackBar1_ValueChanged(object sender, EventArgs e) + { + MainMap.Zoom = trackBarZoomLevel.Value / 100.0; + } + + // go to + private void btnGoToCoords_Click(object sender, EventArgs e) + { + try + { + double lat = double.Parse(textBoxLat.Text, CultureInfo.InvariantCulture); + double lng = double.Parse(textBoxLng.Text, CultureInfo.InvariantCulture); + + MainMap.Position = new PointLatLng(lat, lng); + } + catch (Exception ex) + { + MessageBox.Show("incorrect coordinate format: " + ex.Message); + } + } + + // goto by geocoder + private void textBoxGeo_KeyPress(object sender, KeyPressEventArgs e) + { + if ((Keys)e.KeyChar == Keys.Enter) + { + GeoCoderStatusCode status = MainMap.SetCurrentPositionByKeywords(textBoxGeo.Text); + if (status != GeoCoderStatusCode.G_GEO_SUCCESS) + { + MessageBox.Show("Google Maps Geocoder can't find: '" + textBoxGeo.Text + "', reason: " + status.ToString(), "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + } + } + } + + // reload map + private void btnReload_Click(object sender, EventArgs e) + { + MainMap.ReloadMap(); + } + + // cache config + private void checkBoxUseCache_CheckedChanged(object sender, EventArgs e) + { + MainMap.Manager.UseRouteCache = checkBoxUseRouteCache.Checked; + MainMap.Manager.UseGeocoderCache = checkBoxUseRouteCache.Checked; + MainMap.Manager.UsePlacemarkCache = checkBoxUseRouteCache.Checked; + MainMap.Manager.UseDirectionsCache = checkBoxUseRouteCache.Checked; + } + + // clear cache + private void button2_Click(object sender, EventArgs e) + { + if (MessageBox.Show("Are You sure?", "Clear GMap.NET cache?", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) + { + try + { + MainMap.Manager.PrimaryCache.DeleteOlderThan(DateTime.Now, null); + MessageBox.Show("Done. Cache is clear."); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } + } + + // add test route + private void btnAddRoute_Click(object sender, EventArgs e) + { + RoutingProvider rp = MainMap.MapProvider as RoutingProvider; + if (rp == null) + { + rp = GMapProviders.GoogleMap; // use google if provider does not implement routing + } + + MapRoute route = rp.GetRoute(start, end, false, false, (int)MainMap.Zoom); + if (route != null) + { + // add route + GMapRoute r = new GMapRoute(route.Points, route.Name); + r.IsHitTestVisible = true; + routes.Routes.Add(r); + + // add route start/end marks + GMapMarker m1 = new GMarkerGoogle(start, GMarkerGoogleType.green_big_go); + m1.ToolTipText = "Start: " + route.Name; + m1.ToolTipMode = MarkerTooltipMode.Always; + + GMapMarker m2 = new GMarkerGoogle(end, GMarkerGoogleType.red_big_stop); + m2.ToolTipText = "End: " + end.ToString(); + m2.ToolTipMode = MarkerTooltipMode.Always; + + objects.Markers.Add(m1); + objects.Markers.Add(m2); + + //MainMap.ZoomAndCenterRoute(r); + + } + } + + // add marker on current position - MDKEdit + private void btnAddMarker_Click(object sender, EventArgs e) + { + GMarkerGoogle m = new GMarkerGoogle(currentMarker.Position, GMarkerGoogleType.blue_small); + //GMapMarkerRect mBorders = new GMapMarkerRect(currentMarker.Position); + //{ + // mBorders.InnerMarker = m; + // if(polygon != null) + // { + // mBorders.Tag = polygon.Points.Count; + // } + // mBorders.ToolTipMode = MarkerTooltipMode.Always; + //} + + Placemark? p = null; + if (xboxPlacemarkInfo.Checked) + { + GeoCoderStatusCode status; + var ret = GMapProviders.GoogleMap.GetPlacemark(currentMarker.Position, out status); + if (status == GeoCoderStatusCode.G_GEO_SUCCESS && ret != null) + { + p = ret; + } + } + + //if(p != null) + //{ + // mBorders.ToolTipText = p.Value.Address; + //} + //else + //{ + // mBorders.ToolTipText = currentMarker.Position.ToString(); + //} + + objects.Markers.Add(m); + //objects.Markers.Add(mBorders); + + //RegeneratePolygon(); + } + + // clear routes + private void btnClearRoutes_Click(object sender, EventArgs e) + { + routes.Routes.Clear(); + } + + // clear polygons + private void btnClearPolygons_Click(object sender, EventArgs e) + { + //polygons.Polygons.Clear(); + } + + // clear markers + private void btnClearMarkers_Click(object sender, EventArgs e) + { + objects.Markers.Clear(); + hasEndMarker = false; + hasStartMarker = false; + } + + // show current marker + private void checkBoxCurrentMarker_CheckedChanged(object sender, EventArgs e) + { + currentMarker.IsVisible = xboxCurrentMarker.Checked; + } + + // can drag + private void checkBoxCanDrag_CheckedChanged(object sender, EventArgs e) + { + MainMap.CanDragMap = xboxCanDrag.Checked; + } + + bool hasStartMarker = false; + // set route start + private void buttonSetStart_Click(object sender, EventArgs e) + { + start = currentMarker.Position; + // - MDKAdd + GMarkerGoogle m = new GMarkerGoogle(currentMarker.Position, GMarkerGoogleType.green_small); + + //prevent multiple start markers from existing + if(hasStartMarker){ + objects.Markers.RemoveAt(0); + } + + objects.Markers.Insert(0, m); + if (hasEndMarker) + { + objects.Markers.Move(2, 1); + } + hasStartMarker = true; + } + + bool hasEndMarker = false; + // set route end + private void buttonSetEnd_Click(object sender, EventArgs e) + { + end = currentMarker.Position; + // - MDKAdd + GMarkerGoogle m = new GMarkerGoogle(currentMarker.Position, GMarkerGoogleType.red_small); + + //prevent multiple start markers from existing + if (hasEndMarker) + { + objects.Markers.RemoveAt(1); + } + objects.Markers.Insert(1, m); + hasEndMarker = true; + } + + // zoom to max for markers + private void button7_Click(object sender, EventArgs e) + { + MainMap.ZoomAndCenterMarkers("objects"); + } + + // export map data + private void button9_Click(object sender, EventArgs e) + { + MainMap.ShowExportDialog(); + } + + // import map data + private void button10_Click(object sender, EventArgs e) + { + MainMap.ShowImportDialog(); + } + + // prefetch + private void button11_Click(object sender, EventArgs e) + { + RectLatLng area = MainMap.SelectedArea; + if (!area.IsEmpty) + { + for (int i = (int)MainMap.Zoom; i <= MainMap.MaxZoom; i++) + { + DialogResult res = MessageBox.Show("Ready ripp at Zoom = " + i + " ?", "GMap.NET", MessageBoxButtons.YesNoCancel); + + if (res == DialogResult.Yes) + { + using (TilePrefetcher obj = new TilePrefetcher()) + { + obj.Owner = this; + obj.ShowCompleteMessage = true; + obj.Start(area, i, MainMap.MapProvider, 100); + } + } + else if (res == DialogResult.No) + { + continue; + } + else if (res == DialogResult.Cancel) + { + break; + } + } + } + else + { + MessageBox.Show("Select map area holding ALT", "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + } + } + + // saves current map view + private void btnSaveView_Click(object sender, EventArgs e) + { + try + { + using (SaveFileDialog sfd = new SaveFileDialog()) + { + sfd.Filter = "PNG (*.png)|*.png"; + sfd.FileName = "GMap.NET image"; + + Image tmpImage = MainMap.ToImage(); + if (tmpImage != null) + { + using (tmpImage) + { + if (sfd.ShowDialog() == DialogResult.OK) + { + tmpImage.Save(sfd.FileName); + + MessageBox.Show("Image saved: " + sfd.FileName, "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + } + } + } + catch (Exception ex) + { + MessageBox.Show("Image failed to save: " + ex.Message, "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + // debug tile grid + private void checkBoxDebug_CheckedChanged(object sender, EventArgs e) + { + MainMap.ShowTileGridLines = xboxGrid.Checked; + } + + // launch static map maker + private void btnGetStatic_Click(object sender, EventArgs e) + { + StaticImage st = new StaticImage(this); + st.Owner = this; + st.Show(); + } + + // add gps log from mobile + private void btnMobileLog_Click(object sender, EventArgs e) + { + using (FileDialog dlg = new OpenFileDialog()) + { + dlg.CheckPathExists = true; + dlg.CheckFileExists = false; + dlg.AddExtension = true; + dlg.DefaultExt = "gpsd"; + dlg.ValidateNames = true; + dlg.Title = "GMap.NET: open gps log generated in your windows mobile"; + dlg.Filter = "GMap.NET gps log DB files (*.gpsd)|*.gpsd"; + dlg.FilterIndex = 1; + dlg.RestoreDirectory = true; + + if (dlg.ShowDialog() == DialogResult.OK) + { + routes.Routes.Clear(); + + mobileGpsLog = dlg.FileName; + + // add routes + AddGpsMobileLogRoutes(dlg.FileName); + + if (routes.Routes.Count > 0) + { + MainMap.ZoomAndCenterRoutes(null); + } + } + } + } + + // key-up events + private void MainForm_KeyUp(object sender, KeyEventArgs e) + { + int offset = -22; + + if (e.KeyCode == Keys.Left) + { + MainMap.Offset(-offset, 0); + } + else if (e.KeyCode == Keys.Right) + { + MainMap.Offset(offset, 0); + } + else if (e.KeyCode == Keys.Up) + { + MainMap.Offset(0, -offset); + } + else if (e.KeyCode == Keys.Down) + { + MainMap.Offset(0, offset); + } + else if (e.KeyCode == Keys.Delete) + { + //if (currentPolygon != null) + //{ + // polygons.Polygons.Remove(currentPolygon); + // currentPolygon = null; + //} + + if (currentRoute != null) + { + routes.Routes.Remove(currentRoute); + currentRoute = null; + } + + if (CurentRectMarker != null) + { + objects.Markers.Remove(CurentRectMarker); + + if (CurentRectMarker.InnerMarker != null) + { + objects.Markers.Remove(CurentRectMarker.InnerMarker); + } + CurentRectMarker = null; + + //RegeneratePolygon(); + } + } + else if (e.KeyCode == Keys.Escape) + { + MainMap.Bearing = 0; + + //if (currentTransport != null && !MainMap.IsMouseOverMarker) + //{ + // currentTransport.ToolTipMode = MarkerTooltipMode.OnMouseOver; + // currentTransport = null; + //} + } + } + + // key-press events + private void MainForm_KeyPress(object sender, KeyPressEventArgs e) + { + if (MainMap.Focused) + { + if (e.KeyChar == '+') + { + MainMap.Zoom = ((int)MainMap.Zoom) + 1; + } + else if (e.KeyChar == '-') + { + MainMap.Zoom = ((int)(MainMap.Zoom + 0.99)) - 1; + } + else if (e.KeyChar == 'a') + { + MainMap.Bearing--; + } + else if (e.KeyChar == 'z') + { + MainMap.Bearing++; + } + } + } + + private void buttonZoomUp_Click(object sender, EventArgs e) + { + MainMap.Zoom = ((int)MainMap.Zoom) + 1; + } + + private void buttonZoomDown_Click(object sender, EventArgs e) + { + MainMap.Zoom = ((int)(MainMap.Zoom + 0.99)) - 1; + } + + // engage some live demo + //private void RealTimeChanged(object sender, EventArgs e) + //{ + // objects.Markers.Clear(); + // polygons.Polygons.Clear(); + // routes.Routes.Clear(); + + // //// start performance test + // //if(rbtnPerf.Checked) + // //{ + // // timerPerf.Interval = 44; + // // timerPerf.Start(); + // //} + // //else + // //{ + // // // stop performance test + // // timerPerf.Stop(); + // //} + + // // start realtime transport tracking demo + // //if(rbtnFlight.Checked) + // //{ + // // if(!flightWorker.IsBusy) + // // { + // // firstLoadFlight = true; + // // flightWorker.RunWorkerAsync(); + // // } + // //} + // //else + // //{ + // // if(flightWorker.IsBusy) + // // { + // // flightWorker.CancelAsync(); + // // } + // //} + + // // vehicle demo + // //if(rbtnVehicle.Checked) + // //{ + // // if(!transportWorker.IsBusy) + // // { + // // firstLoadTrasport = true; + // // transportWorker.RunWorkerAsync(); + // // } + // //} + // //else + // //{ + // // if(transportWorker.IsBusy) + // // { + // // transportWorker.CancelAsync(); + // // } + // //} + + // // start live tcp/ip connections demo + // if(rbtnTcpIp.Checked) + // { + // GridConnections.Visible = true; + // checkBoxTcpIpSnap.Visible = true; + // checkBoxTraceRoute.Visible = true; + // GridConnections.Refresh(); + + // if(!connectionsWorker.IsBusy) + // { + // //if(MainMap.Provider != MapType.GoogleMap) + // //{ + // // MainMap.MapType = MapType.GoogleMap; + // //} + // MainMap.Zoom = 5; + + // connectionsWorker.RunWorkerAsync(); + // } + // } + // else + // { + // CountryStatusView.Clear(); + // GridConnections.Visible = false; + // checkBoxTcpIpSnap.Visible = false; + // checkBoxTraceRoute.Visible = false; + + // if(connectionsWorker.IsBusy) + // { + // connectionsWorker.CancelAsync(); + // } + + // if(ipInfoSearchWorker.IsBusy) + // { + // ipInfoSearchWorker.CancelAsync(); + // } + + // if(iptracerWorker.IsBusy) + // { + // iptracerWorker.CancelAsync(); + // } + // } + //} + + // export mobile gps log to gpx file + private void buttonExportToGpx_Click(object sender, EventArgs e) + { + try + { + using (SaveFileDialog sfd = new SaveFileDialog()) + { + sfd.Filter = "GPX (*.gpx)|*.gpx"; + sfd.FileName = "mobile gps log"; + + DateTime? date = null; + DateTime? dateEnd = null; + + if (MobileLogFrom.Checked) + { + date = MobileLogFrom.Value.ToUniversalTime(); + + sfd.FileName += " from " + MobileLogFrom.Value.ToString("yyyy-MM-dd HH-mm"); + } + + if (MobileLogTo.Checked) + { + dateEnd = MobileLogTo.Value.ToUniversalTime(); + + sfd.FileName += " to " + MobileLogTo.Value.ToString("yyyy-MM-dd HH-mm"); + } + + if (sfd.ShowDialog() == DialogResult.OK) + { + var log = Stuff.GetRoutesFromMobileLog(mobileGpsLog, date, dateEnd, 3.3); + if (log != null) + { + if (MainMap.Manager.ExportGPX(log, sfd.FileName)) + { + MessageBox.Show("GPX saved: " + sfd.FileName, "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + } + } + } + catch (Exception ex) + { + MessageBox.Show("GPX failed to save: " + ex.Message, "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + // load gpx file + private void btnLoadGPX_Click(object sender, EventArgs e) + { + using (FileDialog dlg = new OpenFileDialog()) + { + dlg.CheckPathExists = true; + dlg.CheckFileExists = false; + dlg.AddExtension = true; + dlg.DefaultExt = "gpx"; + dlg.ValidateNames = true; + dlg.Title = "GMap.NET: open gpx log"; + dlg.Filter = "gpx files (*.gpx)|*.gpx"; + dlg.FilterIndex = 1; + dlg.RestoreDirectory = true; + + if (dlg.ShowDialog() == DialogResult.OK) + { + try + { + string gpx = File.ReadAllText(dlg.FileName); + + gpxType r = MainMap.Manager.DeserializeGPX(gpx); + if (r != null) + { + if (r.trk.Length > 0) + { + foreach (var trk in r.trk) + { + List points = new List(); + + foreach (var seg in trk.trkseg) + { + foreach (var p in seg.trkpt) + { + points.Add(new PointLatLng((double)p.lat, (double)p.lon)); + } + } + + GMapRoute rt = new GMapRoute(points, string.Empty); + { + rt.Stroke = new Pen(Color.FromArgb(144, Color.Red)); + rt.Stroke.Width = 5; + rt.Stroke.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot; + } + routes.Routes.Add(rt); + } + + MainMap.ZoomAndCenterRoutes(null); + } + } + } + catch (Exception ex) + { + Debug.WriteLine("GPX import: " + ex.ToString()); + MessageBox.Show("Error importing gpx: " + ex.Message, "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + } + } + } + + // enable/disable host tracing + //private void checkBoxTraceRoute_CheckedChanged(object sender, EventArgs e) + //{ + // TryTraceConnection = checkBoxTraceRoute.Checked; + // if(!TryTraceConnection) + // { + // if(iptracerWorker.IsBusy) + // { + // iptracerWorker.CancelAsync(); + // } + // routes.Routes.Clear(); + // } + //} + + //private void GridConnections_DoubleClick(object sender, EventArgs e) + //{ + // GridConnections.ClearSelection(); + //} + + // open disk cache location + private void button17_Click(object sender, EventArgs e) + { + try + { + string argument = "/select, \"" + MainMap.CacheLocation + "TileDBv5\""; + System.Diagnostics.Process.Start("explorer.exe", argument); + } + catch (Exception ex) + { + MessageBox.Show("Failed to open: " + ex.Message, "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + #endregion + + #region graph functions + + #region chart coloring + //this method clears the background of all charts + private void ResetChartColors() + { + chrtTopLeft.BackColor = Color.LightGray; + chrtTopRight.BackColor = Color.LightGray; + chrtBottomLeft.BackColor = Color.LightGray; + chrtBottomRight.BackColor = Color.LightGray; + } + + //highlight Top Left chart on click + //set text box values based on this chart + private void chrtTopLeft_Click(object sender, EventArgs e) + { + ResetChartColors(); + chrtTopLeft.BackColor = Color.Gray; + tboxChartData.Text = "Altitude"; + tboxCurrent.Text = ""; + tboxAverage.Text = ""; + tboxMax.Text = ""; + tboxMin.Text = ""; + } + + //highlight Top Right chart on click + //set text box values based on this chart + private void chrtTopRight_Click(object sender, EventArgs e) + { + ResetChartColors(); + chrtTopRight.BackColor = Color.Gray; + tboxChartData.Text = "Humidity"; + tboxCurrent.Text = ""; + tboxAverage.Text = ""; + tboxMax.Text = ""; + tboxMin.Text = ""; + } + + //highlight Bottom Left chart on click + //set text box values based on this chart + private void chrtBottomLeft_Click(object sender, EventArgs e) + { + ResetChartColors(); + chrtBottomLeft.BackColor = Color.Gray; + tboxChartData.Text = "Pressure"; + tboxCurrent.Text = ""; + tboxAverage.Text = ""; + tboxMax.Text = ""; + tboxMin.Text = ""; + } + + //highlight Bottom Right chart on click + //set text box values based on this chart + private void chrtBottomRight_Click(object sender, EventArgs e) + { + ResetChartColors(); + chrtBottomRight.BackColor = Color.Gray; + tboxChartData.Text = "Map"; + tboxCurrent.Text = ""; + tboxAverage.Text = ""; + tboxMax.Text = ""; + tboxMin.Text = ""; + } + + #endregion + + public void PrepareGraphs(){ + + //set up for graphs MDKEdit + // http://www.youtube.com/watch?v=zTod4-Fg6Ew - split containers + // http://www.youtube.com/watch?v=bMXtgPk875I - chart controls + + chrtTopLeft.ChartAreas.Add("altitudeArea"); + chrtTopLeft.Series.Add("altitudeTrend"); + + chrtTopRight.ChartAreas.Add("humidityArea"); + chrtTopRight.Series.Add("humidityTrend"); + + chrtBottomLeft.Series.Add("pressureTrend"); + chrtBottomLeft.ChartAreas.Add("pressureArea"); + + chrtBottomRight.ChartAreas.Add("velocityArea"); + chrtBottomRight.Series.Add("velocityTrend"); + + // declare all series, data points to be modified dynamically at run + + //---------prep altitude area BEGIN + chrtTopLeft.Series["altitudeTrend"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + chrtTopLeft.Series["altitudeTrend"].Color = Color.Green; + System.Windows.Forms.DataVisualization.Charting.AxisName.X.Equals("Time"); + System.Windows.Forms.DataVisualization.Charting.AxisName.Y.Equals("Altitude"); + + ///required initial value + chrtTopLeft.Series["altitudeTrend"].Points.AddXY(0, 0); + //---------prep altitude area END + + + //-----------prep humidity area BEGIN + chrtTopRight.Series["humidityTrend"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + chrtTopRight.Series["humidityTrend"].Color = Color.Red; + System.Windows.Forms.DataVisualization.Charting.AxisName.X.Equals("Time"); + System.Windows.Forms.DataVisualization.Charting.AxisName.Y.Equals("Humidity"); + + ///required initial value + chrtTopRight.Series["humidityTrend"].Points.AddXY(0, 0); + //-----------prep humidity area END + + + //-----------prep pressure area BEGIN + chrtBottomLeft.Series["pressureTrend"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + chrtBottomLeft.Series["pressureTrend"].Color = Color.Blue; + System.Windows.Forms.DataVisualization.Charting.AxisName.X.Equals("Time"); + System.Windows.Forms.DataVisualization.Charting.AxisName.Y.Equals("Pressure"); + + ///required initial value + chrtBottomLeft.Series["pressureTrend"].Points.AddXY(0, 0); + //-----------prep pressure area END + + + //----------prep velocity area BEGIN + chrtBottomRight.Series["velocityTrend"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; + chrtBottomRight.Series["velocityTrend"].Color = Color.Green; + System.Windows.Forms.DataVisualization.Charting.AxisName.X.Equals("Time"); + System.Windows.Forms.DataVisualization.Charting.AxisName.Y.Equals("Altitude"); + + ///required initial value + chrtBottomRight.Series["velocityTrend"].Points.AddXY(0, 0); + //----------prep velocity area END + + //put chart displays in a ready state + ResetChartColors(); + } + string latitude; + string longitude; + //handle line of input data and put into chart + + public void ParseIncomingData(string rawDataReceived) + { + //check to see if data should be processed + if (!cboxCollectData.Checked) + { + return; + } + /* sample stansmission + KD8TDF-9>APRS,WIDE2-1:/151916z3944.87N/08348.75WO005/0.013 SV:09 A-30.5 B45.64 C99542 + ^char 31 ^char 40 ^60 + */ + //TODO: verify index charcter accuracy with real transmission + int indexStart = rawDataReceived.IndexOf("z"); + int indexEnd = rawDataReceived.IndexOf("N/"); + latitude = rawDataReceived.Substring(indexStart + 1, indexEnd - indexStart - 1); + + indexStart = rawDataReceived.IndexOf("N/"); + indexEnd = rawDataReceived.IndexOf("WO"); + longitude = rawDataReceived.Substring(indexStart + 2, indexEnd - indexStart - 2); + + //latitude = rawDataReceived.Substring(30, 7); //does not include the N/S char + //longitude = rawDataReceived.Substring(41, 7); //does not include the N/S char + addMarkerFromTransmit(latitude, longitude); + AddText(rawDataReceived + "\r\n"); + + rawDataReceived = rawDataReceived.Substring(59); //remove APRS overhead from string + + //place each datum in its own variable + string[] dataTransmission; + dataTransmission = rawDataReceived.Split(' '); + + //parse out the data type - should be a single letter + string typeCode; + double data; + string csvData = ""; + //loop through all datums in the transmission and send them to the chart builder + for (int i = 1; i < dataTransmission.Length; i++) + { + typeCode = dataTransmission[i].Substring(0, 1); + data = double.Parse(dataTransmission[i].Substring(1)); + addToChart(typeCode, data); + csvData += typeCode + data + ","; + } + WriteToCSV(csvData); + } + + private void WriteToCSV(string data) + { + using (StreamWriter writer = new StreamWriter("C:/Users/mkanning/Documents/Visual Studio 2010/Projects/greatmaps_05f05ab16904 - unchanged/Demo.WindowsForms/debug.csv", true)) + { + writer.WriteLine(data); + } + } + //method to insert parsed data into the charts + //TODO: add inserts for all charts. altitude is finished and is a template + private void addToChart(string dataType, double data) + { + ///data types organized by listing in google doc + //MASTER MODULE DATA VALUES + if (dataType.Equals("t")) //board temperature + { + + } + else if (dataType.Equals("L")) //battery level + { + + } + else if (dataType.Equals("X")) //Latitude accuracy + { + + } + else if (dataType.Equals("Y")) //Longitude accuracy + { + + } + else if (dataType.Equals("V")) //Velocity + { + chrtBottomRight.Series.FindByName("velocityTrend").Points.AddY(data); + } + else if (dataType.Equals("I")) //Info/error Message + { + + } + + //ATMOSPHERIC MODULE DATA VALUES + else if (dataType.Equals("l")) //battery level + { + + } + else if (dataType.Equals("C")) //battery level + { + + } + else if (dataType.Equals("H")) //Humidity + { + chrtTopRight.Series.FindByName("humidityTrend").Points.AddY(data); + } + else if (dataType.Equals("P")) //Pressure + { + chrtBottomLeft.Series.FindByName("pressureTrend").Points.AddY(data); + } + else if (dataType.Equals("A")) //Altitude + { + chrtTopLeft.Series.FindByName("altitudeTrend").Points.AddY(data); + } + + //GEIGER MODULE DATA VALUES + else if (dataType.Equals("l")) //battery level + { + + } + else if (dataType.Equals("R")) //radiation (CPM) + { + + } + + // CAMERA MODULE DATA VALUES + else if (dataType.Equals("l")) //battery level + { + + } + else //invalid data type + { + + } + } + + // add marker from an APRS transmission - MDKEdit + private void addMarkerFromTransmit(string lat, string lng) + { + double latitude = double.Parse(lat), longitude = double.Parse(lng); + PointLatLng APRSloc = new PointLatLng(); + APRSloc.Lat = latitude; + APRSloc.Lng = longitude; + + GMarkerGoogle m = new GMarkerGoogle(APRSloc, GMarkerGoogleType.blue_small); + + Placemark? p = null; + if (xboxPlacemarkInfo.Checked) + { + GeoCoderStatusCode status; + var ret = GMapProviders.GoogleMap.GetPlacemark(currentMarker.Position, out status); + if (status == GeoCoderStatusCode.G_GEO_SUCCESS && ret != null) + { + p = ret; + } + } + + objects.Markers.Add(m); + } + #endregion + + #region cross theading + + //these are for function calls across threads + delegate void SetTextDelegate(string value); + public void AddText(string value) + { + if (InvokeRequired) + { + Invoke(new SetTextDelegate(AddText), value); + } + else + { + tboxMessageBox.AppendText(value);// += value; + } + } + + delegate void ChartDataDelegate(string dataType, double data); + public void AddDataToChart(string dataType, double data) + { + if (InvokeRequired) + { + Invoke(new ChartDataDelegate(AddDataToChart), dataType, data); + } + else + { + addToChart(dataType, data); + } + } + + #endregion + + #region testing + + //click event on the test button + //currently simulates serial inputs + string testData; + int testIteration = 0; + double testLat = 39.751248, testLng = -83.809848, testVelocity = 5.8, testAltitude = 100, testPressure = 700, testHumidity = 38; + private void btnTest_Click(object sender, EventArgs e) + { + testLat += GetRandomNumber(-.005, .015); + testLng += GetRandomNumber(-.005, .015); + testVelocity += GetRandomNumber(1, 15); + testAltitude += GetRandomNumber(50, 150); + testPressure -= GetRandomNumber(10, 50); + testHumidity -= GetRandomNumber(1, 3); + + switch (testIteration) + { + case 0: + testData = "KD8TDF-9>APRS,WIDE2-1:/151916z" + testLat + "N/" + testLng + "WO005/0.013 V" + testVelocity + " A" + testAltitude+" H"+testHumidity+" P"+testPressure; + ParseIncomingData(testData); + break; + case 1: + testData = "KD8TDF-9>APRS,WIDE2-1:/151916z" + testLat + "N/" + testLng + "WO005/0.013 V" + testVelocity + " A" + testAltitude + " H" + testHumidity + " P" + testPressure; + ParseIncomingData(testData); + break; + case 2: + testData = "KD8TDF-9>APRS,WIDE2-1:/151916z" + testLat + "N/" + testLng + "WO005/0.013 V" + testVelocity + " A" + testAltitude + " H" + testHumidity + " P" + testPressure; + ParseIncomingData(testData); + break; + case 3: + testData = "KD8TDF-9>APRS,WIDE2-1:/151916z" + testLat + "N/" + testLng + "WO005/0.013 V" + testVelocity + " A" + testAltitude + " H" + testHumidity + " P" + testPressure; + ParseIncomingData(testData); + break; + case 4: + testData = "KD8TDF-9>APRS,WIDE2-1:/151916z" + testLat + "N/" + testLng + "WO005/0.013 V" + testVelocity + " A" + testAltitude + " H" + testHumidity + " P" + testPressure; + ParseIncomingData(testData); + break; + case 5: + testData = "KD8TDF-9>APRS,WIDE2-1:/151916z" + testLat + "N/" + testLng + "WO005/0.013 V" + testVelocity + " A" + testAltitude + " H" + testHumidity + " P" + testPressure; + ParseIncomingData(testData); + break; + case 6: + testData = "KD8TDF-9>APRS,WIDE2-1:/151916z" + testLat + "N/" + testLng + "WO005/0.013 V" + testVelocity + " A" + testAltitude + " H" + testHumidity + " P" + testPressure; + ParseIncomingData(testData); + break; + case 7: + testData = "KD8TDF-9>APRS,WIDE2-1:/151916z" + testLat + "N/" + testLng + "WO005/0.013 V" + testVelocity + " A" + testAltitude + " H" + testHumidity + " P" + testPressure; + ParseIncomingData(testData); + break; + case 8: + testData = "KD8TDF-9>APRS,WIDE2-1:/151916z" + testLat + "N/" + testLng + "WO005/0.013 V" + testVelocity + " A" + testAltitude + " H" + testHumidity + " P" + testPressure; + ParseIncomingData(testData); + break; + case 9: + testData = "KD8TDF-9>APRS,WIDE2-1:/151916z" + testLat + "N/" + testLng + "WO005/0.013 V" + testVelocity + " A" + testAltitude + " H" + testHumidity + " P" + testPressure; + ParseIncomingData(testData); + break; + default: + break; + } + testIteration++; + } + + public double GetRandomNumber(double minimum, double maximum) + { + Random random = new Random(); + return random.NextDouble() * (maximum - minimum) + minimum; + } + + #endregion + + + + } +} +//TODO: CSV logging, offline caching diff --git a/Demo.WindowsForms/Forms/MainForm.resx b/Demo.WindowsForms/Forms/MainForm.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Forms/MainForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Demo.WindowsForms/Forms/Message.Designer.cs b/Demo.WindowsForms/Forms/Message.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Forms/Message.Designer.cs @@ -0,0 +1,101 @@ +namespace Demo.WindowsForms.Forms +{ + partial class Message + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Message)); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button1.DialogResult = System.Windows.Forms.DialogResult.Yes; + this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.button1.Location = new System.Drawing.Point(346, 414); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(268, 67); + this.button1.TabIndex = 1; + this.button1.Text = "YES, I accept full responsability for using this software"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.button2.DialogResult = System.Windows.Forms.DialogResult.No; + this.button2.Location = new System.Drawing.Point(8, 414); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(111, 67); + this.button2.TabIndex = 2; + this.button2.Text = "NO, thanks"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // richTextBox1 + // + this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Top; + this.richTextBox1.Location = new System.Drawing.Point(5, 5); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.ReadOnly = true; + this.richTextBox1.Size = new System.Drawing.Size(609, 394); + this.richTextBox1.TabIndex = 3; + this.richTextBox1.Text = resources.GetString("richTextBox1.Text"); + // + // Message + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Gray; + this.ClientSize = new System.Drawing.Size(619, 489); + this.Controls.Add(this.richTextBox1); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Message"; + this.Padding = new System.Windows.Forms.Padding(5); + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "<< WARNING >>"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + internal System.Windows.Forms.RichTextBox richTextBox1; + + } +} \ No newline at end of file diff --git a/Demo.WindowsForms/Forms/Message.cs b/Demo.WindowsForms/Forms/Message.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Forms/Message.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace Demo.WindowsForms.Forms +{ + public partial class Message : Form + { + public Message() + { + InitializeComponent(); + } + + private void button2_Click(object sender, EventArgs e) + { + Close(); + } + + private void button1_Click(object sender, EventArgs e) + { + Close(); + } + } +} diff --git a/Demo.WindowsForms/Forms/Message.resx b/Demo.WindowsForms/Forms/Message.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Forms/Message.resx @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + License: The MIT License (MIT) +------------------------------------------------------------------- +Copyright (c) 2008-2011 Universe, WARNING: This software can access some +map providers and may viotile their Terms of Service, you use it at your +own risk, nothing is forcing you to accept this ;} Source itself is legal! + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------- + + \ No newline at end of file diff --git a/Demo.WindowsForms/Forms/StaticImage.Designer.cs b/Demo.WindowsForms/Forms/StaticImage.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Forms/StaticImage.Designer.cs @@ -0,0 +1,153 @@ +namespace Demo.WindowsForms +{ + partial class StaticImage + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + this.button2 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.checkBoxWorldFile = new System.Windows.Forms.CheckBox(); + this.checkBoxRoutes = new System.Windows.Forms.CheckBox(); + ((System.ComponentModel.ISupportInitialize) (this.numericUpDown1)).BeginInit(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Location = new System.Drawing.Point(497, 29); + this.button1.Margin = new System.Windows.Forms.Padding(2); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(84, 32); + this.button1.TabIndex = 1; + this.button1.Text = "Generate"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // progressBar1 + // + this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.progressBar1.Location = new System.Drawing.Point(6, 6); + this.progressBar1.Margin = new System.Windows.Forms.Padding(2); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(484, 93); + this.progressBar1.TabIndex = 2; + // + // numericUpDown1 + // + this.numericUpDown1.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.numericUpDown1.Location = new System.Drawing.Point(535, 6); + this.numericUpDown1.Margin = new System.Windows.Forms.Padding(2); + this.numericUpDown1.Name = "numericUpDown1"; + this.numericUpDown1.Size = new System.Drawing.Size(47, 20); + this.numericUpDown1.TabIndex = 3; + // + // button2 + // + this.button2.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.button2.Location = new System.Drawing.Point(497, 67); + this.button2.Margin = new System.Windows.Forms.Padding(2); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(84, 32); + this.button2.TabIndex = 4; + this.button2.Text = "Cancel"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(494, 8); + this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(37, 13); + this.label1.TabIndex = 5; + this.label1.Text = "Zoom:"; + // + // checkBoxWorldFile + // + this.checkBoxWorldFile.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.checkBoxWorldFile.AutoSize = true; + this.checkBoxWorldFile.Location = new System.Drawing.Point(497, 106); + this.checkBoxWorldFile.Name = "checkBoxWorldFile"; + this.checkBoxWorldFile.Size = new System.Drawing.Size(96, 17); + this.checkBoxWorldFile.TabIndex = 6; + this.checkBoxWorldFile.Text = "make Worldfile"; + this.checkBoxWorldFile.UseVisualStyleBackColor = true; + // + // checkBoxRoutes + // + this.checkBoxRoutes.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.checkBoxRoutes.AutoSize = true; + this.checkBoxRoutes.Location = new System.Drawing.Point(7, 106); + this.checkBoxRoutes.Name = "checkBoxRoutes"; + this.checkBoxRoutes.Size = new System.Drawing.Size(147, 17); + this.checkBoxRoutes.TabIndex = 7; + this.checkBoxRoutes.Text = "Use area of routes in map"; + this.checkBoxRoutes.UseVisualStyleBackColor = true; + // + // StaticImage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(588, 130); + this.Controls.Add(this.checkBoxRoutes); + this.Controls.Add(this.checkBoxWorldFile); + this.Controls.Add(this.label1); + this.Controls.Add(this.button2); + this.Controls.Add(this.numericUpDown1); + this.Controls.Add(this.progressBar1); + this.Controls.Add(this.button1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.Margin = new System.Windows.Forms.Padding(2); + this.MinimumSize = new System.Drawing.Size(16, 164); + this.Name = "StaticImage"; + this.Padding = new System.Windows.Forms.Padding(4); + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Static Map maker"; + ((System.ComponentModel.ISupportInitialize) (this.numericUpDown1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.ProgressBar progressBar1; + private System.Windows.Forms.NumericUpDown numericUpDown1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.CheckBox checkBoxWorldFile; + private System.Windows.Forms.CheckBox checkBoxRoutes; + } +} \ No newline at end of file diff --git a/Demo.WindowsForms/Forms/StaticImage.cs b/Demo.WindowsForms/Forms/StaticImage.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Forms/StaticImage.cs @@ -0,0 +1,401 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Windows.Forms; +using GMap.NET; +using GMap.NET.WindowsForms; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using GMap.NET.MapProviders; + +namespace Demo.WindowsForms +{ + public partial class StaticImage : Form + { + MainForm Main; + + BackgroundWorker bg = new BackgroundWorker(); + readonly List tileArea = new List(); + + public StaticImage(MainForm main) + { + InitializeComponent(); + + Main = main; + + numericUpDown1.Maximum = Main.MainMap.MaxZoom; + numericUpDown1.Minimum = Main.MainMap.MinZoom; + numericUpDown1.Value = new decimal(Main.MainMap.Zoom); + + bg.WorkerReportsProgress = true; + bg.WorkerSupportsCancellation = true; + bg.DoWork += new DoWorkEventHandler(bg_DoWork); + bg.ProgressChanged += new ProgressChangedEventHandler(bg_ProgressChanged); + bg.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bg_RunWorkerCompleted); + } + + void bg_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) + { + if(!e.Cancelled) + { + if(e.Error != null) + { + MessageBox.Show("Error:" + e.Error.ToString(), "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + else if(e.Result != null) + { + try + { + Process.Start(e.Result as string); + } + catch + { + } + } + } + + this.Text = "Static Map maker"; + progressBar1.Value = 0; + button1.Enabled = true; + numericUpDown1.Enabled = true; + } + + void bg_ProgressChanged(object sender, ProgressChangedEventArgs e) + { + progressBar1.Value = e.ProgressPercentage; + + GPoint p = (GPoint)e.UserState; + this.Text = "Static Map maker: Downloading[" + p + "]: " + tileArea.IndexOf(p) + " of " + tileArea.Count; + } + + void bg_DoWork(object sender, DoWorkEventArgs e) + { + MapInfo info = (MapInfo)e.Argument; + if(!info.Area.IsEmpty) + { + //var types = GMaps.Instance.GetAllLayersOfType(info.Type); + + string bigImage = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + Path.DirectorySeparatorChar + "GMap at zoom " + info.Zoom + " - " + info.Type + "-" + DateTime.Now.Ticks + ".png"; + e.Result = bigImage; + + // current area + GPoint topLeftPx = info.Type.Projection.FromLatLngToPixel(info.Area.LocationTopLeft, info.Zoom); + GPoint rightButtomPx = info.Type.Projection.FromLatLngToPixel(info.Area.Bottom, info.Area.Right, info.Zoom); + GPoint pxDelta = new GPoint(rightButtomPx.X - topLeftPx.X, rightButtomPx.Y - topLeftPx.Y); + GMap.NET.GSize maxOfTiles = info.Type.Projection.GetTileMatrixMaxXY(info.Zoom); + + int padding = info.MakeWorldFile ? 0 : 22; + { + using(Bitmap bmpDestination = new Bitmap((int)(pxDelta.X + padding * 2), (int)(pxDelta.Y + padding * 2))) + { + using(Graphics gfx = Graphics.FromImage(bmpDestination)) + { + gfx.InterpolationMode = InterpolationMode.HighQualityBicubic; + gfx.SmoothingMode = SmoothingMode.HighQuality; + + int i = 0; + + // get tiles & combine into one + lock(tileArea) + { + foreach(var p in tileArea) + { + if(bg.CancellationPending) + { + e.Cancel = true; + return; + } + + int pc = (int)(((double)++i / tileArea.Count) * 100); + bg.ReportProgress(pc, p); + + foreach(var tp in info.Type.Overlays) + { + Exception ex; + WindowsFormsImage tile; + + // tile number inversion(BottomLeft -> TopLeft) for pergo maps + //if(tp == MapType.PergoTurkeyMap) + //{ + // tile = GMaps.Instance.GetImageFrom(tp, new GPoint(p.X, maxOfTiles.Height - p.Y), info.Zoom, out ex) as WindowsFormsImage; + //} + //else // ok + { + tile = GMaps.Instance.GetImageFrom(tp, p, info.Zoom, out ex) as WindowsFormsImage; + } + + if(tile != null) + { + using(tile) + { + long x = p.X * info.Type.Projection.TileSize.Width - topLeftPx.X + padding; + long y = p.Y * info.Type.Projection.TileSize.Width - topLeftPx.Y + padding; + { + gfx.DrawImage(tile.Img, x, y, info.Type.Projection.TileSize.Width, info.Type.Projection.TileSize.Height); + } + } + } + } + } + } + + // draw routes + { + foreach(GMapRoute r in Main.routes.Routes) + { + if(r.IsVisible) + { + using(GraphicsPath rp = new GraphicsPath()) + { + for(int j = 0; j < r.Points.Count; j++) + { + var pr = r.Points[j]; + GPoint px = info.Type.Projection.FromLatLngToPixel(pr.Lat, pr.Lng, info.Zoom); + + px.Offset(padding, padding); + px.Offset(-topLeftPx.X, -topLeftPx.Y); + + GPoint p2 = px; + + if(j == 0) + { + rp.AddLine(p2.X, p2.Y, p2.X, p2.Y); + } + else + { + System.Drawing.PointF p = rp.GetLastPoint(); + rp.AddLine(p.X, p.Y, p2.X, p2.Y); + } + } + + if(rp.PointCount > 0) + { + gfx.DrawPath(r.Stroke, rp); + } + } + } + } + } + + // draw polygons + //{ + // foreach(GMapPolygon r in Main.polygons.Polygons) + // { + // if(r.IsVisible) + // { + // using(GraphicsPath rp = new GraphicsPath()) + // { + // for(int j = 0; j < r.Points.Count; j++) + // { + // var pr = r.Points[j]; + // GPoint px = info.Type.Projection.FromLatLngToPixel(pr.Lat, pr.Lng, info.Zoom); + + // px.Offset(padding, padding); + // px.Offset(-topLeftPx.X, -topLeftPx.Y); + + // GPoint p2 = px; + + // if(j == 0) + // { + // rp.AddLine(p2.X, p2.Y, p2.X, p2.Y); + // } + // else + // { + // System.Drawing.PointF p = rp.GetLastPoint(); + // rp.AddLine(p.X, p.Y, p2.X, p2.Y); + // } + // } + + // if(rp.PointCount > 0) + // { + // rp.CloseFigure(); + + // gfx.FillPath(r.Fill, rp); + + // gfx.DrawPath(r.Stroke, rp); + // } + // } + // } + // } + //} + + // draw markers + { + foreach(GMapMarker r in Main.objects.Markers) + { + if(r.IsVisible) + { + var pr = r.Position; + GPoint px = info.Type.Projection.FromLatLngToPixel(pr.Lat, pr.Lng, info.Zoom); + + px.Offset(padding, padding); + px.Offset(-topLeftPx.X, -topLeftPx.Y); + px.Offset(r.Offset.X, r.Offset.Y); + + r.LocalPosition = new System.Drawing.Point((int)px.X, (int)px.Y); + + r.OnRender(gfx); + } + } + + // tooltips above + foreach(GMapMarker m in Main.objects.Markers) + { + if(m.IsVisible && m.ToolTip != null && m.IsVisible) + { + if(!string.IsNullOrEmpty(m.ToolTipText)) + { + m.ToolTip.OnRender(gfx); + } + } + } + } + + // draw info + { + System.Drawing.Rectangle rect = new System.Drawing.Rectangle(); + { + rect.Location = new System.Drawing.Point(padding, padding); + rect.Size = new System.Drawing.Size((int)pxDelta.X, (int)pxDelta.Y); + } + + using(Font f = new Font(FontFamily.GenericSansSerif, 9, FontStyle.Bold)) + { + // draw bounds & coordinates + using(Pen p = new Pen(Brushes.DimGray, 3)) + { + p.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot; + + gfx.DrawRectangle(p, rect); + + string topleft = info.Area.LocationTopLeft.ToString(); + SizeF s = gfx.MeasureString(topleft, f); + + gfx.DrawString(topleft, f, p.Brush, rect.X + s.Height / 2, rect.Y + s.Height / 2); + + string rightBottom = new PointLatLng(info.Area.Bottom, info.Area.Right).ToString(); + SizeF s2 = gfx.MeasureString(rightBottom, f); + + gfx.DrawString(rightBottom, f, p.Brush, rect.Right - s2.Width - s2.Height / 2, rect.Bottom - s2.Height - s2.Height / 2); + } + + // draw scale + using(Pen p = new Pen(Brushes.Blue, 1)) + { + double rez = info.Type.Projection.GetGroundResolution(info.Zoom, info.Area.Bottom); + int px100 = (int)(100.0 / rez); // 100 meters + int px1000 = (int)(1000.0 / rez); // 1km + + gfx.DrawRectangle(p, rect.X + 10, rect.Bottom - 20, px1000, 10); + gfx.DrawRectangle(p, rect.X + 10, rect.Bottom - 20, px100, 10); + + string leftBottom = "scale: 100m | 1Km"; + SizeF s = gfx.MeasureString(leftBottom, f); + gfx.DrawString(leftBottom, f, p.Brush, rect.X + 10, rect.Bottom - s.Height - 20); + } + } + } + } + + bmpDestination.Save(bigImage, ImageFormat.Png); + } + } + + //The worldfile for the original image is: + + //0.000067897543 // the horizontal size of a pixel in coordinate units (longitude degrees in this case); + //0.0000000 + //0.0000000 + //-0.0000554613012 // the comparable vertical pixel size in latitude degrees, negative because latitude decreases as you go from top to bottom in the image. + //-111.743323868834 // longitude of the pixel in the upper-left-hand corner. + //35.1254392635083 // latitude of the pixel in the upper-left-hand corner. + + // generate world file + if(info.MakeWorldFile) + { + string wf = bigImage + "w"; + using(StreamWriter world = File.CreateText(wf)) + { + world.WriteLine("{0:0.000000000000}", (info.Area.WidthLng / pxDelta.X)); + world.WriteLine("0.0000000"); + world.WriteLine("0.0000000"); + world.WriteLine("{0:0.000000000000}", (-info.Area.HeightLat / pxDelta.Y)); + world.WriteLine("{0:0.000000000000}", info.Area.Left); + world.WriteLine("{0:0.000000000000}", info.Area.Top); + world.Close(); + } + } + } + } + + readonly List GpxRoute = new List(); + RectLatLng AreaGpx = RectLatLng.Empty; + + private void button1_Click(object sender, EventArgs e) + { + RectLatLng? area = null; + + if(checkBoxRoutes.Checked) + { + area = Main.MainMap.GetRectOfAllRoutes(null); + if(!area.HasValue) + { + MessageBox.Show("No routes in map", "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + } + else + { + area = Main.MainMap.SelectedArea; + if(area.Value.IsEmpty) + { + MessageBox.Show("Select map area holding ALT", "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + } + + if(!bg.IsBusy) + { + lock(tileArea) + { + tileArea.Clear(); + tileArea.AddRange(Main.MainMap.MapProvider.Projection.GetAreaTileList(area.Value, (int)numericUpDown1.Value, 1)); + tileArea.TrimExcess(); + } + + numericUpDown1.Enabled = false; + progressBar1.Value = 0; + button1.Enabled = false; + + bg.RunWorkerAsync(new MapInfo(area.Value, (int)numericUpDown1.Value, Main.MainMap.MapProvider, checkBoxWorldFile.Checked)); + } + } + + private void button2_Click(object sender, EventArgs e) + { + if(bg.IsBusy) + { + bg.CancelAsync(); + } + } + } + + public struct MapInfo + { + public RectLatLng Area; + public int Zoom; + public GMapProvider Type; + public bool MakeWorldFile; + + public MapInfo(RectLatLng Area, int Zoom, GMapProvider Type, bool makeWorldFile) + { + this.Area = Area; + this.Zoom = Zoom; + this.Type = Type; + this.MakeWorldFile = makeWorldFile; + } + } +} diff --git a/Demo.WindowsForms/Forms/StaticImage.resx b/Demo.WindowsForms/Forms/StaticImage.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Forms/StaticImage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Demo.WindowsForms/Properties/AssemblyInfo.cs b/Demo.WindowsForms/Properties/AssemblyInfo.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Properties/AssemblyInfo.cs @@ -0,0 +1,31 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Demo.WindowsForms")] +[assembly: AssemblyDescription("Demo for GMap.NET.WindowsForms")] +[assembly: AssemblyProduct("Demo.WindowsForms")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3a7e8f7c-d56d-45f2-8226-2640f7049ea8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +//[assembly: AssemblyVersion("1.0.0.0")] +//[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Demo.WindowsForms/Properties/Resources.Designer.cs b/Demo.WindowsForms/Properties/Resources.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Properties/Resources.Designer.cs @@ -0,0 +1,182 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.269 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Demo.WindowsForms.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Demo.WindowsForms.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap ChevronDown { + get { + object obj = ResourceManager.GetObject("ChevronDown", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap ChevronLeft { + get { + object obj = ResourceManager.GetObject("ChevronLeft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap ChevronRight { + get { + object obj = ResourceManager.GetObject("ChevronRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap ChevronUp { + get { + object obj = ResourceManager.GetObject("ChevronUp", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap closePanel { + get { + object obj = ResourceManager.GetObject("closePanel", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Collapse { + get { + object obj = ResourceManager.GetObject("Collapse", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Collapse_h { + get { + object obj = ResourceManager.GetObject("Collapse_h", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Expand { + get { + object obj = ResourceManager.GetObject("Expand", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Expand_h { + get { + object obj = ResourceManager.GetObject("Expand_h", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized string similar to Parameter {0} can't be null. + /// + internal static string IDS_ArgumentException { + get { + return ResourceManager.GetString("IDS_ArgumentException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value of '{0}' is not valid for '{1}'. 'Value' should be between '{2}' and '{3}'. + ///Parameter name: {1}. + /// + internal static string IDS_InvalidBoundArgument { + get { + return ResourceManager.GetString("IDS_InvalidBoundArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value of '{0}' is not valid for '{1}'. 'Maximum' must be greater than or equal to 0. + ///Parameter name: {1}. + /// + internal static string IDS_InvalidLowBoundArgument { + get { + return ResourceManager.GetString("IDS_InvalidLowBoundArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value of '{0}' is not valid for '{1}'. '{1}' must be greater than or equal to {2}. + ///Parameter name: {1}. + /// + internal static string IDS_InvalidOperationExceptionInteger { + get { + return ResourceManager.GetString("IDS_InvalidOperationExceptionInteger", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CREATE TABLE [Cache] ( + /// [Ip] varchar(15) PRIMARY KEY NOT NULL, + /// [CountryName] text NOT NULL, + /// [RegionName] text NOT NULL, + /// [City] text NOT NULL, + /// [Latitude] float NOT NULL, + /// [Longitude] float NOT NULL, + /// [Time] datetime NOT NULL + ///);. + /// + internal static string IpCacheCreateDb { + get { + return ResourceManager.GetString("IpCacheCreateDb", resourceCulture); + } + } + } +} diff --git a/Demo.WindowsForms/Properties/Resources.resx b/Demo.WindowsForms/Properties/Resources.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Properties/Resources.resx @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\BSE.Windows.Forms\Resources\ChevronDown.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\BSE.Windows.Forms\Resources\ChevronLeft.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\BSE.Windows.Forms\Resources\ChevronRight.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\BSE.Windows.Forms\Resources\ChevronUp.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\BSE.Windows.Forms\Resources\closePanel.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\BSE.Windows.Forms\Resources\Collapse.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\BSE.Windows.Forms\Resources\Collapse_h.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\BSE.Windows.Forms\Resources\Expand.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\BSE.Windows.Forms\Resources\Expand_h.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + CREATE TABLE [Cache] ( + [Ip] varchar(15) PRIMARY KEY NOT NULL, + [CountryName] text NOT NULL, + [RegionName] text NOT NULL, + [City] text NOT NULL, + [Latitude] float NOT NULL, + [Longitude] float NOT NULL, + [Time] datetime NOT NULL +); + + + Parameter {0} can't be null + + + Value of '{0}' is not valid for '{1}'. 'Value' should be between '{2}' and '{3}'. +Parameter name: {1} + + + Value of '{0}' is not valid for '{1}'. 'Maximum' must be greater than or equal to 0. +Parameter name: {1} + + + Value of '{0}' is not valid for '{1}'. '{1}' must be greater than or equal to {2}. +Parameter name: {1} + + \ No newline at end of file diff --git a/Demo.WindowsForms/Properties/app.manifest b/Demo.WindowsForms/Properties/app.manifest new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Properties/app.manifest @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demo.WindowsForms/Resources/ImageReady.ico b/Demo.WindowsForms/Resources/ImageReady.ico new file mode 100644 index 0000000000000000000000000000000000000000..b7fee32d3a43a405ef2fce56fd05b74ec6720489 GIT binary patch literal 104382 zc%1CL2bdMb@;*Gvl7ol=6AFkZph!?mAW?#X3QEpVl7JwR1tdw1l5@^EN69(E0!vsn zz~-D-($x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=(*QgCbq??xJI}TAd@Gxd zzv6(7za0lO{ExsU0rOJ5WA}QyvIhJs0sjube*y51vEpBp1~C3Q2NeEx8eoHeB5VaL z2)N%{(a+&}6Ac`=0~}}z4!jKxYy)9e{B1Pgci^7_+XwvT!g>M!`zpGh z*IUUO@c$F=uLf(wYw6&?IN<*l@Sg+x=Kz1hzyY3n9|!yg!#V-~CxCy2@2k1quD9#$ zdb{4Px9jbCyWXz1(ljcYcEK^#`_iF*!_9x`CeP*X;!juAe;cimy0+ZgC3RiZ>(?EQ z%HF>&|H5TU=iKJCaZ7v6>t=lYj(J_xygAPwxNN!BKF+w~3)=Nf-XCvVJBqlz!TaO+ z+HJYkKb||Z*Xw$!e)kUUkk=(TzgdsHxzU2uwGByYq@rNUpKpKx&Ga9 zZRucD%LB1qS2o!quYb2(dw*ah-)qN}T;Jq#{d*~|FBf@zL%CmHD(CAfyPx8o$CY1u zKkrIccwO0ocX8KMeXrjs>bjX_gj=tt`d(kqugUjXA8|M6a_SI*WWClOSS1?))E`Jy z@>aB}7C~)h5nQVPd+WJzd-@IEGK#xC@AK>}#@&n9E;}KNSu77tpydA3Bb2DY!{tx?6^XUKp diff --git a/Demo.WindowsForms/Source/DemoStuff.cs b/Demo.WindowsForms/Source/DemoStuff.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Source/DemoStuff.cs @@ -0,0 +1,517 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Xml; +using GMap.NET; +using System.Data.Common; +using GMap.NET.MapProviders; +using System.Text; +using System.Diagnostics; + +#if !PocketPC +using System.Net.NetworkInformation; +#endif + +#if !MONO +#if SQLite +using System.Data.SQLite; +#endif +#else + using SQLiteConnection=Mono.Data.SqliteClient.SqliteConnection; + using SQLiteTransaction=Mono.Data.SqliteClient.SqliteTransaction; + using SQLiteCommand=Mono.Data.SqliteClient.SqliteCommand; + using SQLiteDataReader=Mono.Data.SqliteClient.SqliteDataReader; + using SQLiteParameter=Mono.Data.SqliteClient.SqliteParameter; +#endif + +namespace Demo.WindowsForms +{ + public struct VehicleData + { + public int Id; + public double Lat; + public double Lng; + public string Line; + public string LastStop; + public string TrackType; + public string AreaName; + public string StreetName; + public string Time; + public double? Bearing; + } + + public enum TransportType + { + Bus, + TrolleyBus, + } + + public struct FlightRadarData + { + public string name; + public string hex; + public PointLatLng point; + public int bearing; + public string altitude; + public string speed; + public int Id; + } + + public class Stuff + { +#if !PocketPC + public static bool PingNetwork(string hostNameOrAddress) + { + bool pingStatus = false; + + using(Ping p = new Ping()) + { + byte[] buffer = Encoding.ASCII.GetBytes("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); + int timeout = 4444; // 4s + + try + { + PingReply reply = p.Send(hostNameOrAddress, timeout, buffer); + pingStatus = (reply.Status == IPStatus.Success); + } + catch(Exception) + { + pingStatus = false; + } + } + + return pingStatus; + } +#endif + + /// + /// gets routes from gpsd log file + /// + /// + /// start time(UTC) of route, null to read from very start + /// end time(UTC) of route, null to read to the very end + /// max value of PositionDilutionOfPrecision, null to get all + /// + public static IEnumerable> GetRoutesFromMobileLog(string gpsdLogFile, DateTime? start, DateTime? end, double? maxPositionDilutionOfPrecision) + { +#if SQLite + using(SQLiteConnection cn = new SQLiteConnection()) + { +#if !MONO + cn.ConnectionString = string.Format("Data Source=\"{0}\";FailIfMissing=True;", gpsdLogFile); +#else + cn.ConnectionString = string.Format("Version=3,URI=file://{0},FailIfMissing=True", gpsdLogFile); +#endif + + cn.Open(); + { + using(DbCommand cmd = cn.CreateCommand()) + { + cmd.CommandText = "SELECT * FROM GPS "; + int initLenght = cmd.CommandText.Length; + + if(start.HasValue) + { + cmd.CommandText += "WHERE TimeUTC >= @t1 "; + SQLiteParameter lookupValue = new SQLiteParameter("@t1", start); + cmd.Parameters.Add(lookupValue); + } + + if(end.HasValue) + { + if(cmd.CommandText.Length <= initLenght) + { + cmd.CommandText += "WHERE "; + } + else + { + cmd.CommandText += "AND "; + } + + cmd.CommandText += "TimeUTC <= @t2 "; + SQLiteParameter lookupValue = new SQLiteParameter("@t2", end); + cmd.Parameters.Add(lookupValue); + } + + if(maxPositionDilutionOfPrecision.HasValue) + { + if(cmd.CommandText.Length <= initLenght) + { + cmd.CommandText += "WHERE "; + } + else + { + cmd.CommandText += "AND "; + } + + cmd.CommandText += "PositionDilutionOfPrecision <= @p3 "; + SQLiteParameter lookupValue = new SQLiteParameter("@p3", maxPositionDilutionOfPrecision); + cmd.Parameters.Add(lookupValue); + } + + using(DbDataReader rd = cmd.ExecuteReader()) + { + List points = new List(); + while(rd.Read()) + { + GpsLog log = new GpsLog(); + { + log.TimeUTC = (DateTime)rd["TimeUTC"]; + log.SessionCounter = (long)rd["SessionCounter"]; + log.Delta = rd["Delta"] as double?; + log.Speed = rd["Speed"] as double?; + log.SeaLevelAltitude = rd["SeaLevelAltitude"] as double?; + log.EllipsoidAltitude = rd["EllipsoidAltitude"] as double?; + log.SatellitesInView = rd["SatellitesInView"] as System.Byte?; + log.SatelliteCount = rd["SatelliteCount"] as System.Byte?; + log.Position = new PointLatLng((double)rd["Lat"], (double)rd["Lng"]); + log.PositionDilutionOfPrecision = rd["PositionDilutionOfPrecision"] as double?; + log.HorizontalDilutionOfPrecision = rd["HorizontalDilutionOfPrecision"] as double?; + log.VerticalDilutionOfPrecision = rd["VerticalDilutionOfPrecision"] as double?; + log.FixQuality = (FixQuality)((byte)rd["FixQuality"]); + log.FixType = (FixType)((byte)rd["FixType"]); + log.FixSelection = (FixSelection)((byte)rd["FixSelection"]); + } + + if(log.SessionCounter == 0 && points.Count > 0) + { + List ret = new List(points); + points.Clear(); + { + yield return ret; + } + } + + points.Add(log); + } + + if(points.Count > 0) + { + List ret = new List(points); + points.Clear(); + { + yield return ret; + } + } + + points.Clear(); + points = null; + + rd.Close(); + } + } + } + cn.Close(); + } +#else + return null; +#endif + } + + static readonly Random r = new Random(); + + /// + /// gets realtime data from public transport in city vilnius of lithuania + /// + /// type of transport + /// linenum or null to get all + /// + public static void GetVilniusTransportData(TransportType type, string line, List ret) + { + ret.Clear(); + + //http://stops.lt/vilnius/gps.txt?1318577178193 + //http://www.marsrutai.lt/vilnius/Vehicle_Map.aspx?trackID=34006&t=1318577231295 + // http://www.troleibusai.lt/eismas/get_gps.php?allowed=true&more=1&bus=1&rand=0.5487859781558404 + + string url = string.Format(CultureInfo.InvariantCulture, "http://www.troleibusai.lt/eismas/get_gps.php?allowed=true&more=1&bus={0}&rand={1}", type == TransportType.Bus ? 2 : 1, r.NextDouble()); + + if(!string.IsNullOrEmpty(line)) + { + url += "&nr=" + line; + } + +#if !PocketPC + url += "&app=GMap.NET.Desktop"; +#else + url += "&app=GMap.NET.WindowsMobile"; +#endif + + string xml = string.Empty; + { + HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url); + + request.UserAgent = GMapProvider.UserAgent; + request.Timeout = GMapProvider.TimeoutMs; + request.ReadWriteTimeout = GMapProvider.TimeoutMs * 6; + request.Accept = "*/*"; + request.KeepAlive = true; + + using(HttpWebResponse response = request.GetResponse() as HttpWebResponse) + { + using(Stream responseStream = response.GetResponseStream()) + { + using(StreamReader read = new StreamReader(responseStream, Encoding.UTF8)) + { + xml = read.ReadToEnd(); + } + } +#if PocketPC + request.Abort(); +#endif + response.Close(); + } + } + + // 54.690688; 25.2116; 1263522; 1; 48.152; 2011-10-14 14:41:29 + + if(!string.IsNullOrEmpty(xml)) + { + var items = xml.Split('&'); + + foreach(var it in items) + { + var sit = it.Split(';'); + if(sit.Length == 8) + { + VehicleData d = new VehicleData(); + { + d.Id = int.Parse(sit[2]); + d.Lat = double.Parse(sit[0], CultureInfo.InvariantCulture); + d.Lng = double.Parse(sit[1], CultureInfo.InvariantCulture); + d.Line = sit[3]; + if(!string.IsNullOrEmpty(sit[4])) + { + d.Bearing = double.Parse(sit[4], CultureInfo.InvariantCulture); + } + + if(!string.IsNullOrEmpty(sit[5])) + { + d.Time = sit[5]; + + var t = DateTime.Parse(d.Time); + if(DateTime.Now - t > TimeSpan.FromMinutes(5)) + { + continue; + } + + d.Time = t.ToLongTimeString(); + } + + d.TrackType = sit[6]; + } + + //if(d.Id == 1262760) + //if(d.Line == "13") + { + ret.Add(d); + } + } + } + } + #region -- old -- + //XmlDocument doc = new XmlDocument(); + //{ + // doc.LoadXml(xml); + + // XmlNodeList devices = doc.GetElementsByTagName("Device"); + // foreach(XmlNode dev in devices) + // { + // VehicleData d = new VehicleData(); + // d.Id = int.Parse(dev.Attributes["ID"].InnerText); + + // foreach(XmlElement elem in dev.ChildNodes) + // { + // // Debug.WriteLine(d.Id + "->" + elem.Name + ": " + elem.InnerText); + + // switch(elem.Name) + // { + // case "Lat": + // { + // d.Lat = double.Parse(elem.InnerText, CultureInfo.InvariantCulture); + // } + // break; + + // case "Lng": + // { + // d.Lng = double.Parse(elem.InnerText, CultureInfo.InvariantCulture); + // } + // break; + + // case "Bearing": + // { + // if(!string.IsNullOrEmpty(elem.InnerText)) + // { + // d.Bearing = double.Parse(elem.InnerText, CultureInfo.InvariantCulture); + // } + // } + // break; + + // case "LineNum": + // { + // d.Line = elem.InnerText; + // } + // break; + + // case "AreaName": + // { + // d.AreaName = elem.InnerText; + // } + // break; + + // case "StreetName": + // { + // d.StreetName = elem.InnerText; + // } + // break; + + // case "TrackType": + // { + // d.TrackType = elem.InnerText; + // } + // break; + + // case "LastStop": + // { + // d.LastStop = elem.InnerText; + // } + // break; + + // case "Time": + // { + // d.Time = elem.InnerText; + // } + // break; + // } + // } + // ret.Add(d); + // } + //} + #endregion + } + + public static string sessionId = string.Empty; + + public static void GetFlightRadarData(List ret, PointLatLng location, int zoom, bool resetSession) + { + ret.Clear(); + + if(resetSession || string.IsNullOrEmpty(sessionId)) + { + sessionId = GetFlightRadarContentUsingHttp("http://www.flightradar24.com/", location, zoom, string.Empty); + } + + // get track for one object + //var tm = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalMilliseconds; + //var r = GetContentUsingHttp("http://www.flightradar24.com/FlightDataService.php?callsign=WZZ1MF&hex=47340F&date=" + tm, p1, 6, id); + //Debug.WriteLine(r); + + if(!string.IsNullOrEmpty(sessionId)) + { + var response = GetFlightRadarContentUsingHttp("http://www.flightradar24.com/PlaneFeed.json", location, zoom, sessionId); + + var items = response.Split(']'); + //int i = 0; + foreach(var it in items) + { + if(it.Length > 11) + { + var d = it.Substring(2).Replace(":", ",").Replace("\"", string.Empty).Replace("[", string.Empty); + + //Debug.WriteLine(++i + " -> " + d); + + // BAW576":["400803",48.9923,1.8083,"144","36950","462","0512","LFPO","A319","G-EUPC" + var par = d.Split(','); + if(par.Length >= 12) + { + var name = par[0]; + var hex = par[1]; + var lat = par[2]; + var lng = par[3]; + var bearing = par[4]; + var altitude = (int) (int.Parse(par[5]) * 0.3048) + "m"; + var speed = (int) (int.Parse(par[6]) * 1.852) + "km/h"; + + FlightRadarData fd = new FlightRadarData(); + fd.name = name; + fd.hex = hex; + fd.bearing = int.Parse(bearing); + fd.altitude = altitude; + fd.speed = speed; + fd.point = new PointLatLng(double.Parse(lat, CultureInfo.InvariantCulture), double.Parse(lng, CultureInfo.InvariantCulture)); + fd.Id = Convert.ToInt32(hex, 16); + ret.Add(fd); + + //Debug.WriteLine("name: " + name); + //Debug.WriteLine("hex: " + hex); + //Debug.WriteLine("point: " + fd.point); + //Debug.WriteLine("bearing: " + bearing); + //Debug.WriteLine("altitude: " + altitude); + //Debug.WriteLine("speed: " + speed); + } + else + { +#if DEBUG + if(Debugger.IsAttached) + { + Debugger.Break(); + } +#endif + } + //Debug.WriteLine("--------------"); + } + } + } + } + + static string GetFlightRadarContentUsingHttp(string url, PointLatLng p, int zoom, string sid) + { + string ret = string.Empty; + + HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url); + + request.UserAgent = GMapProvider.UserAgent; + request.Timeout = GMapProvider.TimeoutMs; + request.ReadWriteTimeout = GMapProvider.TimeoutMs * 6; + request.Accept = "*/*"; + request.Referer = "http://www.flightradar24.com/"; + request.KeepAlive = true; + request.Headers.Add("Cookie", string.Format(System.Globalization.CultureInfo.InvariantCulture, "map_lat={0}; map_lon={1}; map_zoom={2}; " + (!string.IsNullOrEmpty(sid) ? "PHPSESSID=" + sid + ";" : string.Empty) + "__utma=109878426.303091014.1316587318.1316587318.1316587318.1; __utmb=109878426.2.10.1316587318; __utmz=109878426.1316587318.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)", p.Lat, p.Lng, zoom)); + + using(HttpWebResponse response = request.GetResponse() as HttpWebResponse) + { + if(string.IsNullOrEmpty(sid)) + { + var c = response.Headers["Set-Cookie"]; + //Debug.WriteLine(c); + if(c.Contains("PHPSESSID")) + { + c = c.Split('=')[1].Split(';')[0]; + ret = c; + } + } + + using(Stream responseStream = response.GetResponseStream()) + { + using(StreamReader read = new StreamReader(responseStream, Encoding.UTF8)) + { + var tmp = read.ReadToEnd(); + if(!string.IsNullOrEmpty(sid)) + { + ret = tmp; + } + } + } + +#if PocketPC + request.Abort(); +#endif + response.Close(); + } + + return ret; + } + } +} diff --git a/Demo.WindowsForms/Source/Map.cs b/Demo.WindowsForms/Source/Map.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Source/Map.cs @@ -0,0 +1,61 @@ + +namespace Demo.WindowsForms +{ + using System.Windows.Forms; + using GMap.NET.WindowsForms; + using System.Drawing; + using System; + using System.Globalization; + + /// + /// custom map of GMapControl + /// + public class Map : GMapControl + { + public long ElapsedMilliseconds; + +#if DEBUG + private int counter; + readonly Font DebugFont = new Font(FontFamily.GenericSansSerif, 14, FontStyle.Regular); + readonly Font DebugFontSmall = new Font(FontFamily.GenericSansSerif, 12, FontStyle.Bold); + DateTime start; + DateTime end; + int delta; + + protected override void OnPaint(PaintEventArgs e) + { + start = DateTime.Now; + + base.OnPaint(e); + + end = DateTime.Now; + delta = (int)(end - start).TotalMilliseconds; + } + + /// + /// any custom drawing here + /// + /// + protected override void OnPaintOverlays(System.Drawing.Graphics g) + { + base.OnPaintOverlays(g); + + g.DrawString(string.Format(CultureInfo.InvariantCulture, "{0:0.0}", Zoom) + "z, " + MapProvider + ", refresh: " + counter++ + ", load: " + ElapsedMilliseconds + "ms, render: " + delta + "ms", DebugFont, Brushes.Blue, DebugFont.Height, DebugFont.Height + 20); + + //g.DrawString(ViewAreaPixel.Location.ToString(), DebugFontSmall, Brushes.Blue, DebugFontSmall.Height, DebugFontSmall.Height); + + //string lb = ViewAreaPixel.LeftBottom.ToString(); + //var lbs = g.MeasureString(lb, DebugFontSmall); + //g.DrawString(lb, DebugFontSmall, Brushes.Blue, DebugFontSmall.Height, Height - DebugFontSmall.Height * 2); + + //string rb = ViewAreaPixel.RightBottom.ToString(); + //var rbs = g.MeasureString(rb, DebugFontSmall); + //g.DrawString(rb, DebugFontSmall, Brushes.Blue, Width - rbs.Width - DebugFontSmall.Height, Height - DebugFontSmall.Height * 2); + + //string rt = ViewAreaPixel.RightTop.ToString(); + //var rts = g.MeasureString(rb, DebugFontSmall); + //g.DrawString(rt, DebugFontSmall, Brushes.Blue, Width - rts.Width - DebugFontSmall.Height, DebugFontSmall.Height); + } +#endif + } +} diff --git a/Demo.WindowsForms/Source/Program.cs b/Demo.WindowsForms/Source/Program.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Source/Program.cs @@ -0,0 +1,428 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Net; +using System.Net.NetworkInformation; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; +using System.IO; +using System.IO.Ports; +using System.Threading; + +namespace Demo.WindowsForms +{ + class Program + { + /// + /// The main entry point for the application. + /// + /// + // Instantiate the communications port + private SerialPort port = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One); + static MainForm windowGUI; + + [STAThread] + static void Main() + { + Application.SetCompatibleTextRenderingDefault(false); + var program = new Program(); + windowGUI = new MainForm(); + program.SerialInitialize(); + Application.EnableVisualStyles(); + + Application.Run(new MainForm()); + } + + //inits the serial port and event handler + private void SerialInitialize() + { + // http://msmvps.com/blogs/coad/archive/2005/03/23/SerialPort-_2800_RS_2D00_232-Serial-COM-Port_2900_-in-C_2300_-.NET.aspx + // Attach a method to be called when there is data waiting in the port's buffer + port.DataReceived += new SerialDataReceivedEventHandler(ReceiveData); + + // Open the port for communications + port.Open(); + + } + + //process received data + private void ReceiveData(object sender, SerialDataReceivedEventArgs e) + { + // Show all the incoming data in the port's buffer + string testChk = port.ReadLine(); + windowGUI.ParseIncomingData(testChk); + } + } + + public class Dummy + { + + } + + class IpInfo + { + public string Ip; + //public int Port; + //public TcpState State; + //public string ProcessName; + + public string CountryName; + public string RegionName; + public string City; + public double Latitude; + public double Longitude; + public DateTime CacheTime; + + //public DateTime StatusTime; + //public bool TracePoint; + } + + struct IpStatus + { + private string countryName; + public string CountryName + { + get + { + return countryName; + } + set + { + countryName = value; + } + } + + private int connectionsCount; + public int ConnectionsCount + { + get + { + return connectionsCount; + } + set + { + connectionsCount = value; + } + } + } + + class DescendingComparer : IComparer + { + public bool SortOnlyCountryName = false; + + public int Compare(IpStatus x, IpStatus y) + { + int r = 0; + + if(!SortOnlyCountryName) + { + r = y.ConnectionsCount.CompareTo(x.ConnectionsCount); + } + + if(r == 0) + { + return x.CountryName.CompareTo(y.CountryName); + } + return r; + } + } + + class TraceRoute + { + readonly static string Data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + readonly static byte[] DataBuffer; + readonly static int timeout = 8888; + + static TraceRoute() + { + DataBuffer = Encoding.ASCII.GetBytes(Data); + } + + public static List GetTraceRoute(string hostNameOrAddress) + { + var ret = GetTraceRoute(hostNameOrAddress, 1); + + return ret; + } + + private static List GetTraceRoute(string hostNameOrAddress, int ttl) + { + List result = new List(); + + using(Ping pinger = new Ping()) + { + PingOptions pingerOptions = new PingOptions(ttl, true); + + PingReply reply = pinger.Send(hostNameOrAddress, timeout, DataBuffer, pingerOptions); + + //Debug.WriteLine("GetTraceRoute[" + hostNameOrAddress + "]: " + reply.RoundtripTime + "ms " + reply.Address + " -> " + reply.Status); + + if(reply.Status == IPStatus.Success) + { + result.Add(reply); + } + else if(reply.Status == IPStatus.TtlExpired) + { + // add the currently returned address + result.Add(reply); + + // recurse to get the next address... + result.AddRange(GetTraceRoute(hostNameOrAddress, ttl + 1)); + } + else + { + Debug.WriteLine("GetTraceRoute: " + hostNameOrAddress + " - " + reply.Status); + } + } + + return result; + } + } + + +#if !MONO + #region Managed IP Helper API + + public struct TcpTable : IEnumerable + { + #region Private Fields + + private IEnumerable tcpRows; + + #endregion + + #region Constructors + + public TcpTable(IEnumerable tcpRows) + { + this.tcpRows = tcpRows; + } + + #endregion + + #region Public Properties + + public IEnumerable Rows + { + get + { + return this.tcpRows; + } + } + + #endregion + + #region IEnumerable Members + + public IEnumerator GetEnumerator() + { + return this.tcpRows.GetEnumerator(); + } + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + return this.tcpRows.GetEnumerator(); + } + + #endregion + } + + public struct TcpRow + { + #region Private Fields + + private IPEndPoint localEndPoint; + private IPEndPoint remoteEndPoint; + private TcpState state; + private int processId; + + #endregion + + #region Constructors + + public TcpRow(IpHelper.TcpRow tcpRow) + { + this.state = tcpRow.state; + this.processId = tcpRow.owningPid; + + int localPort = (tcpRow.localPort1 << 8) + (tcpRow.localPort2) + (tcpRow.localPort3 << 24) + (tcpRow.localPort4 << 16); + long localAddress = tcpRow.localAddr; + this.localEndPoint = new IPEndPoint(localAddress, localPort); + + int remotePort = (tcpRow.remotePort1 << 8) + (tcpRow.remotePort2) + (tcpRow.remotePort3 << 24) + (tcpRow.remotePort4 << 16); + long remoteAddress = tcpRow.remoteAddr; + this.remoteEndPoint = new IPEndPoint(remoteAddress, remotePort); + } + + #endregion + + #region Public Properties + + public IPEndPoint LocalEndPoint + { + get + { + return this.localEndPoint; + } + } + + public IPEndPoint RemoteEndPoint + { + get + { + return this.remoteEndPoint; + } + } + + public TcpState State + { + get + { + return this.state; + } + } + + public int ProcessId + { + get + { + return this.processId; + } + } + + #endregion + } + + public static class ManagedIpHelper + { + public static readonly List TcpRows = new List(); + + #region Public Methods + + public static void UpdateExtendedTcpTable(bool sorted) + { + TcpRows.Clear(); + + IntPtr tcpTable = IntPtr.Zero; + int tcpTableLength = 0; + + if(IpHelper.GetExtendedTcpTable(tcpTable, ref tcpTableLength, sorted, IpHelper.AfInet, IpHelper.TcpTableType.OwnerPidConnections, 0) != 0) + { + try + { + tcpTable = Marshal.AllocHGlobal(tcpTableLength); + if(IpHelper.GetExtendedTcpTable(tcpTable, ref tcpTableLength, true, IpHelper.AfInet, IpHelper.TcpTableType.OwnerPidConnections, 0) == 0) + { + IpHelper.TcpTable table = (IpHelper.TcpTable)Marshal.PtrToStructure(tcpTable, typeof(IpHelper.TcpTable)); + + IntPtr rowPtr = (IntPtr)((long)tcpTable + Marshal.SizeOf(table.Length)); + for(int i = 0; i < table.Length; ++i) + { + TcpRows.Add(new TcpRow((IpHelper.TcpRow)Marshal.PtrToStructure(rowPtr, typeof(IpHelper.TcpRow)))); + rowPtr = (IntPtr)((long)rowPtr + Marshal.SizeOf(typeof(IpHelper.TcpRow))); + } + } + } + finally + { + if(tcpTable != IntPtr.Zero) + { + Marshal.FreeHGlobal(tcpTable); + } + } + } + } + + #endregion + } + + #endregion + + #region P/Invoke IP Helper API + + /// + /// + /// + public static class IpHelper + { + #region Public Fields + + public const string DllName = "iphlpapi.dll"; + public const int AfInet = 2; + + #endregion + + #region Public Methods + + /// + /// + /// + [DllImport(IpHelper.DllName, SetLastError = true)] + public static extern uint GetExtendedTcpTable(IntPtr tcpTable, ref int tcpTableLength, bool sort, int ipVersion, TcpTableType tcpTableType, int reserved); + + #endregion + + #region Public Enums + + /// + /// + /// + public enum TcpTableType + { + BasicListener, + BasicConnections, + BasicAll, + OwnerPidListener, + OwnerPidConnections, + OwnerPidAll, + OwnerModuleListener, + OwnerModuleConnections, + OwnerModuleAll, + } + + #endregion + + #region Public Structs + + /// + /// + /// + [StructLayout(LayoutKind.Sequential)] + public struct TcpTable + { + public uint Length; + public TcpRow row; + } + + /// + /// + /// + [StructLayout(LayoutKind.Sequential)] + public struct TcpRow + { + public TcpState state; + public uint localAddr; + public byte localPort1; + public byte localPort2; + public byte localPort3; + public byte localPort4; + public uint remoteAddr; + public byte remotePort1; + public byte remotePort2; + public byte remotePort3; + public byte remotePort4; + public int owningPid; + } + + #endregion + } + + #endregion +#endif +} diff --git a/Demo.WindowsForms/Source/SQLiteIpCache.cs b/Demo.WindowsForms/Source/SQLiteIpCache.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/Source/SQLiteIpCache.cs @@ -0,0 +1,240 @@ + +namespace Demo.WindowsForms +{ +#if SQLite + using System.Collections.Generic; + using System.Data.Common; +#if !MONO + using System.Data.SQLite; +#else + using SQLiteConnection=Mono.Data.SqliteClient.SqliteConnection; + using SQLiteTransaction=Mono.Data.SqliteClient.SqliteTransaction; + using SQLiteCommand=Mono.Data.SqliteClient.SqliteCommand; + using SQLiteDataReader=Mono.Data.SqliteClient.SqliteDataReader; + using SQLiteParameter=Mono.Data.SqliteClient.SqliteParameter; +#endif + using System.IO; + using System.Text; + using System; + using System.Diagnostics; + using System.Globalization; + + /// + /// ultra fast cache system for tiles + /// + internal class SQLiteIpCache + { + string cache; + string ipCache; + string db; + + public string IpCache + { + get + { + return ipCache; + } + } + + /// + /// local cache location + /// + public string CacheLocation + { + get + { + return cache; + } + set + { + cache = value; + ipCache = Path.Combine(cache, "IpGeoCacheDB") + Path.DirectorySeparatorChar; + + // make empty db + { + db = ipCache + "Data.ipdb"; + + if(!File.Exists(db)) + { + CreateEmptyDB(db); + } + } + } + } + + public static bool CreateEmptyDB(string file) + { + bool ret = true; + + try + { + string dir = Path.GetDirectoryName(file); + if(!Directory.Exists(dir)) + { + Directory.CreateDirectory(dir); + } + + using(SQLiteConnection cn = new SQLiteConnection()) + { +#if !MONO + cn.ConnectionString = string.Format("Data Source=\"{0}\";FailIfMissing=False;", file); +#else + cn.ConnectionString = string.Format("Version=3,URI=file://{0},FailIfMissing=False", file); +#endif + cn.Open(); + { + using(DbTransaction tr = cn.BeginTransaction()) + { + try + { + using(DbCommand cmd = cn.CreateCommand()) + { + cmd.Transaction = tr; + cmd.CommandText = Properties.Resources.IpCacheCreateDb; + cmd.ExecuteNonQuery(); + } + tr.Commit(); + } + catch(Exception exx) + { + Console.WriteLine("CreateEmptyDB: " + exx.ToString()); + Debug.WriteLine("CreateEmptyDB: " + exx.ToString()); + + tr.Rollback(); + ret = false; + } + } + cn.Close(); + } + } + } + catch(Exception ex) + { +#if MONO + Console.WriteLine("CreateEmptyDB: " + ex.ToString()); +#endif + Debug.WriteLine("CreateEmptyDB: " + ex.ToString()); + ret = false; + } + return ret; + } + + public bool PutDataToCache(string ip, IpInfo data) + { + bool ret = true; + try + { + using(SQLiteConnection cn = new SQLiteConnection()) + { +#if !MONO + cn.ConnectionString = string.Format("Data Source=\"{0}\";", db); +#else + cn.ConnectionString = string.Format("Version=3,URI=file://{0},FailIfMissing=True,Default Timeout=33", db); +#endif + + cn.Open(); + { + { + using(DbTransaction tr = cn.BeginTransaction()) + { + try + { + using(DbCommand cmd = cn.CreateCommand()) + { + cmd.Transaction = tr; + + cmd.CommandText = "INSERT INTO Cache(Ip, CountryName, RegionName, City, Latitude, Longitude, Time) VALUES(@p1, @p2, @p3, @p4, @p5, @p6, @p7)"; + + cmd.Parameters.Add(new SQLiteParameter("@p1", ip)); + cmd.Parameters.Add(new SQLiteParameter("@p2", data.CountryName)); + cmd.Parameters.Add(new SQLiteParameter("@p3", data.RegionName)); + cmd.Parameters.Add(new SQLiteParameter("@p4", data.City)); + cmd.Parameters.Add(new SQLiteParameter("@p5", data.Latitude)); + cmd.Parameters.Add(new SQLiteParameter("@p6", data.Longitude)); + cmd.Parameters.Add(new SQLiteParameter("@p7", data.CacheTime)); + + cmd.ExecuteNonQuery(); + } + tr.Commit(); + } + catch(Exception ex) + { + Console.WriteLine("PutDataToCache: " + ex.ToString()); + + Debug.WriteLine("PutDataToCache: " + ex.ToString()); + + tr.Rollback(); + ret = false; + } + } + } + } + cn.Close(); + } + } + catch(Exception ex) + { +#if MONO + Console.WriteLine("PutDataToCache: " + ex.ToString()); +#endif + Debug.WriteLine("PutDataToCache: " + ex.ToString()); + ret = false; + } + return ret; + } + + public IpInfo GetDataFromCache(string ip) + { + IpInfo ret = null; + try + { + using(SQLiteConnection cn = new SQLiteConnection()) + { +#if !MONO + cn.ConnectionString = string.Format("Data Source=\"{0}\";", db); +#else + cn.ConnectionString = string.Format("Version=3,URI=file://{0},Default Timeout=33", db); +#endif + cn.Open(); + { + using(DbCommand com = cn.CreateCommand()) + { + com.CommandText = "SELECT * FROM Cache WHERE Ip = '" + ip + "'"; + + using(DbDataReader rd = com.ExecuteReader()) + { + if(rd.Read()) + { + IpInfo val = new IpInfo(); + { + val.Ip = ip; + val.CountryName = rd["CountryName"] as string; + val.RegionName = rd["RegionName"] as string; + val.City = rd["City"] as string; + val.Latitude = (double)rd["Latitude"]; + val.Longitude = (double)rd["Longitude"]; + val.CacheTime = (DateTime)rd["Time"]; + } + ret = val; + } + rd.Close(); + } + } + } + cn.Close(); + } + } + catch(Exception ex) + { +#if MONO + Console.WriteLine("GetDataFromCache: " + ex.ToString()); +#endif + Debug.WriteLine("GetDataFromCache: " + ex.ToString()); + ret = null; + } + + return ret; + } + } +#endif +} diff --git a/Demo.WindowsForms/debug.csv b/Demo.WindowsForms/debug.csv new file mode 100644 --- /dev/null +++ b/Demo.WindowsForms/debug.csv @@ -0,0 +1,73 @@ +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +whatever you text is +V16.5211037379322,A219.436455270944,H35.6112708945811,P662.225417891622, +V31.3015968193773,A367.868548709838,H32.6426290258032,P612.852580516065, +V41.7915624479724,A485.654017485517,H30.2869196502897,P575.738393005793, +V55.7468573601669,A628.191838286906,H27.4361632342619,P528.723264685237, +V65.4116248195114,A740.083034425081,H25.1983393114984,P493.966786229967, +V70.7858648260058,A821.327605900042,H23.5734478819992,P471.468957639983, +V76.892847758016,A907.8060554144,H21.843878891712,P446.87757783424, +V78.7093032371762,A963.637880265544,H20.7272423946891,P434.544847893782, +V7.07996864927931,A151.999776066281,H36.9600044786744,P689.200089573488, +V13.7326547709911,A242.37610550708,H35.1524778898584,P663.049557797168, +V18.6887169323343,A320.633692373817,H33.5873261525237,P641.746523050473, +V27.0638807554095,A423.313433967211,H31.5337313206558,P610.674626413116, +V39.1748405689256,A552.677432635183,H28.9464513472963,P568.929026945927, +V40.6124468004389,A605.803191431706,H27.8839361713659,P557.678723427318, +V23.2508758291839,A353.220541637028,H32.9355891672594,P628.711783345189, +V27.1359460743777,A423.828186245555,H31.5234362750889,P610.468725501778, +V40.6842612448541,A563.459008891815,H28.7308198221637,P564.616396443274, +V49.895821340613,A672.113009575807,H26.5577398084839,P531.154796169677, +V20.9362935449631,A293.830668178308,H34.1233866364338,P642.467732728677, +V30.029080660841,A401.636290434579,H31.9672741913084,P609.345483826169, +V19.1560603807476,A281.11471700534,H34.3777056598932,P647.554113197864, +V23.0682034616676,A351.915739011912,H32.9616852197618,P629.233704395235, +V26.1551483733371,A416.822488380979,H31.6635502323804,P613.271004647608, +V37.7306929469717,A542.362092478369,H29.1527581504326,P573.055163008652, +V50.0389804461221,A673.135574615158,H26.5372885076968,P530.745770153937, +V65.0336266814888,A823.097333439205,H23.5380533312159,P480.761066624318, +V19.0889440778126,A237.778171984376,H35.2444365603125,P654.88873120625, +V25.3547743446914,A325.391245319225,H33.4921750936155,P629.84350187231, +V38.5974908006366,A462.839220004547,H30.7432155999091,P584.864311998181, +V39.7475954454148,A513.911396038677,H29.7217720792265,P574.435441584529, +V16.7495422425445,A263.925301732461,H34.7214939653508,P654.429879307016, +V28.8544923888773,A393.246374206267,H32.1350725158747,P612.701450317493, +V35.8437169131095,A486.026549379354,H30.2794690124129,P585.589380248259, diff --git a/Demo.WindowsForms/sn.snk b/Demo.WindowsForms/sn.snk new file mode 100644 index 0000000000000000000000000000000000000000..5d3f356338012a684961ee80096fa2174233ecb1 GIT binary patch literal 596 zc$@)L0;~N80ssI2Bme+XQ$aES1ONa50098aB^wKmaCwnSzCKn}*)CKkA&)--K~s91 zw?=zyqN-f72^GT>0DulKfzl3SRHIR3U=QfOPlRVg@)6)bSb|{8hb(xj*&9MEUJ&RG5c5qH`OA-hvLk9oF^;s`eGfcYOeiCvwP z_xV1L3m4YvokO*ySD*DRh0|q*i_C2^p!Kh)MdJnPJ6XP=Lw(o7pafRAo0w+7KaU_Q z?-m#(D$rPUc-kXo8U-;83`LF6O3+qBuE^*zJGx1L&Sxid3!0LP3pMi=zGQ7tZy$CU z=Wgg81drW2)_Po1Fzk)eJxRGP3R^vIA<-TOrZ^?J<(_FphivoEAe=#@ + + Debug + AnyCPU + 9.0.30729 + 2.0 + {27C6704C-040E-43BB-91CC-924EE351A6C7} + WinExe + Properties + Demo.WindowsMobile + GMap.NET + {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + PocketPC + b2c48bd2-963d-4549-9169-1fa021dce484 + 5.2 + GMap.NET + v3.5 + Windows Mobile 6 Professional SDK + + + %25CSIDL_PROGRAM_FILES%25 + Resources\ImageReady.ico + true + + + true + full + false + bin\Debug\ + TRACE;DEBUG;PocketPC + true + true + prompt + 512 + 4 + Off + + + none + true + bin\Release\ + TRACE;PocketPC + true + true + prompt + 512 + 4 + Off + + + + Source\DemoStuff.cs + + + UserControl + + + Search.cs + + + UserControl + + + GPS.cs + + + Form + + + MainForm.cs + + + UserControl + + + Transport.cs + + + + + + Search.cs + Designer + + + GPS.cs + Designer + + + MainForm.cs + Designer + + + Transport.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + + {421813B1-A007-44B2-8C53-32751C45113E} + GMap.NET.WindowsMobile %28GMap.NET\GMap.NET.WindowsMobile%29 + + + + + + + + + + False + ..\References\CompactFramework\System.Data.SQLite.dll + True + + + + + + + + SQLite.Interop.081.dll + PreserveNewest + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demo.WindowsMobile/Forms/GPS.Designer.cs b/Demo.WindowsMobile/Forms/GPS.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/GPS.Designer.cs @@ -0,0 +1,86 @@ +namespace Demo.WindowsMobile +{ + partial class GPS + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.status = new System.Windows.Forms.Label(); + this.splitter1 = new System.Windows.Forms.Splitter(); + this.panelSignals = new System.Windows.Forms.Panel(); + this.SuspendLayout(); + // + // status + // + this.status.BackColor = System.Drawing.Color.Navy; + this.status.Dock = System.Windows.Forms.DockStyle.Top; + this.status.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Regular); + this.status.ForeColor = System.Drawing.Color.Lime; + this.status.Location = new System.Drawing.Point(0, 0); + this.status.Name = "status"; + this.status.Size = new System.Drawing.Size(391, 417); + this.status.Text = "Loading..."; + // + // splitter1 + // + this.splitter1.BackColor = System.Drawing.Color.Black; + this.splitter1.Dock = System.Windows.Forms.DockStyle.Top; + this.splitter1.Location = new System.Drawing.Point(0, 417); + this.splitter1.MinExtra = 0; + this.splitter1.MinSize = 0; + this.splitter1.Name = "splitter1"; + this.splitter1.Size = new System.Drawing.Size(391, 11); + // + // panelSignals + // + this.panelSignals.BackColor = System.Drawing.Color.DarkBlue; + this.panelSignals.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelSignals.Location = new System.Drawing.Point(0, 428); + this.panelSignals.Name = "panelSignals"; + this.panelSignals.Size = new System.Drawing.Size(391, 103); + this.panelSignals.Paint += new System.Windows.Forms.PaintEventHandler(this.panelSignals_Paint); + // + // GPS + // + this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.Controls.Add(this.panelSignals); + this.Controls.Add(this.splitter1); + this.Controls.Add(this.status); + this.Name = "GPS"; + this.Size = new System.Drawing.Size(391, 531); + this.Resize += new System.EventHandler(this.GPS_Resize); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Splitter splitter1; + internal System.Windows.Forms.Label status; + internal System.Windows.Forms.Panel panelSignals; + } +} diff --git a/Demo.WindowsMobile/Forms/GPS.cs b/Demo.WindowsMobile/Forms/GPS.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/GPS.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; + +namespace Demo.WindowsMobile +{ + public partial class GPS : UserControl + { + MainForm Main; + + Pen penForSat = new Pen(Color.White, 3.0f); + Brush brushForSatOk = new SolidBrush(Color.LimeGreen); + Brush brushForSatNo = new SolidBrush(Color.Red); + Font fSignal = new Font(FontFamily.GenericSansSerif, 6, FontStyle.Regular); + Brush bSignal = new SolidBrush(Color.Blue); + StringFormat sformat = new StringFormat(); + + public GPS(MainForm main) + { + InitializeComponent(); + Main = main; + sformat.LineAlignment = StringAlignment.Far; + sformat.Alignment = StringAlignment.Center; + } + + private void panelSignals_Paint(object sender, PaintEventArgs e) + { + lock(Main.Satellites) + { + if(Main.Satellites.Count > 0) + { + int cc = Width / Main.Satellites.Count; + for(int i = 0; i < Main.Satellites.Count; i++) + { + int str = (int) (2.0 * (panelSignals.Height * Main.Satellites[i].SignalStrength)/100.0); + + if(Main.Satellites[i].InSolution) + { + e.Graphics.FillRectangle(brushForSatOk, new Rectangle(i*cc, panelSignals.Height - str, cc, str)); + } + else + { + e.Graphics.FillRectangle(brushForSatNo, new Rectangle(i*cc, panelSignals.Height - str, cc, str)); + } + + e.Graphics.DrawRectangle(penForSat, new Rectangle(i*cc + (int) penForSat.Width/2, 0, cc - (int) penForSat.Width/2, panelSignals.Height)); + + e.Graphics.DrawString(Main.Satellites[i].SignalStrength + "dB", fSignal, bSignal, new Rectangle(i*cc, 0, cc, (int)(panelSignals.Height-fSignal.Size/2)), sformat); + } + } + } + } + + private void GPS_Resize(object sender, EventArgs e) + { + if(Parent != null) + { + status.Height = Parent.Height - 44*5; + } + } + } +} diff --git a/Demo.WindowsMobile/Forms/GPS.resx b/Demo.WindowsMobile/Forms/GPS.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/GPS.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 2 + + + Pocket_PC_Phone + + + Pocket_PC_Phone + + \ No newline at end of file diff --git a/Demo.WindowsMobile/Forms/MainForm.Designer.cs b/Demo.WindowsMobile/Forms/MainForm.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/MainForm.Designer.cs @@ -0,0 +1,450 @@ +namespace Demo.WindowsMobile +{ + partial class MainForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + private System.Windows.Forms.MainMenu mainMenu1; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.mainMenu1 = new System.Windows.Forms.MainMenu(); + this.menuItem1 = new System.Windows.Forms.MenuItem(); + this.menuItemGotoMap = new System.Windows.Forms.MenuItem(); + this.menuItemGotoGps = new System.Windows.Forms.MenuItem(); + this.menuItemSearch = new System.Windows.Forms.MenuItem(); + this.menuItemGotoTransport = new System.Windows.Forms.MenuItem(); + this.menuItem34 = new System.Windows.Forms.MenuItem(); + this.menuItem32 = new System.Windows.Forms.MenuItem(); + this.menuItem2 = new System.Windows.Forms.MenuItem(); + this.menuItem29 = new System.Windows.Forms.MenuItem(); + this.menuItemGPSenabled = new System.Windows.Forms.MenuItem(); + this.menuItem8 = new System.Windows.Forms.MenuItem(); + this.menuItem12 = new System.Windows.Forms.MenuItem(); + this.menuItem13 = new System.Windows.Forms.MenuItem(); + this.menuItem9 = new System.Windows.Forms.MenuItem(); + this.menuItem10 = new System.Windows.Forms.MenuItem(); + this.menuItem11 = new System.Windows.Forms.MenuItem(); + this.menuItem16 = new System.Windows.Forms.MenuItem(); + this.menuItem18 = new System.Windows.Forms.MenuItem(); + this.menuItem24 = new System.Windows.Forms.MenuItem(); + this.menuItem20 = new System.Windows.Forms.MenuItem(); + this.menuItem21 = new System.Windows.Forms.MenuItem(); + this.menuItem17 = new System.Windows.Forms.MenuItem(); + this.menuItem14 = new System.Windows.Forms.MenuItem(); + this.menuItem15 = new System.Windows.Forms.MenuItem(); + this.menuItem19 = new System.Windows.Forms.MenuItem(); + this.menuItem7 = new System.Windows.Forms.MenuItem(); + this.menuItemCacheOnly = new System.Windows.Forms.MenuItem(); + this.menuItemServerAndCache = new System.Windows.Forms.MenuItem(); + this.menuItemServerOnly = new System.Windows.Forms.MenuItem(); + this.menuItem30 = new System.Windows.Forms.MenuItem(); + this.menuItemEnableGrid = new System.Windows.Forms.MenuItem(); + this.menuItemDisableAutoSleep = new System.Windows.Forms.MenuItem(); + this.menuItemSnapToGps = new System.Windows.Forms.MenuItem(); + this.menuItem6 = new System.Windows.Forms.MenuItem(); + this.menuItem36 = new System.Windows.Forms.MenuItem(); + this.menuItem37 = new System.Windows.Forms.MenuItem(); + this.menuItem35 = new System.Windows.Forms.MenuItem(); + this.menuItem38 = new System.Windows.Forms.MenuItem(); + this.menuItem41 = new System.Windows.Forms.MenuItem(); + this.menuItem42 = new System.Windows.Forms.MenuItem(); + this.menuItem43 = new System.Windows.Forms.MenuItem(); + this.menuItem40 = new System.Windows.Forms.MenuItem(); + this.menuItem39 = new System.Windows.Forms.MenuItem(); + this.menuItem27 = new System.Windows.Forms.MenuItem(); + this.menuItem28 = new System.Windows.Forms.MenuItem(); + this.menuItem3 = new System.Windows.Forms.MenuItem(); + this.timerKeeperOfLife = new System.Windows.Forms.Timer(); + this.MainMap = new Map(); + this.menuItemshowDestination = new System.Windows.Forms.MenuItem(); + this.menuItemSetDestination = new System.Windows.Forms.MenuItem(); + this.SuspendLayout(); + // + // mainMenu1 + // + this.mainMenu1.MenuItems.Add(this.menuItem1); + this.mainMenu1.MenuItems.Add(this.menuItem2); + // + // menuItem1 + // + this.menuItem1.MenuItems.Add(this.menuItemGotoMap); + this.menuItem1.MenuItems.Add(this.menuItemGotoGps); + this.menuItem1.MenuItems.Add(this.menuItemSearch); + this.menuItem1.MenuItems.Add(this.menuItemGotoTransport); + this.menuItem1.MenuItems.Add(this.menuItem34); + this.menuItem1.MenuItems.Add(this.menuItem32); + this.menuItem1.Text = "Page"; + // + // menuItemGotoMap + // + this.menuItemGotoMap.Checked = true; + this.menuItemGotoMap.Text = "Map"; + this.menuItemGotoMap.Click += new System.EventHandler(this.menuItemGotoMap_Click); + // + // menuItemGotoGps + // + this.menuItemGotoGps.Text = "GPS"; + this.menuItemGotoGps.Click += new System.EventHandler(this.menuItemGotoGps_Click); + // + // menuItemSearch + // + this.menuItemSearch.Text = "Search"; + this.menuItemSearch.Click += new System.EventHandler(this.menuItemSearch_Click); + // + // menuItemGotoTransport + // + this.menuItemGotoTransport.Text = "Vilnius Transport"; + this.menuItemGotoTransport.Click += new System.EventHandler(this.menuItemGotoTransport_Click); + // + // menuItem34 + // + this.menuItem34.Text = "-"; + // + // menuItem32 + // + this.menuItem32.Text = "Hide"; + this.menuItem32.Click += new System.EventHandler(this.menuItem32_Click); + // + // menuItem2 + // + this.menuItem2.MenuItems.Add(this.menuItem29); + this.menuItem2.MenuItems.Add(this.menuItem8); + this.menuItem2.MenuItems.Add(this.menuItem7); + this.menuItem2.MenuItems.Add(this.menuItem30); + this.menuItem2.MenuItems.Add(this.menuItem6); + this.menuItem2.MenuItems.Add(this.menuItem36); + this.menuItem2.MenuItems.Add(this.menuItem38); + this.menuItem2.MenuItems.Add(this.menuItem27); + this.menuItem2.MenuItems.Add(this.menuItem28); + this.menuItem2.MenuItems.Add(this.menuItem3); + this.menuItem2.Text = "Menu"; + // + // menuItem29 + // + this.menuItem29.MenuItems.Add(this.menuItemGPSenabled); + this.menuItem29.Text = "GPS"; + // + // menuItemGPSenabled + // + this.menuItemGPSenabled.Checked = true; + this.menuItemGPSenabled.Text = "Enabled"; + this.menuItemGPSenabled.Click += new System.EventHandler(this.menuItemGPSenabled_Click); + // + // menuItem8 + // + this.menuItem8.MenuItems.Add(this.menuItem12); + this.menuItem8.MenuItems.Add(this.menuItem13); + this.menuItem8.MenuItems.Add(this.menuItem9); + this.menuItem8.MenuItems.Add(this.menuItem10); + this.menuItem8.MenuItems.Add(this.menuItem11); + this.menuItem8.MenuItems.Add(this.menuItem16); + this.menuItem8.MenuItems.Add(this.menuItem18); + this.menuItem8.MenuItems.Add(this.menuItem24); + this.menuItem8.MenuItems.Add(this.menuItem20); + this.menuItem8.MenuItems.Add(this.menuItem21); + this.menuItem8.MenuItems.Add(this.menuItem17); + this.menuItem8.MenuItems.Add(this.menuItem14); + this.menuItem8.MenuItems.Add(this.menuItem15); + this.menuItem8.MenuItems.Add(this.menuItem19); + this.menuItem8.Text = "Map"; + // + // menuItem12 + // + this.menuItem12.Text = "OpenStreetMap"; + this.menuItem12.Click += new System.EventHandler(this.menuItem12_Click); + // + // menuItem13 + // + this.menuItem13.Text = "-"; + // + // menuItem9 + // + this.menuItem9.Text = "GoogleMap"; + this.menuItem9.Click += new System.EventHandler(this.menuItem9_Click); + // + // menuItem10 + // + this.menuItem10.Text = "Google Hybrid"; + this.menuItem10.Click += new System.EventHandler(this.menuItem10_Click); + // + // menuItem11 + // + this.menuItem11.Text = "-"; + // + // menuItem16 + // + this.menuItem16.Text = "Bing"; + this.menuItem16.Click += new System.EventHandler(this.menuItem16_Click); + // + // menuItem18 + // + this.menuItem18.Text = "Bing Hybrid"; + this.menuItem18.Click += new System.EventHandler(this.menuItem18_Click); + // + // menuItem24 + // + this.menuItem24.Text = "-"; + // + // menuItem20 + // + this.menuItem20.Text = "Yahoo"; + this.menuItem20.Click += new System.EventHandler(this.menuItem20_Click); + // + // menuItem21 + // + this.menuItem21.Text = "Yahoo Hybrid"; + this.menuItem21.Click += new System.EventHandler(this.menuItem21_Click); + // + // menuItem17 + // + this.menuItem17.Text = "-"; + // + // menuItem14 + // + this.menuItem14.Text = "Maps.LT"; + this.menuItem14.Click += new System.EventHandler(this.menuItem14_Click); + // + // menuItem15 + // + this.menuItem15.Text = "Maps.LT Hybrid"; + this.menuItem15.Click += new System.EventHandler(this.menuItem15_Click); + // + // menuItem19 + // + this.menuItem19.Text = "-"; + // + // menuItem7 + // + this.menuItem7.MenuItems.Add(this.menuItemCacheOnly); + this.menuItem7.MenuItems.Add(this.menuItemServerAndCache); + this.menuItem7.MenuItems.Add(this.menuItemServerOnly); + this.menuItem7.Text = "Mode"; + // + // menuItemCacheOnly + // + this.menuItemCacheOnly.Text = "CacheOnly"; + this.menuItemCacheOnly.Click += new System.EventHandler(this.menuItemCacheOnly_Click); + // + // menuItemServerAndCache + // + this.menuItemServerAndCache.Text = "ServerAndCache"; + this.menuItemServerAndCache.Click += new System.EventHandler(this.menuItemServerAndCache_Click); + // + // menuItemServerOnly + // + this.menuItemServerOnly.Text = "ServerOnly"; + this.menuItemServerOnly.Click += new System.EventHandler(this.menuItemServerOnly_Click); + // + // menuItem30 + // + this.menuItem30.MenuItems.Add(this.menuItemshowDestination); + this.menuItem30.MenuItems.Add(this.menuItemSnapToGps); + this.menuItem30.MenuItems.Add(this.menuItemDisableAutoSleep); + this.menuItem30.MenuItems.Add(this.menuItemEnableGrid); + this.menuItem30.Text = "Options"; + // + // menuItemEnableGrid + // + this.menuItemEnableGrid.Text = "Enable Grid"; + this.menuItemEnableGrid.Click += new System.EventHandler(this.menuItemEnableGrid_Click); + // + // menuItemDisableAutoSleep + // + this.menuItemDisableAutoSleep.Checked = true; + this.menuItemDisableAutoSleep.Text = "Disable Auto Sleep"; + this.menuItemDisableAutoSleep.Click += new System.EventHandler(this.menuItemDisableAutoSleep_Click); + // + // menuItemSnapToGps + // + this.menuItemSnapToGps.Checked = true; + this.menuItemSnapToGps.Text = "Snap To GPS"; + this.menuItemSnapToGps.Click += new System.EventHandler(this.menuItemSnapToGps_Click); + // + // menuItem6 + // + this.menuItem6.Text = "-"; + // + // menuItem36 + // + this.menuItem36.MenuItems.Add(this.menuItem37); + this.menuItem36.MenuItems.Add(this.menuItem35); + this.menuItem36.MenuItems.Add(this.menuItemSetDestination); + this.menuItem36.Text = "Markers"; + // + // menuItem37 + // + this.menuItem37.Text = "Clear"; + this.menuItem37.Click += new System.EventHandler(this.menuItem37_Click); + // + // menuItem35 + // + this.menuItem35.Text = "Fit to All"; + this.menuItem35.Click += new System.EventHandler(this.menuItem35_Click); + // + // menuItem38 + // + this.menuItem38.MenuItems.Add(this.menuItem41); + this.menuItem38.MenuItems.Add(this.menuItem42); + this.menuItem38.MenuItems.Add(this.menuItem43); + this.menuItem38.MenuItems.Add(this.menuItem40); + this.menuItem38.MenuItems.Add(this.menuItem39); + this.menuItem38.Text = "Zoom"; + // + // menuItem41 + // + this.menuItem41.Text = "In"; + this.menuItem41.Click += new System.EventHandler(this.menuItem4_Click); + // + // menuItem42 + // + this.menuItem42.Text = "Out"; + this.menuItem42.Click += new System.EventHandler(this.menuItem5_Click); + // + // menuItem43 + // + this.menuItem43.Text = "-"; + // + // menuItem40 + // + this.menuItem40.Text = "Max"; + this.menuItem40.Click += new System.EventHandler(this.menuItem33_Click); + // + // menuItem39 + // + this.menuItem39.Text = "Min"; + this.menuItem39.Click += new System.EventHandler(this.menuItem31_Click); + // + // menuItem27 + // + this.menuItem27.Text = "Reload"; + this.menuItem27.Click += new System.EventHandler(this.menuItem27_Click); + // + // menuItem28 + // + this.menuItem28.Text = "-"; + // + // menuItem3 + // + this.menuItem3.Text = "Exit"; + this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click); + // + // timerKeeperOfLife + // + this.timerKeeperOfLife.Tick += new System.EventHandler(this.timerKeeperOfLife_Tick); + // + // MainMap + // + this.MainMap.BackColor = System.Drawing.Color.White; + this.MainMap.Dock = System.Windows.Forms.DockStyle.Fill; + this.MainMap.Location = new System.Drawing.Point(0, 0); + this.MainMap.Name = "MainMap"; + this.MainMap.Size = new System.Drawing.Size(480, 696); + this.MainMap.TabIndex = 0; + // + // menuItemshowDestination + // + this.menuItemshowDestination.Text = "Show Destination"; + this.menuItemshowDestination.Click += new System.EventHandler(this.menuItemshowDestination_Click); + // + // menuItemSetDestination + // + this.menuItemSetDestination.Text = "Set Destination"; + this.menuItemSetDestination.Click += new System.EventHandler(this.menuItemSetDestination_Click); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(192F, 192F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.AutoScroll = true; + this.ClientSize = new System.Drawing.Size(480, 696); + this.Controls.Add(this.MainMap); + this.KeyPreview = true; + this.Location = new System.Drawing.Point(0, 52); + this.Menu = this.mainMenu1; + this.Name = "MainForm"; + this.Text = "GMap.NET"; + this.Load += new System.EventHandler(this.MainForm_Load); + this.Closed += new System.EventHandler(this.MainForm_Closed); + this.Activated += new System.EventHandler(this.MainForm_Activated); + this.ResumeLayout(false); + + } + + #endregion + + internal Map MainMap; + private System.Windows.Forms.MenuItem menuItem1; + private System.Windows.Forms.MenuItem menuItem2; + private System.Windows.Forms.MenuItem menuItem3; + private System.Windows.Forms.MenuItem menuItem6; + private System.Windows.Forms.MenuItem menuItem8; + private System.Windows.Forms.MenuItem menuItem12; + private System.Windows.Forms.MenuItem menuItem13; + private System.Windows.Forms.MenuItem menuItem9; + private System.Windows.Forms.MenuItem menuItem10; + private System.Windows.Forms.MenuItem menuItem11; + private System.Windows.Forms.MenuItem menuItem14; + private System.Windows.Forms.MenuItem menuItem15; + private System.Windows.Forms.MenuItem menuItem16; + private System.Windows.Forms.MenuItem menuItem18; + private System.Windows.Forms.MenuItem menuItem24; + private System.Windows.Forms.MenuItem menuItem21; + private System.Windows.Forms.MenuItem menuItem20; + private System.Windows.Forms.MenuItem menuItem17; + private System.Windows.Forms.MenuItem menuItem19; + private System.Windows.Forms.MenuItem menuItem27; + private System.Windows.Forms.MenuItem menuItem28; + private System.Windows.Forms.MenuItem menuItem7; + private System.Windows.Forms.MenuItem menuItemServerAndCache; + private System.Windows.Forms.MenuItem menuItemCacheOnly; + private System.Windows.Forms.MenuItem menuItem29; + private System.Windows.Forms.MenuItem menuItemGPSenabled; + private System.Windows.Forms.MenuItem menuItem30; + private System.Windows.Forms.MenuItem menuItemEnableGrid; + private System.Windows.Forms.Timer timerKeeperOfLife; + private System.Windows.Forms.MenuItem menuItemDisableAutoSleep; + private System.Windows.Forms.MenuItem menuItemGotoMap; + private System.Windows.Forms.MenuItem menuItemGotoGps; + private System.Windows.Forms.MenuItem menuItem34; + private System.Windows.Forms.MenuItem menuItem32; + private System.Windows.Forms.MenuItem menuItemServerOnly; + private System.Windows.Forms.MenuItem menuItemGotoTransport; + private System.Windows.Forms.MenuItem menuItem36; + private System.Windows.Forms.MenuItem menuItem37; + private System.Windows.Forms.MenuItem menuItem35; + private System.Windows.Forms.MenuItem menuItemSearch; + private System.Windows.Forms.MenuItem menuItem38; + private System.Windows.Forms.MenuItem menuItem41; + private System.Windows.Forms.MenuItem menuItem42; + private System.Windows.Forms.MenuItem menuItem43; + private System.Windows.Forms.MenuItem menuItem40; + private System.Windows.Forms.MenuItem menuItem39; + private System.Windows.Forms.MenuItem menuItemSnapToGps; + internal System.Windows.Forms.MenuItem menuItemshowDestination; + private System.Windows.Forms.MenuItem menuItemSetDestination; + } +} + diff --git a/Demo.WindowsMobile/Forms/MainForm.cs b/Demo.WindowsMobile/Forms/MainForm.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/MainForm.cs @@ -0,0 +1,1215 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Data.Common; +using System.Data.SQLite; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; +using GMap.NET; +using GMap.NET.GPS; +using GMap.NET.Internals; +using GMap.NET.WindowsForms; +using GMap.NET.WindowsForms.Markers; +using Microsoft.Win32; +using Microsoft.WindowsCE.Forms; +using GMap.NET.MapProviders; + +namespace Demo.WindowsMobile +{ + public partial class MainForm : Form + { + PointLatLng start = new PointLatLng(54.6961334816182, 25.2985095977783); + PointLatLng destinationPoint = new PointLatLng(54.6961334816182, 25.2985095977783); + + // marker + GMarkerCross gpsPos; + + // layers + GMapOverlay top; + internal GMapOverlay objects; + + #region -- variables -- + string LogDb; + SQLiteConnection cn; + DbCommand cmd; + DateTime LastFlush = DateTime.Now; + TimeSpan FlushDelay = TimeSpan.FromSeconds(60); + + readonly Gps gps = new Gps(); + GpsDeviceState device = null; + + int count = 0; + int countReal = 0; + double Total = 0; + + EventHandler updateDataHandler; + TimeSpan delay = TimeSpan.FromSeconds(1); + DateTime? TimeUTC; + double? Lat = 0; + double? Lng = 0; + double Delta = 0; + internal readonly List Satellites = new List(); + + IntPtr gpsPowerHandle = IntPtr.Zero; + + GPS pageGps; + Transport pageTransport; + Search pageSearch; + + readonly HookKeys hook = new HookKeys(); + #endregion + + public MainForm() + { + InitializeComponent(); + + pageGps = new GPS(this); + pageTransport = new Transport(this); + pageSearch = new Search(this); + +#if DEBUG + MainMap.Manager.Mode = AccessMode.ServerAndCache; + menuItemServerAndCache.Checked = true; + menuItemEnableGrid.Checked = true; + menuItemGPSenabled.Checked = false; + MainMap.ShowTileGridLines = true; +#else + menuItemGPSenabled.Checked = false; + MainMap.Manager.Mode = AccessMode.CacheOnly; + menuItemCacheOnly.Checked = true; +#endif + MainMap.MapProvider = GMapProviders.LithuaniaMap; + MainMap.MaxZoom = 11; + MainMap.MinZoom = 1; + MainMap.Zoom = MainMap.MinZoom + 1; + MainMap.Position = start; + + MainMap.OnMapTypeChanged += new MapTypeChanged(MainMap_OnMapTypeChanged); + MainMap.OnMapZoomChanged += new MapZoomChanged(MainMap_OnMapZoomChanged); + MainMap.OnPositionChanged += new PositionChanged(MainMap_OnPositionChanged); + + // add custom layers + { + objects = new GMapOverlay("objects"); + MainMap.Overlays.Add(objects); + + top = new GMapOverlay("top"); + MainMap.Overlays.Add(top); + } + + // gps pos + gpsPos = new GMarkerCross(MainMap.Position); + gpsPos.IsVisible = false; + top.Markers.Add(gpsPos); + +#if DEBUG + // transparent marker test + GMapMarkerTransparentGoogleGreen goo = new GMapMarkerTransparentGoogleGreen(MainMap.Position); + goo.ToolTipMode = MarkerTooltipMode.Always; + goo.ToolTipText = "Welcome to Lithuania! ;}"; + objects.Markers.Add(goo); +#endif + + // hook for volume up/down zooming + hook.HookEvent += new HookKeys.HookEventHandler(hook_HookEvent); + + // test performance + if(PerfTestEnabled) + { + timer.Interval = 111; + timer.Tick += new EventHandler(timer_Tick); + timer.Enabled = true; + } + } + + void MainMap_OnPositionChanged(PointLatLng point) + { + if(menuItemshowDestination.Checked && !menuItemGPSenabled.Checked) + { + UpdateDestinationRoute(true, menuItemSnapToGps.Checked ? MainMap.Position : gpsPos.Position); + } + } + + readonly IntPtr volumeUp = new IntPtr(257); + + bool hook_HookEvent(HookEventArgs e, KeyBoardInfo keyBoardInfo) + { + if(keyBoardInfo.vkCode == 117) + { + if(e.wParam == volumeUp) + { + MainMap.Zoom = (int) (MainMap.Zoom) + 1; + } + } + else if(keyBoardInfo.vkCode == 118) + { + if(e.wParam == volumeUp) + { + MainMap.Zoom = (int) (MainMap.Zoom) - 1; + } + } + return true; + } + + #region -- performance test-- + + bool PerfTestEnabled = false; + + double NextDouble(Random rng, double min, double max) + { + return min + (rng.NextDouble() * (max - min)); + } + + Random r = new Random(); + + int tt = 0; + void timer_Tick(object sender, EventArgs e) + { + var pos = new PointLatLng(NextDouble(r, MainMap.ViewArea.Top, MainMap.ViewArea.Bottom), NextDouble(r, MainMap.ViewArea.Left, MainMap.ViewArea.Right)); + GMapMarker m = new GMapMarkerGoogleGreen(pos); + { + m.ToolTipText = (tt++).ToString(); + m.ToolTipMode = MarkerTooltipMode.Always; + m.Offset = new System.Drawing.Point(-m.Size.Width, -m.Size.Height); + } + + objects.Markers.Add(m); + + if(tt >= 44) + { + timer.Enabled = false; + tt = 0; + } + } + + Timer timer = new Timer(); + #endregion + + public void ZoomToFitMarkers() + { + if(objects.Markers.Count > 0) + { + RectLatLng? m = MainMap.GetRectOfAllMarkers(null); + if(m.HasValue) + { + MainMap.SetZoomToFitRect(m.Value); + } + } + } + + void MainMap_OnMapZoomChanged() + { + this.Text = "GMap.NET: " + (int) MainMap.Zoom; + } + + void MainMap_OnMapTypeChanged(GMapProvider type) + { + //if(routes.Routes.Count > 0) + //{ + // MainMap.ZoomAndCenterRoutes(null); + //} + } + + private void menuItem3_Click(object sender, EventArgs e) + { + this.Close(); + } + + // zoom in + private void menuItem4_Click(object sender, EventArgs e) + { + MainMap.Zoom = (int) (MainMap.Zoom) + 1; + } + + // zoom out + private void menuItem5_Click(object sender, EventArgs e) + { + MainMap.Zoom = (int) (MainMap.Zoom) - 1; + } + + private void menuItem15_Click(object sender, EventArgs e) + { + MainMap.MapProvider = GMapProviders.LithuaniaOrtoFotoMap; + } + + private void menuItem10_Click(object sender, EventArgs e) + { + MainMap.MapProvider = GMapProviders.GoogleHybridMap; + } + + private void menuItem12_Click(object sender, EventArgs e) + { + MainMap.MapProvider = GMapProviders.OpenStreetMap; + } + + private void menuItem22_Click(object sender, EventArgs e) + { + //MainMap.MapProvider = GMapProviders.OpenStreetMapSurfer; + } + + private void menuItem23_Click(object sender, EventArgs e) + { + //MainMap.MapProvider = GMapProviders.OpenStreetOsm; + } + + private void menuItem9_Click(object sender, EventArgs e) + { + MainMap.MapProvider = GMapProviders.GoogleMap; + } + + private void menuItem16_Click(object sender, EventArgs e) + { + MainMap.MapProvider = GMapProviders.BingMap; + } + + private void menuItem18_Click(object sender, EventArgs e) + { + MainMap.MapProvider = GMapProviders.BingHybridMap; + } + + private void menuItem20_Click(object sender, EventArgs e) + { + MainMap.MapProvider = GMapProviders.YahooMap; + } + + private void menuItem21_Click(object sender, EventArgs e) + { + MainMap.MapProvider = GMapProviders.YahooHybridMap; + } + + private void menuItem14_Click(object sender, EventArgs e) + { + MainMap.MapProvider = GMapProviders.LithuaniaMap; + } + + private void menuItem25_Click(object sender, EventArgs e) + { + MainMap.MapProvider = GMapProviders.ArcGIS_World_Topo_Map; + } + + private void menuItem26_Click(object sender, EventArgs e) + { + MainMap.MapProvider = GMapProviders.ArcGIS_World_Physical_Map; + } + + private void menuItem27_Click(object sender, EventArgs e) + { + MainMap.ReloadMap(); + } + + private void menuItemCacheOnly_Click(object sender, EventArgs e) + { + MainMap.Manager.Mode = AccessMode.CacheOnly; + menuItemCacheOnly.Checked = true; + menuItemServerAndCache.Checked = false; + menuItemServerOnly.Checked = false; + } + + private void menuItemServerAndCache_Click(object sender, EventArgs e) + { + MainMap.Manager.Mode = AccessMode.ServerAndCache; + menuItemServerAndCache.Checked = true; + menuItemCacheOnly.Checked = false; + menuItemServerOnly.Checked = false; + } + + private void menuItemServerOnly_Click(object sender, EventArgs e) + { + MainMap.Manager.Mode = AccessMode.ServerOnly; + menuItemServerOnly.Checked = true; + menuItemServerAndCache.Checked = false; + menuItemCacheOnly.Checked = false; + } + + private void menuItemGPSenabled_Click(object sender, EventArgs e) + { + menuItemGPSenabled.Checked = !menuItemGPSenabled.Checked; + + if(!menuItemGPSenabled.Checked) + { + if(gps.Opened) + { + gps.Close(); + SetOffGPSPower(); + } + + count = 0; + countReal = 0; + Total = 0; + { + TimeUTC = null; + Lat = null; + Lng = null; + Delta = 0; + } + lock(Satellites) + { + Satellites.Clear(); + Satellites.TrimExcess(); + } + + if(Controls.Contains(pageGps)) + { + pageGps.panelSignals.Invalidate(); + } + + TryCommitData(); + + gpsPos.Pen.Color = Color.Blue; + } + else // start tracking + { + gpsPos.Pen.Color = Color.Red; + gpsPos.IsVisible = true; + + if(!gps.Opened) + { + gps.Open(); + SetOnGPSPower(); + } + } + } + + public new void Hide() + { + Native.ShowWindow(this.Handle, Native.SW_MINIMIZED); + timerKeeperOfLife.Enabled = false; + IsVisible = false; + + hook.Stop(); + } + + object visibleLock = new object(); + bool visible = true; + public bool IsVisible + { + get + { + lock(visibleLock) + { + return visible; + } + } + set + { + lock(visibleLock) + { + visible = value; + } + } + } + + public bool AddToLogCurrentInfo(GpsPosition data) + { + if(string.IsNullOrEmpty(LogDb)) + { + return false; + } + + bool ret = true; + try + { + { + if(cmd.Transaction == null) + { + cmd.Transaction = cn.BeginTransaction(IsolationLevel.Serializable); + Debug.WriteLine("BeginTransaction: " + DateTime.Now.ToLongTimeString()); + } + + cmd.Parameters["@p1"].Value = data.Time.Value; + cmd.Parameters["@p2"].Value = countReal++; + cmd.Parameters["@p3"].Value = Delta; + cmd.Parameters["@p4"].Value = data.Speed; + cmd.Parameters["@p5"].Value = data.SeaLevelAltitude; + cmd.Parameters["@p6"].Value = data.EllipsoidAltitude; + cmd.Parameters["@p7"].Value = (short?) data.SatellitesInViewCount; + cmd.Parameters["@p8"].Value = (short?) data.SatelliteCount; + cmd.Parameters["@p9"].Value = data.Latitude.Value; + cmd.Parameters["@p10"].Value = data.Longitude.Value; + cmd.Parameters["@p11"].Value = data.PositionDilutionOfPrecision; + cmd.Parameters["@p12"].Value = data.HorizontalDilutionOfPrecision; + cmd.Parameters["@p13"].Value = data.VerticalDilutionOfPrecision; + cmd.Parameters["@p14"].Value = (byte) data.FixQuality; + cmd.Parameters["@p15"].Value = (byte) data.FixType; + cmd.Parameters["@p16"].Value = (byte) data.FixSelection; + + cmd.ExecuteNonQuery(); + } + + if(DateTime.Now - LastFlush >= FlushDelay) + { + TryCommitData(); + } + } + catch(Exception ex) + { + Debug.WriteLine("AddToLog: " + ex.ToString()); + ret = false; + } + + return ret; + } + + void TryCommitData() + { + try + { + if(cmd.Transaction != null) + { + using(cmd.Transaction) + { + cmd.Transaction.Commit(); + LastFlush = DateTime.Now; + } + cmd.Transaction = null; + Debug.WriteLine("TryCommitData: OK " + LastFlush.ToLongTimeString()); + } + } + catch(Exception ex) + { + Debug.WriteLine("TryCommitData: " + ex.ToString()); + } + } + + public bool CheckLogDb(string file) + { + bool ret = true; + + try + { + string dir = Path.GetDirectoryName(file); + if(!Directory.Exists(dir)) + { + Directory.CreateDirectory(dir); + } + + cn = new SQLiteConnection(); + { + cn.ConnectionString = string.Format("Data Source=\"{0}\";FailIfMissing=False;", file); + cn.Open(); + { + using(DbTransaction tr = cn.BeginTransaction()) + { + try + { + using(DbCommand cmd = cn.CreateCommand()) + { + cmd.Transaction = tr; + cmd.CommandText = @"CREATE TABLE IF NOT EXISTS GPS (id INTEGER NOT NULL PRIMARY KEY, + TimeUTC DATETIME NOT NULL, + SessionCounter INTEGER NOT NULL, + Delta DOUBLE, + Speed DOUBLE, + SeaLevelAltitude DOUBLE, + EllipsoidAltitude DOUBLE, + SatellitesInView TINYINT, + SatelliteCount TINYINT, + Lat DOUBLE NOT NULL, + Lng DOUBLE NOT NULL, + PositionDilutionOfPrecision DOUBLE, + HorizontalDilutionOfPrecision DOUBLE, + VerticalDilutionOfPrecision DOUBLE, + FixQuality TINYINT NOT NULL, + FixType TINYINT NOT NULL, + FixSelection TINYINT NOT NULL); + CREATE INDEX IF NOT EXISTS IndexOfGPS ON GPS (TimeUTC, PositionDilutionOfPrecision);"; + cmd.ExecuteNonQuery(); + } + + this.cmd = cn.CreateCommand(); + { + cmd.CommandText = @"INSERT INTO GPS + (TimeUTC, + SessionCounter, + Delta, + Speed, + SeaLevelAltitude, + EllipsoidAltitude, + SatellitesInView, + SatelliteCount, + Lat, + Lng, + PositionDilutionOfPrecision, + HorizontalDilutionOfPrecision, + VerticalDilutionOfPrecision, + FixQuality, + FixType, + FixSelection) VALUES(@p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16);"; + + cmd.Parameters.Add(new SQLiteParameter("@p1")); + cmd.Parameters.Add(new SQLiteParameter("@p2")); + cmd.Parameters.Add(new SQLiteParameter("@p3")); + cmd.Parameters.Add(new SQLiteParameter("@p4")); + cmd.Parameters.Add(new SQLiteParameter("@p5")); + cmd.Parameters.Add(new SQLiteParameter("@p6")); + cmd.Parameters.Add(new SQLiteParameter("@p7")); + cmd.Parameters.Add(new SQLiteParameter("@p8")); + cmd.Parameters.Add(new SQLiteParameter("@p9")); + cmd.Parameters.Add(new SQLiteParameter("@p10")); + cmd.Parameters.Add(new SQLiteParameter("@p11")); + cmd.Parameters.Add(new SQLiteParameter("@p12")); + cmd.Parameters.Add(new SQLiteParameter("@p13")); + cmd.Parameters.Add(new SQLiteParameter("@p14")); + cmd.Parameters.Add(new SQLiteParameter("@p15")); + cmd.Parameters.Add(new SQLiteParameter("@p16")); + cmd.Prepare(); + } + + tr.Commit(); + } + catch + { + tr.Rollback(); + ret = false; + } + } + } + } + } + catch(Exception ex) + { + if(cn != null) + { + cn.Dispose(); + cn = null; + } + if(cmd != null) + { + cmd.Dispose(); + cmd = null; + } + Debug.WriteLine("CreateEmptyDB: " + ex.ToString()); + ret = false; + } + + if(ret) + { + LogDb = file; + } + else + { + LogDb = null; + } + + return ret; + } + + private void MainForm_Load(object sender, EventArgs e) + { + updateDataHandler = new EventHandler(UpdateData); + + gps.DeviceStateChanged += new DeviceStateChangedEventHandler(gps_DeviceStateChanged); + gps.LocationChanged += new LocationChangedEventHandler(gps_LocationChanged); + + string sd = Native.GetRemovableStorageDirectory(); + if(!string.IsNullOrEmpty(sd)) + { + var fileName = sd + Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar + "log.gpsd"; + { + CheckLogDb(fileName); + } + } + + timerKeeperOfLife.Interval = ShortestTimeoutInterval() * 1000; + timerKeeperOfLife.Enabled = true; + + if(menuItemGPSenabled.Checked) + { + if(!gps.Opened) + { + gps.Open(); + gpsPos.Pen.Color = Color.Red; + gpsPos.IsVisible = true; + + SetOnGPSPower(); + } + } + else + { + gpsPos.Pen.Color = Color.Blue; + gpsPos.IsVisible = false; + } + + try + { + // Config AutoRotate + { + using(RegistryKey Config = Registry.CurrentUser.OpenSubKey(@"Software\HTC\HTCSENSOR\GSensor\ModuleName", true)) + { + if(Config != null) + { + string gmapnet = Config.GetValue("GMapNET", null) as string; + if(string.IsNullOrEmpty(gmapnet)) + { + Config.SetValue("GMapNET", @"\Program files\gmap.net\GMap.NET.exe"); + } + } + } + + using(RegistryKey Config = Registry.CurrentUser.OpenSubKey(@"Software\HTC\HTCSENSOR\GSensor\WhiteList", true)) + { + if(Config != null) + { + string gmapnet = Config.GetValue("GMapNET", null) as string; + if(string.IsNullOrEmpty(gmapnet)) + { + Config.SetValue("GMapNET", "#NETCF_AGL_BASE_"); + } + } + } + } + } + catch(Exception ex) + { + Debug.WriteLine(ex.ToString()); + } + } + + void gps_LocationChanged(object sender, GpsPosition position) + { + try + { + if(position != null) + { + count++; + + //Debug.WriteLine("LocationChanged: " + DateTime.Now.ToLongTimeString() + " -> " + count); + + if(position.Time.HasValue && position.Latitude.HasValue && position.Longitude.HasValue) + { + //Debug.WriteLine("Location: " + position.Latitude.Value + "|" + position.Longitude.Value); + + // first time + if(!TimeUTC.HasValue) + { + TimeUTC = position.Time; + Lat = position.Latitude; + Lng = position.Longitude; + } + + if(TimeUTC.HasValue && position.Time - TimeUTC.Value >= delay) + { + Delta = gps.GetDistance(position.Latitude.Value, position.Longitude.Value, Lat.Value, Lng.Value); + Total += Delta; + Lat = position.Latitude; + Lng = position.Longitude; + TimeUTC = position.Time; + + AddToLogCurrentInfo(position); + } + } + else + { + Lat = position.Latitude; + Lng = position.Longitude; + TimeUTC = position.Time; + } + + // do not update if user is idling + if(IsVisible) + { + lock(Satellites) + { + Satellites.Clear(); + Satellites.AddRange(position.GetSatellitesInView()); + Satellites.TrimExcess(); + } + + Invoke(updateDataHandler, position); + } + } + } + catch(Exception ex) + { + Debug.WriteLine("gps_LocationChanged: " + ex); + } + } + + void gps_DeviceStateChanged(object sender, GpsDeviceState args) + { + device = args; + + if(IsVisible) + { + Invoke(updateDataHandler); + } + } + + private void MainForm_Closed(object sender, EventArgs e) + { + hook.Stop(); + + if(gps.Opened) + { + gps.Close(); + } + + SetOffGPSPower(); + + if(cn != null) + { + TryCommitData(); + + if(cn.State == ConnectionState.Open) + { + cn.Close(); + } + cn.Dispose(); + cn = null; + } + if(cmd != null) + { + cmd.Dispose(); + cmd = null; + } + } + + void SetOnGPSPower() + { + // Keep the GPS and device alive + bool power = Native.PowerPolicyNotify(Native.PPN_UNATTENDEDMODE, true); + if(!power) + { + Debug.WriteLine("PowerPolicyNotify failed for PPN_UNATTENDEDMODE"); + } + else + { + if(gpsPowerHandle == IntPtr.Zero) + { + gpsPowerHandle = Native.SetPowerRequirement("gps0:", Native.CedevicePowerStateState.D0, Native.POWER_NAME | Native.POWER_FORCE, null, 0); + if(gpsPowerHandle == IntPtr.Zero) + { + Debug.WriteLine("SetPowerRequirement failed for GPS"); + } + } + } + } + + void SetOffGPSPower() + { + if(gpsPowerHandle != IntPtr.Zero) + { + Native.ReleasePowerRequirement(gpsPowerHandle); + gpsPowerHandle = IntPtr.Zero; + } + Native.PowerPolicyNotify(Native.PPN_UNATTENDEDMODE, false); + } + + ~MainForm() + { + MainForm_Closed(null, null); + } + + void UpdateData(object sender, System.EventArgs args) + { + try + { + var lastData = sender as GpsPosition; + + // update signals + if(Controls.Contains(pageGps)) + { + pageGps.panelSignals.Invalidate(); + + string str = Environment.NewLine; + + str += "GPS: " + device.DeviceState + ", Driver: " + device.ServiceState + ", " + count + " | " + countReal + "\n"; + + if(lastData != null) + { + if(lastData.Time.HasValue && lastData.Longitude.HasValue && lastData.Longitude.HasValue) + { + int deltaClock = ((int) (DateTime.UtcNow - lastData.Time.Value).TotalSeconds); + + str += "Time(UTC): " + lastData.Time.Value.ToLongTimeString() + ", delay: " + deltaClock + "s \n"; + str += "Delta: " + string.Format("{0:0.00}m, total: {1:0.00km}\n", Delta * 1000.0, Total); + str += "Latitude: " + lastData.Latitude.Value + "\n"; + str += "Longitude: " + lastData.Longitude.Value + "\n\n"; + + if(Math.Abs(deltaClock) > 5) // 5s + { + UpdateTime(lastData.Time.Value); + } + } + else + { + str += "Time(UTC): -" + "\n"; + str += "Delta: - \n"; + str += "Latitude: -" + "\n"; + str += "Longitude: -" + "\n\n"; + } + + if(lastData.Speed.HasValue) + { + str += "Speed: " + string.Format("{0:0.0}km/h | {1:0.0}m/s, head: {2}\n", lastData.Speed, lastData.Speed / 3.6, (int) (lastData.Heading.HasValue ? lastData.Heading.Value : 0)); + } + else + { + str += "Speed: -\n"; + } + + if(lastData.SeaLevelAltitude.HasValue) + { + str += "SeaLevelAltitude: " + string.Format("{0:0.00}m\n", lastData.SeaLevelAltitude); + } + else + { + str += "SeaLevelAltitude: -\n"; + } + + if(lastData.PositionDilutionOfPrecision.HasValue) + { + str += "PositionDilutionOfPrecision: " + string.Format("{0:0.00}\n", lastData.PositionDilutionOfPrecision); + } + else + { + str += "PositionDilutionOfPrecision: -\n"; + } + + if(lastData.HorizontalDilutionOfPrecision.HasValue) + { + str += "HorizontalDilutionOfPrecision: " + string.Format("{0:0.00}\n", lastData.HorizontalDilutionOfPrecision); + } + else + { + str += "HorizontalDilutionOfPrecision: -\n"; + } + + if(lastData.VerticalDilutionOfPrecision.HasValue) + { + str += "VerticalDilutionOfPrecision: " + string.Format("{0:0.00}\n", lastData.VerticalDilutionOfPrecision); + } + else + { + str += "VerticalDilutionOfPrecision: -\n"; + } + + if(lastData.SatellitesInViewCount.HasValue) + { + str += "SatellitesInView: " + lastData.SatellitesInViewCount + "\n"; + } + else + { + str += "SatellitesInView: -" + "\n"; + } + + if(lastData.SatelliteCount.HasValue) + { + str += "SatelliteCount: " + lastData.SatelliteCount + "\n"; + } + else + { + str += "SatelliteCount: -" + "\n"; + } + } + pageGps.status.Text = str; + } + else if(Controls.Contains(MainMap)) + { + if(lastData != null) + { + if(lastData.Time.HasValue && lastData.Longitude.HasValue && lastData.Longitude.HasValue) + { + // center map + if(menuItemGPSenabled.Checked) + { + if(menuItemSnapToGps.Checked && !MainMap.IsDragging) + { + var newPos = new PointLatLng(lastData.Latitude.Value, lastData.Longitude.Value); + + if(menuItemshowDestination.Checked) + { + UpdateDestinationRoute(false, newPos); + } + + MainMap.Position = newPos; + } + else + { + gpsPos.Position = new PointLatLng(lastData.Latitude.Value, lastData.Longitude.Value); + + if(menuItemshowDestination.Checked) + { + UpdateDestinationRoute(true, gpsPos.Position); + } + } + } + } + } + } + } + catch(Exception ex) + { + pageGps.status.Text = "\n" + ex.ToString(); + } + } + + int ShortestTimeoutInterval() + { + int retVal = 1000; + + try + { + RegistryKey key = Registry.LocalMachine.OpenSubKey(@"\SYSTEM\CurrentControlSet\Control\Power"); + object oBatteryTimeout = key.GetValue("BattPowerOff"); + object oACTimeOut = key.GetValue("ExtPowerOff"); + object oScreenPowerOff = key.GetValue("ScreenPowerOff"); + key.Close(); + + if(oBatteryTimeout is int) + { + int v = (int) oBatteryTimeout; + if(v > 0) + retVal = Math.Min(retVal, v); + } + if(oACTimeOut is int) + { + int v = (int) oACTimeOut; + if(v > 0) + retVal = Math.Min(retVal, v); + } + if(oScreenPowerOff is int) + { + int v = (int) oScreenPowerOff; + if(v > 0) + retVal = Math.Min(retVal, v); + } + } + catch(Exception ex) + { + Debug.WriteLine("ShortestTimeoutInterval: " + ex.ToString()); + } + + return retVal * 9 / 10; + } + + private void menuItemEnableGrid_Click(object sender, EventArgs e) + { + menuItemEnableGrid.Checked = !menuItemEnableGrid.Checked; + MainMap.ShowTileGridLines = menuItemEnableGrid.Checked; + } + + private void timerKeeperOfLife_Tick(object sender, EventArgs e) + { + Native.SystemIdleTimerReset(); + } + + private void menuItemDisableAutoSleep_Click(object sender, EventArgs e) + { + menuItemDisableAutoSleep.Checked = !menuItemDisableAutoSleep.Checked; + timerKeeperOfLife.Enabled = menuItemDisableAutoSleep.Checked; + } + + private void MainForm_Activated(object sender, EventArgs e) + { + timerKeeperOfLife.Enabled = menuItemDisableAutoSleep.Checked; + IsVisible = true; + hook.Start(); + } + + private void menuItem32_Click(object sender, EventArgs e) + { + this.Hide(); + } + + internal void menuItemGotoMap_Click(object sender, EventArgs e) + { + menuItemGotoMap.Checked = true; + menuItemGotoGps.Checked = false; + menuItemGotoTransport.Checked = false; + menuItemSearch.Checked = false; + + this.SuspendLayout(); + this.Controls.Clear(); + this.Controls.Add(this.MainMap); + this.ResumeLayout(false); + } + + private void menuItemGotoGps_Click(object sender, EventArgs e) + { + menuItemGotoGps.Checked = true; + menuItemGotoTransport.Checked = false; + menuItemGotoMap.Checked = false; + menuItemSearch.Checked = false; + + this.SuspendLayout(); + this.Controls.Clear(); + this.pageGps.Dock = DockStyle.Fill; + this.Controls.Add(pageGps); + this.ResumeLayout(false); + + pageGps.panelSignals.Invalidate(); + } + + internal void menuItemGotoTransport_Click(object sender, EventArgs e) + { + menuItemGotoTransport.Checked = true; + menuItemGotoMap.Checked = false; + menuItemGotoGps.Checked = false; + menuItemSearch.Checked = false; + + this.SuspendLayout(); + this.Controls.Clear(); + this.pageTransport.Dock = DockStyle.Fill; + this.Controls.Add(pageTransport); + this.ResumeLayout(false); + } + + private void menuItemSearch_Click(object sender, EventArgs e) + { + menuItemSearch.Checked = true; + menuItemGotoTransport.Checked = false; + menuItemGotoMap.Checked = false; + menuItemGotoGps.Checked = false; + + this.SuspendLayout(); + this.Controls.Clear(); + this.pageSearch.Dock = DockStyle.Fill; + this.Controls.Add(pageSearch); + this.ResumeLayout(false); + } + + private void menuItem35_Click(object sender, EventArgs e) + { + ZoomToFitMarkers(); + } + + private void menuItem31_Click(object sender, EventArgs e) + { + MainMap.Zoom = MainMap.MinZoom; + } + + private void menuItem33_Click(object sender, EventArgs e) + { + MainMap.Zoom = MainMap.MaxZoom; + } + + // clear markers + private void menuItem37_Click(object sender, EventArgs e) + { + objects.Markers.Clear(); + } + + private struct SYSTEMTIME + { + public short Year; + public short Month; + public short DayOfWeek; + public short Day; + public short Hour; + public short Minute; + public short Second; + public short Milliseconds; + } + + [DllImport("coredll.dll")] + private static extern bool SetSystemTime(ref SYSTEMTIME time); + + private void UpdateTime(DateTime gpsTime) + { + SYSTEMTIME s = new SYSTEMTIME(); + s.Year = (short) gpsTime.Year; + s.Month = (short) gpsTime.Month; + s.DayOfWeek = (short) gpsTime.DayOfWeek; + s.Day = (short) gpsTime.Day; + s.Hour = (short) gpsTime.Hour; + s.Minute = (short) gpsTime.Minute; + s.Second = (short) gpsTime.Second; + s.Milliseconds = (short) gpsTime.Millisecond; + + bool t = SetSystemTime(ref s); + Debug.WriteLine("SetSystemTime: " + t); + } + + private void menuItemSnapToGps_Click(object sender, EventArgs e) + { + menuItemSnapToGps.Checked = !menuItemSnapToGps.Checked; + if(!menuItemSnapToGps.Checked) + { + gpsPos.Position = MainMap.Position; + } + } + + private void menuItemSetDestination_Click(object sender, EventArgs e) + { + { + destinationPoint = MainMap.Position; + + if(menuItemshowDestination.Checked) + { + UpdateDestinationRoute(true, menuItemSnapToGps.Checked ? MainMap.Position : gpsPos.Position); + } + } + } + + internal GMapRoute destinationRoute; + + private void menuItemshowDestination_Click(object sender, EventArgs e) + { + menuItemshowDestination.Checked = !menuItemshowDestination.Checked; + + if(menuItemshowDestination.Checked) + { + if(MainMap.panel == null) + { + MainMap.panel = this; + } + UpdateDestinationRoute(true, menuItemSnapToGps.Checked ? MainMap.Position : gpsPos.Position); + } + + if(destinationRoute != null) + { + destinationRoute.IsVisible = menuItemshowDestination.Checked; + } + } + + void UpdateDestinationRoute(bool forceUpdate, PointLatLng startPoint) + { + if(destinationRoute == null) + { + destinationRoute = new GMapRoute("destination route"); + + destinationRoute.Stroke.Color = Color.Red; + destinationRoute.Stroke.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + destinationRoute.Stroke.Width = 1.0f; + + objects.Routes.Add(destinationRoute); + } + else + { + destinationRoute.Points.Clear(); + } + + destinationRoute.Points.Add(startPoint); + destinationRoute.Points.Add(destinationPoint); + if(forceUpdate) + { + MainMap.UpdateRouteLocalPosition(destinationRoute); + MainMap.Invalidate(); + } + } + } + + public class Map : GMapControl + { + readonly Brush screenBrush = new SolidBrush(Color.Navy); + readonly Font screenFont = new Font(FontFamily.GenericSansSerif, 7, FontStyle.Regular); + + public MainForm panel; + + protected override void OnPaintOverlays(Graphics g) + { + base.OnPaintOverlays(g); + + if(panel != null && panel.menuItemshowDestination.Checked) + { + g.DrawString(string.Format("destination: {0:0.00} km", panel.destinationRoute.Distance), screenFont, screenBrush, screenFont.Size, screenFont.Size); + } + } + } +} \ No newline at end of file diff --git a/Demo.WindowsMobile/Forms/MainForm.resx b/Demo.WindowsMobile/Forms/MainForm.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/MainForm.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 151, 17 + + + Pocket_PC_Phone_VGA + + + Pocket_PC_Phone_VGA + + + False + + \ No newline at end of file diff --git a/Demo.WindowsMobile/Forms/Search.cs b/Demo.WindowsMobile/Forms/Search.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/Search.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using GMap.NET; +using GMap.NET.WindowsForms; +using GMap.NET.WindowsForms.Markers; +using GMap.NET.MapProviders; + +namespace Demo.WindowsMobile +{ + public partial class Search : UserControl + { + MainForm Main; + + public Search(MainForm main) + { + InitializeComponent(); + Main = main; + } + + private void button1_Click(object sender, EventArgs e) + { + try + { + GeoCoderStatusCode status = GeoCoderStatusCode.Unknow; + { + PointLatLng? pos = GMapProviders.GoogleMap.GetPoint(textAddress.Text, out status); + if(pos != null && status == GeoCoderStatusCode.G_GEO_SUCCESS) + { + GMapMarker address = new GMapMarkerTransparentGoogleGreen(pos.Value); + address.ToolTipMode = MarkerTooltipMode.Always; + address.ToolTipText = textAddress.Text; + Main.objects.Markers.Add(address); + + Main.MainMap.Position = address.Position; + Main.menuItemGotoMap_Click(null, null); + } + else + { + labelstatus.Text = status.ToString(); + } + } + } + catch(Exception ex) + { + labelstatus.Text = ex.ToString(); + } + } + } +} diff --git a/Demo.WindowsMobile/Forms/Search.designer.cs b/Demo.WindowsMobile/Forms/Search.designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/Search.designer.cs @@ -0,0 +1,89 @@ +namespace Demo.WindowsMobile +{ + partial class Search + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.textAddress = new System.Windows.Forms.TextBox(); + this.labelstatus = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // textAddress + // + this.textAddress.BackColor = System.Drawing.Color.Navy; + this.textAddress.Dock = System.Windows.Forms.DockStyle.Top; + this.textAddress.Font = new System.Drawing.Font("Tahoma", 22F, System.Drawing.FontStyle.Regular); + this.textAddress.ForeColor = System.Drawing.Color.AliceBlue; + this.textAddress.Location = new System.Drawing.Point(0, 0); + this.textAddress.Multiline = true; + this.textAddress.Name = "textAddress"; + this.textAddress.Size = new System.Drawing.Size(239, 199); + this.textAddress.TabIndex = 4; + this.textAddress.Text = "Lithuania, Vilnius"; + // + // labelstatus + // + this.labelstatus.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelstatus.Location = new System.Drawing.Point(0, 199); + this.labelstatus.Name = "labelstatus"; + this.labelstatus.Size = new System.Drawing.Size(239, 127); + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles) (((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.button1.BackColor = System.Drawing.Color.Blue; + this.button1.ForeColor = System.Drawing.Color.White; + this.button1.Location = new System.Drawing.Point(19, 242); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(197, 53); + this.button1.TabIndex = 7; + this.button1.Text = "Search Address"; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // Search + // + this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.Controls.Add(this.button1); + this.Controls.Add(this.labelstatus); + this.Controls.Add(this.textAddress); + this.Name = "Search"; + this.Size = new System.Drawing.Size(239, 326); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TextBox textAddress; + private System.Windows.Forms.Label labelstatus; + private System.Windows.Forms.Button button1; + + } +} diff --git a/Demo.WindowsMobile/Forms/Search.resx b/Demo.WindowsMobile/Forms/Search.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/Search.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Pocket_PC_Phone + + + Pocket_PC_Phone + + \ No newline at end of file diff --git a/Demo.WindowsMobile/Forms/Transport.Designer.cs b/Demo.WindowsMobile/Forms/Transport.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/Transport.Designer.cs @@ -0,0 +1,155 @@ +namespace Demo.WindowsMobile +{ + partial class Transport + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.textBoxTrolley = new System.Windows.Forms.TextBox(); + this.checkBoxTrolley = new System.Windows.Forms.CheckBox(); + this.checkBoxBus = new System.Windows.Forms.CheckBox(); + this.textBoxBus = new System.Windows.Forms.TextBox(); + this.checkBoxRefresh = new System.Windows.Forms.CheckBox(); + this.timerRefresh = new System.Windows.Forms.Timer(); + this.labelstatus = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // textBoxTrolley + // + this.textBoxTrolley.BackColor = System.Drawing.Color.Navy; + this.textBoxTrolley.Dock = System.Windows.Forms.DockStyle.Top; + this.textBoxTrolley.Font = new System.Drawing.Font("Tahoma", 26F, System.Drawing.FontStyle.Regular); + this.textBoxTrolley.ForeColor = System.Drawing.Color.AliceBlue; + this.textBoxTrolley.Location = new System.Drawing.Point(0, 48); + this.textBoxTrolley.Name = "textBoxTrolley"; + this.textBoxTrolley.Size = new System.Drawing.Size(310, 59); + this.textBoxTrolley.TabIndex = 0; + this.textBoxTrolley.Text = "13,17"; + // + // checkBoxTrolley + // + this.checkBoxTrolley.Checked = true; + this.checkBoxTrolley.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxTrolley.Dock = System.Windows.Forms.DockStyle.Top; + this.checkBoxTrolley.Font = new System.Drawing.Font("Tahoma", 18F, System.Drawing.FontStyle.Regular); + this.checkBoxTrolley.Location = new System.Drawing.Point(0, 0); + this.checkBoxTrolley.Name = "checkBoxTrolley"; + this.checkBoxTrolley.Size = new System.Drawing.Size(310, 48); + this.checkBoxTrolley.TabIndex = 2; + this.checkBoxTrolley.Text = "Trolley"; + this.checkBoxTrolley.CheckStateChanged += new System.EventHandler(this.checkBoxTrolley_CheckStateChanged); + // + // checkBoxBus + // + this.checkBoxBus.Dock = System.Windows.Forms.DockStyle.Top; + this.checkBoxBus.Font = new System.Drawing.Font("Tahoma", 18F, System.Drawing.FontStyle.Regular); + this.checkBoxBus.Location = new System.Drawing.Point(0, 107); + this.checkBoxBus.Name = "checkBoxBus"; + this.checkBoxBus.Size = new System.Drawing.Size(310, 48); + this.checkBoxBus.TabIndex = 5; + this.checkBoxBus.Text = "Bus"; + this.checkBoxBus.CheckStateChanged += new System.EventHandler(this.checkBoxBus_CheckStateChanged); + // + // textBoxBus + // + this.textBoxBus.BackColor = System.Drawing.Color.Navy; + this.textBoxBus.Dock = System.Windows.Forms.DockStyle.Top; + this.textBoxBus.Font = new System.Drawing.Font("Tahoma", 26F, System.Drawing.FontStyle.Regular); + this.textBoxBus.ForeColor = System.Drawing.Color.AliceBlue; + this.textBoxBus.Location = new System.Drawing.Point(0, 155); + this.textBoxBus.Name = "textBoxBus"; + this.textBoxBus.Size = new System.Drawing.Size(310, 59); + this.textBoxBus.TabIndex = 4; + this.textBoxBus.Text = "50"; + // + // checkBoxRefresh + // + this.checkBoxRefresh.BackColor = System.Drawing.Color.Navy; + this.checkBoxRefresh.Dock = System.Windows.Forms.DockStyle.Bottom; + this.checkBoxRefresh.Font = new System.Drawing.Font("Tahoma", 16F, System.Drawing.FontStyle.Regular); + this.checkBoxRefresh.ForeColor = System.Drawing.Color.Lime; + this.checkBoxRefresh.Location = new System.Drawing.Point(0, 388); + this.checkBoxRefresh.Name = "checkBoxRefresh"; + this.checkBoxRefresh.Size = new System.Drawing.Size(310, 59); + this.checkBoxRefresh.TabIndex = 6; + this.checkBoxRefresh.Text = "AutoRefresh 15s"; + this.checkBoxRefresh.CheckStateChanged += new System.EventHandler(this.checkBoxRefresh_CheckStateChanged); + // + // timerRefresh + // + this.timerRefresh.Interval = 15000; + this.timerRefresh.Tick += new System.EventHandler(this.timerRefresh_Tick); + // + // labelstatus + // + this.labelstatus.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelstatus.Location = new System.Drawing.Point(0, 214); + this.labelstatus.Name = "labelstatus"; + this.labelstatus.Size = new System.Drawing.Size(310, 174); + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button1.BackColor = System.Drawing.Color.Blue; + this.button1.ForeColor = System.Drawing.Color.White; + this.button1.Location = new System.Drawing.Point(237, 391); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(70, 53); + this.button1.TabIndex = 7; + this.button1.Text = "Manual"; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // Transport + // + this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.Controls.Add(this.button1); + this.Controls.Add(this.labelstatus); + this.Controls.Add(this.textBoxBus); + this.Controls.Add(this.checkBoxBus); + this.Controls.Add(this.textBoxTrolley); + this.Controls.Add(this.checkBoxTrolley); + this.Controls.Add(this.checkBoxRefresh); + this.Name = "Transport"; + this.Size = new System.Drawing.Size(310, 447); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TextBox textBoxTrolley; + private System.Windows.Forms.CheckBox checkBoxTrolley; + private System.Windows.Forms.CheckBox checkBoxBus; + private System.Windows.Forms.TextBox textBoxBus; + private System.Windows.Forms.CheckBox checkBoxRefresh; + private System.Windows.Forms.Timer timerRefresh; + private System.Windows.Forms.Label labelstatus; + private System.Windows.Forms.Button button1; + + } +} diff --git a/Demo.WindowsMobile/Forms/Transport.cs b/Demo.WindowsMobile/Forms/Transport.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/Transport.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using GMap.NET; +using GMap.NET.WindowsForms; +using GMap.NET.WindowsForms.Markers; +using Demo.WindowsForms; +using System.Linq; +using System.IO; + +namespace Demo.WindowsMobile +{ + public partial class Transport : UserControl + { + MainForm Main; + int Count = 0; + + readonly List Bus = new List(); + readonly List Trolley = new List(); + + readonly List BusMarkers = new List(); + readonly List TrolleyMarkers = new List(); + + public Transport(MainForm main) + { + InitializeComponent(); + Main = main; + } + + private void checkBoxRefresh_CheckStateChanged(object sender, EventArgs e) + { + timerRefresh.Enabled = checkBoxRefresh.Checked; + labelstatus.Text = string.Empty; + Count = 0; + } + + private void checkBoxBus_CheckStateChanged(object sender, EventArgs e) + { + if(!checkBoxBus.Checked) + { + foreach(var b in BusMarkers) + { + Main.objects.Markers.Remove(b); + } + } + } + + private void checkBoxTrolley_CheckStateChanged(object sender, EventArgs e) + { + if(!checkBoxTrolley.Checked) + { + foreach(var b in TrolleyMarkers) + { + Main.objects.Markers.Remove(b); + } + } + } + + // update data + private void timerRefresh_Tick(object sender, EventArgs e) + { + timerRefresh.Enabled = false; + + try + { + DateTime tstart = DateTime.Now; + { + if(checkBoxBus.Checked) + { + foreach(var b in BusMarkers) + { + Main.objects.Markers.Remove(b); + } + + Stuff.GetVilniusTransportData(TransportType.Bus, textBoxBus.Text, Bus); + + foreach(var t in Bus) + { + if (textBoxBus.Text.Split(',').Contains(t.Line)) + { + var r = new GMapMarkerTransparent(new PointLatLng(t.Lat, t.Lng)); + { + r.ToolTipMode = MarkerTooltipMode.Always; + r.ToolTipText = "B " + t.Id + Environment.NewLine + t.Line + " @ " + t.Time; + r.Data = t; + } + Main.objects.Markers.Add(r); + BusMarkers.Add(r); + } + } + } + + if(checkBoxTrolley.Checked) + { + foreach(var b in TrolleyMarkers) + { + Main.objects.Markers.Remove(b); + } + + Stuff.GetVilniusTransportData(TransportType.TrolleyBus, textBoxTrolley.Text, Trolley); + + foreach(var t in Trolley) + { + if (textBoxTrolley.Text.Split(',').Contains(t.Line)) + { + var r = new GMapMarkerTransparent(new PointLatLng(t.Lat, t.Lng)); + { + r.ToolTipMode = MarkerTooltipMode.Always; + r.ToolTipText = "T " + t.Id + Environment.NewLine + t.Line + " @ " + t.Time; + r.Data = t; + } + Main.objects.Markers.Add(r); + TrolleyMarkers.Add(r); + } + } + } + } + labelstatus.Text = ++Count + " -> " + DateTime.Now.ToLongTimeString() + ", request: " + (DateTime.Now - tstart).TotalSeconds+ "s"; + } + catch(Exception ex) + { + labelstatus.Text = ex.ToString(); + } + timerRefresh.Enabled = checkBoxRefresh.Checked; + } + + private void button1_Click(object sender, EventArgs e) + { + labelstatus.Text = "Connecting manualy once..."; + labelstatus.Invalidate(); + timerRefresh_Tick(null, null); + Main.ZoomToFitMarkers(); + Main.menuItemGotoMap_Click(null, null); + } + } + + public class GMapMarkerTransparent : GMapMarkerTransparentGoogleGreen + { + public VehicleData Data; + + public GMapMarkerTransparent(PointLatLng p) + : base(p) + { + + } + } +} diff --git a/Demo.WindowsMobile/Forms/Transport.resx b/Demo.WindowsMobile/Forms/Transport.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Forms/Transport.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + Pocket_PC_Phone + + + Pocket_PC_Phone + + \ No newline at end of file diff --git a/Demo.WindowsMobile/Properties/AssemblyInfo.cs b/Demo.WindowsMobile/Properties/AssemblyInfo.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Demo.WindowsMobile")] +[assembly: AssemblyDescription("Demo for GMap.NET.WindowsMobile")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Universe")] +[assembly: AssemblyProduct("Demo.WindowsMobile")] +[assembly: AssemblyCopyright("Copyright © Universe 2010")] +[assembly: AssemblyTrademark("email@radioman.lt")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("545e643b-a82a-481b-9df8-96ee8c774d5c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] + +// Below attribute is to suppress FxCop warning "CA2232 : Microsoft.Usage : Add STAThreadAttribute to assembly" +// as Device app does not support STA thread. +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2232:MarkWindowsFormsEntryPointsWithStaThread")] diff --git a/Demo.WindowsMobile/Properties/Resources.Designer.cs b/Demo.WindowsMobile/Properties/Resources.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Properties/Resources.Designer.cs @@ -0,0 +1,68 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.4927 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Demo.WindowsMobile.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the Strongly Typed Resource Builder + // class via a tool like ResGen or Visual Studio.NET. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + class Resources + { + + private static System.Resources.ResourceManager _resMgr; + + private static System.Globalization.CultureInfo _resCulture; + + /*FamANDAssem*/ + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + public static System.Resources.ResourceManager ResourceManager + { + get + { + if((_resMgr == null)) + { + System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Demo.WindowsMobile.Properties.Resources", typeof(Resources).Assembly); + _resMgr = temp; + } + return _resMgr; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + public static System.Globalization.CultureInfo Culture + { + get + { + return _resCulture; + } + set + { + _resCulture = value; + } + } + } +} diff --git a/Demo.WindowsMobile/Properties/Resources.resx b/Demo.WindowsMobile/Properties/Resources.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Demo.WindowsMobile/Resources/ImageReady.ico b/Demo.WindowsMobile/Resources/ImageReady.ico new file mode 100644 index 0000000000000000000000000000000000000000..b7fee32d3a43a405ef2fce56fd05b74ec6720489 GIT binary patch literal 104382 zc%1CL2bdMb@;*Gvl7ol=6AFkZph!?mAW?#X3QEpVl7JwR1tdw1l5@^EN69(E0!vsn zz~-D-($x39-95X9WeIZedVk;Fd7ffsIp@suRJ~nQ-CbQ}S#DMu>)B^5oO4;NQd?F{ z%d&Fi(tj_)|L?&66)tT4&TCmeyl7dKD(SxmSGTNZid$CSzWVQc>D{aeqbw^Q?(r<| zW9k3rQ98BtSjYJB)l$nZvA4ZQl-j( zI#jDxZ9$VJO^&x~*X~M}E?v&!yyg4vzwgn#d-pez|MtZfUrhh`=bwLo-_^tKh727# z^xD#;OJ&KL9nyW?73nbjvh?2?A;Dph5)~CCF}TO7^8u1^ZJb!kZi+Q7MhXoIm*DVtk6X8H zrQtnZc;SUqQ>ILrFl&RCxU~<#cjBbN);N48LLwt0B|17z2`};?{)81FCzENULz9H7!n^IGhW=vpixF!qem@D%nwB6RFYuFb+t0|R6Bi`{_xWm9tXT8# zSf1i+$P9~KlaM^w;_85PU_b4=ZsgGDS@%)Zxe^0cbFP<|H_Zbo=uZ|6o#e2`m=_}V{!P!X2 z0{`DSSgu@;U%}toww-3@!RwJ$`HNyT3m2;c?$H^~>5lvS3hEatwPtxqw{_R#*R9}h z&nPL>`MTV^d9$U1gV@-((fO+$5vy9DSWR$`R(MW3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ydA3Bb2DY!{tx?6^XUKp diff --git a/Demo.WindowsMobile/Source/HookKeys.cs b/Demo.WindowsMobile/Source/HookKeys.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Source/HookKeys.cs @@ -0,0 +1,114 @@ + +namespace Demo.WindowsMobile +{ + using System; + using System.Runtime.CompilerServices; + using System.Runtime.InteropServices; + + public class HookKeys + { + private static int hHook; + private HookProc hookDeleg; + private const int WH_KEYBOARD_LL = 20; + + public event HookEventHandler HookEvent; + + [DllImport("coredll.dll")] + private static extern int CallNextHookEx(HookProc hhk, int nCode, IntPtr wParam, IntPtr lParam); + [DllImport("coredll.dll")] + private static extern int GetCurrentThreadId(); + [DllImport("coredll.dll")] + private static extern IntPtr GetModuleHandle(string mod); + private int HookProcedure(int code, IntPtr wParam, IntPtr lParam) + { + KBDLLHOOKSTRUCT kbdllhookstruct = (KBDLLHOOKSTRUCT) Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT)); + if(code >= 0) + { + HookEventArgs hookArgs = new HookEventArgs(); + hookArgs.Code = code; + hookArgs.wParam = wParam; + hookArgs.lParam = lParam; + KeyBoardInfo keyBoardInfo = new KeyBoardInfo(); + keyBoardInfo.vkCode = kbdllhookstruct.vkCode; + keyBoardInfo.scanCode = kbdllhookstruct.scanCode; + if(this.OnHookEvent(hookArgs, keyBoardInfo)) + { + return 1; + } + } + return CallNextHookEx(this.hookDeleg, code, wParam, lParam); + } + + public bool isRunning() + { + if(hHook == 0) + { + return false; + } + return true; + } + + protected virtual bool OnHookEvent(HookEventArgs hookArgs, KeyBoardInfo keyBoardInfo) + { + return ((this.HookEvent != null) && this.HookEvent(hookArgs, keyBoardInfo)); + } + + [DllImport("coredll.dll")] + private static extern int SetWindowsHookEx(int type, HookProc hookProc, IntPtr hInstance, int m); + public void Start() + { + if(isRunning()) + { + this.Stop(); + } + this.hookDeleg = new HookProc(this.HookProcedure); + hHook = SetWindowsHookEx(20, this.hookDeleg, GetModuleHandle(null), 0); + if(hHook == 0) + { + throw new SystemException("Failed acquiring of the hook."); + } + } + + public void Stop() + { + if(isRunning()) + { + UnhookWindowsHookEx(hHook); + hHook = 0; + } + } + + [DllImport("coredll.dll", SetLastError=true)] + private static extern int UnhookWindowsHookEx(int idHook); + + public delegate bool HookEventHandler(HookEventArgs e, KeyBoardInfo keyBoardInfo); + + public delegate int HookProc(int code, IntPtr wParam, IntPtr lParam); + + [StructLayout(LayoutKind.Sequential)] + private struct KBDLLHOOKSTRUCT + { + public int vkCode; + public int scanCode; + public int flags; + public int time; + public IntPtr dwExtraInfo; + } + } + + public class HookEventArgs : EventArgs + { + public int Code; + public IntPtr lParam; + public IntPtr wParam; + } + + public class KeyBoardInfo + { + public int flags; + public int scanCode; + public int time; + public int vkCode; + } +} + diff --git a/Demo.WindowsMobile/Source/Program.cs b/Demo.WindowsMobile/Source/Program.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsMobile/Source/Program.cs @@ -0,0 +1,19 @@ +using System; + +using System.Collections.Generic; +using System.Windows.Forms; + +namespace Demo.WindowsMobile +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [MTAThread] + static void Main() + { + Application.Run(new MainForm()); + } + } +} \ No newline at end of file diff --git a/Demo.WindowsPresentation/Controls/TrolleyTooltip.xaml b/Demo.WindowsPresentation/Controls/TrolleyTooltip.xaml new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Controls/TrolleyTooltip.xaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + diff --git a/Demo.WindowsPresentation/Controls/TrolleyTooltip.xaml.cs b/Demo.WindowsPresentation/Controls/TrolleyTooltip.xaml.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Controls/TrolleyTooltip.xaml.cs @@ -0,0 +1,28 @@ +using System.Windows.Controls; +using GMap.NET; +using Demo.WindowsForms; + +namespace Demo.WindowsPresentation.Controls +{ + /// + /// Interaction logic for TrolleyTooltip.xaml + /// + public partial class TrolleyTooltip : UserControl + { + public TrolleyTooltip() + { + InitializeComponent(); + } + + public void SetValues(string type, VehicleData vl) + { + Device.Text = vl.Id.ToString(); + LineNum.Text = type + " " + vl.Line; + StopName.Text = vl.LastStop; + TrackType.Text = vl.TrackType; + TimeGps.Text = vl.Time; + Area.Text = vl.AreaName; + Street.Text = vl.StreetName; + } + } +} diff --git a/Demo.WindowsPresentation/CustomMarkers/Circle.xaml b/Demo.WindowsPresentation/CustomMarkers/Circle.xaml new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/CustomMarkers/Circle.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/Demo.WindowsPresentation/CustomMarkers/Circle.xaml.cs b/Demo.WindowsPresentation/CustomMarkers/Circle.xaml.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/CustomMarkers/Circle.xaml.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using GMap.NET; + +namespace Demo.WindowsPresentation.CustomMarkers +{ + /// + /// Interaction logic for Circle.xaml + /// + public partial class Circle : UserControl + { + public Circle() + { + InitializeComponent(); + } + + public PointLatLng Center; + public PointLatLng Bound; + } +} diff --git a/Demo.WindowsPresentation/CustomMarkers/CircleVisual.cs b/Demo.WindowsPresentation/CustomMarkers/CircleVisual.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/CustomMarkers/CircleVisual.cs @@ -0,0 +1,333 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Controls.Primitives; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Effects; +using Demo.WindowsPresentation.Controls; +using GMap.NET.WindowsPresentation; + +namespace Demo.WindowsPresentation.CustomMarkers +{ + public class CircleVisual : FrameworkElement + { + public readonly Popup Popup = new Popup(); + public readonly TrolleyTooltip Tooltip = new TrolleyTooltip(); + public readonly GMapMarker Marker; + + public CircleVisual(GMapMarker m, Brush background) + { + Marker = m; + Marker.ZIndex = 100; + + Popup.AllowsTransparency = true; + Popup.PlacementTarget = this; + Popup.Placement = PlacementMode.Mouse; + Popup.Child = Tooltip; + Popup.Child.Opacity = 0.777; + + SizeChanged += new SizeChangedEventHandler(CircleVisual_SizeChanged); + MouseEnter += new System.Windows.Input.MouseEventHandler(CircleVisual_MouseEnter); + MouseLeave += new System.Windows.Input.MouseEventHandler(CircleVisual_MouseLeave); + Loaded += new RoutedEventHandler(OnLoaded); + + Text = "?"; + + StrokeArrow.EndLineCap = PenLineCap.Triangle; + StrokeArrow.LineJoin = PenLineJoin.Round; + + RenderTransform = scale; + + Width = Height = 22; + FontSize = (Width/1.55); + + Background = background; + Angle = null; + } + + void CircleVisual_SizeChanged(object sender, SizeChangedEventArgs e) + { + Marker.Offset = new System.Windows.Point(-e.NewSize.Width/2, -e.NewSize.Height/2); + scale.CenterX = -Marker.Offset.X; + scale.CenterY = -Marker.Offset.Y; + } + + void OnLoaded(object sender, RoutedEventArgs e) + { + UpdateVisual(true); + } + + readonly ScaleTransform scale = new ScaleTransform(1, 1); + + void CircleVisual_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) + { + if(Popup.IsOpen) + { + Popup.IsOpen = false; + } + + Marker.ZIndex -= 10000; + Cursor = Cursors.Arrow; + + this.Effect = null; + + scale.ScaleY = 1; + scale.ScaleX = 1; + } + + void CircleVisual_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) + { + if(!Popup.IsOpen) + { + Popup.IsOpen = true; + } + + Marker.ZIndex += 10000; + Cursor = Cursors.Hand; + + this.Effect = ShadowEffect; + + scale.ScaleY = 1.5; + scale.ScaleX = 1.5; + } + + public DropShadowEffect ShadowEffect; + + static readonly Typeface Font = new Typeface(new FontFamily("Arial"), FontStyles.Normal, FontWeights.Bold, FontStretches.Normal); + FormattedText FText; + + private Brush background = Brushes.Blue; + public Brush Background + { + get + { + return background; + } + set + { + if(background != value) + { + background = value; + IsChanged = true; + } + } + } + + private Brush foreground = Brushes.White; + public Brush Foreground + { + get + { + return foreground; + } + set + { + if(foreground != value) + { + foreground = value; + IsChanged = true; + + ForceUpdateText(); + } + } + } + + private Pen stroke = new Pen(Brushes.Blue, 2.0); + public Pen Stroke + { + get + { + return stroke; + } + set + { + if(stroke != value) + { + stroke = value; + IsChanged = true; + } + } + } + + private Pen strokeArrow = new Pen(Brushes.Blue, 2.0); + public Pen StrokeArrow + { + get + { + return strokeArrow; + } + set + { + if(strokeArrow != value) + { + strokeArrow = value; + IsChanged = true; + } + } + } + + public double FontSize = 16; + + private double? angle = 0; + public double? Angle + { + get + { + return angle; + } + set + { + if(!Angle.HasValue || !value.HasValue || (Angle.HasValue && value.HasValue && Math.Abs(angle.Value - value.Value) > 11)) + { + angle = value; + IsChanged = true; + } + } + } + public bool IsChanged = true; + + void ForceUpdateText() + { + FText = new FormattedText(text, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, Font, FontSize, Foreground); + IsChanged = true; + } + + string text; + public string Text + { + get + { + return text; + } + set + { + if(text != value) + { + text = value; + ForceUpdateText(); + } + } + } + + Visual _child; + public virtual Visual Child + { + get + { + return _child; + } + set + { + if(_child != value) + { + if(_child != null) + { + RemoveLogicalChild(_child); + RemoveVisualChild(_child); + } + + if(value != null) + { + AddVisualChild(value); + AddLogicalChild(value); + } + + // cache the new child + _child = value; + + InvalidateVisual(); + } + } + } + + public bool UpdateVisual(bool forceUpdate) + { + if(forceUpdate || IsChanged) + { + Child = Create(); + IsChanged = false; + return true; + } + + return false; + } + + int countCreate = 0; + + private DrawingVisual Create() + { + countCreate++; + + var square = new DrawingVisualFx(); + + using(DrawingContext dc = square.RenderOpen()) + { + dc.DrawEllipse(null, Stroke, new Point(Width/2, Height/2), Width/2 + Stroke.Thickness/2, Height/2 + Stroke.Thickness/2); + + if(Angle.HasValue) + { + dc.PushTransform(new RotateTransform(Angle.Value, Width/2, Height/2)); + { + PolyLineSegment polySeg = new PolyLineSegment(new Point[] { new Point(Width*0.2, Height*0.3), new Point(Width*0.8, Height*0.3) }, true); + PathFigure pathFig = new PathFigure(new Point(Width*0.5, -Height*0.22), new PathSegment[] { polySeg }, true); + PathGeometry pathGeo = new PathGeometry(new PathFigure[] { pathFig }); + dc.DrawGeometry(Brushes.AliceBlue, StrokeArrow, pathGeo); + } + dc.Pop(); + } + + dc.DrawEllipse(Background, null, new Point(Width/2, Height/2), Width/2, Height/2); + dc.DrawText(FText, new Point(Width/2 - FText.Width/2, Height/2 - FText.Height/2)); + } + + return square; + } + + #region Necessary Overrides -- Needed by WPF to maintain bookkeeping of our hosted visuals + protected override int VisualChildrenCount + { + get + { + return (Child == null ? 0 : 1); + } + } + + protected override Visual GetVisualChild(int index) + { + return Child; + } + #endregion + } + + public class DrawingVisualFx : DrawingVisual + { + public static readonly DependencyProperty EffectProperty = DependencyProperty.Register("Effect", typeof(Effect), typeof(DrawingVisualFx), + new FrameworkPropertyMetadata(null, (FrameworkPropertyMetadataOptions.AffectsRender), new PropertyChangedCallback(OnEffectChanged))); + public Effect Effect + { + get + { + return (Effect) GetValue(EffectProperty); + } + set + { + SetValue(EffectProperty, value); + } + } + + private static void OnEffectChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) + { + DrawingVisualFx drawingVisualFx = o as DrawingVisualFx; + if(drawingVisualFx != null) + { + drawingVisualFx.setMyProtectedVisualEffect((Effect) e.NewValue); + } + } + + private void setMyProtectedVisualEffect(Effect effect) + { + VisualEffect = effect; + } + } +} diff --git a/Demo.WindowsPresentation/CustomMarkers/Cross.xaml b/Demo.WindowsPresentation/CustomMarkers/Cross.xaml new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/CustomMarkers/Cross.xaml @@ -0,0 +1,9 @@ + + + + + + diff --git a/Demo.WindowsPresentation/CustomMarkers/Cross.xaml.cs b/Demo.WindowsPresentation/CustomMarkers/Cross.xaml.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/CustomMarkers/Cross.xaml.cs @@ -0,0 +1,16 @@ +using System.Windows.Controls; + +namespace Demo.WindowsPresentation.CustomMarkers +{ + /// + /// Interaction logic for Cross.xaml + /// + public partial class Cross : UserControl + { + public Cross() + { + InitializeComponent(); + this.IsHitTestVisible = false; + } + } +} diff --git a/Demo.WindowsPresentation/CustomMarkers/CustomMarkerDemo.xaml b/Demo.WindowsPresentation/CustomMarkers/CustomMarkerDemo.xaml new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/CustomMarkers/CustomMarkerDemo.xaml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/Demo.WindowsPresentation/CustomMarkers/CustomMarkerDemo.xaml.cs b/Demo.WindowsPresentation/CustomMarkers/CustomMarkerDemo.xaml.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/CustomMarkers/CustomMarkerDemo.xaml.cs @@ -0,0 +1,121 @@ +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Input; +using System.Windows.Media; +using GMap.NET.WindowsPresentation; +using System.Diagnostics; + +namespace Demo.WindowsPresentation.CustomMarkers +{ + /// + /// Interaction logic for CustomMarkerDemo.xaml + /// + public partial class CustomMarkerDemo + { + Popup Popup; + Label Label; + GMapMarker Marker; + MainWindow MainWindow; + + public CustomMarkerDemo(MainWindow window, GMapMarker marker, string title) + { + this.InitializeComponent(); + + this.MainWindow = window; + this.Marker = marker; + + Popup = new Popup(); + Label = new Label(); + + this.Unloaded += new RoutedEventHandler(CustomMarkerDemo_Unloaded); + this.Loaded += new RoutedEventHandler(CustomMarkerDemo_Loaded); + this.SizeChanged += new SizeChangedEventHandler(CustomMarkerDemo_SizeChanged); + this.MouseEnter += new MouseEventHandler(MarkerControl_MouseEnter); + this.MouseLeave += new MouseEventHandler(MarkerControl_MouseLeave); + this.MouseMove += new MouseEventHandler(CustomMarkerDemo_MouseMove); + this.MouseLeftButtonUp += new MouseButtonEventHandler(CustomMarkerDemo_MouseLeftButtonUp); + this.MouseLeftButtonDown += new MouseButtonEventHandler(CustomMarkerDemo_MouseLeftButtonDown); + + Popup.Placement = PlacementMode.Mouse; + { + Label.Background = Brushes.Blue; + Label.Foreground = Brushes.White; + Label.BorderBrush = Brushes.WhiteSmoke; + Label.BorderThickness = new Thickness(2); + Label.Padding = new Thickness(5); + Label.FontSize = 22; + Label.Content = title; + } + Popup.Child = Label; + } + + void CustomMarkerDemo_Loaded(object sender, RoutedEventArgs e) + { + if(icon.Source.CanFreeze) + { + icon.Source.Freeze(); + } + } + + void CustomMarkerDemo_Unloaded(object sender, RoutedEventArgs e) + { + this.Unloaded -= new RoutedEventHandler(CustomMarkerDemo_Unloaded); + this.Loaded -= new RoutedEventHandler(CustomMarkerDemo_Loaded); + this.SizeChanged-= new SizeChangedEventHandler(CustomMarkerDemo_SizeChanged); + this.MouseEnter -= new MouseEventHandler(MarkerControl_MouseEnter); + this.MouseLeave -= new MouseEventHandler(MarkerControl_MouseLeave); + this.MouseMove -= new MouseEventHandler(CustomMarkerDemo_MouseMove); + this.MouseLeftButtonUp -= new MouseButtonEventHandler(CustomMarkerDemo_MouseLeftButtonUp); + this.MouseLeftButtonDown -= new MouseButtonEventHandler(CustomMarkerDemo_MouseLeftButtonDown); + + Marker.Shape = null; + icon.Source = null; + icon = null; + Popup = null; + Label = null; + } + + void CustomMarkerDemo_SizeChanged(object sender, SizeChangedEventArgs e) + { + Marker.Offset = new Point(-e.NewSize.Width/2, -e.NewSize.Height); + } + + void CustomMarkerDemo_MouseMove(object sender, MouseEventArgs e) + { + if(e.LeftButton == MouseButtonState.Pressed && IsMouseCaptured) + { + Point p = e.GetPosition(MainWindow.MainMap); + Marker.Position = MainWindow.MainMap.FromLocalToLatLng((int) (p.X), (int) (p.Y)); + } + } + + void CustomMarkerDemo_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + if(!IsMouseCaptured) + { + Mouse.Capture(this); + } + } + + void CustomMarkerDemo_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) + { + if(IsMouseCaptured) + { + Mouse.Capture(null); + } + } + + void MarkerControl_MouseLeave(object sender, MouseEventArgs e) + { + Marker.ZIndex -= 10000; + Popup.IsOpen = false; + } + + void MarkerControl_MouseEnter(object sender, MouseEventArgs e) + { + Marker.ZIndex += 10000; + Popup.IsOpen = true; + } + } +} \ No newline at end of file diff --git a/Demo.WindowsPresentation/CustomMarkers/CustomMarkerRed.xaml b/Demo.WindowsPresentation/CustomMarkers/CustomMarkerRed.xaml new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/CustomMarkers/CustomMarkerRed.xaml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/Demo.WindowsPresentation/CustomMarkers/CustomMarkerRed.xaml.cs b/Demo.WindowsPresentation/CustomMarkers/CustomMarkerRed.xaml.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/CustomMarkers/CustomMarkerRed.xaml.cs @@ -0,0 +1,101 @@ +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Input; +using System.Windows.Media; +using GMap.NET.WindowsPresentation; + +namespace Demo.WindowsPresentation.CustomMarkers +{ + /// + /// Interaction logic for CustomMarkerDemo.xaml + /// + public partial class CustomMarkerRed + { + Popup Popup; + Label Label; + GMapMarker Marker; + MainWindow MainWindow; + + public CustomMarkerRed(MainWindow window, GMapMarker marker, string title) + { + this.InitializeComponent(); + + this.MainWindow = window; + this.Marker = marker; + + Popup = new Popup(); + Label = new Label(); + + this.Loaded += new RoutedEventHandler(CustomMarkerDemo_Loaded); + this.SizeChanged += new SizeChangedEventHandler(CustomMarkerDemo_SizeChanged); + this.MouseEnter += new MouseEventHandler(MarkerControl_MouseEnter); + this.MouseLeave += new MouseEventHandler(MarkerControl_MouseLeave); + this.MouseMove += new MouseEventHandler(CustomMarkerDemo_MouseMove); + this.MouseLeftButtonUp += new MouseButtonEventHandler(CustomMarkerDemo_MouseLeftButtonUp); + this.MouseLeftButtonDown += new MouseButtonEventHandler(CustomMarkerDemo_MouseLeftButtonDown); + + Popup.Placement = PlacementMode.Mouse; + { + Label.Background = Brushes.Blue; + Label.Foreground = Brushes.White; + Label.BorderBrush = Brushes.WhiteSmoke; + Label.BorderThickness = new Thickness(2); + Label.Padding = new Thickness(5); + Label.FontSize = 22; + Label.Content = title; + } + Popup.Child = Label; + } + + void CustomMarkerDemo_Loaded(object sender, RoutedEventArgs e) + { + if(icon.Source.CanFreeze) + { + icon.Source.Freeze(); + } + } + + void CustomMarkerDemo_SizeChanged(object sender, SizeChangedEventArgs e) + { + Marker.Offset = new Point(-e.NewSize.Width/2, -e.NewSize.Height); + } + + void CustomMarkerDemo_MouseMove(object sender, MouseEventArgs e) + { + if(e.LeftButton == MouseButtonState.Pressed && IsMouseCaptured) + { + Point p = e.GetPosition(MainWindow.MainMap); + Marker.Position = MainWindow.MainMap.FromLocalToLatLng((int) p.X, (int) p.Y); + } + } + + void CustomMarkerDemo_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + if(!IsMouseCaptured) + { + Mouse.Capture(this); + } + } + + void CustomMarkerDemo_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) + { + if(IsMouseCaptured) + { + Mouse.Capture(null); + } + } + + void MarkerControl_MouseLeave(object sender, MouseEventArgs e) + { + Marker.ZIndex -= 10000; + Popup.IsOpen = false; + } + + void MarkerControl_MouseEnter(object sender, MouseEventArgs e) + { + Marker.ZIndex += 10000; + Popup.IsOpen = true; + } + } +} \ No newline at end of file diff --git a/Demo.WindowsPresentation/CustomMarkers/Test.xaml b/Demo.WindowsPresentation/CustomMarkers/Test.xaml new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/CustomMarkers/Test.xaml @@ -0,0 +1,9 @@ + + + + 44 + + diff --git a/Demo.WindowsPresentation/CustomMarkers/Test.xaml.cs b/Demo.WindowsPresentation/CustomMarkers/Test.xaml.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/CustomMarkers/Test.xaml.cs @@ -0,0 +1,17 @@ +using System.Windows.Controls; + +namespace Demo.WindowsPresentation.CustomMarkers +{ + /// + /// Interaction logic for Test.xaml + /// + public partial class Test : UserControl + { + public Test(string txt) + { + InitializeComponent(); + + text.Text = txt; + } + } +} diff --git a/Demo.WindowsPresentation/CustomMarkers/bigMarkerGreen.png b/Demo.WindowsPresentation/CustomMarkers/bigMarkerGreen.png new file mode 100644 index 0000000000000000000000000000000000000000..4aed804959cd7450939446ca75515003033a8543 GIT binary patch literal 894 zc$@)#1A+XBP)Kp|5|ZZ>3!~F6!}b9YxvG>RP$q{tlDOFSWGbFMs#<`R z{+4+N`q`;31gF1NN<9L&S~>b^v}bFoby!vAp*8gTw+{d(06Ks^4#z+2eq~oAn<%se zt5n*xGeOpHcQchcs{v00w*LkaG0X@E%$7%SxR zR&q9W+qjt@1I9XlWu|gb3GjIF=?LwwwxGS4;lFo{Q^48Ea=ei>-MQqs_P0*o zmjT=vD-E0kO1&&1o>Ja?Po+};+CL@tPkKI&ux>f%LhbT+h22p3Xe(fXi|XV z8@!vhw1^Bd>UpJzeQv8!5g^$cJ5jnjvRZdrVtZ9LEo|h4Cn_0t1E7QYe&XX({E=mRBjSLJN!nqf}u$ zM3%Wk6BXT@xTuNKxJb6S!I)8JT;{TwnPpj=B6C}eV=voW5 zH0nq2Yv&sjaqvx}6+AsofXB9Y@$|I7w@p>hs!YI$Wa)_vRsYPr@&8G{eAi~OH(%3< zLE(rw51=0>>}v(jRwpcNZT7N^(ErotACwgUE)Tqvn>j$oGYj~^RZq@TnsRaSg`*_~ zfPr>yqNNAG2^ny~aZ4f1gy)2%&@_#4m;_vHu##+9*ttebJM{naoi1>ze?Q_-)xKwf)=n#_tQ*6{z$zf7h?sl?y z0KJoi9@0idJjWzpxJakPf-*l|SB{2i`**tl4fu6~l@=t=-u!GMlYonLWyBa0b<7kK zh0D+eo^I#5CSUIUGyPTZv9w2=9=DaT6{6{OJHgZ{{Y9eLq1+5E=z59~En2VVYXED= zub%Gi%ZYJB(lXuHD_``IE0|49a-zGNSjgq}B>9@!KvRzg76|wE z`|f&ERp_nOS~AsAE8dR&&)+LEbFL zslcrXxFnnx7IEJzq(RW9Rz5k|XeD3Zd#hm*aN25I!^g-et5G8LlT6`qaHpS3b_?C} zbEm9D30EBDuX z@0A+J_6${ZRKNyUL=O~fj0C&<;lYy?MffbA7bXFRO?qBN&3WXF{G8Z8iTJnAZKbdg zJK~@w&G0C51StbNhFXIDm{-sLI|2s5GDaVsY*cx z(vnG*ENnlmit>=)k6g)e(xTiX2$O*Qm^vY-vF!4=T~t6tT+Hw>G@#I~p)d)ct`_2? vrHJ&YliXB5hf2QfL`5Na7q_Pn4-)VPp(xYTA7S)500000NkvXXu0mjfx@>;Z diff --git a/Demo.WindowsPresentation/Demo.WindowsPresentation.csproj b/Demo.WindowsPresentation/Demo.WindowsPresentation.csproj new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Demo.WindowsPresentation.csproj @@ -0,0 +1,263 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {83195AEF-0071-471C-9E8B-E67211F5D028} + WinExe + Properties + Demo.WindowsPresentation + Demo.WindowsPresentation + v3.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + Resources\ImageReady.ico + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + + + sn.snk + + + + LocalIntranet + + + true + + + + + + Properties\app.manifest + + + true + bin\Debug\ + DEBUG;TRACE + full + AnyCPU + ..\Build\Debug\Demo.WindowsPresentation.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + ..\Build\Release\ + TRACE + true + AnyCPU + ..\Build\Release\Demo.WindowsPresentation.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + false + prompt + MinimumRecommendedRules.ruleset + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + false + ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + + + 3.5 + + + + + + 3.0 + + + 3.0 + + + 3.0 + + + 3.0 + + + 4.0 + + + + + Source\DemoStuff.cs + + + Message.xaml + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + MSBuild:Compile + Designer + + + Properties\VersionInfo.cs + + + MainWindow.xaml + Code + + + Designer + MSBuild:Compile + + + + + TrolleyTooltip.xaml + + + Circle.xaml + + + + CustomMarkerRed.xaml + + + Cross.xaml + + + CustomMarkerDemo.xaml + + + + Code + + + True + True + Resources.resx + + + + Test.xaml + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + + + + + + + + + + + + + + {D0C39D9D-BED0-418B-9A5E-713176CAF40C} + GMap.NET.Core + + + {644FE7D4-0184-400F-B2D7-99CB41360658} + GMap.NET.WindowsPresentation + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + \ No newline at end of file diff --git a/Demo.WindowsPresentation/Properties/AssemblyInfo.cs b/Demo.WindowsPresentation/Properties/AssemblyInfo.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Properties/AssemblyInfo.cs @@ -0,0 +1,50 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Demo.WindowsPresentation")] +[assembly: AssemblyDescription("Demo for GMap.NET.WindowsPresentation")] +[assembly: AssemblyProduct("Demo.WindowsPresentation")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +//[assembly: AssemblyVersion("1.0.0.0")] +//[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Demo.WindowsPresentation/Properties/Resources.Designer.cs b/Demo.WindowsPresentation/Properties/Resources.Designer.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.235 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Demo.WindowsPresentation.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Demo.WindowsPresentation.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Demo.WindowsPresentation/Properties/Resources.resx b/Demo.WindowsPresentation/Properties/Resources.resx new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Properties/Resources.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Demo.WindowsPresentation/Properties/app.manifest b/Demo.WindowsPresentation/Properties/app.manifest new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Properties/app.manifest @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demo.WindowsPresentation/Resources/ImageReady.ico b/Demo.WindowsPresentation/Resources/ImageReady.ico new file mode 100644 index 0000000000000000000000000000000000000000..b7fee32d3a43a405ef2fce56fd05b74ec6720489 GIT binary patch literal 104382 zc%1CL2bdMb@;*Gvl7ol=6AFkZph!?mAW?#X3QEpVl7JwR1tdw1l5@^EN69(E0!vsn zz~-D-($x39-95X9WeIZedVk;Fd7ffsIp@suRJ~nQ-CbQ}S#DMu>)B^5oO4;NQd?F{ z%d&Fi(tj_)|L?&66)tT4&TCmeyl7dKD(SxmSGTNZid$CSzWVQc>D{aeqbw^Q?(r<| zW9k3rQ98BtSjYJB)l$nZvA4ZQl-j( zI#jDxZ9$VJO^&x~*X~M}E?v&!yyg4vzwgn#d-pez|MtZfUrhh`=bwLo-_^tKh727# z^xD#;OJ&KL9nyW?73nbjvh?2?A;Dph5)~CCF}TO7^8u1^ZJb!kZi+Q7MhXoIm*DVtk6X8H zrQtnZc;SUqQ>ILrFl&RCxU~<#cjBbN);N48LLwt0B|17z2`};?{)81FCzENULz9H7!n^IGhW=vpixF!qem@D%nwB6RFYuFb+t0|R6Bi`{_xWm9tXT8# zSf1i+$P9~KlaM^w;_85PU_b4=ZsgGDS@%)Zxe^0cbFP<|H_Zbo=uZ|6o#e2`m=_}V{!P!X2 z0{`DSSgu@;U%}toww-3@!RwJ$`HNyT3m2;c?$H^~>5lvS3hEatwPtxqw{_R#*R9}h z&nPL>`MTV^d9$U1gV@-((fO+$5vy9DSWR$`R(MW3+@~Y%(*@K6_vsZQRsOgtR(*e2 zwAJ4q7|7)O9{0+&b+?~)nvZdhuW^q$VPZAHeVRvz)e`q=4Qdf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B*2y zE~nWV8AY}ulWPkn)O2-qPmPNk)_SI`1{DAF&gp5#S_6Es?>P0YE}X7ziYJYtc+x1G z?rxl}E^79B@O1bnxOvKOp!h<;0lK@p7d}vWU-^}JxneRI@%eoG`|EGV#l;P)INI78 zf2OU`;Fn^PJ&nE9pJ6f@FdB_$ng)yqz*$#II2!ep zc(An8`nU48=Je<~CW8T&`|!0H>FJx@ha0CjGBZv9XeP7y^1}^{)Ymyl?E8qS6@_en zdHiW-+g~0})rvx{N!Z7sLrpZbdN7z|)Ws?=0MT1tU;k+7+_~>WStIG{>0ww*44%&8 z*V}FJ>-T}#RH{t z-wuTWw0Cr1vn2o&<&4aJyJp}1SYt38s<+y6#^A4FYgIie@ovzfkhZq~P^k|?$P1wp zpf_R3%%WHK9~>0H0EAMi?A}?k0&D)hwlvaeHDqRHph3xojTJ5}5bmqA+8t;~SAj7J zB2pkC`M(|_>=2m@=46N+MN~>Y!LV=3U;zdoyv@zc^Y58i@>;#q>DP5He_Fb9f7v6C zEHeUI8^5WUmvhs7DRm!g0c{wVEWEh-LzJe#XoZjwBuLtX$sB8RwE>kw0T_VrDWx8t zRdSa<|LUs~ckkM@Kt$S352EDJ1uLSHa!u~f_L49xk}Sta%w`iU%|~f&ZO5LMi~nR} z;MlkO9=q5ex|ArTtf#61=Zxa05t+|qPb^B#NlGR!Bb7*tqPEGyfg_F7@2+as54nH$ zzXbn5pz{tRrKTEe@lzucZ8<1~x5MKMdpau#hc{nr`u$k>54yN(5(^hDj{pDw07*qo IM6N<$g4&V`ga7~l diff --git a/Demo.WindowsPresentation/Resources/zoom-.png b/Demo.WindowsPresentation/Resources/zoom-.png new file mode 100644 index 0000000000000000000000000000000000000000..0ca3453b36ec3f6cdace9f4c33aa1546c2ad1aa3 GIT binary patch literal 2135 zc$@)O2&ngoP)Y zdvH|c6~KSr-FxqDHd*r6&5M|jY>1CUq7o1)>L^u%8Xkg(PKEfYq%zv#AKEH((2kZC zEEb_s)JCB#pag_~)+Uw4#mo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H07F1P5Q51v_eHD;IA`wF2Fs5muIO4Db__}(peIA@$5#kT*8FiXuGI3BtHz}q`CvQPouFA!G!>yJgo7r8gW&HV?fMCHHF%l~UqjJg z+i)NeLTC<$V|o6y*Cy`UyLX|KvgzC)N*+`2T1--|=Kbsd2_vG&a*syWH5%$qQQz2% zD=(MenL6|IHwT{_Y!D3r!hW_YaKR{!9+mk*_N2n(oTOy(GE#}M3aU=}IDDdx>V3PK zjbq+l|1ZJ67wDqHNQh|`XZ*CNL}v~{;BWEOM0{=KL?YXMNZBtX{{`l4X=ChEbi4on N002ovPDHLkV1k)~Bsl;8 diff --git a/Demo.WindowsPresentation/Source/App.cs b/Demo.WindowsPresentation/Source/App.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Source/App.cs @@ -0,0 +1,39 @@ +using System; +using System.Windows; +using GMap.NET; + +namespace Demo.WindowsPresentation +{ + public partial class App : Application + { + [STAThread()] + static void Main() + { + // Create the application. + Application app = new Application(); + + // Create the main window. + MainWindow win = new MainWindow(); + + // Launch the application and show the main window. + app.Run(win); + } + } + + public class Dummy + { + + } + + public struct PointAndInfo + { + public PointLatLng Point; + public string Info; + + public PointAndInfo(PointLatLng point, string info) + { + Point = point; + Info = info; + } + } +} diff --git a/Demo.WindowsPresentation/Source/Map.cs b/Demo.WindowsPresentation/Source/Map.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Source/Map.cs @@ -0,0 +1,47 @@ + +namespace Demo.WindowsPresentation +{ + using System.Windows.Controls; + using System.Windows.Media; + using GMap.NET.WindowsPresentation; + using System.Globalization; + using System.Windows.Forms; + using System.Windows; + using System; + + /// + /// the custom map f GMapControl + /// + public class Map : GMapControl + { + public long ElapsedMilliseconds; + +#if DEBUG + DateTime start; + DateTime end; + int delta; + + private int counter; + readonly Typeface tf = new Typeface("GenericSansSerif"); + readonly System.Windows.FlowDirection fd = new System.Windows.FlowDirection(); + + /// + /// any custom drawing here + /// + /// + protected override void OnRender(DrawingContext drawingContext) + { + start = DateTime.Now; + + base.OnRender(drawingContext); + + end = DateTime.Now; + delta = (int)(end - start).TotalMilliseconds; + + FormattedText text = new FormattedText(string.Format(CultureInfo.InvariantCulture, "{0:0.0}", Zoom) + "z, " + MapProvider + ", refresh: " + counter++ + ", load: " + ElapsedMilliseconds + "ms, render: " + delta + "ms", CultureInfo.InvariantCulture, fd, tf, 20, Brushes.Blue); + drawingContext.DrawText(text, new Point(text.Height, text.Height)); + text = null; + } +#endif + } +} diff --git a/Demo.WindowsPresentation/Windows/MainWindow.xaml b/Demo.WindowsPresentation/Windows/MainWindow.xaml new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Windows/MainWindow.xaml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + Grid + + + + + + + + lietuva vilnius + + + + + + + + + + + + + + + + + + routing + geocoding + + + + + Transport demo + Performance + None + + + + + + + place info + + + + + + + + + + + + diff --git a/Demo.WindowsPresentation/Windows/MainWindow.xaml.cs b/Demo.WindowsPresentation/Windows/MainWindow.xaml.cs new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Windows/MainWindow.xaml.cs @@ -0,0 +1,990 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Threading; +using Demo.WindowsForms; +using Demo.WindowsPresentation.CustomMarkers; +using GMap.NET; +using GMap.NET.MapProviders; +using GMap.NET.WindowsPresentation; + +namespace Demo.WindowsPresentation +{ + public partial class MainWindow : Window + { + PointLatLng start; + PointLatLng end; + + // marker + GMapMarker currentMarker; + + // zones list + List Circles = new List(); + + public MainWindow() + { + InitializeComponent(); + + // add your custom map db provider + //MySQLPureImageCache ch = new MySQLPureImageCache(); + //ch.ConnectionString = @"server=sql2008;User Id=trolis;Persist Security Info=True;database=gmapnetcache;password=trolis;"; + //MainMap.Manager.SecondaryCache = ch; + + // set your proxy here if need + //GMapProvider.WebProxy = new WebProxy("10.2.0.100", 8080); + //GMapProvider.WebProxy.Credentials = new NetworkCredential("ogrenci@bilgeadam.com", "bilgeada"); + + // set cache mode only if no internet avaible + if(!Stuff.PingNetwork("pingtest.net")) + { + MainMap.Manager.Mode = AccessMode.CacheOnly; + MessageBox.Show("No internet connection available, going to CacheOnly mode.", "GMap.NET - Demo.WindowsPresentation", MessageBoxButton.OK, MessageBoxImage.Warning); + } + + // config map + MainMap.MapProvider = GMapProviders.OpenStreetMap; + MainMap.Position = new PointLatLng(54.6961334816182, 25.2985095977783); + + //MainMap.ScaleMode = ScaleModes.Dynamic; + + // map events + MainMap.OnPositionChanged += new PositionChanged(MainMap_OnCurrentPositionChanged); + MainMap.OnTileLoadComplete += new TileLoadComplete(MainMap_OnTileLoadComplete); + MainMap.OnTileLoadStart += new TileLoadStart(MainMap_OnTileLoadStart); + MainMap.OnMapTypeChanged += new MapTypeChanged(MainMap_OnMapTypeChanged); + MainMap.MouseMove += new System.Windows.Input.MouseEventHandler(MainMap_MouseMove); + MainMap.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(MainMap_MouseLeftButtonDown); + MainMap.MouseEnter += new MouseEventHandler(MainMap_MouseEnter); + + // get map types + comboBoxMapType.ItemsSource = GMapProviders.List; + comboBoxMapType.DisplayMemberPath = "Name"; + comboBoxMapType.SelectedItem = MainMap.MapProvider; + + // acccess mode + comboBoxMode.ItemsSource = Enum.GetValues(typeof(AccessMode)); + comboBoxMode.SelectedItem = MainMap.Manager.Mode; + + // get cache modes + checkBoxCacheRoute.IsChecked = MainMap.Manager.UseRouteCache; + checkBoxGeoCache.IsChecked = MainMap.Manager.UseGeocoderCache; + + // setup zoom min/max + sliderZoom.Maximum = MainMap.MaxZoom; + sliderZoom.Minimum = MainMap.MinZoom; + + // get position + textBoxLat.Text = MainMap.Position.Lat.ToString(CultureInfo.InvariantCulture); + textBoxLng.Text = MainMap.Position.Lng.ToString(CultureInfo.InvariantCulture); + + // get marker state + checkBoxCurrentMarker.IsChecked = true; + + // can drag map + checkBoxDragMap.IsChecked = MainMap.CanDragMap; + +#if DEBUG + checkBoxDebug.IsChecked = true; +#endif + + //validator.Window = this; + + // set current marker + currentMarker = new GMapMarker(MainMap.Position); + { + currentMarker.Shape = new CustomMarkerRed(this, currentMarker, "custom position marker"); + currentMarker.Offset = new System.Windows.Point(-15, -15); + currentMarker.ZIndex = int.MaxValue; + MainMap.Markers.Add(currentMarker); + } + + //if(false) + { + // add my city location for demo + GeoCoderStatusCode status = GeoCoderStatusCode.Unknow; + + PointLatLng? city = GMapProviders.GoogleMap.GetPoint("Lithuania, Vilnius", out status); + if(city != null && status == GeoCoderStatusCode.G_GEO_SUCCESS) + { + GMapMarker it = new GMapMarker(city.Value); + { + it.ZIndex = 55; + it.Shape = new CustomMarkerDemo(this, it, "Welcome to Lithuania! ;}"); + } + MainMap.Markers.Add(it); + + #region -- add some markers and zone around them -- + //if(false) + { + List objects = new List(); + { + string area = "Antakalnis"; + PointLatLng? pos = GMapProviders.GoogleMap.GetPoint("Lithuania, Vilnius, " + area, out status); + if(pos != null && status == GeoCoderStatusCode.G_GEO_SUCCESS) + { + objects.Add(new PointAndInfo(pos.Value, area)); + } + } + { + string area = "Senamiestis"; + PointLatLng? pos = GMapProviders.GoogleMap.GetPoint("Lithuania, Vilnius, " + area, out status); + if(pos != null && status == GeoCoderStatusCode.G_GEO_SUCCESS) + { + objects.Add(new PointAndInfo(pos.Value, area)); + } + } + { + string area = "Pilaite"; + PointLatLng? pos = GMapProviders.GoogleMap.GetPoint("Lithuania, Vilnius, " + area, out status); + if(pos != null && status == GeoCoderStatusCode.G_GEO_SUCCESS) + { + objects.Add(new PointAndInfo(pos.Value, area)); + } + } + AddDemoZone(8.8, city.Value, objects); + } + #endregion + } + + if(MainMap.Markers.Count > 1) + { + MainMap.ZoomAndCenterMarkers(null); + } + } + + // perfromance test + timer.Interval = TimeSpan.FromMilliseconds(44); + timer.Tick += new EventHandler(timer_Tick); + + // transport demo + transport.DoWork += new DoWorkEventHandler(transport_DoWork); + transport.ProgressChanged += new ProgressChangedEventHandler(transport_ProgressChanged); + transport.WorkerSupportsCancellation = true; + transport.WorkerReportsProgress = true; + } + + void MainMap_MouseEnter(object sender, MouseEventArgs e) + { + MainMap.Focus(); + } + + #region -- performance test-- + public RenderTargetBitmap ToImageSource(FrameworkElement obj) + { + // Save current canvas transform + Transform transform = obj.LayoutTransform; + obj.LayoutTransform = null; + + // fix margin offset as well + Thickness margin = obj.Margin; + obj.Margin = new Thickness(0, 0, margin.Right - margin.Left, margin.Bottom - margin.Top); + + // Get the size of canvas + System.Windows.Size size = new System.Windows.Size(obj.Width, obj.Height); + + // force control to Update + obj.Measure(size); + obj.Arrange(new Rect(size)); + + RenderTargetBitmap bmp = new RenderTargetBitmap((int)size.Width, (int)size.Height, 96, 96, PixelFormats.Pbgra32); + bmp.Render(obj); + + if(bmp.CanFreeze) + { + bmp.Freeze(); + } + + // return values as they were before + obj.LayoutTransform = transform; + obj.Margin = margin; + + return bmp; + } + + double NextDouble(Random rng, double min, double max) + { + return min + (rng.NextDouble() * (max - min)); + } + + Random r = new Random(); + + int tt = 0; + void timer_Tick(object sender, EventArgs e) + { + var pos = new PointLatLng(NextDouble(r, MainMap.ViewArea.Top, MainMap.ViewArea.Bottom), NextDouble(r, MainMap.ViewArea.Left, MainMap.ViewArea.Right)); + GMapMarker m = new GMapMarker(pos); + { + var s = new Test((tt++).ToString()); + + var image = new Image(); + { + RenderOptions.SetBitmapScalingMode(image, BitmapScalingMode.LowQuality); + image.Stretch = Stretch.None; + image.Opacity = s.Opacity; + + image.MouseEnter += new System.Windows.Input.MouseEventHandler(image_MouseEnter); + image.MouseLeave += new System.Windows.Input.MouseEventHandler(image_MouseLeave); + + image.Source = ToImageSource(s); + } + + m.Shape = image; + + m.Offset = new System.Windows.Point(-s.Width, -s.Height); + } + MainMap.Markers.Add(m); + + if(tt >= 333) + { + timer.Stop(); + tt = 0; + } + } + + void image_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) + { + Image img = sender as Image; + img.RenderTransform = null; + } + + void image_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) + { + Image img = sender as Image; + img.RenderTransform = new ScaleTransform(1.2, 1.2, 12.5, 12.5); + } + + DispatcherTimer timer = new DispatcherTimer(); + #endregion + + #region -- transport demo -- + BackgroundWorker transport = new BackgroundWorker(); + + readonly List trolleybus = new List(); + readonly Dictionary trolleybusMarkers = new Dictionary(); + + readonly List bus = new List(); + readonly Dictionary busMarkers = new Dictionary(); + + bool firstLoadTrasport = true; + + void transport_ProgressChanged(object sender, ProgressChangedEventArgs e) + { + using(Dispatcher.DisableProcessing()) + { + lock(trolleybus) + { + foreach(VehicleData d in trolleybus) + { + GMapMarker marker; + + if(!trolleybusMarkers.TryGetValue(d.Id, out marker)) + { + marker = new GMapMarker(new PointLatLng(d.Lat, d.Lng)); + marker.Tag = d.Id; + marker.Shape = new CircleVisual(marker, Brushes.Red); + + trolleybusMarkers[d.Id] = marker; + MainMap.Markers.Add(marker); + } + else + { + marker.Position = new PointLatLng(d.Lat, d.Lng); + var shape = (marker.Shape as CircleVisual); + { + shape.Text = d.Line; + shape.Angle = d.Bearing; + shape.Tooltip.SetValues("TrolleyBus", d); + + if(shape.IsChanged) + { + shape.UpdateVisual(false); + } + } + } + } + } + + lock(bus) + { + foreach(VehicleData d in bus) + { + GMapMarker marker; + + if(!busMarkers.TryGetValue(d.Id, out marker)) + { + marker = new GMapMarker(new PointLatLng(d.Lat, d.Lng)); + marker.Tag = d.Id; + + var v = new CircleVisual(marker, Brushes.Blue); + { + v.Stroke = new Pen(Brushes.Gray, 2.0); + } + marker.Shape = v; + + busMarkers[d.Id] = marker; + MainMap.Markers.Add(marker); + } + else + { + marker.Position = new PointLatLng(d.Lat, d.Lng); + var shape = (marker.Shape as CircleVisual); + { + shape.Text = d.Line; + shape.Angle = d.Bearing; + shape.Tooltip.SetValues("Bus", d); + + if(shape.IsChanged) + { + shape.UpdateVisual(false); + } + } + } + } + } + + if(firstLoadTrasport) + { + firstLoadTrasport = false; + } + } + } + + void transport_DoWork(object sender, DoWorkEventArgs e) + { + while(!transport.CancellationPending) + { + try + { + lock(trolleybus) + { + Stuff.GetVilniusTransportData(TransportType.TrolleyBus, string.Empty, trolleybus); + } + + lock(bus) + { + Stuff.GetVilniusTransportData(TransportType.Bus, string.Empty, bus); + } + + transport.ReportProgress(100); + } + catch(Exception ex) + { + Debug.WriteLine("transport_DoWork: " + ex.ToString()); + } + Thread.Sleep(3333); + } + trolleybusMarkers.Clear(); + busMarkers.Clear(); + } + + #endregion + + // add objects and zone around them + void AddDemoZone(double areaRadius, PointLatLng center, List objects) + { + var objectsInArea = from p in objects + where MainMap.MapProvider.Projection.GetDistance(center, p.Point) <= areaRadius + select new + { + Obj = p, + Dist = MainMap.MapProvider.Projection.GetDistance(center, p.Point) + }; + if(objectsInArea.Any()) + { + var maxDistObject = (from p in objectsInArea + orderby p.Dist descending + select p).First(); + + // add objects to zone + foreach(var o in objectsInArea) + { + GMapMarker it = new GMapMarker(o.Obj.Point); + { + it.ZIndex = 55; + var s = new CustomMarkerDemo(this, it, o.Obj.Info + ", distance from center: " + o.Dist + "km."); + it.Shape = s; + } + + MainMap.Markers.Add(it); + } + + // add zone circle + //if(false) + { + GMapMarker it = new GMapMarker(center); + it.ZIndex = -1; + + Circle c = new Circle(); + c.Center = center; + c.Bound = maxDistObject.Obj.Point; + c.Tag = it; + c.IsHitTestVisible = false; + + UpdateCircle(c); + Circles.Add(it); + + it.Shape = c; + MainMap.Markers.Add(it); + } + } + } + + // calculates circle radius + void UpdateCircle(Circle c) + { + var pxCenter = MainMap.FromLatLngToLocal(c.Center); + var pxBounds = MainMap.FromLatLngToLocal(c.Bound); + + double a = (double)(pxBounds.X - pxCenter.X); + double b = (double)(pxBounds.Y - pxCenter.Y); + var pxCircleRadius = Math.Sqrt(a * a + b * b); + + c.Width = 55 + pxCircleRadius * 2; + c.Height = 55 + pxCircleRadius * 2; + (c.Tag as GMapMarker).Offset = new System.Windows.Point(-c.Width / 2, -c.Height / 2); + } + + void MainMap_OnMapTypeChanged(GMapProvider type) + { + sliderZoom.Minimum = MainMap.MinZoom; + sliderZoom.Maximum = MainMap.MaxZoom; + } + + void MainMap_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + System.Windows.Point p = e.GetPosition(MainMap); + currentMarker.Position = MainMap.FromLocalToLatLng((int)p.X, (int)p.Y); + } + + // move current marker with left holding + void MainMap_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) + { + if(e.LeftButton == System.Windows.Input.MouseButtonState.Pressed) + { + System.Windows.Point p = e.GetPosition(MainMap); + currentMarker.Position = MainMap.FromLocalToLatLng((int)p.X, (int)p.Y); + } + } + + // zoo max & center markers + private void button13_Click(object sender, RoutedEventArgs e) + { + MainMap.ZoomAndCenterMarkers(null); + + /* + PointAnimation panMap = new PointAnimation(); + panMap.Duration = TimeSpan.FromSeconds(1); + panMap.From = new Point(MainMap.Position.Lat, MainMap.Position.Lng); + panMap.To = new Point(0, 0); + Storyboard.SetTarget(panMap, MainMap); + Storyboard.SetTargetProperty(panMap, new PropertyPath(GMapControl.MapPointProperty)); + + Storyboard panMapStoryBoard = new Storyboard(); + panMapStoryBoard.Children.Add(panMap); + panMapStoryBoard.Begin(this); + */ + } + + // tile louading starts + void MainMap_OnTileLoadStart() + { + System.Windows.Forms.MethodInvoker m = delegate() + { + progressBar1.Visibility = Visibility.Visible; + }; + + try + { + this.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, m); + } + catch + { + } + } + + // tile loading stops + void MainMap_OnTileLoadComplete(long ElapsedMilliseconds) + { + MainMap.ElapsedMilliseconds = ElapsedMilliseconds; + + System.Windows.Forms.MethodInvoker m = delegate() + { + progressBar1.Visibility = Visibility.Hidden; + groupBox3.Header = "loading, last in " + MainMap.ElapsedMilliseconds + "ms"; + }; + + try + { + this.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, m); + } + catch + { + } + } + + // current location changed + void MainMap_OnCurrentPositionChanged(PointLatLng point) + { + mapgroup.Header = "gmap: " + point; + } + + // reload + private void button1_Click(object sender, RoutedEventArgs e) + { + MainMap.ReloadMap(); + } + + // enable current marker + private void checkBoxCurrentMarker_Checked(object sender, RoutedEventArgs e) + { + if(currentMarker != null) + { + MainMap.Markers.Add(currentMarker); + } + } + + // disable current marker + private void checkBoxCurrentMarker_Unchecked(object sender, RoutedEventArgs e) + { + if(currentMarker != null) + { + MainMap.Markers.Remove(currentMarker); + } + } + + // enable map dragging + private void checkBoxDragMap_Checked(object sender, RoutedEventArgs e) + { + MainMap.CanDragMap = true; + } + + // disable map dragging + private void checkBoxDragMap_Unchecked(object sender, RoutedEventArgs e) + { + MainMap.CanDragMap = false; + } + + // goto! + private void button2_Click(object sender, RoutedEventArgs e) + { + try + { + double lat = double.Parse(textBoxLat.Text, CultureInfo.InvariantCulture); + double lng = double.Parse(textBoxLng.Text, CultureInfo.InvariantCulture); + + MainMap.Position = new PointLatLng(lat, lng); + } + catch(Exception ex) + { + MessageBox.Show("incorrect coordinate format: " + ex.Message); + } + } + + // goto by geocoder + private void textBoxGeo_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) + { + if(e.Key == System.Windows.Input.Key.Enter) + { + GeoCoderStatusCode status = MainMap.SetCurrentPositionByKeywords(textBoxGeo.Text); + if(status != GeoCoderStatusCode.G_GEO_SUCCESS) + { + MessageBox.Show("Google Maps Geocoder can't find: '" + textBoxGeo.Text + "', reason: " + status.ToString(), "GMap.NET", MessageBoxButton.OK, MessageBoxImage.Exclamation); + } + else + { + currentMarker.Position = MainMap.Position; + } + } + } + + // zoom changed + private void sliderZoom_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) + { + // updates circles on map + foreach(var c in Circles) + { + UpdateCircle(c.Shape as Circle); + } + } + + // zoom up + private void czuZoomUp_Click(object sender, RoutedEventArgs e) + { + MainMap.Zoom = ((int)MainMap.Zoom) + 1; + } + + // zoom down + private void czuZoomDown_Click(object sender, RoutedEventArgs e) + { + MainMap.Zoom = ((int)(MainMap.Zoom + 0.99)) - 1; + } + + // prefetch + private void button3_Click(object sender, RoutedEventArgs e) + { + RectLatLng area = MainMap.SelectedArea; + if(!area.IsEmpty) + { + for(int i = (int)MainMap.Zoom; i <= MainMap.MaxZoom; i++) + { + MessageBoxResult res = MessageBox.Show("Ready ripp at Zoom = " + i + " ?", "GMap.NET", MessageBoxButton.YesNoCancel); + + if(res == MessageBoxResult.Yes) + { + TilePrefetcher obj = new TilePrefetcher(); + obj.Owner = this; + obj.ShowCompleteMessage = true; + obj.Start(area, i, MainMap.MapProvider, 100); + } + else if(res == MessageBoxResult.No) + { + continue; + } + else if(res == MessageBoxResult.Cancel) + { + break; + } + } + } + else + { + MessageBox.Show("Select map area holding ALT", "GMap.NET", MessageBoxButton.OK, MessageBoxImage.Exclamation); + } + } + + // access mode + private void comboBoxMode_DropDownClosed(object sender, EventArgs e) + { + MainMap.Manager.Mode = (AccessMode)comboBoxMode.SelectedItem; + MainMap.ReloadMap(); + } + + // clear cache + private void button4_Click(object sender, RoutedEventArgs e) + { + if(MessageBox.Show("Are You sure?", "Clear GMap.NET cache?", MessageBoxButton.OKCancel, MessageBoxImage.Warning) == MessageBoxResult.OK) + { + try + { + MainMap.Manager.PrimaryCache.DeleteOlderThan(DateTime.Now, null); + MessageBox.Show("Done. Cache is clear."); + } + catch(Exception ex) + { + MessageBox.Show(ex.Message); + } + } + } + + // export + private void button6_Click(object sender, RoutedEventArgs e) + { + MainMap.ShowExportDialog(); + } + + // import + private void button5_Click(object sender, RoutedEventArgs e) + { + MainMap.ShowImportDialog(); + } + + // use route cache + private void checkBoxCacheRoute_Checked(object sender, RoutedEventArgs e) + { + MainMap.Manager.UseRouteCache = checkBoxCacheRoute.IsChecked.Value; + } + + // use geocoding cahce + private void checkBoxGeoCache_Checked(object sender, RoutedEventArgs e) + { + MainMap.Manager.UseGeocoderCache = checkBoxGeoCache.IsChecked.Value; + MainMap.Manager.UsePlacemarkCache = MainMap.Manager.UseGeocoderCache; + } + + // save currnt view + private void button7_Click(object sender, RoutedEventArgs e) + { + try + { + ImageSource img = MainMap.ToImageSource(); + PngBitmapEncoder en = new PngBitmapEncoder(); + en.Frames.Add(BitmapFrame.Create(img as BitmapSource)); + + Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog(); + dlg.FileName = "GMap.NET Image"; // Default file name + dlg.DefaultExt = ".png"; // Default file extension + dlg.Filter = "Image (.png)|*.png"; // Filter files by extension + dlg.AddExtension = true; + dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); + + // Show save file dialog box + bool? result = dlg.ShowDialog(); + + // Process save file dialog box results + if(result == true) + { + // Save document + string filename = dlg.FileName; + + using(System.IO.Stream st = System.IO.File.OpenWrite(filename)) + { + en.Save(st); + } + } + } + catch(Exception ex) + { + MessageBox.Show(ex.Message); + } + } + + // clear all markers + private void button10_Click(object sender, RoutedEventArgs e) + { + var clear = MainMap.Markers.Where(p => p != null && p != currentMarker); + if(clear != null) + { + for(int i = 0; i < clear.Count(); i++) + { + MainMap.Markers.Remove(clear.ElementAt(i)); + i--; + } + } + + if(radioButtonPerformance.IsChecked == true) + { + tt = 0; + if(!timer.IsEnabled) + { + timer.Start(); + } + } + } + + // add marker + private void button8_Click(object sender, RoutedEventArgs e) + { + GMapMarker m = new GMapMarker(currentMarker.Position); + { + Placemark? p = null; + if(checkBoxPlace.IsChecked.Value) + { + GeoCoderStatusCode status; + var plret = GMapProviders.GoogleMap.GetPlacemark(currentMarker.Position, out status); + if(status == GeoCoderStatusCode.G_GEO_SUCCESS && plret != null) + { + p = plret; + } + } + + string ToolTipText; + if(p != null) + { + ToolTipText = p.Value.Address; + } + else + { + ToolTipText = currentMarker.Position.ToString(); + } + + m.Shape = new CustomMarkerDemo(this, m, ToolTipText); + m.ZIndex = 55; + } + MainMap.Markers.Add(m); + } + + // sets route start + private void button11_Click(object sender, RoutedEventArgs e) + { + start = currentMarker.Position; + } + + // sets route end + private void button9_Click(object sender, RoutedEventArgs e) + { + end = currentMarker.Position; + } + + // adds route + private void button12_Click(object sender, RoutedEventArgs e) + { + RoutingProvider rp = MainMap.MapProvider as RoutingProvider; + if(rp == null) + { + rp = GMapProviders.GoogleMap; // use google if provider does not implement routing + } + + MapRoute route = rp.GetRoute(start, end, false, false, (int)MainMap.Zoom); + if(route != null) + { + GMapMarker m1 = new GMapMarker(start); + m1.Shape = new CustomMarkerDemo(this, m1, "Start: " + route.Name); + + GMapMarker m2 = new GMapMarker(end); + m2.Shape = new CustomMarkerDemo(this, m2, "End: " + start.ToString()); + + GMapMarker mRoute = new GMapMarker(start); + { + mRoute.Route.AddRange(route.Points); + mRoute.RegenerateRouteShape(MainMap); + + mRoute.ZIndex = -1; + } + + MainMap.Markers.Add(m1); + MainMap.Markers.Add(m2); + MainMap.Markers.Add(mRoute); + + MainMap.ZoomAndCenterMarkers(null); + } + } + + // enables tile grid view + private void checkBox1_Checked(object sender, RoutedEventArgs e) + { + MainMap.ShowTileGridLines = true; + } + + // disables tile grid view + private void checkBox1_Unchecked(object sender, RoutedEventArgs e) + { + MainMap.ShowTileGridLines = false; + } + + private void Window_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) + { + int offset = 22; + + if(MainMap.IsFocused) + { + if(e.Key == Key.Left) + { + MainMap.Offset(-offset, 0); + } + else if(e.Key == Key.Right) + { + MainMap.Offset(offset, 0); + } + else if(e.Key == Key.Up) + { + MainMap.Offset(0, -offset); + } + else if(e.Key == Key.Down) + { + MainMap.Offset(0, offset); + } + else if(e.Key == Key.Add) + { + czuZoomUp_Click(null, null); + } + else if(e.Key == Key.Subtract) + { + czuZoomDown_Click(null, null); + } + } + } + + // set real time demo + private void realTimeChanged(object sender, RoutedEventArgs e) + { + MainMap.Markers.Clear(); + + // start performance test + if(radioButtonPerformance.IsChecked == true) + { + timer.Start(); + } + else + { + // stop performance test + timer.Stop(); + } + + // start realtime transport tracking demo + if(radioButtonTransport.IsChecked == true) + { + if(!transport.IsBusy) + { + firstLoadTrasport = true; + transport.RunWorkerAsync(); + } + } + else + { + if(transport.IsBusy) + { + transport.CancelAsync(); + } + } + } + + private void Window_PreviewKeyDown(object sender, KeyEventArgs e) + { + if(e.Key == Key.A) + { + MainMap.Bearing--; + } + else if(e.Key == Key.Z) + { + MainMap.Bearing++; + } + } + } + + public class MapValidationRule : ValidationRule + { + bool UserAcceptedLicenseOnce = false; + internal MainWindow Window; + + public override ValidationResult Validate(object value, CultureInfo cultureInfo) + { + if(!(value is OpenStreetMapProviderBase)) + { + if(!UserAcceptedLicenseOnce) + { + if(File.Exists(AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "License.txt")) + { + string ctn = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "License.txt"); + int li = ctn.IndexOf("License"); + string txt = ctn.Substring(li); + + var d = new Demo.WindowsPresentation.Windows.Message(); + d.richTextBox1.Text = txt; + + if(true == d.ShowDialog()) + { + UserAcceptedLicenseOnce = true; + if(Window != null) + { + Window.Title += " - license accepted by " + Environment.UserName + " at " + DateTime.Now; + } + } + } + else + { + // user deleted License.txt ;} + UserAcceptedLicenseOnce = true; + } + } + + if(!UserAcceptedLicenseOnce) + { + return new ValidationResult(false, "user do not accepted license ;/"); + } + } + + return new ValidationResult(true, null); + } + } +} diff --git a/Demo.WindowsPresentation/Windows/Message.xaml b/Demo.WindowsPresentation/Windows/Message.xaml new file mode 100644 --- /dev/null +++ b/Demo.WindowsPresentation/Windows/Message.xaml @@ -0,0 +1,10 @@ + + + +