/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The <see c_ref="ZoomStateStack"/> object from which to copy</param> public ZoomStateStack(ZoomStateStack rhs) { foreach (ZoomState state in rhs) { Add(new ZoomState(state)); } }
/// <summary> /// Default Constructor /// </summary> public GraphControl() { 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 += ZedGraphControl_MouseDown; base.MouseUp += ZedGraphControl_MouseUp; base.MouseMove += 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("UIGraphLib.GraphLocale", Assembly.GetExecutingAssembly()); Rectangle rect = new Rectangle(0, 0, Size.Width, 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 = CreateGraphics()) { graphPane.AxisChange(g); //g.Dispose(); } _masterPane.Add(graphPane); hScrollBar1.Minimum = 0; hScrollBar1.Maximum = 100; hScrollBar1.Value = 0; vScrollBar1.Minimum = 0; vScrollBar1.Maximum = 100; 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(); }