OSDN Git Service

AppliStation-GUI,進捗ダイアログでログ表示のテキストボックスが自動でスクロールするように
authorttp <ttp@users.sourceforge.jp>
Sun, 14 Jun 2009 03:12:42 +0000 (12:12 +0900)
committerttp <ttp@users.sourceforge.jp>
Sun, 14 Jun 2009 03:12:42 +0000 (12:12 +0900)
AppliStation/AppliStation.Util/ExecutionProgressViewer.cs

index fa6e0ea..b0ef4fb 100644 (file)
@@ -89,6 +89,8 @@ namespace AppliStation.Util
                {\r
                        NaGetTaskSet taskSet = (NaGetTaskSet) sender;\r
                        \r
+                       bool isCursorPositionLast = logBox.SelectionStart >= logBox.TextLength-1;\r
+                       \r
                        if (e.TaskProgressPercent >= 0) {\r
                                progressBar.Value = (int) e.TaskProgressPercent;\r
                                progressBar.Style = ProgressBarStyle.Continuous;\r
@@ -159,6 +161,10 @@ namespace AppliStation.Util
                                        break;\r
                        }\r
                        \r
+                       if (isCursorPositionLast && logBox.TextLength > 0) {\r
+                               logBox.Select(logBox.TextLength-1, 0);\r
+                       }\r
+                       \r
                        if (taskSet.Done) {\r
                                if ((ActionOnDone & ActionOnDoneFlags.FlashWindow) != 0) {\r
                                        NativeMethods.Form_FlashWindow(this,\r