svnno****@sourc*****
svnno****@sourc*****
2010年 12月 30日 (木) 22:02:33 JST
Revision: 1284 http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1284 Author: anis774 Date: 2010-12-30 22:02:33 +0900 (Thu, 30 Dec 2010) Log Message: ----------- タブが多段表示になっているときに下段のダブが正しくD&Dで移動出来なかったのを修正。 Modified Paths: -------------- trunk/Tween/Tween.vb -------------- next part -------------- Modified: trunk/Tween/Tween.vb =================================================================== --- trunk/Tween/Tween.vb 2010-12-29 19:34:51 UTC (rev 1283) +++ trunk/Tween/Tween.vb 2010-12-30 13:02:33 UTC (rev 1284) @@ -57,6 +57,7 @@ Private _initialLayout As Boolean = True Private _ignoreConfigSave As Boolean 'True:起動時処理中 Private _tabDrag As Boolean 'タブドラッグ中フラグ(DoDragDropを実行するかの判定用) + Private _tabMouseDownPoint As Point Private _rclickTabName As String '右クリックしたタブの名前(Tabコントロール機能不足対応) Private ReadOnly _syncObject As New Object() 'ロック用 Private Const detailHtmlFormatMono1 As String = "<html><head><style type=""text/css""><!-- pre {font-family: """ @@ -3733,14 +3734,11 @@ If e.Button = Windows.Forms.MouseButtons.Left AndAlso _tabDrag Then Dim tn As String = "" - For i As Integer = 0 To ListTab.TabPages.Count - 1 - Dim rect As Rectangle = ListTab.GetTabRect(i) - If rect.Left <= cpos.X AndAlso cpos.X <= rect.Right AndAlso _ - rect.Top <= cpos.Y AndAlso cpos.Y <= rect.Bottom Then - tn = ListTab.TabPages(i).Text - Exit For - End If - Next + Dim dragEnableRectangle As New Rectangle(CInt(_tabMouseDownPoint.X - (SystemInformation.DragSize.Width / 2)), CInt(_tabMouseDownPoint.Y - (SystemInformation.DragSize.Height / 2)), SystemInformation.DragSize.Width, SystemInformation.DragSize.Height) + If Not dragEnableRectangle.Contains(e.Location) Then + 'タブが多段の場合にはMouseDownの前の段階で選択されたタブの段が変わっているので、このタイミングでカーソルの位置からタブを判定出来ない。 + tn = ListTab.SelectedTab.Text + End If If tn = "" Then Exit Sub @@ -6550,6 +6548,7 @@ For i As Integer = 0 To ListTab.TabPages.Count - 1 If Me.ListTab.GetTabRect(i).Contains(e.Location) Then _tabDrag = True + _tabMouseDownPoint = e.Location Exit For End If Next