public void Create_Control_IsSuppliedControl()
        {
            var           control = new Control();
            ValuesToolTip sut     = ValuesToolTip.Create(control, new ToolTip());

            Assert.That(sut.Control, Is.EqualTo(control));
        }
        public void Create_SetCallback_IsToolTipSetToolTip()
        {
            var           toolTip = new ToolTip();
            ValuesToolTip sut     = ValuesToolTip.Create(new Control(), toolTip);

            Assert.That(sut.SetCallback, Is.EqualTo(new Action <Control, string>(toolTip.SetToolTip)));
        }
        public void Create_DisableCreatedToolTip_SetsToolTipNotActive()
        {
            var toolTip = new ToolTip {
                Active = true
            };
            ValuesToolTip sut = ValuesToolTip.Create(new Control(), toolTip);

            sut.Disable();

            Assert.That(toolTip.Active, Is.False, "The active tool tip was still active.");
        }
        public void Create_EnableCreatedToolTip_SetsToolTipActive()
        {
            var toolTip = new ToolTip {
                Active = false
            };
            ValuesToolTip sut = ValuesToolTip.Create(new Control(), toolTip);

            sut.Enable();

            Assert.That(toolTip.Active, Is.True, "The non-active tool tip was not set to active.");
        }
        /// <summary>
        /// Default Constructor
        /// </summary>
        public ZedGraphControl()
        {
            InitializeComponent();
            this.tooltip = ValuesToolTip.Create(this, this.pointToolTip);

            // 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);
            base.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ZedGraphControl_MouseClick);

            //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;

            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 = ZedGraphLocale.title_def;
            string xStr     = ZedGraphLocale.x_title_def;
            string yStr     = ZedGraphLocale.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();
        }