示例#1
0
        private void HandleMouseInTitle(MouseEventArgs e)
        {
            var item = this.GetTabItemByPoint(e.Location);

            if (item != null)
            {
                var inTitle = item.LocationIsInTitle(e.Location);
                var args    = new TabControlMouseOnTitleEventArgs(item, e.Location);
                if (inTitle)
                {
                    //mouseWasOnTitle = true;
                    this.OnTabControlMouseOnTitle(args);
                    if (!this.mouseEnteredTitle)
                    {
                        this.mouseEnteredTitle = true;
                        this.OnTabControlMouseEnteredTitle(args);
                    }
                }
                else if (this.mouseEnteredTitle) // if (mouseWasOnTitle)
                {
                    //mouseWasOnTitle = false;
                    this.mouseEnteredTitle = false;
                    this.OnTabControlMouseLeftTitle(args);
                }
            }
        }
示例#2
0
 protected internal virtual void OnTabControlMouseLeftTitle(TabControlMouseOnTitleEventArgs e)
 {
     if (this.TabControlMouseLeftTitle != null)
     {
         this.TabControlMouseLeftTitle(e);
     }
 }
 protected internal virtual void OnTabControlMouseEnteredTitle(TabControlMouseOnTitleEventArgs e)
 {
     if (TabControlMouseEnteredTitle != null)
     {
         TabControlMouseEnteredTitle(e);
     }
 }
示例#4
0
        private void TcTerminals_TabControlMouseOnTitle(TabControlMouseOnTitleEventArgs e)
        {
            if (settings.ShowInformationToolTips)
            {
                if (this.currentToolTip == null)
                {
                    this.currentToolTip = new ToolTip();
                    this.currentToolTip.Active = false;
                }
                else if ((this.currentToolTipItem != null) && (this.currentToolTipItem != e.Item))
                {
                    this.currentToolTip.Hide(this.currentToolTipItem);
                    this.currentToolTip.Active = false;
                }

                if (!this.currentToolTip.Active)
                {
                    this.currentToolTip = new ToolTip();
                    this.currentToolTip.ToolTipTitle = Program.Resources.GetString("ConnectionInformation");
                    this.currentToolTip.ToolTipIcon = ToolTipIcon.Info;
                    this.currentToolTip.UseFading = true;
                    this.currentToolTip.UseAnimation = true;
                    this.currentToolTip.IsBalloon = false;
                    this.currentToolTip.Show(e.Item.ToolTipText, e.Item, (int)e.Item.StripRect.X, 2);
                    this.currentToolTipItem = e.Item;
                    this.currentToolTip.Active = true;
                }
            }
        }
示例#5
0
 private void TcTerminals_TabControlMouseLeftTitle(TabControlMouseOnTitleEventArgs e)
 {
     if (this.currentToolTipItem != null)
     {
         this.currentToolTip.Hide(this.currentToolTipItem);
         this.currentToolTip.Active = false;
     }
     /*if (previewPictureBox != null)
     {
         previewPictureBox.Image.Dispose();
         previewPictureBox.Dispose();
         previewPictureBox = null;
     }*/
 }
示例#6
0
 private void tcTerminals_TabControlMouseOnTitle(TabControlMouseOnTitleEventArgs e)
 {
     if(Settings.ShowInformationToolTips)
     {
         //ToolTip
         if((currentToolTipItem != null) && (currentToolTipItem != e.Item))
         {
             currentToolTip.Hide(currentToolTipItem);
         }
         currentToolTip.ToolTipTitle = "Connection information";
         currentToolTip.ToolTipIcon = ToolTipIcon.Info;
         currentToolTip.UseFading = true;
         currentToolTip.UseAnimation = true;
         currentToolTip.IsBalloon = false;
         currentToolTip.Show(e.Item.ToolTipText, e.Item, (int)e.Item.StripRect.X, 2);
         currentToolTipItem = e.Item;
     }
 }
示例#7
0
 private void tcTerminals_TabControlMouseLeftTitle(TabControlMouseOnTitleEventArgs e)
 {
     if(currentToolTipItem != null)
     {
         currentToolTip.Hide(currentToolTipItem);
     }
     /*if (previewPictureBox != null)
     {
         previewPictureBox.Image.Dispose();
         previewPictureBox.Dispose();
         previewPictureBox = null;
     }*/
 }
示例#8
0
 private void tcTerminals_TabControlMouseEnteredTitle(TabControlMouseOnTitleEventArgs e)
 {
     //Picture
     /*previewPictureBox = new PictureBox();
     previewPictureBox.BorderStyle = BorderStyle.FixedSingle;
     previewPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
     previewPictureBox.Size = new Size(320, 240);
     Image capturedImage = screenCapture.CaptureControl(((TerminalTabControlItem)e.Item).TerminalControl);
     previewPictureBox.Image = capturedImage;
     previewPictureBox.Parent = tcTerminals.SelectedItem;
     previewPictureBox.Location = new Point((int)e.Item.StripRect.X, 2);
     previewPictureBox.BringToFront();
     previewPictureBox.Show();*/
     if(Settings.ShowInformationToolTips)
     {
         /*TerminalTabControlItem item = (TerminalTabControlItem)e.Item;
         previewPictureBox = new PictureBox();
         previewPictureBox.BorderStyle = BorderStyle.FixedSingle;
         previewPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
         previewPictureBox.Size = new Size(320, 240);
         string fileName = Path.GetTempPath() + e.Item.Title;
         screenCapture.CaptureControl(((TerminalTabControlItem)e.Item).TerminalControl, fileName, ImageFormatHandler.ImageFormatTypes.imgPNG);
         FileStream fileStream = new FileStream(fileName + ".PNG", FileMode.Open, FileAccess.Read);
         previewPictureBox.Image = Image.FromStream(fileStream);
         fileStream.Close();
         previewPictureBox.Parent = item;
         previewPictureBox.Location = new Point((int)e.Item.StripRect.X, 2);
         previewPictureBox.BringToFront();
         previewPictureBox.Show();*/
         /*if ((currentToolTipItem != null) && (currentToolTipItem != e.Item))
         {
             currentToolTip.Hide(currentToolTipItem);
         }
         currentToolTip.ToolTipTitle = "Connection information";
         currentToolTip.ToolTipIcon = ToolTipIcon.Info;
         currentToolTip.UseFading = true;
         currentToolTip.UseAnimation = true;
         currentToolTip.IsBalloon = false;
         currentToolTip.Show(e.Item.ToolTipText, e.Item, (int)e.Item.StripRect.X, 2);
         currentToolTipItem = e.Item;*/
     }
 }
示例#9
0
 private void HandleMouseInTitle(MouseEventArgs e)
 {
     TabControlItem item = this.GetTabItemByPoint(e.Location);
     if (item != null)
     {
         var inTitle = item.LocationIsInTitle(e.Location);
         TabControlMouseOnTitleEventArgs args = new TabControlMouseOnTitleEventArgs(item, e.Location);
         if (inTitle)
         {
             //mouseWasOnTitle = true;
             this.OnTabControlMouseOnTitle(args);
             if (!this.mouseEnteredTitle)
             {
                 this.mouseEnteredTitle = true;
                 this.OnTabControlMouseEnteredTitle(args);
             }
         }
         else if (this.mouseEnteredTitle) // if (mouseWasOnTitle)
         {
             //mouseWasOnTitle = false;
             this.mouseEnteredTitle = false;
             this.OnTabControlMouseLeftTitle(args);
         }
     }
 }
示例#10
0
 protected internal virtual void OnTabControlMouseOnTitle(TabControlMouseOnTitleEventArgs e)
 {
     if (TabControlMouseOnTitle != null)
     {
         TabControlMouseOnTitle(e);
     }
 }
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (menuGlyph.Rect.Contains(e.Location))
            {
                menuGlyph.IsMouseOver = true;
                this.Invalidate(menuGlyph.Rect);
            }
            else
            {
                if (menuGlyph.IsMouseOver != false && !menuOpen)
                {
                    menuGlyph.IsMouseOver = false;
                    this.Invalidate(menuGlyph.Rect);
                }
            }

            if (closeButton.Rect.Contains(e.Location))
            {
                closeButton.IsMouseOver = true;
                this.Invalidate(closeButton.Rect);
            }
            else
            {
                if (closeButton.IsMouseOver != false)
                {
                    closeButton.IsMouseOver = false;
                    this.Invalidate(closeButton.Rect);
                }
            }

            TabControlItem item = GetTabItemByPoint(e.Location);

            if (item != null)
            {
                bool inTitle = (((item.StripRect.X + item.StripRect.Width - 1) > e.Location.X) &&
                                ((item.StripRect.Y + item.StripRect.Height - 1) > e.Location.Y));

                TabControlMouseOnTitleEventArgs args = new TabControlMouseOnTitleEventArgs(item, e.Location);
                if (inTitle)
                {
                    //mouseWasOnTitle = true;
                    OnTabControlMouseOnTitle(args);
                    if (!mouseEnteredTitle)
                    {
                        mouseEnteredTitle = true;
                        OnTabControlMouseEnteredTitle(args);
                    }
                }
                else if (mouseEnteredTitle)// if (mouseWasOnTitle)
                {
                    //mouseWasOnTitle = false;
                    mouseEnteredTitle = false;
                    OnTabControlMouseLeftTitle(args);
                }
            }

            /*else
             * {
             *  if (mouseWasOnTitle)
             *  {
             *      mouseWasOnTitle = false;
             *      mouseEnteredTitle = false;
             *      OnTabControlMouseLeftTitle(new EventArgs());
             *  }
             * }*/
        }
示例#12
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);

            if (menuGlyph.Rect.Contains(e.Location))
            {
                menuGlyph.IsMouseOver = true;
                this.Invalidate(menuGlyph.Rect);
            }
            else
            {
                if (menuGlyph.IsMouseOver != false && !menuOpen)
                {
                    menuGlyph.IsMouseOver = false;
                    this.Invalidate(menuGlyph.Rect);
                }
            }

            if (closeButton.Rect.Contains(e.Location))
            {
                closeButton.IsMouseOver = true;
                this.Invalidate(closeButton.Rect);
            }
            else
            {
                if (closeButton.IsMouseOver != false)
                {
                    closeButton.IsMouseOver = false;
                    this.Invalidate(closeButton.Rect);
                }
            }

            TabControlItem item = GetTabItemByPoint(e.Location);
            if (item != null)
            {
                bool inTitle = (((item.StripRect.X + item.StripRect.Width - 1) > e.Location.X) &&
                    ((item.StripRect.Y + item.StripRect.Height - 1) > e.Location.Y));

                TabControlMouseOnTitleEventArgs args = new TabControlMouseOnTitleEventArgs(item, e.Location);
                if (inTitle)
                {
                    //mouseWasOnTitle = true;
                    OnTabControlMouseOnTitle(args);
                    if (!mouseEnteredTitle)
                    {
                        mouseEnteredTitle = true;
                        OnTabControlMouseEnteredTitle(args);
                    }
                }
                else if (mouseEnteredTitle)// if (mouseWasOnTitle)
                {
                    //mouseWasOnTitle = false;
                    mouseEnteredTitle = false;
                    OnTabControlMouseLeftTitle(args);
                }
            }
            /*else
            {
                if (mouseWasOnTitle)
                {
                    mouseWasOnTitle = false;
                    mouseEnteredTitle = false;
                    OnTabControlMouseLeftTitle(new EventArgs());
                }
            }*/
        }