Fix issue MR-332 - Can't select different tab with one click after disconnecting existing tab

(cherry picked from commit 73f71050a0)

Conflicts:
	CHANGELOG.TXT
This commit is contained in:
Riley McArdle
2013-02-25 18:16:22 -06:00
parent 7c3a349bd6
commit 3bc5ceede4
2 changed files with 11 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
Fixed issue MR-332 - Can't select different tab with one click after disconnecting existing tab
1.70 (2013-02-22):
Fixed issue MR-183 - Error trying to save connections when using SQL - Invalid column name _parentConstantId
Fixed issue MR-225 - Tabs do not open in a panel until multiple panels are displayed.

View File

@@ -276,6 +276,7 @@ Namespace UI
End If
nTab.Selected = True
_ignoreChangeSelectedTabClick = False
Return nTab
Catch ex As Exception
@@ -762,6 +763,7 @@ Namespace UI
Dim IC As mRemoteNG.Connection.InterfaceControl = Me.TabController.SelectedTab.Tag
App.Runtime.OpenConnection(IC.Info, mRemoteNG.Connection.Info.Force.DoNotJump)
_ignoreChangeSelectedTabClick = False
End If
End If
Catch ex As Exception
@@ -822,6 +824,7 @@ Namespace UI
Else
Try
Me.TabController.TabPages.Remove(TabToBeClosed)
_ignoreChangeSelectedTabClick = False
Catch comEx As System.Runtime.InteropServices.COMException
CloseTab(TabToBeClosed)
Catch ex As Exception
@@ -834,23 +837,25 @@ Namespace UI
End If
End Sub
Private _selectedTabChanged As Boolean = False
Private _ignoreChangeSelectedTabClick As Boolean = False
Private Sub TabController_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabController.SelectionChanged
_selectedTabChanged = True
_ignoreChangeSelectedTabClick = True
FocusIC()
RefreshIC()
End Sub
Private Sub TabController_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles TabController.MouseUp
Debug.Print("TabController_MouseUp()")
Debug.Print("_ignoreChangeSelectedTabClick = {0}", _ignoreChangeSelectedTabClick)
Try
If Not Native.GetForegroundWindow() = frmMain.Handle And Not _selectedTabChanged Then
If Not Native.GetForegroundWindow() = frmMain.Handle And Not _ignoreChangeSelectedTabClick 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
_ignoreChangeSelectedTabClick = False
Select Case e.Button
Case MouseButtons.Left