protected override void OnMouseDoubleClick(MouseEventArgs e) { base.OnMouseDoubleClick(e); if (OrbBounds.Contains(e.Location)) { OnOrbDoubleClicked(EventArgs.Empty); } }
/// <summary> /// Overriden. Raises the MouseDown event and tunnels the message to child elements /// </summary> protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) { base.OnMouseDown(e); if (OrbBounds.Contains(e.Location)) { OrbMouseDown(); } else { TabHitTest(e.X, e.Y); } }
/// <summary> /// Overriden. Raises the MouseMove event and tunnels the message to child elements /// </summary> /// <param name="e">A <see cref="T:System.Windows.Forms.MouseEventArgs"></see> that contains the event data.</param> protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e) { base.OnMouseMove(e); if (ActiveTab == null) { return; } bool someTabHitted = false; //Check if mouse on tab if (ActiveTab.TabContentBounds.Contains(e.X, e.Y)) { //Do nothing, everything is on the sensor } //Check if mouse on orb else if (OrbVisible && OrbBounds.Contains(e.Location) && !OrbSelected) { OrbSelected = true; Invalidate(OrbBounds); } //Check if mouse on QuickAccess toolbar else if (QuickAccessVisible && QuickAcessToolbar.Bounds.Contains(e.Location)) { } else { //look for mouse on tabs foreach (RibbonTab tab in Tabs) { if (tab.TabBounds.Contains(e.X, e.Y)) { SetSelectedTab(tab); someTabHitted = true; } } } if (!someTabHitted) { SetSelectedTab(null); } if (OrbSelected && !OrbBounds.Contains(e.Location)) { OrbSelected = false; Invalidate(OrbBounds); } }