Permalink
Browse files

Fix issue MR-317 - Difficulty right-clicking on Tab

Fix issue MR-318 - Wrong tab gets selected when tab names overflow on the tab bar
  • Loading branch information...
rmcardle committed Feb 19, 2013
1 parent e82a9c5 commit d71bf494df80c86109bf3e41b18c53cc56ac2050
Showing with 32 additions and 25 deletions.
  1. +2 −0 CHANGELOG.TXT
  2. +30 −25 mRemoteV1/UI/UI.Window.Connection.vb
View
@@ -1,4 +1,6 @@
Fix issue MR-225 - Tabs do not open in a panel until multiple panels are displayed.
+ Fix issue MR-317 - Difficulty right-clicking on Tab
+ Fix issue MR-318 - Wrong tab gets selected when tab names overflow on the tab bar
Fix issue MR-321 - New connection panel doesn't get panel header if its the only one or is moved
Added option to always show panel tabs
@@ -834,9 +834,37 @@ Namespace UI
End If
End Sub
+ Private _selectedTabChanged As Boolean = False
Private Sub TabController_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabController.SelectionChanged
- Me.FocusIC()
- Me.RefreshIC()
+ _selectedTabChanged = True
+ FocusIC()
+ RefreshIC()
+ End Sub
+
+ Private Sub TabController_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles TabController.MouseUp
+ Try
+ If Not Native.GetForegroundWindow() = frmMain.Handle And Not _selectedTabChanged Then
+ Dim clickedTab As Magic.Controls.TabPage = TabController.TabPageFromPoint(e.Location)
+ If clickedTab IsNot Nothing And TabController.SelectedTab IsNot clickedTab Then
+ Native.SetForegroundWindow(Handle)
+ TabController.SelectedTab = clickedTab
+ End If
+ End If
+ _selectedTabChanged = False
+
+ Select Case e.Button
+ Case MouseButtons.Left
+ FocusIC()
+ Case MouseButtons.Middle
+ CloseConnectionTab()
+ Case MouseButtons.Right
+ ShowHideMenuButtons()
+ Native.SetForegroundWindow(Handle)
+ cmenTab.Show(TabController, e.Location)
+ End Select
+ Catch ex As Exception
+ MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "TabController_MouseUp (UI.Window.Connections) failed" & vbNewLine & ex.Message, True)
+ End Try
End Sub
Private Sub FocusIC()
@@ -918,29 +946,6 @@ Namespace UI
TabController.SelectedTab = sourceTab
TabController.TabPages.ResumeEvents()
End Sub
-
- Private Sub TabController_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles TabController.MouseUp
- Try
- Dim clickedTab As Magic.Controls.TabPage = TabController.TabPageFromPoint(e.Location)
- If clickedTab IsNot Nothing And TabController.SelectedTab IsNot clickedTab Then
- TabController.SelectedTab = clickedTab
- Return
- End If
-
- Select Case e.Button
- Case MouseButtons.Left
- FocusIC()
- Case MouseButtons.Middle
- TabController.SelectedTab = TabController.TabPageFromPoint(e.Location)
- CloseConnectionTab()
- Case MouseButtons.Right
- ShowHideMenuButtons()
- cmenTab.Show(TabController, e.Location)
- End Select
- Catch ex As Exception
- MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "TabController_MouseUp (UI.Window.Connections) failed" & vbNewLine & ex.Message, True)
- End Try
- End Sub
#End Region
End Class
End Namespace

0 comments on commit d71bf49

Please sign in to comment.