Skip to content

Commit

Permalink
Settings - Context menu editor and layout changes
Browse files Browse the repository at this point in the history
- Added Context Menu Editor (add new items, remove items, move up/down
as well as indent left/right for submenus).
- Added "About" page to settings.
- Altered layout of the settings window so it can be resized.
- Context menu now supports multiple submenus (and submenus inside
submenus).
  • Loading branch information
Torrunt committed Jun 18, 2014
1 parent 32181c6 commit 664e592
Show file tree
Hide file tree
Showing 23 changed files with 1,969 additions and 1,510 deletions.
311 changes: 158 additions & 153 deletions vimage/Source/Config.cs

Large diffs are not rendered by default.

278 changes: 112 additions & 166 deletions vimage/Source/ContextMenu.cs

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions vimage/Source/MenuFuncs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
namespace vimage
{
class MenuFuncs
{
public const string CLOSE = "CLOSE";
public const string NEXT_IMAGE = "NEXTIMAGE";
public const string PREV_IMAGE = "PREVIMAGE";
public const string ROTATE_CLOCKWISE = "ROTATECLOCKWISE";
public const string ROTATE_ANTICLOCKWISE = "ROTATEANTICLOCKWISE";
public const string FLIP = "FLIP";
public const string FIT_TO_HEIGHT = "FITTOHEIGHT";
public const string RESET_IMAGE = "RESETIMAGE";
public const string TOGGLE_SMOOTHING = "TOGGLESMOOTHING";
public const string TOGGLE_BACKGROUND = "TOGGLEBACKGROUND";
public const string ALWAYS_ON_TOP = "ALWAYSONTOP";
public const string OPEN_FILE_LOCATION = "OPENFILELOCATION";
public const string DELETE = "DELETE";
public const string OPEN_SETTINGS = "OPENSETTINGS";
public const string RELOAD_SETTINGS = "RELOADSETTINGS";
public const string VERSION_NAME = "VERSIONNAME";

public const string SORT_NAME = "SORTNAME";
public const string SORT_DATE_MODIFIED = "SORTDATEMODIFIED";
public const string SORT_DATE_CREATED = "SORTDATECREATED";
public const string SORT_SIZE = "SORTSIZE";
public const string SORT_ASCENDING = "SORTASCENDING";
public const string SORT_DESCENDING = "SORTDESCENDING";

public const string NEXT_FRAME = "NEXTFRAME";
public const string PREV_FRAME = "PREVFRAME";
public const string TOGGLE_ANIMATION = "TOGGLEANIMATION";

public static readonly string[] FUNCS =
{
CLOSE, NEXT_IMAGE, PREV_IMAGE, ROTATE_CLOCKWISE, ROTATE_ANTICLOCKWISE,
FLIP, FIT_TO_HEIGHT, RESET_IMAGE, TOGGLE_SMOOTHING, TOGGLE_BACKGROUND,
ALWAYS_ON_TOP, OPEN_FILE_LOCATION, DELETE, OPEN_SETTINGS, RELOAD_SETTINGS,
VERSION_NAME, SORT_NAME, SORT_DATE_MODIFIED, SORT_DATE_CREATED, SORT_SIZE,
SORT_ASCENDING, SORT_DESCENDING, NEXT_FRAME, PREV_FRAME, TOGGLE_ANIMATION
};

// <summary>Takes a MenuFunc name and adds space between certain words (for ease of reading).</summary>
public static string WithSpaces(string func)
{
// Don't bother if there are already spaces
if (func.IndexOf(" ") != -1)
return func;

func = func.Replace("SORT", "SORT ");
func = func.Replace("DATE", "DATE ");
func = func.Replace("FRAME", " FRAME");
func = func.Replace("TOGGLE", "TOGGLE ");
func = func.Replace("RESET", "RESET ");
func = func.Replace("FITTO", "FIT TO ");
func = func.Replace("IMAGE", " IMAGE");
func = func.Replace("ROTATE", "ROTATE ");
func = func.Replace("ALWAYSONTOP", "ALWAYS ON TOP");
func = func.Replace("VERSIONNAME", "VERSION NAME");
func = func.Replace("RELOAD", "RELOAD ");
func = func.Replace("OPEN", "OPEN ");
func = func.Replace("FILELOCATION", "FILE LOCATION");

return func;
}
}
}
1 change: 1 addition & 0 deletions vimage/vimage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<Compile Include="Source\Display\ImageManipulation\OctreeQuantizer.cs" />
<Compile Include="Source\Display\ImageManipulation\Quantizer.cs" />
<Compile Include="Source\ImageViewer.cs" />
<Compile Include="Source\MenuFuncs.cs" />
<Compile Include="Source\Program.cs" />
<Compile Include="Source\Utils\EnumerableComparer.cs" />
<Compile Include="Source\Utils\ImageViewerUtils.cs" />
Expand Down
102 changes: 77 additions & 25 deletions vimage_settings/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 27 additions & 5 deletions vimage_settings/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
Expand All @@ -60,6 +60,7 @@
: 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">
Expand All @@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<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">
Expand All @@ -85,9 +87,10 @@
<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="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">
Expand All @@ -109,9 +112,28 @@
<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>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.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>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="bullet_arrow_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bullet_arrow_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bullet_arrow_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bullet_arrow_up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bullet_arrow_right" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bullet_arrow_right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bullet_arrow_left" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bullet_arrow_left.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cross" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\cross.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="add" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file added vimage_settings/Resources/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vimage_settings/Resources/bullet_arrow_down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vimage_settings/Resources/bullet_arrow_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vimage_settings/Resources/bullet_arrow_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vimage_settings/Resources/bullet_arrow_up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vimage_settings/Resources/cross.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 664e592

Please sign in to comment.