• R/O
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javaandroidc++linuxc#objective-ccocoa誰得qtrubybathyscaphegamephpguicwindows翻訳pythonomegattwitterframeworkbtronarduinovb.net計画中(planning stage)directxpreviewertestゲームエンジンdom

どうぶつしょうぎの完全解析をするGUI


コミットメタ情報

リビジョン34 (tree)
日時2015-07-28 16:45:40
作者bellyoshi

ログメッセージ

変更サマリ

差分

--- doubutu.UI.Form/frmMain.vb (revision 33)
+++ doubutu.UI.Form/frmMain.vb (revision 34)
@@ -2,8 +2,7 @@
22 Dim output As String
33
44 Private Sub btnAnalyze_Click(sender As System.Object, e As System.EventArgs) Handles btnAnalyze.Click
5- Analyze()
6- TextBox1.Text = output
5+ ReAnalyze()
76 End Sub
87
98 Private Sub Analyze()
@@ -63,7 +62,9 @@
6362 End Sub
6463
6564 Private Sub BackgroundWorker1_RunWorkerCompleted(sender As System.Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
66- TextBox1.Text = output
65+ Dim lines As String() = output.Split(vbLf)
66+ ListBox1.Items.Clear()
67+ ListBox1.Items.AddRange(lines)
6768 End Sub
6869
6970 Private Sub chkRotated_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles chkRotated.CheckedChanged
@@ -91,13 +92,31 @@
9192 Private Sub FormUpdate()
9293 BoardViewer1.DrawCurrentBitmap()
9394 output = String.Empty
94- TextBox1.Text = String.Empty
95+ ListBox1.Items.Clear()
9596 End Sub
9697
9798 Private Sub ReAnalyze()
9899 While BackgroundWorker1.IsBusy
99100 Threading.Thread.Sleep(1)
101+ Application.DoEvents()
100102 End While
103+ output = String.Empty
104+ ListBox1.Items.Clear()
101105 BackgroundWorker1.RunWorkerAsync()
102106 End Sub
107+
108+ Private Sub ListBox1_Click(sender As System.Object, e As System.EventArgs) Handles ListBox1.Click
109+ If ListBox1.SelectedIndex = -1 Then
110+ Exit Sub
111+ End If
112+ Dim line As String = DirectCast(ListBox1.SelectedItem, String)
113+ Dim startIdx As Integer = line.IndexOfAny({"+"c, "-"c})
114+ Dim movecode As String = line.Substring(startIdx, 7)
115+ Dim move As New Move(movecode)
116+ If BoardViewer1.kyokumen.CanMove(move) Then
117+ BoardViewer1.kyokumen.DoMove(move)
118+ FormUpdate()
119+ ReAnalyze()
120+ End If
121+ End Sub
103122 End Class
--- doubutu.UI.Form/frmMain.Designer.vb (revision 33)
+++ doubutu.UI.Form/frmMain.Designer.vb (revision 34)
@@ -24,14 +24,14 @@
2424 Private Sub InitializeComponent()
2525 Dim Board1 As doubutu.UI.Form.Board = New doubutu.UI.Form.Board()
2626 Me.btnAnalyze = New System.Windows.Forms.Button()
27- Me.TextBox1 = New System.Windows.Forms.TextBox()
2827 Me.btnUndoFirst = New System.Windows.Forms.Button()
2928 Me.btnUndo = New System.Windows.Forms.Button()
3029 Me.btnNext = New System.Windows.Forms.Button()
3130 Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker()
3231 Me.chkRotated = New System.Windows.Forms.CheckBox()
32+ Me.btnBestMove = New System.Windows.Forms.Button()
33+ Me.ListBox1 = New System.Windows.Forms.ListBox()
3334 Me.BoardViewer1 = New doubutu.UI.Form.Control.Board.BoardViewer()
34- Me.btnBestMove = New System.Windows.Forms.Button()
3535 Me.SuspendLayout()
3636 '
3737 'btnAnalyze
@@ -43,15 +43,6 @@
4343 Me.btnAnalyze.Text = "解析"
4444 Me.btnAnalyze.UseVisualStyleBackColor = True
4545 '
46- 'TextBox1
47- '
48- Me.TextBox1.Location = New System.Drawing.Point(805, 41)
49- Me.TextBox1.Multiline = True
50- Me.TextBox1.Name = "TextBox1"
51- Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
52- Me.TextBox1.Size = New System.Drawing.Size(392, 595)
53- Me.TextBox1.TabIndex = 2
54- '
5546 'btnUndoFirst
5647 '
5748 Me.btnUndoFirst.Location = New System.Drawing.Point(86, 35)
@@ -92,6 +83,24 @@
9283 Me.chkRotated.Text = "反転"
9384 Me.chkRotated.UseVisualStyleBackColor = True
9485 '
86+ 'btnBestMove
87+ '
88+ Me.btnBestMove.Location = New System.Drawing.Point(886, 12)
89+ Me.btnBestMove.Name = "btnBestMove"
90+ Me.btnBestMove.Size = New System.Drawing.Size(137, 23)
91+ Me.btnBestMove.TabIndex = 7
92+ Me.btnBestMove.Text = "最善手を着手"
93+ Me.btnBestMove.UseVisualStyleBackColor = True
94+ '
95+ 'ListBox1
96+ '
97+ Me.ListBox1.FormattingEnabled = True
98+ Me.ListBox1.ItemHeight = 15
99+ Me.ListBox1.Location = New System.Drawing.Point(805, 75)
100+ Me.ListBox1.Name = "ListBox1"
101+ Me.ListBox1.Size = New System.Drawing.Size(438, 529)
102+ Me.ListBox1.TabIndex = 8
103+ '
95104 'BoardViewer1
96105 '
97106 Me.BoardViewer1.IsBoardViewRotated = False
@@ -101,20 +110,12 @@
101110 Me.BoardViewer1.Size = New System.Drawing.Size(774, 544)
102111 Me.BoardViewer1.TabIndex = 3
103112 '
104- 'btnBestMove
105- '
106- Me.btnBestMove.Location = New System.Drawing.Point(886, 12)
107- Me.btnBestMove.Name = "btnBestMove"
108- Me.btnBestMove.Size = New System.Drawing.Size(137, 23)
109- Me.btnBestMove.TabIndex = 7
110- Me.btnBestMove.Text = "最善手を着手"
111- Me.btnBestMove.UseVisualStyleBackColor = True
112- '
113113 'frmMain
114114 '
115115 Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!)
116116 Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
117117 Me.ClientSize = New System.Drawing.Size(1272, 672)
118+ Me.Controls.Add(Me.ListBox1)
118119 Me.Controls.Add(Me.btnBestMove)
119120 Me.Controls.Add(Me.chkRotated)
120121 Me.Controls.Add(Me.btnNext)
@@ -121,7 +122,6 @@
121122 Me.Controls.Add(Me.btnUndo)
122123 Me.Controls.Add(Me.btnUndoFirst)
123124 Me.Controls.Add(Me.BoardViewer1)
124- Me.Controls.Add(Me.TextBox1)
125125 Me.Controls.Add(Me.btnAnalyze)
126126 Me.Name = "frmMain"
127127 Me.Text = "Form1"
@@ -130,7 +130,6 @@
130130
131131 End Sub
132132 Friend WithEvents btnAnalyze As System.Windows.Forms.Button
133- Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
134133 Friend WithEvents BoardViewer1 As doubutu.UI.Form.Control.Board.BoardViewer
135134 Friend WithEvents btnUndoFirst As System.Windows.Forms.Button
136135 Friend WithEvents btnUndo As System.Windows.Forms.Button
@@ -138,5 +137,6 @@
138137 Friend WithEvents BackgroundWorker1 As System.ComponentModel.BackgroundWorker
139138 Friend WithEvents chkRotated As System.Windows.Forms.CheckBox
140139 Friend WithEvents btnBestMove As System.Windows.Forms.Button
140+ Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
141141
142142 End Class