|
4 | 4 | using System.Collections; |
5 | 5 | using System.Collections.Concurrent; |
6 | 6 | using System.Diagnostics; |
| 7 | +using System.Reflection; |
7 | 8 | using Kantan.Net.Utilities; |
8 | 9 | using Kantan.Text; |
9 | 10 | using Microsoft.Extensions.Logging; |
@@ -185,24 +186,53 @@ private void Queue_Dialog() |
185 | 186 | lv.SetFocus(); |
186 | 187 | }; |
187 | 188 |
|
| 189 | + tf.TextChanged += delegate(ustring ustring) |
| 190 | + { |
| 191 | + Debug.WriteLine($"{ustring}"); |
| 192 | + }; |
| 193 | + |
188 | 194 | tf.TextChanging += a => |
189 | 195 | { |
190 | 196 |
|
191 | | - var s = a.NewText.ToString().CleanString(); |
| 197 | + var s = a.NewText.ToString().CleanString().Trim('\"'); |
192 | 198 |
|
| 199 | + // Application.MainLoop.Invoke(() => Task.Delay(TimeSpan.FromSeconds(1))); |
193 | 200 | if (SearchQuery.IsValidSourceType(s)) { |
194 | 201 | Queue.Enqueue(s); |
195 | 202 | lv.Source = new ListWrapper(Queue.ToList()); |
196 | | - tf.DeleteAll(); |
197 | | - tf.Text = ustring.Empty; |
198 | | - a.Cancel = true; |
| 203 | + /*tf.DeleteAll(); |
| 204 | + tf.Text = ustring.Empty; |
| 205 | + a.Cancel = false; |
199 | 206 | a.NewText = ustring.Empty; |
| 207 | + tf.DeleteAll();*/ |
200 | 208 | tf.DeleteAll(); |
201 | | - tf.SetFocus(); |
202 | | - tf.SetNeedsDisplay(); |
| 209 | + Debug.WriteLine($"{tf.Text} {s}"); |
| 210 | + // tf.Text = ustring.Empty; |
| 211 | + // a.NewText = ustring.Empty; |
| 212 | + // tf.SetFocus(); |
| 213 | + // tf.SetNeedsDisplay(); |
| 214 | + Application.MainLoop.Invoke(() => Action(tf)); |
| 215 | + tf.Text = ustring.Empty; |
| 216 | + |
| 217 | + Debug.WriteLine($"{tf.Text} {a.NewText}"); |
203 | 218 | } |
204 | 219 | }; |
205 | 220 |
|
| 221 | + static void Action(TextField tf) |
| 222 | + { |
| 223 | + Debug.WriteLine($"clearing"); |
| 224 | + // Task.Delay(TimeSpan.FromSeconds(3)); |
| 225 | + // tf.Text = ustring.Empty; |
| 226 | + // tf.CursorPosition = 0; |
| 227 | + tf.DeleteAll(); |
| 228 | + tf.ClearHistoryChanges(); |
| 229 | + tf.ClearAllSelection(); |
| 230 | + tf.SetNeedsDisplay(); |
| 231 | + Debug.WriteLine($"cleared"); |
| 232 | + } |
| 233 | + |
| 234 | + void Reload() { } |
| 235 | + |
206 | 236 | d.Add(tf, lv); |
207 | 237 | d.AddButton(btnRm); |
208 | 238 | d.AddButton(btnRmAll); |
@@ -247,7 +277,7 @@ private void Browse_Clicked() |
247 | 277 | Queue.Enqueue(fs); |
248 | 278 | } |
249 | 279 |
|
250 | | - NextQueue(); |
| 280 | + // NextQueue(); |
251 | 281 | } |
252 | 282 |
|
253 | 283 | else { |
|
0 commit comments