Skip to content

Commit 3a5c027

Browse files
committed
- Word highlight color added...
- Warning fix
1 parent 1bcd4a6 commit 3a5c027

File tree

9 files changed

+105
-15
lines changed

9 files changed

+105
-15
lines changed

External/Plugins/ASCompletion/Completion/ASDocumentation.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using PluginCore.Managers;
1717
using PluginCore.Utilities;
1818
using ScintillaNet;
19-
using System.Drawing;
2019

2120
namespace ASCompletion.Completion
2221
{

FlashDevelop/Dialogs/EditorDialog.cs

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,17 @@ public class EditorDialog : Form
8585
private System.Windows.Forms.Label bookmarkLineLabel;
8686
private System.Windows.Forms.Label modifiedLineLabel;
8787
private System.Windows.Forms.Label highlightBackLabel;
88+
private System.Windows.Forms.Label highlightWordBackLabel;
8889
private System.Windows.Forms.Button printMarginButton;
8990
private System.Windows.Forms.Button bookmarkLineButton;
9091
private System.Windows.Forms.Button modifiedLineButton;
9192
private System.Windows.Forms.Button highlightBackButton;
93+
private System.Windows.Forms.Button highlightWordBackButton;
9294
private System.Windows.Forms.TextBox printMarginTextBox;
9395
private System.Windows.Forms.TextBox bookmarkLineTextBox;
9496
private System.Windows.Forms.TextBox modifiedLineTextBox;
9597
private System.Windows.Forms.TextBox highlightBackTextBox;
98+
private System.Windows.Forms.TextBox highlightWordBackTextBox;
9699
private System.Windows.Forms.Button debugLineButton;
97100
private System.Windows.Forms.Button errorLineButton;
98101
private System.Windows.Forms.Button disabledLineButton;
@@ -177,6 +180,9 @@ private void InitializeComponent()
177180
this.highlightBackButton = new System.Windows.Forms.Button();
178181
this.highlightBackLabel = new System.Windows.Forms.Label();
179182
this.highlightBackTextBox = new System.Windows.Forms.TextBox();
183+
this.highlightWordBackButton = new System.Windows.Forms.Button();
184+
this.highlightWordBackLabel = new System.Windows.Forms.Label();
185+
this.highlightWordBackTextBox = new System.Windows.Forms.TextBox();
180186
this.modifiedLineButton = new System.Windows.Forms.Button();
181187
this.modifiedLineLabel = new System.Windows.Forms.Label();
182188
this.modifiedLineTextBox = new System.Windows.Forms.TextBox();
@@ -205,7 +211,7 @@ private void InitializeComponent()
205211
// okButton
206212
//
207213
this.okButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
208-
this.okButton.Location = new System.Drawing.Point(431, 534);
214+
this.okButton.Location = new System.Drawing.Point(431, 562);
209215
this.okButton.Name = "okButton";
210216
this.okButton.Size = new System.Drawing.Size(93, 29);
211217
this.okButton.TabIndex = 1;
@@ -217,7 +223,7 @@ private void InitializeComponent()
217223
//
218224
this.applyButton.Enabled = false;
219225
this.applyButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
220-
this.applyButton.Location = new System.Drawing.Point(640, 534);
226+
this.applyButton.Location = new System.Drawing.Point(640, 562);
221227
this.applyButton.Name = "applyButton";
222228
this.applyButton.Size = new System.Drawing.Size(93, 29);
223229
this.applyButton.TabIndex = 3;
@@ -227,23 +233,23 @@ private void InitializeComponent()
227233
//
228234
// exportButton
229235
//
230-
this.exportButton.Location = new System.Drawing.Point(238, 534);
236+
this.exportButton.Location = new System.Drawing.Point(238, 562);
231237
this.exportButton.Name = "exportButton";
232238
this.exportButton.Size = new System.Drawing.Size(35, 29);
233239
this.exportButton.TabIndex = 8;
234240
this.exportButton.Click += new System.EventHandler(this.ExportLanguagesClick);
235241
//
236242
// revertButton
237243
//
238-
this.revertButton.Location = new System.Drawing.Point(285, 534);
244+
this.revertButton.Location = new System.Drawing.Point(285, 562);
239245
this.revertButton.Name = "revertButton";
240246
this.revertButton.Size = new System.Drawing.Size(35, 29);
241247
this.revertButton.TabIndex = 9;
242248
this.revertButton.Click += new System.EventHandler(this.RevertLanguagesClick);
243249
//
244250
// defaultButton
245251
//
246-
this.defaultButton.Location = new System.Drawing.Point(332, 534);
252+
this.defaultButton.Location = new System.Drawing.Point(332, 562);
247253
this.defaultButton.Name = "defaultButton";
248254
this.defaultButton.Size = new System.Drawing.Size(35, 29);
249255
this.defaultButton.TabIndex = 10;
@@ -253,7 +259,7 @@ private void InitializeComponent()
253259
//
254260
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
255261
this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
256-
this.cancelButton.Location = new System.Drawing.Point(536, 534);
262+
this.cancelButton.Location = new System.Drawing.Point(536, 562);
257263
this.cancelButton.Name = "cancelButton";
258264
this.cancelButton.Size = new System.Drawing.Size(93, 29);
259265
this.cancelButton.TabIndex = 2;
@@ -271,7 +277,7 @@ private void InitializeComponent()
271277
this.itemListView.Location = new System.Drawing.Point(14, 49);
272278
this.itemListView.MultiSelect = false;
273279
this.itemListView.Name = "itemListView";
274-
this.itemListView.Size = new System.Drawing.Size(212, 513);
280+
this.itemListView.Size = new System.Drawing.Size(212, 541);
275281
this.itemListView.TabIndex = 5;
276282
this.itemListView.UseCompatibleStateImageBehavior = false;
277283
this.itemListView.View = System.Windows.Forms.View.Details;
@@ -293,7 +299,7 @@ private void InitializeComponent()
293299
this.itemGroupBox.Controls.Add(this.foregroundLabel);
294300
this.itemGroupBox.Controls.Add(this.fontLabel);
295301
this.itemGroupBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
296-
this.itemGroupBox.Location = new System.Drawing.Point(238, 319);
302+
this.itemGroupBox.Location = new System.Drawing.Point(238, 347);
297303
this.itemGroupBox.Name = "itemGroupBox";
298304
this.itemGroupBox.Size = new System.Drawing.Size(494, 204);
299305
this.itemGroupBox.TabIndex = 7;
@@ -598,6 +604,9 @@ private void InitializeComponent()
598604
this.languageGroupBox.Controls.Add(this.highlightBackButton);
599605
this.languageGroupBox.Controls.Add(this.highlightBackLabel);
600606
this.languageGroupBox.Controls.Add(this.highlightBackTextBox);
607+
this.languageGroupBox.Controls.Add(this.highlightWordBackButton);
608+
this.languageGroupBox.Controls.Add(this.highlightWordBackLabel);
609+
this.languageGroupBox.Controls.Add(this.highlightWordBackTextBox);
601610
this.languageGroupBox.Controls.Add(this.modifiedLineButton);
602611
this.languageGroupBox.Controls.Add(this.modifiedLineLabel);
603612
this.languageGroupBox.Controls.Add(this.modifiedLineTextBox);
@@ -617,7 +626,7 @@ private void InitializeComponent()
617626
this.languageGroupBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
618627
this.languageGroupBox.Location = new System.Drawing.Point(238, 10);
619628
this.languageGroupBox.Name = "languageGroupBox";
620-
this.languageGroupBox.Size = new System.Drawing.Size(494, 304);
629+
this.languageGroupBox.Size = new System.Drawing.Size(494, 332);
621630
this.languageGroupBox.TabIndex = 6;
622631
this.languageGroupBox.TabStop = false;
623632
this.languageGroupBox.Text = "Editor Style";
@@ -884,12 +893,38 @@ private void InitializeComponent()
884893
this.disabledLineTextBox.TabIndex = 29;
885894
this.disabledLineTextBox.TextChanged += new System.EventHandler(this.EditorItemChanged);
886895
//
896+
// highlightWordBackButton
897+
//
898+
this.highlightWordBackButton.Location = new System.Drawing.Point(126, 286);
899+
this.highlightWordBackButton.Name = "highlightWordBackButton";
900+
this.highlightWordBackButton.Size = new System.Drawing.Size(33, 30);
901+
this.highlightWordBackButton.TabIndex = 24;
902+
this.highlightWordBackButton.Click += new System.EventHandler(this.HighlightWordBackButtonClick);
903+
//
904+
// highlightWordBackLabel
905+
//
906+
this.highlightWordBackLabel.AutoSize = true;
907+
this.highlightWordBackLabel.FlatStyle = System.Windows.Forms.FlatStyle.System;
908+
this.highlightWordBackLabel.Location = new System.Drawing.Point(14, 270);
909+
this.highlightWordBackLabel.Name = "highlightWordBackLabel";
910+
this.highlightWordBackLabel.Size = new System.Drawing.Size(88, 16);
911+
this.highlightWordBackLabel.TabIndex = 0;
912+
this.highlightWordBackLabel.Text = "Highlight word back:";
913+
//
914+
// highlightWordBackTextBox
915+
//
916+
this.highlightWordBackTextBox.Location = new System.Drawing.Point(14, 290);
917+
this.highlightWordBackTextBox.Name = "highlightWordBackTextBox";
918+
this.highlightWordBackTextBox.Size = new System.Drawing.Size(103, 23);
919+
this.highlightWordBackTextBox.TabIndex = 23;
920+
this.highlightWordBackTextBox.TextChanged += new System.EventHandler(this.EditorItemChanged);
921+
//
887922
// colorizeCheckBox
888923
//
889924
this.colorizeCheckBox.AutoSize = true;
890925
this.colorizeCheckBox.Checked = true;
891926
this.colorizeCheckBox.CheckState = System.Windows.Forms.CheckState.Indeterminate;
892-
this.colorizeCheckBox.Location = new System.Drawing.Point(14, 274);
927+
this.colorizeCheckBox.Location = new System.Drawing.Point(174, 285);
893928
this.colorizeCheckBox.Name = "italicsCheckBox";
894929
this.colorizeCheckBox.Size = new System.Drawing.Size(58, 20);
895930
this.colorizeCheckBox.TabIndex = 12;
@@ -914,7 +949,7 @@ private void InitializeComponent()
914949
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F);
915950
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
916951
this.CancelButton = this.cancelButton;
917-
this.ClientSize = new System.Drawing.Size(746, 577);
952+
this.ClientSize = new System.Drawing.Size(746, 605);
918953
this.Controls.Add(this.languageGroupBox);
919954
this.Controls.Add(this.itemGroupBox);
920955
this.Controls.Add(this.languageDropDown);
@@ -989,6 +1024,7 @@ private void ApplyLocalizedTexts()
9891024
this.markerForeLabel.Text = TextHelper.GetString("Info.MarkerFore");
9901025
this.printMarginLabel.Text = TextHelper.GetString("Info.PrintMargin");
9911026
this.highlightBackLabel.Text = TextHelper.GetString("Info.HighlightBack");
1027+
this.highlightWordBackLabel.Text = TextHelper.GetString("Info.HighlightWordBack");
9921028
this.modifiedLineLabel.Text = TextHelper.GetString("Info.ModifiedLine");
9931029
this.bookmarkLineLabel.Text = TextHelper.GetString("Info.BookmarkLine");
9941030
this.errorLineLabel.Text = TextHelper.GetString("Info.ErrorLineBack");
@@ -1030,6 +1066,7 @@ private void InitializeGraphics()
10301066
this.printMarginButton.ImageList = this.highlightBackButton.ImageList = imageList;
10311067
this.modifiedLineButton.ImageList = this.bookmarkLineButton.ImageList = imageList;
10321068
this.errorLineButton.ImageList = this.debugLineButton.ImageList = imageList;
1069+
this.highlightWordBackButton.ImageList = imageList;
10331070
}
10341071

10351072
/// <summary>
@@ -1047,8 +1084,8 @@ private void PopulateControls()
10471084
this.markerBackButton.ImageIndex = this.markerForeButton.ImageIndex = 1;
10481085
this.printMarginButton.ImageIndex = this.highlightBackButton.ImageIndex = 1;
10491086
this.modifiedLineButton.ImageIndex = this.bookmarkLineButton.ImageIndex = 1;
1087+
this.disabledLineButton.ImageIndex = this.highlightWordBackButton.ImageIndex = 1;
10501088
this.errorLineButton.ImageIndex = this.debugLineButton.ImageIndex = 1;
1051-
this.disabledLineButton.ImageIndex = 1;
10521089
String[] languageFiles = Directory.GetFiles(this.LangDir, "*.xml");
10531090
foreach (String language in languageFiles)
10541091
{
@@ -1206,6 +1243,7 @@ private void LoadEditorStyles()
12061243
this.marginBackTextBox.Text = "";
12071244
this.printMarginTextBox.Text = "";
12081245
this.highlightBackTextBox.Text = "";
1246+
this.highlightWordBackTextBox.Text = "";
12091247
this.modifiedLineTextBox.Text = "";
12101248
this.bookmarkLineTextBox.Text = "";
12111249
this.errorLineTextBox.Text = "";
@@ -1253,6 +1291,10 @@ private void LoadEditorStyles()
12531291
{
12541292
this.highlightBackTextBox.Text = this.editorStyleNode.Attributes["highlight-back"].Value;
12551293
}
1294+
if (this.editorStyleNode.Attributes["highlightword-back"] != null)
1295+
{
1296+
this.highlightWordBackTextBox.Text = this.editorStyleNode.Attributes["highlightword-back"].Value;
1297+
}
12561298
if (this.editorStyleNode.Attributes["modifiedline-back"] != null)
12571299
{
12581300
this.modifiedLineTextBox.Text = this.editorStyleNode.Attributes["modifiedline-back"].Value;
@@ -1307,6 +1349,8 @@ private void SaveEditorStyles()
13071349
else this.editorStyleNode.RemoveAttribute("print-margin");
13081350
if (this.highlightBackTextBox.Text != "") this.editorStyleNode.SetAttribute("highlight-back", this.highlightBackTextBox.Text);
13091351
else this.editorStyleNode.RemoveAttribute("highlight-back");
1352+
if (this.highlightWordBackTextBox.Text != "") this.editorStyleNode.SetAttribute("highlightword-back", this.highlightWordBackTextBox.Text);
1353+
else this.editorStyleNode.RemoveAttribute("highlightword-back");
13101354
if (this.modifiedLineTextBox.Text != "") this.editorStyleNode.SetAttribute("modifiedline-back", this.modifiedLineTextBox.Text);
13111355
else this.editorStyleNode.RemoveAttribute("modifiedline-back");
13121356
if (this.bookmarkLineTextBox.Text != "") this.editorStyleNode.SetAttribute("bookmarkline-back", this.bookmarkLineTextBox.Text);
@@ -1536,6 +1580,18 @@ private void HighlightBackButtonClick(Object sender, EventArgs e)
15361580
}
15371581
}
15381582

1583+
/// <summary>
1584+
/// When color has been selected, update controls
1585+
/// </summary>
1586+
private void HighlightWordBackButtonClick(Object sender, EventArgs e)
1587+
{
1588+
this.colorDialog.Color = ColorTranslator.FromHtml(this.highlightWordBackTextBox.Text);
1589+
if (this.colorDialog.ShowDialog() == DialogResult.OK)
1590+
{
1591+
this.highlightWordBackTextBox.Text = "0x" + this.colorDialog.Color.ToArgb().ToString("X8").Substring(2, 6);
1592+
}
1593+
}
1594+
15391595
/// <summary>
15401596
/// When color has been selected, update controls
15411597
/// </summary>

PluginCore/PluginCore/Resources/de_DE.resX

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5960,4 +5960,8 @@ Eigene Sprachumgebungen müssen eine Erweiterung der Standard-Sprachumgebung sei
59605960
<value>In Classpaths only</value>
59615961
<comment>Added after 5.0.1</comment>
59625962
</data>
5963+
<data name="FlashDevelop.Info.HighlightWordBack" xml:space="preserve">
5964+
<value>Highlight word:</value>
5965+
<comment>Added after 5.0.2</comment>
5966+
</data>
59635967
</root>

PluginCore/PluginCore/Resources/en_US.resX

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5976,4 +5976,8 @@ Custom locales must be an extension of a default locale, e.g. en-US.</value>
59765976
<data name="ASClassWizard.Wizard.Label.ChosePackage" xml:space="preserve">
59775977
<value>Choose a package folder:</value>
59785978
</data>
5979+
<data name="FlashDevelop.Info.HighlightWordBack" xml:space="preserve">
5980+
<value>Highlight word:</value>
5981+
<comment>Added after 5.0.2</comment>
5982+
</data>
59795983
</root>

PluginCore/PluginCore/Resources/eu_ES.resX

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5957,4 +5957,8 @@ Lokalizazio pertsonalizatuek lehenetsiaren luzapen bat izan behar dute, adb. en-
59575957
<value>In Classpaths only</value>
59585958
<comment>Added after 5.0.1</comment>
59595959
</data>
5960+
<data name="FlashDevelop.Info.HighlightWordBack" xml:space="preserve">
5961+
<value>Highlight word:</value>
5962+
<comment>Added after 5.0.2</comment>
5963+
</data>
59605964
</root>

PluginCore/PluginCore/Resources/ja_JP.resX

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6018,4 +6018,8 @@ UseData:"</value>
60186018
<value>In Classpaths only</value>
60196019
<comment>Added after 5.0.1</comment>
60206020
</data>
6021+
<data name="FlashDevelop.Info.HighlightWordBack" xml:space="preserve">
6022+
<value>Highlight word:</value>
6023+
<comment>Added after 5.0.2</comment>
6024+
</data>
60216025
</root>

PluginCore/PluginCore/Resources/zh_CN.resx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5970,4 +5970,8 @@
59705970
<value>In Classpaths only</value>
59715971
<comment>Added after 5.0.1</comment>
59725972
</data>
5973+
<data name="FlashDevelop.Info.HighlightWordBack" xml:space="preserve">
5974+
<value>Highlight word:</value>
5975+
<comment>Added after 5.0.2</comment>
5976+
</data>
59735977
</root>

PluginCore/ScintillaNet/Configuration/EditorStyle.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ public class EditorStyle : ConfigItem
4343

4444
[XmlAttribute("highlight-back")]
4545
public string highlightback;
46-
46+
47+
[XmlAttribute("highlightword-back")]
48+
public string highlightwordback;
49+
4750
[XmlAttribute("errorline-back")]
4851
public string errorlineback;
4952

@@ -235,6 +238,18 @@ public int HighlightBackColor
235238
}
236239
}
237240

241+
public int HighlightWordBackColor
242+
{
243+
get
244+
{
245+
if (!string.IsNullOrEmpty(highlightwordback))
246+
{
247+
return ResolveColor(highlightwordback);
248+
}
249+
return ResolveColor("0xff0000");
250+
}
251+
}
252+
238253
public int ErrorLineBack
239254
{
240255
get

PluginCore/ScintillaNet/ScintillaControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5570,7 +5570,7 @@ private void HighlightWordsMatchingSelected()
55705570
{
55715571
if (TextLength == 0 || TextLength > 64 * 1024) return;
55725572
Language language = Configuration.GetLanguage(ConfigurationLanguage);
5573-
Int32 color = language.editorstyle.SelectionBackgroundColor;
5573+
Int32 color = language.editorstyle.HighlightWordBackColor;
55745574
String word = GetWordFromPosition(CurrentPos);
55755575
if (String.IsNullOrEmpty(word)) return;
55765576
if (this.PositionIsOnComment(CurrentPos))

0 commit comments

Comments
 (0)