Skip to content

Commit 3a779cb

Browse files
committed
Merge branch 'development' of https://github.com/fdorg/flashdevelop into ImageManager
# Conflicts: # PluginCore/PluginCore/Interfaces.cs
2 parents 1b6e4ed + a047a4c commit 3a779cb

File tree

9 files changed

+506
-232
lines changed

9 files changed

+506
-232
lines changed

External/Plugins/ProjectManager/Helpers/LineEntryDialog.cs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System;
2-
using System.Drawing;
3-
using System.Collections;
41
using System.ComponentModel;
52
using System.Windows.Forms;
63
using PluginCore;
@@ -13,13 +10,11 @@ namespace ProjectManager.Helpers
1310
/// </summary>
1411
public class LineEntryDialog : Form
1512
{
16-
readonly Keys shortcutToLowercase;
17-
readonly Keys shortcutToUppercase;
1813
string line;
1914

2015
#region Form Designer Components
2116

22-
protected System.Windows.Forms.TextBox lineBox;
17+
private System.Windows.Forms.TextBox lineBox;
2318
private System.Windows.Forms.Button btnOK;
2419
private System.Windows.Forms.Button btnCancel;
2520
/// <summary>
@@ -40,8 +35,6 @@ public string Line
4035

4136
public LineEntryDialog(string captionText, string labelText, string defaultLine)
4237
{
43-
shortcutToLowercase = PluginBase.MainForm.GetShortcutItemKeys("EditMenu.ToLowercase");
44-
shortcutToUppercase = PluginBase.MainForm.GetShortcutItemKeys("EditMenu.ToUppercase");
4538
InitializeComponent();
4639
InititalizeLocalization();
4740
this.Font = PluginBase.Settings.DefaultFont;
@@ -174,16 +167,22 @@ private void btnCancel_Click(object sender, System.EventArgs e)
174167

175168
void OnLineBoxOnKeyDown(object sender, KeyEventArgs args)
176169
{
177-
string selectedText = lineBox.SelectedText;
178-
if (string.IsNullOrEmpty(selectedText)) return;
179-
Keys keys = args.KeyData;
180-
if (keys == shortcutToLowercase) selectedText = selectedText.ToLower();
181-
else if (keys == shortcutToUppercase) selectedText = selectedText.ToUpper();
182-
else return;
183-
int selectionStart = lineBox.SelectionStart;
184-
int selectionLength = lineBox.SelectionLength;
185-
lineBox.Paste(selectedText);
186-
SelectRange(selectionStart, selectionLength);
170+
string shortcutId = PluginBase.MainForm.GetShortcutItemId(args.KeyData);
171+
if (string.IsNullOrEmpty(shortcutId)) return;
172+
173+
switch (shortcutId)
174+
{
175+
case "EditMenu.ToLowercase":
176+
case "EditMenu.ToUppercase":
177+
string selectedText = lineBox.SelectedText;
178+
if (string.IsNullOrEmpty(selectedText)) break;
179+
selectedText = shortcutId == "EditMenu.ToLowercase" ? selectedText.ToLower() : selectedText.ToUpper();
180+
int selectionStart = lineBox.SelectionStart;
181+
int selectionLength = lineBox.SelectionLength;
182+
lineBox.Paste(selectedText);
183+
SelectRange(selectionStart, selectionLength);
184+
break;
185+
}
187186
}
188187

189188
public void SelectRange(int start, int length)

External/Plugins/ProjectManager/PluginMain.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,19 +561,21 @@ private bool HandleKeyEvent(KeyEvent ke)
561561
{
562562
if (activeProject == null) return false;
563563

564-
if (ke.Value == PluginBase.MainForm.GetShortcutItemKeys("ProjectMenu.ConfigurationSelector"))
564+
string shortcutId = PluginBase.MainForm.GetShortcutItemId(ke.Value);
565+
566+
if (shortcutId == "ProjectMenu.ConfigurationSelector")
565567
{
566568
pluginUI.menus.ConfigurationSelector.Focus();
567569
}
568-
else if (ke.Value == PluginBase.MainForm.GetShortcutItemKeys("ProjectMenu.ConfigurationSelectorToggle"))
570+
else if (shortcutId == "ProjectMenu.ConfigurationSelectorToggle")
569571
{
570572
pluginUI.menus.ToggleDebugRelease();
571573
}
572-
else if (ke.Value == PluginBase.MainForm.GetShortcutItemKeys("ProjectMenu.TargetBuildSelector"))
574+
else if (shortcutId == "ProjectMenu.TargetBuildSelector")
573575
{
574576
pluginUI.menus.TargetBuildSelector.Focus();
575577
}
576-
else if (ke.Value == PluginBase.MainForm.GetShortcutItemKeys("ProjectTree.LocateActiveFile"))
578+
else if (shortcutId == "ProjectTree.LocateActiveFile")
577579
{
578580
ToggleTrackActiveDocument();
579581
}

FlashDevelop/Bin/Debug/Library/AS3/intrinsic/FP11/Vector.as

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ package
2727
/// [FP10] Searches for an item in the Vector and returns the index position of the item.
2828
public function indexOf (searchElement:T, fromIndex:int = 0) : int;
2929

30+
/// [FP19] Insert a single element into the Vector.
31+
public function insertAt (index:int, element:T) : void;
32+
3033
/// [FP10] Converts the elements in the Vector to strings.
3134
public function join (sep:String = ",") : String;
3235

@@ -42,6 +45,9 @@ package
4245
/// [FP10] Adds one or more elements to the end of the Vector and returns the new length of the Vector.
4346
public function push (...args) : uint;
4447

48+
/// [FP19] Remove a single element from the Vector.
49+
public function removeAt (index:int) : T;
50+
4551
/// [FP10] Reverses the order of the elements in the Vector.
4652
public function reverse () : Vector.<T>;
4753

FlashDevelop/Dialogs/ShortcutDialog.cs

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace FlashDevelop.Dialogs
1616
{
1717
public class ShortcutDialog : SmartForm
1818
{
19+
private Timer updateTimer;
1920
private ToolStripMenuItem removeShortcut;
2021
private ToolStripMenuItem revertToDefault;
2122
private ToolStripMenuItem revertAllToDefault;
@@ -41,6 +42,7 @@ public ShortcutDialog()
4142
this.InitializeGraphics();
4243
this.PopulateListView("", false);
4344
this.ApplyScaling();
45+
this.SetupUpdateTimer();
4446
}
4547

4648
#region Windows Form Designer Generated Code
@@ -284,11 +286,11 @@ private void PopulateListView(String filter, Boolean viewCustom)
284286
this.listView.BeginUpdate();
285287
this.listView.Items.Clear();
286288
this.listView.ListViewItemSorter = new ListViewComparer();
287-
foreach (ShortcutItem item in ShortcutManager.RegisteredItems)
289+
foreach (ShortcutItem item in ShortcutManager.RegisteredItems.Values)
288290
{
289291
if (!this.listView.Items.ContainsKey(item.Id) &&
290-
(item.Id.ToLower().Contains(filter.ToLower()) ||
291-
GetKeysAsString(item.Custom).ToLower().Contains(filter.ToLower())))
292+
(item.Id.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0 ||
293+
GetKeysAsString(item.Custom).IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0))
292294
{
293295
if (viewCustom && item.Custom == item.Default) continue;
294296
ListViewItem lvi = new ListViewItem();
@@ -439,14 +441,35 @@ private void ClearFilterClick(Object sender, EventArgs e)
439441
}
440442

441443
/// <summary>
442-
/// Updated the list with the filter
444+
/// Set up the timer for delayed list update with filters.
443445
/// </summary>
444-
private void FilterTextChanged(Object sender, EventArgs e)
446+
private void SetupUpdateTimer()
447+
{
448+
updateTimer = new Timer();
449+
updateTimer.Enabled = false;
450+
updateTimer.Interval = 200;
451+
updateTimer.Tick += UpdateTimer_Tick;
452+
}
453+
454+
/// <summary>
455+
/// Update the list with filter.
456+
/// </summary>
457+
private void UpdateTimer_Tick(Object sender, EventArgs e)
445458
{
459+
updateTimer.Enabled = false;
446460
String searchText = this.filterTextBox.Text.Trim();
447461
this.PopulateListView(searchText, viewCustom.Checked);
448462
}
449463

464+
/// <summary>
465+
/// Restart the timer for updating the list.
466+
/// </summary>
467+
private void FilterTextChanged(Object sender, EventArgs e)
468+
{
469+
updateTimer.Stop();
470+
updateTimer.Start();
471+
}
472+
450473
/// <summary>
451474
/// Closes the shortcut dialog
452475
/// </summary>

0 commit comments

Comments
 (0)