/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The <see cref="ZoomStateStack"/> object from which to copy</param> public ZoomStateStack( ZoomStateStack rhs ) { foreach ( ZoomState state in rhs ) { List.Add( new ZoomState( state ) ); } }
/// <summary> /// Construct a <see cref="ZoomStateGroup"/> object from the scale ranges settings contained /// in each <see cref="GraphPane" /> for the specified <see cref="MasterPane"/>. /// </summary> /// <param name="masterPane">The <see cref="MasterPane"/> from which to obtain the scale /// range values. /// </param> /// <param name="type">A <see cref="ZoomState.StateType"/> enumeration that indicates whether /// this saved state is from a pan, zoom, or scroll.</param> public ZoomStateGroup( MasterPane masterPane, StateType type ) : base(type) { _stack = new ZoomStateStack(); foreach ( GraphPane pane in masterPane._paneList ) _stack.Add( new ZoomState( pane, type ) ); }
/// <summary> /// Constructor for deserializing objects /// </summary> /// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data /// </param> /// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data /// </param> protected GraphPane( SerializationInfo info, StreamingContext context ) : base(info, context) { // The schema value is just a file version parameter. You can use it to make future versions // backwards compatible as new member variables are added to classes int sch = info.GetInt32( "schema2" ); _xAxis = (XAxis)info.GetValue( "xAxis", typeof( XAxis ) ); if ( sch >= 11 ) _x2Axis = (X2Axis)info.GetValue( "x2Axis", typeof( X2Axis ) ); else _x2Axis = new X2Axis( "" ); _yAxisList = (YAxisList)info.GetValue( "yAxisList", typeof( YAxisList ) ); _y2AxisList = (Y2AxisList)info.GetValue( "y2AxisList", typeof( Y2AxisList ) ); _curveList = (CurveList)info.GetValue( "curveList", typeof( CurveList ) ); _chart = (Chart) info.GetValue( "chart", typeof( Chart ) ); _barSettings = (BarSettings)info.GetValue( "barSettings", typeof( BarSettings ) ); _barSettings._ownerPane = this; _isIgnoreInitial = info.GetBoolean( "isIgnoreInitial" ); _isBoundedRanges = info.GetBoolean( "isBoundedRanges" ); _isIgnoreMissing = info.GetBoolean( "isIgnoreMissing" ); _isAlignGrids = info.GetBoolean( "isAlignGrids" ); _lineType = (LineType)info.GetValue( "lineType", typeof( LineType ) ); _zoomStack = new ZoomStateStack(); }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The GraphPane object from which to copy</param> public GraphPane( GraphPane rhs ) : base(rhs) { // copy values for all the value types _isIgnoreInitial = rhs.IsIgnoreInitial; _isBoundedRanges = rhs._isBoundedRanges; _isAlignGrids = rhs._isAlignGrids; _chart = rhs._chart.Clone(); _barSettings = new BarSettings( rhs._barSettings, this ); _lineType = rhs.LineType; // copy all the reference types with deep copies _xAxis = new XAxis( rhs.XAxis ); _x2Axis = new X2Axis( rhs.X2Axis ); _yAxisList = new YAxisList( rhs._yAxisList ); _y2AxisList = new Y2AxisList( rhs._y2AxisList ); _curveList = new CurveList( rhs.CurveList ); _zoomStack = new ZoomStateStack( rhs._zoomStack ); }
/// <summary> /// Constructor for the <see cref="GraphPane"/> object. This routine will /// initialize all member variables and classes, setting appropriate default /// values as defined in the <see cref="Default"/> class. /// </summary> /// <param name="rect"> A rectangular screen area where the graph is to be displayed. /// This area can be any size, and can be resize at any time using the /// <see cref="PaneBase.Rect"/> property. /// </param> /// <param name="title">The <see cref="PaneBase.Title"/> for this <see cref="GraphPane"/></param> /// <param name="xTitle">The <see cref="Axis.Title"/> for the <see cref="XAxis"/></param> /// <param name="yTitle">The <see cref="Axis.Title"/> for the <see cref="YAxis"/></param> public GraphPane( RectangleF rect, string title, string xTitle, string yTitle ) : base(title, rect) { _xAxis = new XAxis( xTitle ); _x2Axis = new X2Axis( "" ); _yAxisList = new YAxisList(); _y2AxisList = new Y2AxisList(); _yAxisList.Add( new YAxis( yTitle ) ); _y2AxisList.Add( new Y2Axis( string.Empty ) ); _curveList = new CurveList(); _zoomStack = new ZoomStateStack(); _isIgnoreInitial = Default.IsIgnoreInitial; _isBoundedRanges = Default.IsBoundedRanges; _isAlignGrids = false; _chart = new Chart(); _barSettings = new BarSettings( this ); _lineType = Default.LineType; }
/// <summary> /// Default Constructor /// </summary> public ZedGraphControl() { InitializeComponent(); // These commands do nothing, but they get rid of the compiler warnings for // unused events bool b = MouseDown == null || MouseUp == null || MouseMove == null; // Link in these events from the base class, since we disable them from this class. base.MouseDown += new System.Windows.Forms.MouseEventHandler( this.ZedGraphControl_MouseDown ); base.MouseUp += new System.Windows.Forms.MouseEventHandler( this.ZedGraphControl_MouseUp ); base.MouseMove += new System.Windows.Forms.MouseEventHandler( this.ZedGraphControl_MouseMove ); //this.MouseWheel += new System.Windows.Forms.MouseEventHandler( this.ZedGraphControl_MouseWheel ); // Use double-buffering for flicker-free updating: SetStyle( ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.ResizeRedraw, true ); //isTransparentBackground = false; //SetStyle( ControlStyles.Opaque, false ); SetStyle( ControlStyles.SupportsTransparentBackColor, true ); //this.BackColor = Color.Transparent; _resourceManager = new ResourceManager( "VixenModules.App.Curves.ZedGraph.ZedGraphLocale", Assembly.GetExecutingAssembly()); Rectangle rect = new Rectangle( 0, 0, this.Size.Width, this.Size.Height ); _masterPane = new MasterPane( "", rect ); _masterPane.Margin.All = 0; _masterPane.Title.IsVisible = false; string titleStr = _resourceManager.GetString( "title_def" ); string xStr = _resourceManager.GetString( "x_title_def" ); string yStr = _resourceManager.GetString( "y_title_def" ); //GraphPane graphPane = new GraphPane( rect, "Title", "X Axis", "Y Axis" ); GraphPane graphPane = new GraphPane( rect, titleStr, xStr, yStr ); using ( Graphics g = this.CreateGraphics() ) { graphPane.AxisChange( g ); //g.Dispose(); } _masterPane.Add( graphPane ); this.hScrollBar1.Minimum = 0; this.hScrollBar1.Maximum = 100; this.hScrollBar1.Value = 0; this.vScrollBar1.Minimum = 0; this.vScrollBar1.Maximum = 100; this.vScrollBar1.Value = 0; _xScrollRange = new ScrollRange( true ); _yScrollRangeList = new ScrollRangeList(); _y2ScrollRangeList = new ScrollRangeList(); _yScrollRangeList.Add( new ScrollRange( true ) ); _y2ScrollRangeList.Add( new ScrollRange( false ) ); _zoomState = null; _zoomStateStack = new ZoomStateStack(); }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The <see cref="ZoomStateGroup"/> object from which to copy</param> public ZoomStateGroup( ZoomStateGroup rhs ) : base(rhs.Type) { _stack = new ZoomStateStack( rhs._stack ); }
/// <summary> /// Constructor for the <see cref="GraphPane"/> object. This routine will /// initialize all member variables and classes, setting appropriate default /// values as defined in the <see cref="Default"/> class. /// </summary> /// <param name="rect"> A rectangular screen area where the graph is to be displayed. /// This area can be any size, and can be resize at any time using the /// <see cref="PaneBase.Rect"/> property. /// </param> /// <param name="title">The <see cref="PaneBase.Title"/> for this <see cref="GraphPane"/></param> /// <param name="xTitle">The <see cref="Axis.Title"/> for the <see cref="XAxis"/></param> /// <param name="yTitle">The <see cref="Axis.Title"/> for the <see cref="YAxis"/></param> public GraphPane( RectangleF rect, string title, string xTitle, string yTitle ) : base( title, rect ) { _xAxis = new XAxis( xTitle ); _x2Axis = new X2Axis( "" ); _yAxisList = new YAxisList(); _y2AxisList = new Y2AxisList(); _yAxisList.Add( new YAxis( yTitle ) ); _y2AxisList.Add( new Y2Axis( string.Empty ) ); _curveList = new CurveList(); _zoomStack = new ZoomStateStack(); _isIgnoreInitial = Default.IsIgnoreInitial; _isBoundedRanges = Default.IsBoundedRanges; _isAlignGrids = false; _chart = new Chart(); _barSettings = new BarSettings( this ); _lineType = Default.LineType; m_angle = Default.Angle; m_gasGaugeRegionWidth = Default.GasGaugeRegionWidth; m_gasGaugeBorder = Default.GasGaugeBorder; m_showGasGaugeValueLabel = Default.ShowGasGaugeValueLabel; m_clockwise = Default.Clockwise; m_watchAngle = Default.WatchAngle; m_pieHeight = Default.PieHeight; m_usedAngleBegin = Default.UsedAngleBegin; m_usedAngleEnd = Default.UsedAngleEnd; }