[Tween-svn] [1561] Shift + Spaceでポストの選択履歴を辿る機能を実装してみた

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2011年 6月 24日 (金) 17:03:51 JST


Revision: 1561
          http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1561
Author:   anis774
Date:     2011-06-24 17:03:51 +0900 (Fri, 24 Jun 2011)

Log Message:
-----------
Shift + Spaceでポストの選択履歴を辿る機能を実装してみた

Modified Paths:
--------------
    trunk/Tween/Tween.vb


-------------- next part --------------
Modified: trunk/Tween/Tween.vb
===================================================================
--- trunk/Tween/Tween.vb	2011-06-23 14:34:00 UTC (rev 1560)
+++ trunk/Tween/Tween.vb	2011-06-24 08:03:51 UTC (rev 1561)
@@ -230,7 +230,8 @@
         End Sub
     End Structure
 
-    Private replyChains As Stack(Of ReplyChain)
+    Private replyChains As Stack(Of ReplyChain) '[, ]でのリプライ移動の履歴
+    Private selectPostChains As New Stack(Of Tuple(Of TabPage, PostClass)) 'ポスト選択履歴
 
     'Backgroundworkerの処理結果通知用引数構造体
     Private Class GetWorkerResult
@@ -1533,6 +1534,8 @@
             Exit Sub
         End Try
 
+        Me.selectPostChains.Push(Tuple.Create(Me._curTab, _curPost))
+
         If SettingDialog.UnreadManage Then _statuses.SetReadAllTab(True, _curTab.Text, _curItemIndex)
         'キャッシュの書き換え
         ChangeCacheStyleRead(True, _curItemIndex, _curTab)   '既読へ(フォント、文字色)
@@ -5329,6 +5332,9 @@
                             ' お気に入り前後ジャンプ(SHIFT+N←/P→)
                             GoFav(False)
                             Return True
+                        Case Keys.Space
+                            Me.GoBackSelectPostChain()
+                            Return True
                     End Select
                 End If
             Case ModifierState.Alt
@@ -5997,6 +6003,17 @@
         End If
     End Sub
 
+    Private Sub GoBackSelectPostChain()
+        Try
+            Me.selectPostChains.Pop()
+            Dim tabPostPair = Me.selectPostChains.Pop()
+            Me.ListTab.SelectedTab = tabPostPair.Item1
+            Me.SelectListItem(Me._curList, Me._statuses.Tabs(Me._curTab.Text).IndexOf(tabPostPair.Item2.StatusId))
+            Me._curList.EnsureVisible(Me._statuses.Tabs(Me._curTab.Text).IndexOf(tabPostPair.Item2.StatusId))
+        Catch ex As InvalidOperationException
+        End Try
+    End Sub
+
     Private Sub MyList_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
         _anchorFlag = False
     End Sub
@@ -10350,5 +10367,4 @@
     Private Sub OpenUserSpecifiedUrlMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenUserSpecifiedUrlMenuItem.Click, OpenUserSpecifiedUrlMenuItem2.Click
         OpenUserAppointUrl()
     End Sub
-
 End Class



Tween-svn メーリングリストの案内
アーカイブの一覧に戻る