Example #1
0
 public void SetHitListTooltip(HitListEntry hle)
 {
     if (hle == null || hle.PageItem.Tooltip == null)
     {
         _tt.Active = false;
     }
     else
     {
         _tt.SetToolTip(this.Parent, hle.PageItem.Tooltip);
         _tt.Active = true;
     }
 }
Example #2
0
        public void SetHitListCursor(HitListEntry hle)
        {
            Cursor c = Cursors.Default;

            if (hle == null)
            {
            }
            else if (hle.PageItem.HyperLink != null || hle.PageItem.BookmarkLink != null)
            {
                c = Cursors.Hand;
            }

            if (_parent.Cursor != c)
            {
                _parent.Cursor = c;
            }
        }
Example #3
0
        override protected void OnMouseDown(MouseEventArgs mea)
        {
            base.OnMouseDown(mea);                      // allow base to process first
            _MousePosition = new Point(mea.X, mea.Y);

            if (MouseDownRubberBand(mea))
            {
                return;
            }

            HitListEntry hle = cpim.GetHitListEntry(mea, cp.Zoom);

            cpim.SetHitListCursor(hle);                 // set the cursor based on the hit list entry

            if (mea.Button != MouseButtons.Left || hle == null)
            {
                return;
            }

            if (hle.PageItem.HyperLink != null)
            {
                RdlViewer rv      = this.Parent as RdlViewer;
                bool      bInvoke = true;
                if (rv != null)
                {
                    HyperlinkEventArgs hlea = new HyperlinkEventArgs(hle.PageItem.HyperLink);
                    rv.InvokeHyperlink(hlea);     // reset any mousemove
                    bInvoke = !hlea.Cancel;
                }
                try
                {
                    if (bInvoke)
                    {
                        System.Diagnostics.Process.Start(hle.PageItem.HyperLink);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Unable to link to {0}{1}{2}",
                                                  hle.PageItem.HyperLink, Environment.NewLine, ex.Message), "HyperLink Error");
                }
            }
        }
Example #4
0
        override protected void OnMouseMove(MouseEventArgs mea)
        {
            if (cpim.SelectToolEnabled)
            {   // When selection we skip other cursor processing
                if (this.Cursor != Cursors.Cross)
                {
                    this.Cursor = Cursors.Cross;
                }

                if (!_bHaveMouse)
                {
                    return;
                }

                Point newMousePosition = new Point(mea.X, mea.Y);

                // we're rubber banding
                // If we drew previously; we'll draw again to remove old rectangle
                if (this._ptRBLast.X != -1)
                {
                    this.RubberBand(this._ptRBOriginal, _ptRBLast);
                }
                _MousePosition = newMousePosition;
                // Update last point;  but don't rubber band outside our client area
                if (newMousePosition.X < 0)
                {
                    newMousePosition.X = 0;
                }
                if (newMousePosition.X > this.Width)
                {
                    newMousePosition.X = this.Width;
                }
                if (newMousePosition.Y < 0)
                {
                    newMousePosition.Y = 0;
                }
                if (newMousePosition.Y > this.Height)
                {
                    newMousePosition.Y = this.Height;
                }
                _ptRBLast = newMousePosition;
                if (_ptRBLast.X < 0)
                {
                    _ptRBLast.X = 0;
                }
                if (_ptRBLast.Y < 0)
                {
                    _ptRBLast.Y = 0;
                }
                // Draw new lines.
                this.RubberBand(_ptRBOriginal, newMousePosition);
                this.Cursor = Cursors.Cross;            // use cross hair to indicate drawing
                return;
            }

            HitListEntry hle = cpim.GetHitListEntry(mea, cp.Zoom);

            cpim.SetHitListCursor(hle);
            cpim.SetHitListTooltip(hle);
            return;
        }