Added, Script Editor: added "Find usages" option (available in the "Search" menu, via text editor context menu, via Ctrl-Shift-F shortcut and in the "Find and Replace" window).

Added, Script Editor: double-clicking text resource tab header now shows the corresponding resource in the Resources tree.
Updated, Game configurations, UDMF: added several missing Thing renderstyles.
This commit is contained in:
MaxED 2016-12-08 12:10:43 +00:00
parent 5dd45ffdca
commit 88363a1a66
21 changed files with 2422 additions and 1323 deletions

View file

@ -129,12 +129,16 @@ thingrenderstyles
normal = "Normal";
translucent = "Translucent";
soultrans = "Translucent (Lost Soul)";
translucentstencil = "Translucent (stencil)";
translucentstencil = "Translucent Stencil";
add = "Additive";
subtract = "Subtractive";
stencil = "Stencil";
addstencil = "Additive Stencil";
fuzzy = "Fuzzy";
optfuzzy = "Fuzzy/Shadow (uses r_drawfuzz CVAR)";
shaded = "Shaded";
addshaded = "Additive Shaded";
shadow = "Shadow";
none = "None";
}

BIN
Build/TabControlEX.dll Normal file

Binary file not shown.

View file

@ -252,9 +252,10 @@ Note: All <bool> fields default to false unless mentioned otherwise.
// negative values are used as their absolute. Default = 1.
renderstyle = <string>; // Set per-actor render style, overriding the class default. Possible values can be "normal",
// "none", "add" or "additive", "subtract" or "subtractive", "stencil", "translucentstencil",
// "translucent", "fuzzy", "optfuzzy", "soultrans". Default is an empty string for no change.
fillcolor = <integer>; // Fill color used by the "stencil" and "translucentstencil" rendestyles, as RRGGBB value, default = 0x000000.
// "none", "add" or "additive", "subtract" or "subtractive", "stencil", "translucentstencil",
// "addstencil", "shaded", "addshaded", "translucent", "fuzzy", "optfuzzy", "soultrans" and "shadow".
// Default is an empty string for no change.
fillcolor = <integer>; // Fill color used by the "stencil", "addstencil" and "translucentstencil" rendestyles, as RRGGBB value, default = 0x000000.
alpha = <float>; // Translucency of this actor (if applicable to renderstyle), default is 1.0.
score = <int>; // Score value of this actor, overriding the class default if not null. Default = 0.
pitch = <integer>; // Pitch of thing in degrees. Default = 0 (horizontal).

View file

@ -46,6 +46,7 @@ Source: DevIL.dll; DestDir: {app}; Flags: ignoreversion
Source: SharpCompress.3.5.dll; DestDir: {app}; Flags: ignoreversion
Source: ScintillaNET.3.5.dll; DestDir: {app}; Flags: ignoreversion
Source: SlimDX.dll; DestDir: {app}; Flags: ignoreversion
Source: TabControlEX.dll; DestDir: {app}; Flags: ignoreversion
Source: GPL.txt; DestDir: {app}; Flags: ignoreversion
Source: Compilers\*; DestDir: {app}\Compilers; Flags: ignoreversion recursesubdirs
Source: Configurations\*; DestDir: {app}\Configurations; Flags: ignoreversion recursesubdirs

View file

@ -542,6 +542,9 @@
<Reference Include="System.Management" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="TabControlEX, Version=0.0.3271.41578, Culture=neutral, PublicKeyToken=1db242dc828e4b4e">
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Controls\PairedFloatControl.resx">
@ -692,6 +695,9 @@
</ItemGroup>
<ItemGroup>
<None Include="app.manifest" />
<EmbeddedResource Include="Controls\Scripting\FindUsagesControl.resx">
<DependentUpon>FindUsagesControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Scripting\ScriptEditorControl.resx">
<DependentUpon>ScriptEditorControl.cs</DependentUpon>
</EmbeddedResource>
@ -709,6 +715,13 @@
<Compile Include="Actions\HintsManager.cs" />
<Compile Include="Config\AllTexturesSet.cs" />
<Compile Include="Config\FlagTranslation.cs" />
<Compile Include="Controls\Scripting\FindUsagesControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Scripting\FindUsagesControl.Designer.cs">
<DependentUpon>FindUsagesControl.cs</DependentUpon>
</Compile>
<Compile Include="Data\Scripting\FindUsagesResult.cs" />
<Compile Include="Controls\Scripting\ScriptIconsManager.cs" />
<Compile Include="Controls\Scripting\ScriptResourceDocumentTab.cs">
<SubType>Component</SubType>

View file

@ -0,0 +1,120 @@
namespace CodeImp.DoomBuilder.Controls.Scripting
{
partial class FindUsagesControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if(disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.findusagestree = new CodeImp.DoomBuilder.Controls.BufferedTreeView();
this.contextmenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menurepeat = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.menuremove = new System.Windows.Forms.ToolStripMenuItem();
this.menuremoveall = new System.Windows.Forms.ToolStripMenuItem();
this.contextmenu.SuspendLayout();
this.SuspendLayout();
//
// findusagestree
//
this.findusagestree.ContextMenuStrip = this.contextmenu;
this.findusagestree.Dock = System.Windows.Forms.DockStyle.Fill;
this.findusagestree.DrawMode = System.Windows.Forms.TreeViewDrawMode.OwnerDrawText;
this.findusagestree.HideSelection = false;
this.findusagestree.Location = new System.Drawing.Point(0, 0);
this.findusagestree.Name = "findusagestree";
this.findusagestree.Size = new System.Drawing.Size(619, 150);
this.findusagestree.TabIndex = 0;
this.findusagestree.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.findusagestree_NodeMouseDoubleClick);
this.findusagestree.DrawNode += new System.Windows.Forms.DrawTreeNodeEventHandler(this.findusagestree_DrawNode);
this.findusagestree.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.findusagestree_BeforeExpand);
this.findusagestree.BeforeCollapse += new System.Windows.Forms.TreeViewCancelEventHandler(this.findusagestree_BeforeCollapse);
this.findusagestree.KeyUp += new System.Windows.Forms.KeyEventHandler(this.findusagestree_KeyUp);
this.findusagestree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.findusagestree_NodeMouseClick);
//
// contextmenu
//
this.contextmenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menurepeat,
this.toolStripSeparator1,
this.menuremove,
this.menuremoveall});
this.contextmenu.Name = "contextmenu";
this.contextmenu.Size = new System.Drawing.Size(148, 76);
this.contextmenu.Opening += new System.ComponentModel.CancelEventHandler(this.contextmenu_Opening);
//
// menurepeat
//
this.menurepeat.Image = global::CodeImp.DoomBuilder.Properties.Resources.Reload;
this.menurepeat.Name = "menurepeat";
this.menurepeat.Size = new System.Drawing.Size(147, 22);
this.menurepeat.Text = "Repeat search";
this.menurepeat.Click += new System.EventHandler(this.menurepeat_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(144, 6);
//
// menuremove
//
this.menuremove.Image = global::CodeImp.DoomBuilder.Properties.Resources.Close;
this.menuremove.Name = "menuremove";
this.menuremove.ShortcutKeys = System.Windows.Forms.Keys.Delete;
this.menuremove.Size = new System.Drawing.Size(147, 22);
this.menuremove.Text = "Delete";
this.menuremove.Click += new System.EventHandler(this.menuremove_Click);
//
// menuremoveall
//
this.menuremoveall.Image = global::CodeImp.DoomBuilder.Properties.Resources.Close;
this.menuremoveall.Name = "menuremoveall";
this.menuremoveall.Size = new System.Drawing.Size(147, 22);
this.menuremoveall.Text = "Delete all";
this.menuremoveall.Click += new System.EventHandler(this.menuremoveall_Click);
//
// FindUsagesControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.findusagestree);
this.Name = "FindUsagesControl";
this.Size = new System.Drawing.Size(619, 150);
this.contextmenu.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private CodeImp.DoomBuilder.Controls.BufferedTreeView findusagestree;
private System.Windows.Forms.ContextMenuStrip contextmenu;
private System.Windows.Forms.ToolStripMenuItem menuremove;
private System.Windows.Forms.ToolStripMenuItem menuremoveall;
private System.Windows.Forms.ToolStripMenuItem menurepeat;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
}
}

View file

@ -0,0 +1,340 @@
#region ================== Namespaces
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.Data.Scripting;
using CodeImp.DoomBuilder.Windows;
#endregion
namespace CodeImp.DoomBuilder.Controls.Scripting
{
public partial class FindUsagesControl : UserControl
{
#region ================== SearchData
private class SearchData
{
private FindReplaceOptions options;
private ScriptType scripttype;
public FindReplaceOptions Options { get { return options; } }
public ScriptType ScriptType { get { return scripttype; } }
private SearchData(){}
public SearchData(FindReplaceOptions options, ScriptType scripttype)
{
this.options = options;
this.scripttype = scripttype;
}
}
#endregion
#region ================== Variabels
private ScriptEditorPanel scriptpanel;
private static List<TreeNode> persistentnodes;
#endregion
#region ================== Properties
#endregion
#region ================== Constructor/Setup
public FindUsagesControl()
{
InitializeComponent();
}
internal void Setup(ScriptEditorPanel scriptpanel)
{
this.scriptpanel = scriptpanel;
findusagestree.ImageList = scriptpanel.Icons.Icons; // Link icons
if(persistentnodes != null)
{
findusagestree.Nodes.AddRange(persistentnodes.ToArray());
}
}
internal void OnClose()
{
if(persistentnodes != null)
{
//TECH: unlink persistentnodes from the TreeView, otherwise we'll get an exception
//when trying to add them to a "new" TreeView after reopening the form.
foreach(TreeNode node in persistentnodes) node.Remove();
}
}
#endregion
#region ================== Methods
internal bool FindUsages(FindReplaceOptions options, ScriptType scripttype)
{
if(string.IsNullOrEmpty(options.FindText)) return false;
// If we have already searched for this text/scripttype, remove it now
foreach(TreeNode node in findusagestree.Nodes)
{
SearchData sd = (SearchData)node.Tag;
if(sd.ScriptType == scripttype && string.Compare(sd.Options.FindText, options.FindText, StringComparison.OrdinalIgnoreCase) == 0)
{
// Found it
findusagestree.Nodes.Remove(node);
break;
}
}
// Perform search
Dictionary<ScriptResource, List<FindUsagesResult>> results = new Dictionary<ScriptResource, List<FindUsagesResult>>();
int matchescount = 0;
int matchingfilescount = 0;
if(scripttype == ScriptType.UNKNOWN)
{
// Search among all script types
foreach(HashSet<ScriptResource> reslist in General.Map.Data.ScriptResources.Values)
{
foreach(ScriptResource res in reslist)
{
List<FindUsagesResult> matches = res.FindUsages(options);
if(matches.Count > 0)
{
// Store
results[res] = matches;
matchescount += matches.Count;
matchingfilescount++;
}
}
}
}
else if(General.Map.Data.ScriptResources.ContainsKey(scripttype)
&& General.Map.Data.ScriptResources[scripttype].Count > 0)
{
// Search among given script type
foreach(ScriptResource res in General.Map.Data.ScriptResources[scripttype])
{
List<FindUsagesResult> matches = res.FindUsages(options);
if(matches.Count > 0)
{
// Store
results[res] = matches;
matchescount += matches.Count;
matchingfilescount++;
}
}
}
else
{
// No dice...
scriptpanel.DisplayStatus(ScriptStatusType.Warning, "No sutable text resources to search in!");
}
// Add to the list
if(results.Count > 0)
{
// Create root node
SearchData data = new SearchData(options, scripttype);
string matchescountstr = matchescount + " match" + (matchescount > 1 ? "es" : "");
string matchingfilescountstr = matchingfilescount + " file" + (matchingfilescount > 1 ? "s" : "");
TreeNode root = new TreeNode("Find results for \"" + options.FindText + "\" (" + matchescountstr + " in " + matchingfilescountstr + ")", 1, 1);
root.Tag = data;
// Create result nodes
foreach(KeyValuePair<ScriptResource, List<FindUsagesResult>> group in results)
{
// Create resource root node
int iconindex = scriptpanel.Icons.GetScriptIcon(group.Key.ScriptType);
matchescountstr = group.Value.Count + " match" + (group.Value.Count > 1 ? "es" : "");
TreeNode resroot = new TreeNode("[" + Path.Combine(group.Key.Resource.Location.GetDisplayName(), group.Key.Filename) + "] (" + matchescountstr + ")", iconindex, iconindex);
// Create a node for each match
foreach(FindUsagesResult result in group.Value)
{
TreeNode resultnode = new TreeNode("Line " + result.LineIndex + ": " + result.Line.Trim(), 4, 4);
resultnode.Tag = result;
resroot.Nodes.Add(resultnode);
}
// Add to the root
root.Nodes.Add(resroot);
}
// Add to the tree
root.Expand();
findusagestree.Nodes.Insert(0, root);
// Store nodes
persistentnodes = new List<TreeNode>();
foreach(TreeNode node in findusagestree.Nodes)
persistentnodes.Add(node);
// Done
return true;
}
// No dice...
scriptpanel.DisplayStatus(ScriptStatusType.Warning, "No usages of \"" + options.FindText + "\" found!");
// Done
return false;
}
#endregion
#region ================== Events
private void findusagestree_DrawNode(object sender, DrawTreeNodeEventArgs e)
{
if(!e.Node.IsVisible) return;
FindUsagesResult result = e.Node.Tag as FindUsagesResult;
Point location = new Point(e.Bounds.Location.X, e.Bounds.Location.Y + 1);
if(result != null)
{
Size preferredsize = new Size(e.Bounds.Width, e.Bounds.Height);
// Draw line number
string linenum = "Line " + result.LineIndex + ": ";
TextRenderer.DrawText(e.Graphics, linenum, findusagestree.Font, location, SystemColors.GrayText);
//TECH: TextFormatFlags are ignored when using TextRenderer.MeasureText override without IDeviceContext
location.X += TextRenderer.MeasureText(e.Graphics, linenum, findusagestree.Font, preferredsize, TextFormatFlags.NoPadding).Width;
// Draw text before match
string before = result.Line.Substring(0, result.MatchStart).TrimStart();
if(!string.IsNullOrEmpty(before))
{
TextRenderer.DrawText(e.Graphics, before, findusagestree.Font, location, findusagestree.ForeColor);
location.X += TextRenderer.MeasureText(e.Graphics, before, findusagestree.Font, preferredsize, TextFormatFlags.NoPadding).Width;
}
// Draw matching text
string match = result.Line.Substring(result.MatchStart, result.MatchEnd - result.MatchStart);
TextRenderer.DrawText(e.Graphics, match, findusagestree.Font, location, SystemColors.HotTrack);
location.X += TextRenderer.MeasureText(e.Graphics, match, findusagestree.Font, preferredsize, TextFormatFlags.NoPadding).Width;
// Draw text after match
string after = result.Line.Substring(result.MatchEnd, result.Line.Length - result.MatchEnd).TrimEnd();
if(!string.IsNullOrEmpty(after))
{
TextRenderer.DrawText(e.Graphics, after, findusagestree.Font, location, findusagestree.ForeColor);
}
}
else
{
// Draw node text
TextRenderer.DrawText(e.Graphics, e.Node.Text, findusagestree.Font, location, findusagestree.ForeColor);
}
}
private void findusagestree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
// Select node on Right-click
findusagestree.SelectedNode = e.Node;
}
private void findusagestree_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
FindUsagesResult result = e.Node.Tag as FindUsagesResult;
if(result != null)
{
ScriptResourceDocumentTab t = scriptpanel.OpenResource(result.Resource);
if(t != null)
{
// Show target text
t.MoveToLine(result.LineIndex);
int pos = t.Editor.Scintilla.Lines[result.LineIndex].Position + result.MatchStart;
t.SelectionStart = pos;
t.SelectionEnd = pos;
t.Focus();
// Show in resources control
scriptpanel.ScriptResourcesControl.SelectItem(t);
}
}
}
private void findusagestree_KeyUp(object sender, KeyEventArgs e)
{
if(findusagestree.SelectedNode == null) return;
if(e.KeyCode == Keys.Delete)
{
persistentnodes.Remove(findusagestree.SelectedNode);
findusagestree.Nodes.Remove(findusagestree.SelectedNode);
}
}
private void menuremove_Click(object sender, EventArgs e)
{
if(findusagestree.SelectedNode != null)
{
persistentnodes.Remove(findusagestree.SelectedNode);
findusagestree.Nodes.Remove(findusagestree.SelectedNode);
}
}
private void menuremoveall_Click(object sender, EventArgs e)
{
findusagestree.Nodes.Clear();
persistentnodes.Clear();
}
private void menurepeat_Click(object sender, EventArgs e)
{
if(findusagestree.SelectedNode == null) return;
// Find root node
TreeNode node = findusagestree.SelectedNode;
while(node.Parent != null) node = node.Parent;
SearchData data = node.Tag as SearchData;
if(data != null)
{
// Remove node
findusagestree.Nodes.Remove(node);
// Repeat search
FindUsages(data.Options, data.ScriptType);
}
}
private void contextmenu_Opening(object sender, System.ComponentModel.CancelEventArgs e)
{
menuremove.Enabled = (findusagestree.SelectedNode != null);
menurepeat.Enabled = (findusagestree.SelectedNode != null);
}
private void findusagestree_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
// Root node expanding?
SearchData data = e.Node.Tag as SearchData;
if(data != null)
{
e.Node.ImageIndex = ScriptIconsManager.SCRIPT_GROUP_OPEN_ICONS_OFFSET;
e.Node.SelectedImageIndex = e.Node.ImageIndex;
}
}
private void findusagestree_BeforeCollapse(object sender, TreeViewCancelEventArgs e)
{
// Root node collapsing?
SearchData data = e.Node.Tag as SearchData;
if(data != null)
{
e.Node.ImageIndex = ScriptIconsManager.SCRIPT_GROUP_ICONS_OFFSET;
e.Node.SelectedImageIndex = e.Node.ImageIndex;
}
}
#endregion
}
}

View file

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -28,9 +28,23 @@ namespace CodeImp.DoomBuilder.Controls
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.scriptedit = new ScintillaNET.Scintilla();
this.contextmenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.menuundo = new System.Windows.Forms.ToolStripMenuItem();
this.menuredo = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.menucut = new System.Windows.Forms.ToolStripMenuItem();
this.menucopy = new System.Windows.Forms.ToolStripMenuItem();
this.menupaste = new System.Windows.Forms.ToolStripMenuItem();
this.menudelete = new System.Windows.Forms.ToolStripMenuItem();
this.menuduplicateline = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.menuselectall = new System.Windows.Forms.ToolStripMenuItem();
this.menufindusages = new System.Windows.Forms.ToolStripMenuItem();
this.scriptpanel = new System.Windows.Forms.Panel();
this.functionbar = new System.Windows.Forms.ComboBox();
this.contextmenu.SuspendLayout();
this.scriptpanel.SuspendLayout();
this.SuspendLayout();
//
@ -41,6 +55,7 @@ namespace CodeImp.DoomBuilder.Controls
this.scriptedit.AutoCOrder = ScintillaNET.Order.Custom;
this.scriptedit.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.scriptedit.CaretWidth = 2;
this.scriptedit.ContextMenuStrip = this.contextmenu;
this.scriptedit.Dock = System.Windows.Forms.DockStyle.Fill;
this.scriptedit.ExtraAscent = 1;
this.scriptedit.ExtraDescent = 1;
@ -59,6 +74,114 @@ namespace CodeImp.DoomBuilder.Controls
this.scriptedit.InsertCheck += new System.EventHandler<ScintillaNET.InsertCheckEventArgs>(this.scriptedit_InsertCheck);
this.scriptedit.UpdateUI += new System.EventHandler<ScintillaNET.UpdateUIEventArgs>(this.scriptedit_UpdateUI);
//
// contextmenu
//
this.contextmenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuundo,
this.menuredo,
this.toolStripSeparator1,
this.menucut,
this.menucopy,
this.menupaste,
this.menudelete,
this.menuduplicateline,
this.toolStripSeparator2,
this.menuselectall,
this.menufindusages});
this.contextmenu.Name = "contextmenu";
this.contextmenu.Size = new System.Drawing.Size(209, 236);
this.contextmenu.Opening += new System.ComponentModel.CancelEventHandler(this.contextmenu_Opening);
//
// menuundo
//
this.menuundo.Image = global::CodeImp.DoomBuilder.Properties.Resources.Undo;
this.menuundo.Name = "menuundo";
this.menuundo.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
this.menuundo.Size = new System.Drawing.Size(208, 22);
this.menuundo.Text = "Undo";
this.menuundo.Click += new System.EventHandler(this.menuundo_Click);
//
// menuredo
//
this.menuredo.Image = global::CodeImp.DoomBuilder.Properties.Resources.Redo;
this.menuredo.Name = "menuredo";
this.menuredo.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));
this.menuredo.Size = new System.Drawing.Size(208, 22);
this.menuredo.Text = "Redo";
this.menuredo.Click += new System.EventHandler(this.menuredo_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(205, 6);
//
// menucut
//
this.menucut.Image = global::CodeImp.DoomBuilder.Properties.Resources.Cut;
this.menucut.Name = "menucut";
this.menucut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
this.menucut.Size = new System.Drawing.Size(208, 22);
this.menucut.Text = "Cut";
this.menucut.Click += new System.EventHandler(this.menucut_Click);
//
// menucopy
//
this.menucopy.Image = global::CodeImp.DoomBuilder.Properties.Resources.Copy;
this.menucopy.Name = "menucopy";
this.menucopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.menucopy.Size = new System.Drawing.Size(208, 22);
this.menucopy.Text = "Copy";
this.menucopy.Click += new System.EventHandler(this.menucopy_Click);
//
// menupaste
//
this.menupaste.Image = global::CodeImp.DoomBuilder.Properties.Resources.Paste;
this.menupaste.Name = "menupaste";
this.menupaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
this.menupaste.Size = new System.Drawing.Size(208, 22);
this.menupaste.Text = "Paste";
this.menupaste.Click += new System.EventHandler(this.menupaste_Click);
//
// menudelete
//
this.menudelete.Image = global::CodeImp.DoomBuilder.Properties.Resources.Close;
this.menudelete.Name = "menudelete";
this.menudelete.ShortcutKeys = System.Windows.Forms.Keys.Delete;
this.menudelete.Size = new System.Drawing.Size(208, 22);
this.menudelete.Text = "Delete";
this.menudelete.Click += new System.EventHandler(this.menudelete_Click);
//
// menuduplicateline
//
this.menuduplicateline.Name = "menuduplicateline";
this.menuduplicateline.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D)));
this.menuduplicateline.Size = new System.Drawing.Size(208, 22);
this.menuduplicateline.Text = "Duplicate line";
this.menuduplicateline.Click += new System.EventHandler(this.menuduplicateline_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(205, 6);
//
// menuselectall
//
this.menuselectall.Name = "menuselectall";
this.menuselectall.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
this.menuselectall.Size = new System.Drawing.Size(208, 22);
this.menuselectall.Text = "Select all";
this.menuselectall.Click += new System.EventHandler(this.menuselectall_Click);
//
// menufindusages
//
this.menufindusages.Image = global::CodeImp.DoomBuilder.Properties.Resources.Search;
this.menufindusages.Name = "menufindusages";
this.menufindusages.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.F)));
this.menufindusages.Size = new System.Drawing.Size(208, 22);
this.menufindusages.Text = "Find usages";
this.menufindusages.Click += new System.EventHandler(this.menufindusages_Click);
//
// scriptpanel
//
this.scriptpanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -92,6 +215,7 @@ namespace CodeImp.DoomBuilder.Controls
this.Controls.Add(this.functionbar);
this.Name = "ScriptEditorControl";
this.Size = new System.Drawing.Size(474, 408);
this.contextmenu.ResumeLayout(false);
this.scriptpanel.ResumeLayout(false);
this.ResumeLayout(false);
@ -102,5 +226,17 @@ namespace CodeImp.DoomBuilder.Controls
private ScintillaNET.Scintilla scriptedit;
private System.Windows.Forms.Panel scriptpanel;
private System.Windows.Forms.ComboBox functionbar;
private System.Windows.Forms.ContextMenuStrip contextmenu;
private System.Windows.Forms.ToolStripMenuItem menuundo;
private System.Windows.Forms.ToolStripMenuItem menuredo;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem menucut;
private System.Windows.Forms.ToolStripMenuItem menucopy;
private System.Windows.Forms.ToolStripMenuItem menupaste;
private System.Windows.Forms.ToolStripMenuItem menudelete;
private System.Windows.Forms.ToolStripMenuItem menuduplicateline;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem menuselectall;
private System.Windows.Forms.ToolStripMenuItem menufindusages;
}
}

View file

@ -1269,5 +1269,69 @@ namespace CodeImp.DoomBuilder.Controls
}
#endregion
#region ================== Context menu Events
private void contextmenu_Opening(object sender, System.ComponentModel.CancelEventArgs e)
{
menuundo.Enabled = scriptedit.CanUndo;
menuredo.Enabled = scriptedit.CanRedo;
bool cancopy = (scriptedit.SelectionEnd > scriptedit.SelectionStart);
menucut.Enabled = cancopy;
menucopy.Enabled = cancopy;
menupaste.Enabled = scriptedit.CanPaste;
menudelete.Enabled = cancopy;
menufindusages.Enabled = !string.IsNullOrEmpty(scriptedit.GetWordFromPosition(scriptedit.SelectionStart));
}
private void menuundo_Click(object sender, EventArgs e)
{
scriptedit.Undo();
}
private void menuredo_Click(object sender, EventArgs e)
{
scriptedit.Redo();
}
private void menucut_Click(object sender, EventArgs e)
{
scriptedit.Cut();
}
private void menucopy_Click(object sender, EventArgs e)
{
scriptedit.Copy();
}
private void menupaste_Click(object sender, EventArgs e)
{
scriptedit.Paste();
}
private void menudelete_Click(object sender, EventArgs e)
{
scriptedit.DeleteRange(scriptedit.SelectionStart, scriptedit.SelectionEnd - scriptedit.SelectionStart);
}
private void menuduplicateline_Click(object sender, EventArgs e)
{
DuplicateLine();
}
private void menuselectall_Click(object sender, EventArgs e)
{
scriptedit.SelectAll();
}
private void menufindusages_Click(object sender, EventArgs e)
{
General.Map.ScriptEditor.Editor.FindUsages();
}
#endregion
}
}

View file

@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -101,6 +101,8 @@ namespace CodeImp.DoomBuilder.Controls
this.menufind = new System.Windows.Forms.ToolStripMenuItem();
this.menufindnext = new System.Windows.Forms.ToolStripMenuItem();
this.menufindprevious = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.menufindusages = new System.Windows.Forms.ToolStripMenuItem();
this.toolsmenu = new System.Windows.Forms.ToolStripMenuItem();
this.menucompile = new System.Windows.Forms.ToolStripMenuItem();
this.scripticons = new System.Windows.Forms.ImageList(this.components);
@ -109,13 +111,17 @@ namespace CodeImp.DoomBuilder.Controls
this.projecttabs = new System.Windows.Forms.TabControl();
this.tabresources = new System.Windows.Forms.TabPage();
this.scriptresources = new CodeImp.DoomBuilder.Controls.ScriptResourcesControl();
this.splitter = new System.Windows.Forms.SplitContainer();
this.scriptsplitter = new CodeImp.DoomBuilder.Controls.CollapsibleSplitContainer();
this.tabs = new CodeImp.DoomBuilder.Controls.VSTabControl();
this.label1 = new System.Windows.Forms.Label();
this.infotabs = new Dotnetrix.Controls.TabControlEX();
this.taberrors = new System.Windows.Forms.TabPage();
this.errorlist = new System.Windows.Forms.ListView();
this.colIndex = new System.Windows.Forms.ColumnHeader();
this.colDescription = new System.Windows.Forms.ColumnHeader();
this.colFile = new System.Windows.Forms.ColumnHeader();
this.tabsearchresults = new System.Windows.Forms.TabPage();
this.findusages = new CodeImp.DoomBuilder.Controls.Scripting.FindUsagesControl();
this.infoicons = new System.Windows.Forms.ImageList(this.components);
this.toolbar.SuspendLayout();
this.statusbar.SuspendLayout();
this.menustrip.SuspendLayout();
@ -125,9 +131,13 @@ namespace CodeImp.DoomBuilder.Controls
this.mainsplitter.SuspendLayout();
this.projecttabs.SuspendLayout();
this.tabresources.SuspendLayout();
this.splitter.Panel1.SuspendLayout();
this.splitter.Panel2.SuspendLayout();
this.splitter.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.scriptsplitter)).BeginInit();
this.scriptsplitter.Panel1.SuspendLayout();
this.scriptsplitter.Panel2.SuspendLayout();
this.scriptsplitter.SuspendLayout();
this.infotabs.SuspendLayout();
this.taberrors.SuspendLayout();
this.tabsearchresults.SuspendLayout();
this.SuspendLayout();
//
// toolbar
@ -750,7 +760,9 @@ namespace CodeImp.DoomBuilder.Controls
this.searchmenuitem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menufind,
this.menufindnext,
this.menufindprevious});
this.menufindprevious,
this.toolStripSeparator8,
this.menufindusages});
this.searchmenuitem.Name = "searchmenuitem";
this.searchmenuitem.Size = new System.Drawing.Size(54, 20);
this.searchmenuitem.Text = "Search";
@ -761,7 +773,7 @@ namespace CodeImp.DoomBuilder.Controls
this.menufind.Image = global::CodeImp.DoomBuilder.Properties.Resources.Search;
this.menufind.Name = "menufind";
this.menufind.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
this.menufind.Size = new System.Drawing.Size(164, 22);
this.menufind.Size = new System.Drawing.Size(208, 22);
this.menufind.Text = "Find...";
this.menufind.Click += new System.EventHandler(this.buttonsearch_Click);
//
@ -770,7 +782,7 @@ namespace CodeImp.DoomBuilder.Controls
this.menufindnext.Image = global::CodeImp.DoomBuilder.Properties.Resources.SearchNext;
this.menufindnext.Name = "menufindnext";
this.menufindnext.ShortcutKeys = System.Windows.Forms.Keys.F3;
this.menufindnext.Size = new System.Drawing.Size(164, 22);
this.menufindnext.Size = new System.Drawing.Size(208, 22);
this.menufindnext.Text = "Find next";
this.menufindnext.Click += new System.EventHandler(this.searchnext_Click);
//
@ -779,10 +791,25 @@ namespace CodeImp.DoomBuilder.Controls
this.menufindprevious.Image = global::CodeImp.DoomBuilder.Properties.Resources.SearchPrev;
this.menufindprevious.Name = "menufindprevious";
this.menufindprevious.ShortcutKeys = System.Windows.Forms.Keys.F2;
this.menufindprevious.Size = new System.Drawing.Size(164, 22);
this.menufindprevious.Size = new System.Drawing.Size(208, 22);
this.menufindprevious.Text = "Find previous";
this.menufindprevious.Click += new System.EventHandler(this.searchprev_Click);
//
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";
this.toolStripSeparator8.Size = new System.Drawing.Size(205, 6);
//
// menufindusages
//
this.menufindusages.Image = global::CodeImp.DoomBuilder.Properties.Resources.Search;
this.menufindusages.Name = "menufindusages";
this.menufindusages.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.F)));
this.menufindusages.Size = new System.Drawing.Size(208, 22);
this.menufindusages.Text = "Find usages";
this.menufindusages.Click += new System.EventHandler(this.menufindusages_Click);
//
// toolsmenu
//
this.toolsmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -889,8 +916,8 @@ namespace CodeImp.DoomBuilder.Controls
//
// mainsplitter.Panel2
//
this.mainsplitter.Panel2.Controls.Add(this.splitter);
this.mainsplitter.Panel2.Padding = new System.Windows.Forms.Padding(0, 3, 3, 1);
this.mainsplitter.Panel2.Controls.Add(this.scriptsplitter);
this.mainsplitter.Panel2.Padding = new System.Windows.Forms.Padding(1, 3, 3, 1);
this.mainsplitter.Size = new System.Drawing.Size(928, 449);
this.mainsplitter.SplitterDistance = 200;
this.mainsplitter.SplitterWidth = 8;
@ -931,27 +958,27 @@ namespace CodeImp.DoomBuilder.Controls
this.scriptresources.Size = new System.Drawing.Size(189, 419);
this.scriptresources.TabIndex = 0;
//
// splitter
// scriptsplitter
//
this.splitter.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitter.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.splitter.IsSplitterFixed = true;
this.splitter.Location = new System.Drawing.Point(0, 3);
this.splitter.Name = "splitter";
this.splitter.Orientation = System.Windows.Forms.Orientation.Horizontal;
this.scriptsplitter.Cursor = System.Windows.Forms.Cursors.Default;
this.scriptsplitter.Dock = System.Windows.Forms.DockStyle.Fill;
this.scriptsplitter.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
this.scriptsplitter.Location = new System.Drawing.Point(1, 3);
this.scriptsplitter.Name = "scriptsplitter";
this.scriptsplitter.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitter.Panel1
// scriptsplitter.Panel1
//
this.splitter.Panel1.Controls.Add(this.tabs);
this.scriptsplitter.Panel1.Controls.Add(this.tabs);
//
// splitter.Panel2
// scriptsplitter.Panel2
//
this.splitter.Panel2.Controls.Add(this.label1);
this.splitter.Panel2.Controls.Add(this.errorlist);
this.splitter.Size = new System.Drawing.Size(717, 445);
this.splitter.SplitterDistance = 319;
this.splitter.TabIndex = 2;
this.splitter.TabStop = false;
this.scriptsplitter.Panel2.Controls.Add(this.infotabs);
this.scriptsplitter.Panel2MinSize = 100;
this.scriptsplitter.Size = new System.Drawing.Size(716, 445);
this.scriptsplitter.SplitterDistance = 250;
this.scriptsplitter.SplitterWidth = 8;
this.scriptsplitter.TabIndex = 3;
//
// tabs
//
@ -969,46 +996,61 @@ namespace CodeImp.DoomBuilder.Controls
this.tabs.SelectedTextColor = System.Drawing.SystemColors.HighlightText;
this.tabs.ShowClosingButton = true;
this.tabs.ShowToolTips = true;
this.tabs.Size = new System.Drawing.Size(717, 319);
this.tabs.Size = new System.Drawing.Size(716, 250);
this.tabs.TabIndex = 0;
this.tabs.TabStop = false;
this.tabs.TextColor = System.Drawing.SystemColors.WindowText;
this.tabs.Selecting += new System.Windows.Forms.TabControlCancelEventHandler(this.tabs_Selecting);
this.tabs.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.tabs_MouseDoubleClick);
this.tabs.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tabs_MouseUp);
this.tabs.OnCloseTabClicked += new System.EventHandler<System.Windows.Forms.TabControlEventArgs>(this.tabs_OnCloseTabClicked);
//
// label1
// infotabs
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.label1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(1);
this.label1.Size = new System.Drawing.Size(711, 16);
this.label1.TabIndex = 1;
this.label1.Text = "Errors";
this.infotabs.Alignment = System.Windows.Forms.TabAlignment.Bottom;
this.infotabs.Appearance = Dotnetrix.Controls.TabAppearanceEX.FlatTab;
this.infotabs.Controls.Add(this.taberrors);
this.infotabs.Controls.Add(this.tabsearchresults);
this.infotabs.Dock = System.Windows.Forms.DockStyle.Fill;
this.infotabs.FlatBorderColor = System.Drawing.SystemColors.ControlDark;
this.infotabs.ImageList = this.infoicons;
this.infotabs.ItemSize = new System.Drawing.Size(74, 19);
this.infotabs.Location = new System.Drawing.Point(0, 0);
this.infotabs.Name = "infotabs";
this.infotabs.SelectedIndex = 1;
this.infotabs.SelectedTabColor = System.Drawing.SystemColors.ControlLightLight;
this.infotabs.Size = new System.Drawing.Size(716, 187);
this.infotabs.TabIndex = 0;
this.infotabs.UseVisualStyles = false;
//
// taberrors
//
this.taberrors.Controls.Add(this.errorlist);
this.taberrors.ImageIndex = 0;
this.taberrors.Location = new System.Drawing.Point(4, 4);
this.taberrors.Name = "taberrors";
this.taberrors.Padding = new System.Windows.Forms.Padding(3);
this.taberrors.Size = new System.Drawing.Size(708, 160);
this.taberrors.TabIndex = 0;
this.taberrors.Text = "Errors";
this.taberrors.UseVisualStyleBackColor = true;
//
// errorlist
//
this.errorlist.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.errorlist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colIndex,
this.colDescription,
this.colFile});
this.errorlist.Dock = System.Windows.Forms.DockStyle.Fill;
this.errorlist.FullRowSelect = true;
this.errorlist.GridLines = true;
this.errorlist.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.errorlist.LabelWrap = false;
this.errorlist.Location = new System.Drawing.Point(3, 19);
this.errorlist.Location = new System.Drawing.Point(3, 3);
this.errorlist.MultiSelect = false;
this.errorlist.Name = "errorlist";
this.errorlist.ShowGroups = false;
this.errorlist.Size = new System.Drawing.Size(711, 100);
this.errorlist.Size = new System.Drawing.Size(702, 154);
this.errorlist.SmallImageList = this.errorimages;
this.errorlist.TabIndex = 0;
this.errorlist.TabStop = false;
@ -1031,6 +1073,33 @@ namespace CodeImp.DoomBuilder.Controls
this.colFile.Text = "File";
this.colFile.Width = 150;
//
// tabsearchresults
//
this.tabsearchresults.Controls.Add(this.findusages);
this.tabsearchresults.ImageIndex = 1;
this.tabsearchresults.Location = new System.Drawing.Point(4, 4);
this.tabsearchresults.Name = "tabsearchresults";
this.tabsearchresults.Padding = new System.Windows.Forms.Padding(3);
this.tabsearchresults.Size = new System.Drawing.Size(708, 160);
this.tabsearchresults.TabIndex = 1;
this.tabsearchresults.Text = "Find results";
this.tabsearchresults.UseVisualStyleBackColor = true;
//
// findusages
//
this.findusages.Dock = System.Windows.Forms.DockStyle.Fill;
this.findusages.Location = new System.Drawing.Point(3, 3);
this.findusages.Name = "findusages";
this.findusages.Size = new System.Drawing.Size(702, 154);
this.findusages.TabIndex = 1;
//
// infoicons
//
this.infoicons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("infoicons.ImageStream")));
this.infoicons.TransparentColor = System.Drawing.Color.Transparent;
this.infoicons.Images.SetKeyName(0, "ScriptError.png");
this.infoicons.Images.SetKeyName(1, "Search.png");
//
// ScriptEditorPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@ -1054,9 +1123,13 @@ namespace CodeImp.DoomBuilder.Controls
this.mainsplitter.ResumeLayout(false);
this.projecttabs.ResumeLayout(false);
this.tabresources.ResumeLayout(false);
this.splitter.Panel1.ResumeLayout(false);
this.splitter.Panel2.ResumeLayout(false);
this.splitter.ResumeLayout(false);
this.scriptsplitter.Panel1.ResumeLayout(false);
this.scriptsplitter.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.scriptsplitter)).EndInit();
this.scriptsplitter.ResumeLayout(false);
this.infotabs.ResumeLayout(false);
this.taberrors.ResumeLayout(false);
this.tabsearchresults.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@ -1082,9 +1155,7 @@ namespace CodeImp.DoomBuilder.Controls
private System.Windows.Forms.ToolStripButton buttonpaste;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripDropDownButton buttonscriptconfig;
private System.Windows.Forms.SplitContainer splitter;
private System.Windows.Forms.ListView errorlist;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ColumnHeader colIndex;
private System.Windows.Forms.ColumnHeader colDescription;
private System.Windows.Forms.ColumnHeader colFile;
@ -1150,5 +1221,13 @@ namespace CodeImp.DoomBuilder.Controls
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripMenuItem menuduplicateline;
private System.Windows.Forms.ToolStripMenuItem menunew;
private CollapsibleSplitContainer scriptsplitter;
private Dotnetrix.Controls.TabControlEX infotabs;
private System.Windows.Forms.TabPage taberrors;
private System.Windows.Forms.TabPage tabsearchresults;
private System.Windows.Forms.ImageList infoicons;
private CodeImp.DoomBuilder.Controls.Scripting.FindUsagesControl findusages;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.ToolStripMenuItem menufindusages;
}
}

View file

@ -74,6 +74,7 @@ namespace CodeImp.DoomBuilder.Controls
public ScriptDocumentTab ActiveTab { get { return (tabs.SelectedTab as ScriptDocumentTab); } }
internal ScriptIconsManager Icons { get { return iconsmgr; } }
internal ScriptResourcesControl ScriptResourcesControl { get { return scriptresources; } }
public bool ShowWhitespace { get { return showwhitespace; } }
public bool WrapLongLines { get { return wraplonglines; } }
@ -144,6 +145,9 @@ namespace CodeImp.DoomBuilder.Controls
//mxd. Initialize script resources control
scriptresources.Setup(this, General.Map.Data.ScriptResources);
//mxd. Initialize "find usages" control
findusages.Setup(this);
// Load the script lumps
ScriptDocumentTab activetab = null; //mxd
@ -292,7 +296,7 @@ namespace CodeImp.DoomBuilder.Controls
errorlist.Columns[1].Width = General.Settings.ReadSetting("scriptspanel.errorscolumn1width", errorlist.Columns[1].Width);
errorlist.Columns[2].Width = General.Settings.ReadSetting("scriptspanel.errorscolumn2width", errorlist.Columns[2].Width);
//mxd. Set splitter position and state
//mxd. Set script navigator splitter position and state
if(General.Settings.ReadSetting("scriptspanel.splittercollapsed", false))
mainsplitter.IsCollapsed = true;
@ -305,6 +309,22 @@ namespace CodeImp.DoomBuilder.Controls
}
mainsplitter.SplitPosition = splitterdistance;
//mxd. Set script splitter position and state
if(General.Settings.ReadSetting("scriptspanel.scriptsplittercollapsed", false))
scriptsplitter.IsCollapsed = true;
splitterdistance = General.Settings.ReadSetting("scriptspanel.scriptsplitterdistance", int.MinValue);
if(splitterdistance == int.MinValue)
{
splitterdistance = 250;
if(MainForm.DPIScaler.Width != 1.0f)
splitterdistance = (int)Math.Round(splitterdistance * MainForm.DPIScaler.Width);
}
scriptsplitter.SplitPosition = splitterdistance;
//mxd. Selected info tab
infotabs.SelectedIndex = General.Settings.ReadSetting("scriptspanel.infotabindex", 0);
//mxd. Set text editor settings
showwhitespace = General.Settings.ReadSetting("scriptspanel.showwhitespace", false);
buttonwhitespace.Checked = showwhitespace;
@ -324,6 +344,9 @@ namespace CodeImp.DoomBuilder.Controls
General.Settings.WriteSetting("scriptspanel.errorscolumn2width", errorlist.Columns[2].Width); //mxd
General.Settings.WriteSetting("scriptspanel.splittercollapsed", mainsplitter.IsCollapsed); //mxd
General.Settings.WriteSetting("scriptspanel.splitterdistance", mainsplitter.SplitPosition); //mxd
General.Settings.WriteSetting("scriptspanel.scriptsplittercollapsed", scriptsplitter.IsCollapsed); //mxd
General.Settings.WriteSetting("scriptspanel.scriptsplitterdistance", scriptsplitter.SplitPosition); //mxd
General.Settings.WriteSetting("scriptspanel.infotabindex", infotabs.SelectedIndex); //mxd
General.Settings.WriteSetting("scriptspanel.showwhitespace", showwhitespace); //mxd
General.Settings.WriteSetting("scriptspanel.wraplonglines", wraplonglines); //mxd
}
@ -817,6 +840,51 @@ namespace CodeImp.DoomBuilder.Controls
return false;
}
//mxd
internal bool FindUsages()
{
ScriptDocumentTab t = ActiveTab;
if(t != null)
{
string text = t.Editor.Scintilla.GetWordFromPosition(t.Editor.Scintilla.SelectionStart);
if(string.IsNullOrEmpty(text))
{
DisplayStatus(ScriptStatusType.Warning, "Unable to get search query from the text cursor position!");
}
else
{
var options = new FindReplaceOptions
{
FindText = text,
SearchMode = FindReplaceSearchMode.CURRENT_PROJECT_CURRENT_SCRIPT_TYPE,
WholeWord = true,
CaseSensitive = t.Config.CaseSensitive
};
return FindUsages(options, t.Config.ScriptType);
}
}
else
{
DisplayStatus(ScriptStatusType.Warning, "An active tab is required to perform Find Usages action!");
}
return false;
}
//mxd
public bool FindUsages(FindReplaceOptions options, ScriptType scripttype)
{
if(findusages.FindUsages(options, scripttype))
{
infotabs.SelectedTab = tabsearchresults;
scriptsplitter.IsCollapsed = false;
return true;
}
return false;
}
// This closed the Find & Replace subwindow
public void CloseFindReplace(bool closing)
@ -874,7 +942,7 @@ namespace CodeImp.DoomBuilder.Controls
public void ClearErrors()
{
// Hide list
splitter.Panel2Collapsed = true;
if(infotabs.SelectedTab == taberrors) scriptsplitter.Panel2Collapsed = true;
errorlist.Items.Clear();
// Clear marks
@ -940,8 +1008,16 @@ namespace CodeImp.DoomBuilder.Controls
t.MarkScriptErrors(compilererrors);
}
// Show/hide panel
splitter.Panel2Collapsed = (errorlist.Items.Count == 0);
//mxd. Show/hide panel
if(errorlist.Items.Count > 0)
{
infotabs.SelectedTab = taberrors;
scriptsplitter.Panel2Collapsed = false;
}
else if(infotabs.SelectedTab == taberrors)
{
scriptsplitter.Panel2Collapsed = true;
}
}
//mxd
@ -1471,6 +1547,9 @@ namespace CodeImp.DoomBuilder.Controls
//mxd. Stop status timers
statusresetter.Stop();
statusflasher.Stop();
//mxd
findusages.OnClose();
// Close the sub windows now
if(findreplaceform != null) findreplaceform.Dispose();
@ -1829,6 +1908,13 @@ namespace CodeImp.DoomBuilder.Controls
ForceFocus();
}
//mxd
private void tabs_MouseDoubleClick(object sender, MouseEventArgs e)
{
// Show corresponding resource
scriptresources.SelectItem(tabs.SelectedTab as ScriptResourceDocumentTab);
}
//mxd
private void tabs_OnCloseTabClicked(object sender, TabControlEventArgs e)
{
@ -1922,6 +2008,11 @@ namespace CodeImp.DoomBuilder.Controls
ForceFocus();
}
}
private void menufindusages_Click(object sender, EventArgs e)
{
FindUsages();
}
#endregion
@ -2030,6 +2121,7 @@ namespace CodeImp.DoomBuilder.Controls
{
ScriptDocumentTab t = ActiveTab;
menufind.Enabled = (t != null);
menufindusages.Enabled = (t != null);
bool enable = (!string.IsNullOrEmpty(findoptions.FindText) && t != null);
menufindnext.Enabled = enable;

File diff suppressed because it is too large Load diff

View file

@ -5,9 +5,9 @@ namespace CodeImp.DoomBuilder.Controls.Scripting
{
internal class ScriptIconsManager
{
private const int SCRIPT_TYPE_ICONS_OFFSET = 4;
private const int SCRIPT_GROUP_ICONS_OFFSET = 23;
private const int SCRIPT_GROUP_OPEN_ICONS_OFFSET = 42;
internal const int SCRIPT_TYPE_ICONS_OFFSET = 4;
internal const int SCRIPT_GROUP_ICONS_OFFSET = 23;
internal const int SCRIPT_GROUP_OPEN_ICONS_OFFSET = 42;
private ImageList icons;
public ImageList Icons { get { return icons; } }

View file

@ -186,6 +186,13 @@ namespace CodeImp.DoomBuilder.Controls
#region ================== Methods
public void SelectItem(ScriptResourceDocumentTab tab)
{
if(tab == null) return;
SelectItem(tab.Resource.Resource.Location.location, tab.Resource.Filename,
tab.Resource.LumpIndex, tab.Resource.ScriptType);
}
public void SelectItem(string resourcelocation, string lumpname, int lumpindex, ScriptType scripttype)
{
TreeNode target = FindItem(projecttree.Nodes, resourcelocation, lumpname, lumpindex, scripttype);
@ -488,6 +495,12 @@ namespace CodeImp.DoomBuilder.Controls
UpdateResourcesTree();
}
private void projecttree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
// Select node on Right-click
projecttree.SelectedNode = e.Node;
}
private void projecttree_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
//TODO: special handling for SCRIPTS/DIALOGUE

View file

@ -101,6 +101,7 @@
this.projecttree.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.projecttree_NodeMouseDoubleClick);
this.projecttree.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.projecttree_BeforeExpand);
this.projecttree.BeforeCollapse += new System.Windows.Forms.TreeViewCancelEventHandler(this.projecttree_BeforeCollapse);
this.projecttree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.projecttree_NodeMouseClick);
//
// ScriptResourcesControl
//

View file

@ -0,0 +1,29 @@
using System.Text.RegularExpressions;
namespace CodeImp.DoomBuilder.Data.Scripting
{
public class FindUsagesResult
{
private ScriptResource source;
private string line;
private int lineindex;
private int matchstart;
private int matchend;
public ScriptResource Resource { get { return source; } }
public string Line { get { return line; } }
public int LineIndex { get { return lineindex; } }
public int MatchStart { get { return matchstart; } }
public int MatchEnd { get { return matchend; } }
private FindUsagesResult() { }
public FindUsagesResult(ScriptResource source, Match match, string line, int lineindex)
{
this.source = source;
this.line = line;
this.lineindex = lineindex;
this.matchstart = match.Index;
this.matchend = match.Index + match.Length;
}
}
}

View file

@ -96,6 +96,38 @@ namespace CodeImp.DoomBuilder.Data.Scripting
return false;
}
// Finds text occurencies in the resource. Whole word / ignode case only.
internal List<FindUsagesResult> FindUsages(FindReplaceOptions options)
{
var result = new List<FindUsagesResult>();
// Get text
DataReader res = GetResource();
if(res == null) return result;
MemoryStream stream = res.LoadFile(filename, lumpindex);
if(stream != null)
{
// Add word boundary delimiter
string findtext = (options.WholeWord ? "\\b" + options.FindText + "\\b" : options.FindText);
Regex regex = new Regex(findtext, (options.CaseSensitive ? RegexOptions.None : RegexOptions.IgnoreCase));
using(StreamReader reader = new StreamReader(stream, ScriptEditorControl.Encoding))
{
int lineindex = 0;
while(!reader.EndOfStream)
{
string line = reader.ReadLine();
foreach(Match match in regex.Matches(line))
result.Add(new FindUsagesResult(this, match, line, lineindex));
lineindex++;
}
}
}
return result;
}
private DataReader GetResource()
{
if(resource == null || resource.IsDisposed)

View file

@ -39,6 +39,7 @@ namespace CodeImp.DoomBuilder.Windows
this.findpreviousbutton = new System.Windows.Forms.Button();
this.tabs = new System.Windows.Forms.TabControl();
this.tabfind = new System.Windows.Forms.TabPage();
this.bookmarkallbutton = new System.Windows.Forms.Button();
this.findinbox = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.findbox = new System.Windows.Forms.ComboBox();
@ -89,30 +90,30 @@ namespace CodeImp.DoomBuilder.Windows
// findnextbutton
//
this.findnextbutton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.findnextbutton.Location = new System.Drawing.Point(79, 185);
this.findnextbutton.Location = new System.Drawing.Point(103, 185);
this.findnextbutton.Name = "findnextbutton";
this.findnextbutton.Size = new System.Drawing.Size(100, 25);
this.findnextbutton.TabIndex = 4;
this.findnextbutton.Size = new System.Drawing.Size(88, 25);
this.findnextbutton.TabIndex = 5;
this.findnextbutton.Text = "Find Next";
this.findnextbutton.UseVisualStyleBackColor = true;
this.findnextbutton.Click += new System.EventHandler(this.findnextbutton_Click);
//
// replaceallbutton
//
this.replaceallbutton.Location = new System.Drawing.Point(185, 185);
this.replaceallbutton.Location = new System.Drawing.Point(197, 185);
this.replaceallbutton.Name = "replaceallbutton";
this.replaceallbutton.Size = new System.Drawing.Size(100, 25);
this.replaceallbutton.TabIndex = 7;
this.replaceallbutton.Size = new System.Drawing.Size(88, 25);
this.replaceallbutton.TabIndex = 6;
this.replaceallbutton.Text = "Replace All";
this.replaceallbutton.UseVisualStyleBackColor = true;
this.replaceallbutton.Click += new System.EventHandler(this.replaceallbutton_Click);
//
// replacebutton
//
this.replacebutton.Location = new System.Drawing.Point(79, 185);
this.replacebutton.Location = new System.Drawing.Point(103, 185);
this.replacebutton.Name = "replacebutton";
this.replacebutton.Size = new System.Drawing.Size(100, 25);
this.replacebutton.TabIndex = 6;
this.replacebutton.Size = new System.Drawing.Size(88, 25);
this.replacebutton.TabIndex = 5;
this.replacebutton.Text = "Replace";
this.replacebutton.UseVisualStyleBackColor = true;
this.replacebutton.Click += new System.EventHandler(this.replacebutton_Click);
@ -120,10 +121,10 @@ namespace CodeImp.DoomBuilder.Windows
// findpreviousbutton
//
this.findpreviousbutton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.findpreviousbutton.Location = new System.Drawing.Point(185, 185);
this.findpreviousbutton.Location = new System.Drawing.Point(197, 185);
this.findpreviousbutton.Name = "findpreviousbutton";
this.findpreviousbutton.Size = new System.Drawing.Size(100, 25);
this.findpreviousbutton.TabIndex = 5;
this.findpreviousbutton.Size = new System.Drawing.Size(88, 25);
this.findpreviousbutton.TabIndex = 6;
this.findpreviousbutton.Text = "Find Previous";
this.findpreviousbutton.UseVisualStyleBackColor = true;
this.findpreviousbutton.Click += new System.EventHandler(this.findpreviousbutton_Click);
@ -145,6 +146,7 @@ namespace CodeImp.DoomBuilder.Windows
//
// tabfind
//
this.tabfind.Controls.Add(this.bookmarkallbutton);
this.tabfind.Controls.Add(this.findinbox);
this.tabfind.Controls.Add(this.findpreviousbutton);
this.tabfind.Controls.Add(this.label2);
@ -155,14 +157,25 @@ namespace CodeImp.DoomBuilder.Windows
this.tabfind.Controls.Add(this.findwholeword);
this.tabfind.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.tabfind.ImageIndex = 0;
this.tabfind.Location = new System.Drawing.Point(4, 22);
this.tabfind.Location = new System.Drawing.Point(4, 23);
this.tabfind.Name = "tabfind";
this.tabfind.Padding = new System.Windows.Forms.Padding(3, 16, 3, 3);
this.tabfind.Size = new System.Drawing.Size(291, 216);
this.tabfind.Size = new System.Drawing.Size(291, 215);
this.tabfind.TabIndex = 0;
this.tabfind.Text = "Find";
this.tabfind.UseVisualStyleBackColor = true;
//
// bookmarkallbutton
//
this.bookmarkallbutton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.bookmarkallbutton.Location = new System.Drawing.Point(9, 185);
this.bookmarkallbutton.Name = "bookmarkallbutton";
this.bookmarkallbutton.Size = new System.Drawing.Size(88, 25);
this.bookmarkallbutton.TabIndex = 4;
this.bookmarkallbutton.Text = "Find Usages";
this.bookmarkallbutton.UseVisualStyleBackColor = true;
this.bookmarkallbutton.Click += new System.EventHandler(this.bookmarkallbutton_Click);
//
// findinbox
//
this.findinbox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@ -178,7 +191,7 @@ namespace CodeImp.DoomBuilder.Windows
this.findinbox.Location = new System.Drawing.Point(9, 80);
this.findinbox.Name = "findinbox";
this.findinbox.Size = new System.Drawing.Size(276, 21);
this.findinbox.TabIndex = 3;
this.findinbox.TabIndex = 1;
//
// label2
//
@ -199,7 +212,7 @@ namespace CodeImp.DoomBuilder.Windows
this.findbox.Location = new System.Drawing.Point(9, 34);
this.findbox.Name = "findbox";
this.findbox.Size = new System.Drawing.Size(276, 21);
this.findbox.TabIndex = 1;
this.findbox.TabIndex = 0;
//
// tabreplace
//
@ -215,10 +228,10 @@ namespace CodeImp.DoomBuilder.Windows
this.tabreplace.Controls.Add(this.replacewholeword);
this.tabreplace.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.tabreplace.ImageIndex = 1;
this.tabreplace.Location = new System.Drawing.Point(4, 22);
this.tabreplace.Location = new System.Drawing.Point(4, 23);
this.tabreplace.Name = "tabreplace";
this.tabreplace.Padding = new System.Windows.Forms.Padding(3);
this.tabreplace.Size = new System.Drawing.Size(291, 216);
this.tabreplace.Size = new System.Drawing.Size(291, 215);
this.tabreplace.TabIndex = 1;
this.tabreplace.Text = "Replace";
this.tabreplace.UseVisualStyleBackColor = true;
@ -233,7 +246,7 @@ namespace CodeImp.DoomBuilder.Windows
this.replacebox.Location = new System.Drawing.Point(9, 79);
this.replacebox.Name = "replacebox";
this.replacebox.Size = new System.Drawing.Size(276, 21);
this.replacebox.TabIndex = 11;
this.replacebox.TabIndex = 1;
//
// label5
//
@ -259,7 +272,7 @@ namespace CodeImp.DoomBuilder.Windows
this.replaceinbox.Location = new System.Drawing.Point(9, 124);
this.replaceinbox.Name = "replaceinbox";
this.replaceinbox.Size = new System.Drawing.Size(276, 21);
this.replaceinbox.TabIndex = 9;
this.replaceinbox.TabIndex = 2;
//
// label3
//
@ -280,7 +293,7 @@ namespace CodeImp.DoomBuilder.Windows
this.replacefindbox.Location = new System.Drawing.Point(9, 34);
this.replacefindbox.Name = "replacefindbox";
this.replacefindbox.Size = new System.Drawing.Size(276, 21);
this.replacefindbox.TabIndex = 5;
this.replacefindbox.TabIndex = 0;
//
// label4
//
@ -297,7 +310,7 @@ namespace CodeImp.DoomBuilder.Windows
this.replacematchcase.Location = new System.Drawing.Point(9, 160);
this.replacematchcase.Name = "replacematchcase";
this.replacematchcase.Size = new System.Drawing.Size(82, 17);
this.replacematchcase.TabIndex = 6;
this.replacematchcase.TabIndex = 3;
this.replacematchcase.Text = "Match case";
this.replacematchcase.UseVisualStyleBackColor = true;
//
@ -307,7 +320,7 @@ namespace CodeImp.DoomBuilder.Windows
this.replacewholeword.Location = new System.Drawing.Point(97, 160);
this.replacewholeword.Name = "replacewholeword";
this.replacewholeword.Size = new System.Drawing.Size(113, 17);
this.replacewholeword.TabIndex = 8;
this.replacewholeword.TabIndex = 4;
this.replacewholeword.Text = "Match whole word";
this.replacewholeword.UseVisualStyleBackColor = true;
//
@ -320,7 +333,6 @@ namespace CodeImp.DoomBuilder.Windows
//
// ScriptFindReplaceForm
//
this.AcceptButton = this.findnextbutton;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(304, 247);
@ -367,5 +379,6 @@ namespace CodeImp.DoomBuilder.Windows
private System.Windows.Forms.Label label4;
private System.Windows.Forms.CheckBox replacematchcase;
private System.Windows.Forms.CheckBox replacewholeword;
private System.Windows.Forms.Button bookmarkallbutton;
}
}

View file

@ -21,6 +21,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.Controls;
#endregion
@ -250,13 +251,34 @@ namespace CodeImp.DoomBuilder.Windows
General.Map.ScriptEditor.Editor.FindNext(options);
}
// Find Previous (mxd)
//mxd. Find Previous
private void findpreviousbutton_Click(object sender, EventArgs e)
{
FindReplaceOptions options = MakeOptions(); //mxd
AddComboboxText(findbox, options.FindText); //mxd
FindReplaceOptions options = MakeOptions();
AddComboboxText(findbox, options.FindText);
General.Map.ScriptEditor.Editor.FindPrevious(options);
}
//mxd. Bookmark all
private void bookmarkallbutton_Click(object sender, EventArgs e)
{
FindReplaceOptions options = MakeOptions();
AddComboboxText(findbox, options.FindText);
// Determine script type
ScriptType scripttype = ScriptType.UNKNOWN;
switch(options.SearchMode)
{
case FindReplaceSearchMode.CURRENT_FILE:
case FindReplaceSearchMode.CURRENT_PROJECT_CURRENT_SCRIPT_TYPE:
case FindReplaceSearchMode.OPENED_TABS_CURRENT_SCRIPT_TYPE:
ScriptDocumentTab t = General.Map.ScriptEditor.Editor.ActiveTab;
if(t != null) scripttype = t.Config.ScriptType;
break;
}
if(General.Map.ScriptEditor.Editor.FindUsages(options, scripttype)) this.Close();
}
//mxd. Replace
private void replacebutton_Click(object sender, EventArgs e)