mirror of
https://github.com/fadden/6502bench.git
synced 2025-03-02 23:29:02 +00:00
Add multi-key combo handling for hints
Doesn't work 100% correctly -- in some cases, using two different combos in quick succession will fail -- but it's close. Added stub methods for the four hint operations.
This commit is contained in:
parent
9bbaa80570
commit
499d3478ba
76
CommonWPF/CommonWPF.csproj
Normal file
76
CommonWPF/CommonWPF.csproj
Normal file
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{1299AA2E-606D-4F3E-B3A9-3F9421E44667}</ProjectGuid>
|
||||
<OutputType>library</OutputType>
|
||||
<RootNamespace>CommonWPF</RootNamespace>
|
||||
<AssemblyName>CommonWPF</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="InverseBooleanConverter.cs" />
|
||||
<Compile Include="MultiKeyInputGesture.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
40
CommonWPF/InverseBooleanConverter.cs
Normal file
40
CommonWPF/InverseBooleanConverter.cs
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2019 faddenSoft
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
using System;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace CommonWPF {
|
||||
/// <summary>
|
||||
/// A value inverter for negating a boolean value (value --> !value).
|
||||
///
|
||||
/// See https://stackoverflow.com/questions/1039636/how-to-bind-inverse-boolean-properties-in-wpf
|
||||
/// </summary>
|
||||
[ValueConversion(typeof(bool), typeof(bool))]
|
||||
public class InverseBooleanConverter : IValueConverter {
|
||||
public object Convert(object value, Type targetType, object parameter,
|
||||
System.Globalization.CultureInfo culture) {
|
||||
if (targetType != typeof(bool))
|
||||
throw new InvalidOperationException("The target must be a boolean");
|
||||
|
||||
return !(bool)value;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter,
|
||||
System.Globalization.CultureInfo culture) {
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
}
|
105
CommonWPF/MultiKeyInputGesture.cs
Normal file
105
CommonWPF/MultiKeyInputGesture.cs
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright 2018 faddenSoft
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
/// <summary>
|
||||
/// Handle a multi-key input sequence for WPF windows.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Also posted as https://stackoverflow.com/a/56452142/294248
|
||||
///
|
||||
/// Example:
|
||||
/// {RoutedUICommand}.InputGestures.Add(
|
||||
/// new MultiKeyInputGesture(new KeyGesture[] {
|
||||
/// new KeyGesture(Key.H, ModifierKeys.Control, "Ctrl+H"),
|
||||
/// new KeyGesture(Key.C, ModifierKeys.Control, "Ctrl+C")
|
||||
/// }) );
|
||||
///
|
||||
/// TODO: if you have more than one handler, the handler that completes a sequence will
|
||||
/// "eat" the final key, and the other handlers won't reset. Might need to define an event
|
||||
/// that all gesture objects subscribe to, so they all reset at once. In the mean time, the
|
||||
/// reset-after-time handler solves the problem if the user is moving slowly enough.
|
||||
/// </remarks>
|
||||
namespace CommonWPF {
|
||||
public class MultiKeyInputGesture : InputGesture {
|
||||
private const int MAX_PAUSE_MILLIS = 1500;
|
||||
|
||||
private InputGestureCollection mGestures = new InputGestureCollection();
|
||||
|
||||
private DateTime mLastWhen = DateTime.Now;
|
||||
private int mCheckIdx;
|
||||
private string mIdStr;
|
||||
|
||||
|
||||
public MultiKeyInputGesture(KeyGesture[] keys) {
|
||||
Debug.Assert(keys.Length > 0);
|
||||
|
||||
StringBuilder idSb = new StringBuilder();
|
||||
|
||||
// Grab a copy of the array contents.
|
||||
foreach (KeyGesture kg in keys) {
|
||||
mGestures.Add(kg);
|
||||
idSb.Append(kg.DisplayString[kg.DisplayString.Length - 1]);
|
||||
}
|
||||
mIdStr = idSb.ToString();
|
||||
}
|
||||
|
||||
public override bool Matches(object targetElement, InputEventArgs inputEventArgs) {
|
||||
if (!(inputEventArgs is KeyEventArgs)) {
|
||||
// does this actually happen?
|
||||
return false;
|
||||
}
|
||||
|
||||
DateTime now = DateTime.Now;
|
||||
if ((now - mLastWhen).TotalMilliseconds > MAX_PAUSE_MILLIS) {
|
||||
//Debug.WriteLine("MKIG " + mIdStr + ": too long since last key (" +
|
||||
// (now - mLastWhen).TotalMilliseconds + " ms");
|
||||
mCheckIdx = 0;
|
||||
}
|
||||
mLastWhen = now;
|
||||
|
||||
if (((KeyEventArgs)inputEventArgs).IsRepeat) {
|
||||
// ignore key-repeat noise (especially from modifiers)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mGestures[mCheckIdx].Matches(null, inputEventArgs)) {
|
||||
if (mCheckIdx > 0) {
|
||||
//Debug.WriteLine("MKIG " + mIdStr + ": no match, resetting");
|
||||
mCheckIdx = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//Debug.WriteLine("MKIG " + mIdStr + ": matched gesture #" + mCheckIdx);
|
||||
mCheckIdx++;
|
||||
if (mCheckIdx == mGestures.Count) {
|
||||
//Debug.WriteLine("MKIG " + mIdStr + ": match");
|
||||
mCheckIdx = 0;
|
||||
inputEventArgs.Handled = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
55
CommonWPF/Properties/AssemblyInfo.cs
Normal file
55
CommonWPF/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("CommonWPF")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CommonWPF")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
//the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly:ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
62
CommonWPF/Properties/Resources.Designer.cs
generated
Normal file
62
CommonWPF/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,62 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace CommonWPF.Properties {
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if ((resourceMan == null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CommonWPF.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
117
CommonWPF/Properties/Resources.resx
Normal file
117
CommonWPF/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?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.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: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" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</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" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</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>
|
||||
</root>
|
30
CommonWPF/Properties/Settings.Designer.cs
generated
Normal file
30
CommonWPF/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace CommonWPF.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
CommonWPF/Properties/Settings.settings
Normal file
7
CommonWPF/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
@ -54,10 +54,10 @@ namespace SourceGenWPF {
|
||||
|
||||
/// <summary>
|
||||
/// Current code list view selection. The length will match the DisplayList Count.
|
||||
///
|
||||
/// A simple foreach through codeListView.SelectedIndices on a 500K-line data set
|
||||
/// takes about 2.5 seconds on a fast Win10 x64 machine. Fortunately the control
|
||||
/// notifies us of changes to the selection, so we can track it ourselves.
|
||||
///
|
||||
/// WinForms was bad -- a simple foreach through SelectedIndices on a 500K-line data set
|
||||
/// took about 2.5 seconds on a fast Win10 x64 machine. In WPF you get a list of
|
||||
/// selected objects, which is fine unless what you really want is the line number.
|
||||
/// </summary>
|
||||
private VirtualListViewSelection mCodeViewSelection = new VirtualListViewSelection();
|
||||
#endif
|
||||
|
@ -45,6 +45,10 @@ limitations under the License.
|
||||
<KeyGesture>Ctrl+Shift+A</KeyGesture>
|
||||
</RoutedUICommand.InputGestures>
|
||||
</RoutedUICommand>
|
||||
<RoutedUICommand x:Key="HintAsCodeEntryPoint" Text="Hint As Code Entry Point"/>
|
||||
<RoutedUICommand x:Key="HintAsDataStart" Text="Hint As Data Start"/>
|
||||
<RoutedUICommand x:Key="HintAsInlineData" Text="Hint As Inline Data"/>
|
||||
<RoutedUICommand x:Key="RemoveHints" Text="Remove Hints"/>
|
||||
<RoutedUICommand x:Key="RecentProjectCmd"/>
|
||||
<RoutedUICommand x:Key="SelectAllCmd" Text="Select All">
|
||||
<RoutedUICommand.InputGestures>
|
||||
@ -56,6 +60,10 @@ limitations under the License.
|
||||
|
||||
<Window.CommandBindings>
|
||||
<CommandBinding Command="{StaticResource AssembleCmd}" Executed="AssembleCmd_Executed"/>
|
||||
<CommandBinding Command="{StaticResource HintAsCodeEntryPoint}" Executed="HintAsCodeEntryPoint_Executed"/>
|
||||
<CommandBinding Command="{StaticResource HintAsDataStart}" Executed="HintAsDataStart_Executed"/>
|
||||
<CommandBinding Command="{StaticResource HintAsInlineData}" Executed="HintAsInlineData_Executed"/>
|
||||
<CommandBinding Command="{StaticResource RemoveHints}" Executed="RemoveHints_Executed"/>
|
||||
<CommandBinding Command="{StaticResource RecentProjectCmd}" Executed="RecentProjectCmd_Executed"/>
|
||||
<!-- ListView has a built-in Ctrl+A handler; this only fires when codeListView not in focus -->
|
||||
<CommandBinding Command="{StaticResource SelectAllCmd}" Executed="SelectAllCmd_Executed"/>
|
||||
@ -106,10 +114,10 @@ limitations under the License.
|
||||
<MenuItem Header="Edit Note..."/>
|
||||
<MenuItem Header="Edit Project Symbol..."/>
|
||||
<Separator/>
|
||||
<MenuItem Header="Hint As Code Entry Point"/>
|
||||
<MenuItem Header="Hint As Data Start"/>
|
||||
<MenuItem Header="Hint As Inline Data"/>
|
||||
<MenuItem Header="Remove Hints"/>
|
||||
<MenuItem Command="{StaticResource HintAsCodeEntryPoint}" InputGestureText="Ctrl+H, Ctrl+C"/>
|
||||
<MenuItem Command="{StaticResource HintAsDataStart}" InputGestureText="Ctrl+H, Ctrl+D"/>
|
||||
<MenuItem Command="{StaticResource HintAsInlineData}" InputGestureText="Ctrl+H, Ctrl+I"/>
|
||||
<MenuItem Command="{StaticResource RemoveHints}" InputGestureText="Ctrl+H, Ctrl+R"/>
|
||||
<Separator/>
|
||||
<MenuItem Header="Format Split-Address Table..."/>
|
||||
<MenuItem Header="Toggle Single-Byte Format"/>
|
||||
|
@ -31,6 +31,8 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
using CommonWPF;
|
||||
|
||||
namespace SourceGenWPF.ProjWin {
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
@ -61,10 +63,40 @@ namespace SourceGenWPF.ProjWin {
|
||||
|
||||
mMainCtrl = new MainController(this);
|
||||
|
||||
AddMultiKeyGestures();
|
||||
|
||||
//GridView gv = (GridView)codeListView.View;
|
||||
//gv.Columns[0].Width = 50;
|
||||
}
|
||||
|
||||
private void AddMultiKeyGestures() {
|
||||
RoutedUICommand ruic;
|
||||
|
||||
ruic = (RoutedUICommand)FindResource("HintAsCodeEntryPoint");
|
||||
ruic.InputGestures.Add(
|
||||
new MultiKeyInputGesture(new KeyGesture[] {
|
||||
new KeyGesture(Key.H, ModifierKeys.Control, "Ctrl+H"),
|
||||
new KeyGesture(Key.C, ModifierKeys.Control, "Ctrl+C")
|
||||
}));
|
||||
ruic = (RoutedUICommand)FindResource("HintAsDataStart");
|
||||
ruic.InputGestures.Add(
|
||||
new MultiKeyInputGesture(new KeyGesture[] {
|
||||
new KeyGesture(Key.H, ModifierKeys.Control, "Ctrl+H"),
|
||||
new KeyGesture(Key.D, ModifierKeys.Control, "Ctrl+D")
|
||||
}));
|
||||
ruic = (RoutedUICommand)FindResource("HintAsInlineData");
|
||||
ruic.InputGestures.Add(
|
||||
new MultiKeyInputGesture(new KeyGesture[] {
|
||||
new KeyGesture(Key.H, ModifierKeys.Control, "Ctrl+H"),
|
||||
new KeyGesture(Key.I, ModifierKeys.Control, "Ctrl+I")
|
||||
}));
|
||||
ruic = (RoutedUICommand)FindResource("RemoveHints");
|
||||
ruic.InputGestures.Add(
|
||||
new MultiKeyInputGesture(new KeyGesture[] {
|
||||
new KeyGesture(Key.H, ModifierKeys.Control, "Ctrl+H"),
|
||||
new KeyGesture(Key.R, ModifierKeys.Control, "Ctrl+R")
|
||||
}));
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e) {
|
||||
mMainCtrl.WindowLoaded();
|
||||
@ -135,6 +167,22 @@ namespace SourceGenWPF.ProjWin {
|
||||
Debug.WriteLine("assembling");
|
||||
}
|
||||
|
||||
private void HintAsCodeEntryPoint_Executed(object sender, ExecutedRoutedEventArgs e) {
|
||||
Debug.WriteLine("hint as code entry point");
|
||||
}
|
||||
|
||||
private void HintAsDataStart_Executed(object sender, ExecutedRoutedEventArgs e) {
|
||||
Debug.WriteLine("hint as data start");
|
||||
}
|
||||
|
||||
private void HintAsInlineData_Executed(object sender, ExecutedRoutedEventArgs e) {
|
||||
Debug.WriteLine("hint as inline data");
|
||||
}
|
||||
|
||||
private void RemoveHints_Executed(object sender, ExecutedRoutedEventArgs e) {
|
||||
Debug.WriteLine("remove hints");
|
||||
}
|
||||
|
||||
private void SelectAllCmd_Executed(object sender, ExecutedRoutedEventArgs e) {
|
||||
DateTime start = DateTime.Now;
|
||||
|
||||
|
@ -183,6 +183,10 @@
|
||||
<Project>{a2993eac-35d8-4768-8c54-152b4e14d69c}</Project>
|
||||
<Name>CommonUtil</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\CommonWPF\CommonWPF.csproj">
|
||||
<Project>{1299aa2e-606d-4f3e-b3a9-3f9421e44667}</Project>
|
||||
<Name>CommonWPF</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\PluginCommon\PluginCommon.csproj">
|
||||
<Project>{70f04543-9e46-4ad3-875a-160fd198c0ff}</Project>
|
||||
<Name>PluginCommon</Name>
|
||||
|
@ -26,6 +26,11 @@ EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonWinForms", "CommonWinForms\CommonWinForms.csproj", "{08EC328D-078E-4236-B574-BE6B3FD85915}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SourceGenWPF", "SourceGenWPF\SourceGenWPF.csproj", "{30C35BBC-B9ED-4723-8F9D-597D51CCB13A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1299AA2E-606D-4F3E-B3A9-3F9421E44667} = {1299AA2E-606D-4F3E-B3A9-3F9421E44667}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonWPF", "CommonWPF\CommonWPF.csproj", "{1299AA2E-606D-4F3E-B3A9-3F9421E44667}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -69,6 +74,10 @@ Global
|
||||
{30C35BBC-B9ED-4723-8F9D-597D51CCB13A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{30C35BBC-B9ED-4723-8F9D-597D51CCB13A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{30C35BBC-B9ED-4723-8F9D-597D51CCB13A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1299AA2E-606D-4F3E-B3A9-3F9421E44667}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1299AA2E-606D-4F3E-B3A9-3F9421E44667}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1299AA2E-606D-4F3E-B3A9-3F9421E44667}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1299AA2E-606D-4F3E-B3A9-3F9421E44667}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
Loading…
x
Reference in New Issue
Block a user