Changeset - 5d0a31247a93
[Not reviewed]
default
4 11 7
Jason Maltzen (jmaltzen) - 9 years ago 2016-02-11 01:41:10
jason.maltzen@unsanctioned.net
Refactor UI classes to be separate views instead of separate windows. Add a checkbox to switch to generating recipes for ribbons instead of paint.
22 files changed with 4383 insertions and 3652 deletions:
0 comments (0 inline, 0 general)
AppSettings.cs
Show inline comments
 
new file 100644
 
using System;
 

	
 
namespace DesertPaintLab
 
{
 
    public class AppSettings
 
    {
 
        private AppSettings()
 
        {
 
        }
 

	
 
        private static Settings _settings = new Settings();
 

	
 
        public static void Get(string key, out int value)
 
        {
 
            _settings.Get(key, out value);
 
        }
 
        public static void Get(string key, out bool value)
 
        {
 
            _settings.Get(key, out value);
 
        }
 
        public static void Set(string key, int value)
 
        {
 
            _settings.Set(key, value);
 
        }
 
        public static void Set(string key, bool value)
 
        {
 
            _settings.Set(key, value);
 
        }
 

	
 
        public static void Save()
 
        {
 
            string settingsPath = System.IO.Path.Combine(FileUtils.AppDataPath, "settings");
 
            _settings.Save(settingsPath);
 
        }
 
        
 
        public static bool Load()
 
        {
 
            string settingsPath = System.IO.Path.Combine(FileUtils.AppDataPath, "settings");
 
            return _settings.Load(settingsPath);
 
        }
 
    }
 
}
 

	
DesertPaintLab.csproj
Show inline comments
...
 
@@ -62,33 +62,37 @@
 
    <Compile Include="Reaction.cs" />
 
    <Compile Include="ReagentManager.cs" />
 
    <Compile Include="Reagent.cs" />
 
    <Compile Include="gtk-gui\MainWindow.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.FirstRunDialog.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.SelectProfileDialog.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.NewProfileDialog.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.PaintSwatch.cs" />
 
    <Compile Include="SimulatorWindow.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.SimulatorWindow.cs" />
 
    <Compile Include="ScreenCheckDialog.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.ScreenCheckDialog.cs" />
 
    <Compile Include="FileUtils.cs" />
 
    <Compile Include="PaintRecipe.cs" />
 
    <Compile Include="ReactionRecorder.cs" />
 
    <Compile Include="ReactionStatusWindow.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.ReactionStatusWindow.cs" />
 
    <Compile Include="RecipeGeneratorWindow.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.RecipeGeneratorWindow.cs" />
 
    <Compile Include="ReactionSet.cs" />
 
    <Compile Include="RecipeGenerator.cs" />
 
    <Compile Include="ReagentWindow.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.ReagentWindow.cs" />
 
    <Compile Include="RecipeSearchNode.cs" />
 
    <Compile Include="Settings.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.CaptureView.cs" />
 
    <Compile Include="UI\CaptureView.cs" />
 
    <Compile Include="UI\RecipeGeneratorView.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.RecipeGeneratorView.cs" />
 
    <Compile Include="UI\SimulatorView.cs" />
 
    <Compile Include="gtk-gui\DesertPaintLab.SimulatorView.cs" />
 
    <Compile Include="StatusUpdateEventArgs.cs" />
 
    <Compile Include="AppSettings.cs" />
 
  </ItemGroup>
 
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
 
  <ProjectExtensions>
 
    <MonoDevelop>
 
      <Properties>
 
        <Policies>
 
          <TextStylePolicy inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp" />
 
          <CSharpFormattingPolicy IndentSwitchBody="True" IndentBlocksInsideExpressions="True" AnonymousMethodBraceStyle="NextLine" PropertyBraceStyle="NextLine" PropertyGetBraceStyle="NextLine" PropertySetBraceStyle="NextLine" EventBraceStyle="NextLine" EventAddBraceStyle="NextLine" EventRemoveBraceStyle="NextLine" StatementBraceStyle="NextLine" ElseNewLinePlacement="NewLine" CatchNewLinePlacement="NewLine" FinallyNewLinePlacement="NewLine" WhileNewLinePlacement="DoNotCare" ArrayInitializerWrapping="DoNotChange" ArrayInitializerBraceStyle="NextLine" BeforeMethodDeclarationParentheses="False" BeforeMethodCallParentheses="False" BeforeConstructorDeclarationParentheses="False" NewLineBeforeConstructorInitializerColon="NewLine" NewLineAfterConstructorInitializerColon="SameLine" BeforeDelegateDeclarationParentheses="False" NewParentheses="False" SpacesBeforeBrackets="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
...
 
@@ -106,9 +110,12 @@
 
    </None>
 
    <None Include="data\template\dp_reactions.txt">
 
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
 
    </None>
 
    <None Include="data\template\ingredients.txt">
 
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
 
    </None>
 
  </ItemGroup>
 
  <ItemGroup>
 
    <Folder Include="UI\" />
 
  </ItemGroup>
 
</Project>
...
 
\ No newline at end of file
MainWindow.cs
Show inline comments
...
 
@@ -30,34 +30,33 @@ using DesertPaintLab;
 
public partial class MainWindow : Gtk.Window
 
{
 
    const string APP_VERSION = "1.7.11";
 

	
 
	bool unsavedData = false;
 
	bool shouldShutDown = false;
 
	List<string> profileList = new List<string>();
 
	PlayerProfile profile = null;
 
	PaintColor expectedColor = new PaintColor();
 
	PaintColor reactedColor = new PaintColor();
 
	
 
	Gdk.Window rootWindow = null;
 
	Gdk.Pixbuf screenBuffer = null;
 

	
 
    Reagent[] reagents = new Reagent[3];
 
    PaintRecipe recipe = new PaintRecipe();
 
    // views
 
    RecipeGeneratorView generatorView;
 
    SimulatorView simulatorView;
 
    CaptureView captureView;
 

	
 
	public bool ShouldShutDown
 
	{
 
		get
 
		{
 
			return shouldShutDown;
 
		}
 
	}
 
	
 
	
 
	public MainWindow () : base(Gtk.WindowType.Toplevel)
 
	{
 
        string appDataPath = FileUtils.AppDataPath;
 
		if (!System.IO.Directory.Exists(appDataPath))
 
		{
 
			System.IO.Directory.CreateDirectory(appDataPath);	
 
		}
 
		
...
 
@@ -66,20 +65,16 @@ public partial class MainWindow : Gtk.Wi
 
		foreach (DirectoryInfo dir in dirs)
 
		{
 
			if (dir.Name != "template")
 
			{
 
				profileList.Add(dir.Name);
 
			}
 
		}
 

	
 
        reagents[0] = null;
 
        reagents[1] = null;
 
        reagents[2] = null;
 

	
 
        string colorsPath = FileUtils.FindApplicationResourceFile("colors.txt");
 
        if (colorsPath == null)
 
        {
 
            // failed to find colors.txt file
 
            MessageDialog md = new MessageDialog(this, 
 
                DialogFlags.DestroyWithParent,
 
                MessageType.Error, ButtonsType.Close, 
 
                "Failed to find colors.txt file. Please check your installation.");
...
 
@@ -102,68 +97,69 @@ public partial class MainWindow : Gtk.Wi
 
            md.Run();
 
            md.Destroy();
 
            Application.Quit();
 
        }
 
        ReagentManager.Load(ingredientsPath);
 
		
 
		Build();
 
		
 
		if (unmodifiedSwatch != null)
 
		{
 
			unmodifiedSwatch.Clear();
 
		}
 
		if (reactionSwatch != null)
 
		{
 
			reactionSwatch.Clear();
 
		}
 

	
 
		// get the root window
 
		rootWindow = Gdk.Global.DefaultRootWindow;
 

	
 
		// get its width and height
 
        int screenWidth;
 
        int screenHeight;
 
		rootWindow.GetSize(out screenWidth, out screenHeight);
 
        int pixelMultiplier = 1;
 

	
 
        if ( DesertPaintLab.Settings.Load() == true )
 
        if ( DesertPaintLab.AppSettings.Load() == true )
 
        {
 
            DesertPaintLab.Settings.Get("ScreenWidth", out screenWidth);
 
            DesertPaintLab.Settings.Get("ScreenHeight", out screenHeight);
 
            DesertPaintLab.Settings.Get("PixelMultiplier", out pixelMultiplier);
 
            DesertPaintLab.AppSettings.Get("ScreenWidth", out screenWidth);
 
            DesertPaintLab.AppSettings.Get("ScreenHeight", out screenHeight);
 
            DesertPaintLab.AppSettings.Get("PixelMultiplier", out pixelMultiplier);
 
        }
 

	
 
        bool enableDebugMenu;
 
        DesertPaintLab.Settings.Get("EnableDebugMenu", out enableDebugMenu);
 
        DesertPaintLab.AppSettings.Get("EnableDebugMenu", out enableDebugMenu);
 
        this.DebugAction.Visible = enableDebugMenu;
 

	
 
		ScreenCheckDialog screenCheckDialog = new ScreenCheckDialog();
 
		screenCheckDialog.ScreenWidth = screenWidth;
 
		screenCheckDialog.ScreenHeight = screenHeight;
 
        screenCheckDialog.GamePixelWidth = pixelMultiplier;
 
		ResponseType resp = (ResponseType)screenCheckDialog.Run();
 
        screenWidth = screenCheckDialog.ScreenWidth;
 
        screenHeight = screenCheckDialog.ScreenHeight;
 
        pixelMultiplier = screenCheckDialog.GamePixelWidth;
 
		screenCheckDialog.Destroy();
 

	
 
        DesertPaintLab.Settings.Set("ScreenWidth", screenWidth);
 
        DesertPaintLab.Settings.Set("ScreenHeight", screenHeight);
 
        DesertPaintLab.Settings.Set("PixelMultiplier", pixelMultiplier);
 
        DesertPaintLab.Settings.Save();
 
        DesertPaintLab.AppSettings.Set("ScreenWidth", screenWidth);
 
        DesertPaintLab.AppSettings.Set("ScreenHeight", screenHeight);
 
        DesertPaintLab.AppSettings.Set("PixelMultiplier", pixelMultiplier);
 
        DesertPaintLab.AppSettings.Save();
 

	
 
		screenBuffer = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, false, 8, screenWidth, screenHeight);
 
	
 
        ReactionRecorder.SetPixelMultiplier(pixelMultiplier);
 

	
 
		if (!OpenProfile())
 
		{
 
			shouldShutDown = true;
 
		}
 

	
 
        captureView = new CaptureView(profile, screenBuffer);
 
        generatorView = new RecipeGeneratorView(profile);
 
        generatorView.SetStatus += OnStatusUpdate;
 
        generatorView.Started += OnGeneratorRunning;
 
        generatorView.Stopped += OnGeneratorStopped;
 
        simulatorView = new SimulatorView(profile);
 

	
 
        contentContainer.Add(captureView);
 
        captureView.Show();
 
	}
 

	
 
	bool ConfirmedExit()
 
	{
 
		if (unsavedData)
 
		{
 
			MessageDialog md = new MessageDialog(this, 
 
	            DialogFlags.DestroyWithParent,
...
 
@@ -173,36 +169,81 @@ public partial class MainWindow : Gtk.Wi
 
	   
 
			ResponseType resp = (ResponseType)md.Run();
 
			md.Destroy();
 
			return (resp == ResponseType.Ok);
 
		}
 
		return true;
 
	}
 
	
 
    protected void OnStatusUpdate(object sender, EventArgs args)
 
    {
 
        StatusUpdateEventArgs statusArgs = (StatusUpdateEventArgs)args;
 
        statusBar.Push(0, statusArgs.Status);
 
    }
 

	
 
    protected void OnGeneratorRunning(object sender, EventArgs args)
 
    {
 
        NewProfileAction.Sensitive = false;
 
        OpenProfileAction.Sensitive = false;
 
        ImportProfileAction.Sensitive = false;
 
        if (captureView != null)
 
        {
 
            captureView.DisableRecord();
 
        }
 
    }
 

	
 
    protected void OnGeneratorStopped(object sender, EventArgs args)
 
    {
 
        NewProfileAction.Sensitive = true;
 
        OpenProfileAction.Sensitive = true;
 
        ImportProfileAction.Sensitive = true;
 
        if (captureView != null)
 
        {
 
            captureView.EnableRecord();
 
        }
 
    }
 
	
 
	void SetProfileName(string name)
 
	{	
 
		profile = new PlayerProfile(name,
 
            System.IO.Path.Combine(FileUtils.AppDataPath, name));
 
	}
 
		
 
		statusBar.Push(0, name);
 
    void ProfileChanged()
 
    {
 
        statusBar.Push(0, "Profile: " + profile.Name);
 
        Title  = "Desert Paint Lab - " + profile.Name;
 

	
 
        if (generatorView != null)
 
        {
 
            generatorView.Profile = profile;
 
        }
 
        if (simulatorView != null)
 
        {
 
            simulatorView.Profile = profile;
 
        }
 
        if (captureView != null)
 
        {
 
            captureView.Profile = profile;
 
        }
 
	}
 
	
 
	bool NewProfile()
 
	{
 
		bool newProfileCreated = false;
 
		bool duplicateName = false;
 
		NewProfileDialog newProfileDialog = new NewProfileDialog();
 
		ResponseType resp = (ResponseType)newProfileDialog.Run();
 
		if (resp == ResponseType.Ok)
 
		{
 
			// Make sure profile doesn't already exist.
 
			foreach (string profileName in profileList)
 
			{
 
				if (profileName == newProfileDialog.ProfileName)
 
				if (profileName.Equals(newProfileDialog.ProfileName))
 
				{
 
					MessageDialog md = new MessageDialog(this, 
 
	            		DialogFlags.DestroyWithParent,
 
	            		MessageType.Error, ButtonsType.Ok, 
 
	            		"That profile name already exists.");
 
					resp = (ResponseType)md.Run();
 
					md.Destroy();
 
					duplicateName = true;
...
 
@@ -221,16 +262,17 @@ public partial class MainWindow : Gtk.Wi
 
                    MessageDialog md = new MessageDialog(this, 
 
                        DialogFlags.DestroyWithParent,
 
                        MessageType.Error, ButtonsType.Ok, 
 
                        "Failed to initialize profile: " + profile.LastError);
 
                    resp = (ResponseType)md.Run();
 
                    md.Destroy();
 
                    duplicateName = false;
 
                }
 
                ProfileChanged();
 
			}
 
		}
 
		newProfileDialog.Destroy();
 
		return newProfileCreated;
 
	}
 
	
 
	bool OpenProfile()
 
	{
...
 
@@ -285,20 +327,20 @@ public partial class MainWindow : Gtk.Wi
 
					}
 
				}
 
			}
 
		}
 
		
 
		if (profileSelected)
 
		{
 
			bool ok = profile.Load();
 

	
 
            if (ok)
 
            {
 
    			PopulateDropDowns();
 
                recipe.Reactions = profile.Reactions;
 
                ProfileChanged();
 
            }
 
            else
 
            {
 
                MessageDialog md = new MessageDialog(this, 
 
                    DialogFlags.DestroyWithParent,
 
                    MessageType.Error, ButtonsType.Ok, 
 
                    "Error loading profile: " + profile.LastError);
 

	
...
 
@@ -306,357 +348,48 @@ public partial class MainWindow : Gtk.Wi
 
                md.Destroy();
 
                profileSelected = false;
 
            }
 
		}
 

	
 
		return profileSelected;
 
	}
 
	
 
	void PopulateDropDowns()
 
	{
 
		ReagentManager.PopulateReagents(ref ingredient1ComboBox);
 
		ReagentManager.PopulateReagents(ref ingredient2ComboBox);
 
		ReagentManager.PopulateReagents(ref ingredient3ComboBox);
 
		
 
		ingredient2ComboBox.Sensitive = false;
 
		ingredient3ComboBox.Sensitive = false;
 
		
 
        Gtk.TreeIter iter;
 
        ingredient1ComboBox.Model.IterNthChild(out iter, 0);
 
        ingredient1ComboBox.SetActiveIter(iter);
 
		ingredient2ComboBox.Model.IterNthChild(out iter, 0);
 
        ingredient2ComboBox.SetActiveIter(iter);
 
		ingredient3ComboBox.Model.IterNthChild(out iter, 0);
 
        ingredient3ComboBox.SetActiveIter(iter);
 
	}
 
	
 
	protected void SetExpectedColor(byte red, byte green, byte blue)
 
	{
 
		expectedColor.Red = red;
 
		expectedColor.Green = green;
 
		expectedColor.Blue = blue;
 
		unmodifiedSwatch.Color = expectedColor;
 
	}
 
	
 
	protected void SetExpectedColor(PaintColor color)
 
	{
 
		SetExpectedColor(color.Red, color.Green, color.Blue);
 
	}
 
	
 
	protected void UpdateIngredients()
 
	{
 
		Reaction reaction1, reaction2;
 
		TreeIter selectIter;
 
		string reagentName;
 
        reagents[0] = null;
 
        reagents[1] = null;
 
        reagents[2] = null;
 
		
 
		bool reactionKnown = true;
 
		
 
		saveButton.Sensitive = false;
 

	
 
        recipe.Clear();
 
		
 
		if (ingredient1ComboBox.GetActiveIter(out selectIter))
 
		{
 
			reagentName = (string)ingredient1ComboBox.Model.GetValue(selectIter, 0);
 
			if ((reagentName == null) || (reagentName.Length == 0))
 
			{
 
                // Nothing selected as reagent 1
 
				ingredient2ComboBox.Sensitive = false;
 
				ingredient3ComboBox.Sensitive = false;
 
				unmodifiedSwatch.Clear();
 
				captureButton.Sensitive = false;
 
			}
 
			else
 
			{
 
                recipe.AddReagent(reagentName);
 
                reagents[0] = ReagentManager.GetReagent(reagentName);
 
				ingredient2ComboBox.Sensitive = true;
 
				if (ingredient2ComboBox.GetActiveIter(out selectIter))
 
				{
 
					reagentName = (string)ingredient2ComboBox.Model.GetValue(selectIter, 0);
 
					if ((reagentName == null) || (reagentName.Length == 0))
 
					{
 
						ingredient3ComboBox.Sensitive = false;
 
						saveButton.Sensitive = false;
 
						reactionKnown = false;
 
					}
 
					else
 
					{
 
                        recipe.AddReagent(reagentName);
 
						reagents[1] = ReagentManager.GetReagent(reagentName);
 
						ingredient3ComboBox.Sensitive = true;
 
						captureButton.Sensitive = true;
 
						
 
                        reaction1 = profile.FindReaction(reagents[0], reagents[1]);
 
						
 
                        if ((reaction1 != null) || (reagents[0] == reagents[1]))
 
						{
 
							ingredient3ComboBox.Sensitive = true;
 
						}
 
						else
 
						{
 
							reactionKnown = false;
 
							ingredient3ComboBox.Sensitive = false;
 
						}
 
						
 
						if (ingredient3ComboBox.GetActiveIter(out selectIter))
 
						{
 
							reagentName = (string)ingredient3ComboBox.Model.GetValue(selectIter, 0);
 
							if ((reagentName != null) && (reagentName.Length != 0))
 
							{
 
                                recipe.AddReagent(reagentName);
 
                                reagents[2] = ReagentManager.GetReagent(reagentName);
 
						
 
								if (!reactionKnown)
 
								{
 
									MessageDialog md = new MessageDialog(this, 
 
	            						DialogFlags.DestroyWithParent,
 
	            						MessageType.Error, ButtonsType.Ok, 
 
	            						"To do a three-ingredient reaction test, " +
 
									    "you must first recored the reaction of " +
 
									    "the first two ingredients.");
 
	   
 
									md.Run();
 
									md.Destroy();
 
									captureButton.Sensitive = false;
 
								}
 
								
 
                                reaction1 = profile.FindReaction(reagents[0], reagents[2]);
 
                                reaction2 = profile.FindReaction(reagents[1], reagents[2]);
 
								
 
								if (reactionKnown && (reaction1 == null) && (reaction2 == null))
 
								{
 
									MessageDialog md = new MessageDialog(this, 
 
	            						DialogFlags.DestroyWithParent,
 
	            						MessageType.Error, ButtonsType.Ok, 
 
	            						"To do a three-ingredient reaction test, " +
 
									    "you must first record the reaction of " +
 
									    "either the first or second ingredient " +
 
									    "with the third ingredient.");
 
	   
 
									md.Run();
 
									md.Destroy();	
 
									captureButton.Sensitive = false;
 
								}
 
								
 
                                if ((reaction1 == null) && (reagents[0] != reagents[2]))
 
								{
 
									reactionKnown = false;	
 
								}
 

	
 
                                if ((reaction2 == null) && (reagents[1] != reagents[2]))
 
								{
 
									reactionKnown = false;	
 
								}
 
							}
 
						}
 
					}
 
				}
 
                expectedColor.Set(recipe.BaseColor);
 
                unmodifiedSwatch.Color = expectedColor;
 
                //SetExpectedColor(recipeColor.Red, recipeColor.Green, recipeColor.Blue);
 
				
 
				if (reactionKnown)
 
				{
 
                    reactedColor.Set(recipe.ReactedColor);
 
					reactionSwatch.Color = reactedColor;
 
				}
 
				else
 
				{
 
					reactionSwatch.Clear();	
 
				}
 
			}
 
		}
 
	}
 
	
 
	protected void OnDeleteEvent(object sender, DeleteEventArgs a)
 
	{
 
		if (ConfirmedExit())
 
		{
 
			a.RetVal = true;
 
			Application.Quit();
 
		}
 
		else
 
		{
 
			a.RetVal = false;
 
		}
 
	}
 
	
 
	bool IsPapyTexture(byte r, byte g, byte b)
 
	{
 
		return ((r > 0xD0) && (g > 0xC8) && (b > 0xA0)) &&
 
				((r < 0xF4) && (g < 0xE0) && (b < 0xC4));
 
	}
 
	
 
	unsafe bool CaptureReactionColor()
 
	{
 
		// Take a screenshot.
 
        int screenWidth, screenHeight;
 
        bool debugScreenshot = false;
 
        bool enableDebugMenu = false;
 
        DesertPaintLab.Settings.Get("ScreenWidth", out screenWidth);
 
        DesertPaintLab.Settings.Get("ScreenHeight", out screenHeight);
 
        DesertPaintLab.Settings.Get("EnableDebugMenu", out enableDebugMenu);
 
        DesertPaintLab.Settings.Get("DebugScreenshot", out debugScreenshot);
 
        Gdk.Image rootImage = rootWindow.GetImage(0, 0, screenWidth, screenHeight);
 
		screenBuffer.GetFromImage(rootImage, rootImage.Colormap, 0, 0, 0, 0, screenWidth, screenHeight);
 
		//screenBuffer.GetFromDrawable(rootWindow,
 
		//	rootWindow.Colormap, 0, 0, 0, 0, screenWidth, screenHeight);
 
		int stride = screenBuffer.Rowstride;
 
		byte* pixBytes = (byte*)screenBuffer.Pixels;
 
        int redPixelStart = -1;
 
	
 
        bool wasCaptured = ReactionRecorder.CaptureReaction(pixBytes, screenWidth, screenHeight, stride, ref reactedColor, ref redPixelStart);
 
        if (!wasCaptured && enableDebugMenu && debugScreenshot)
 
        {
 
            // write out the screenshot
 
            string screenshotDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
 
            string filename;
 
            int i = 0;
 
            do
 
            {
 
                ++i;
 
                filename = System.IO.Path.Combine(screenshotDir, String.Format("DesertPaintLab_Colormatch{0}.png", i));
 
            } while (System.IO.File.Exists(filename));
 
            screenBuffer.Save(filename, "png");
 
        }
 
        else
 
        {
 
            // convert to pixel offset instead of byte
 
            int redPixelStartX = (redPixelStart % stride) / 3;
 
            int redPixelStartY = (redPixelStart / stride);
 
            // write out the screenshot
 
            string screenshotDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
 
            string filename;
 
            int i = 0;
 
            do
 
            {
 
                ++i;
 
                filename = System.IO.Path.Combine(screenshotDir, String.Format("DesertPaintLab_Colormatch{0}.png", i));
 
            } while (System.IO.File.Exists(filename));
 
            int captureAreaWidth = Math.Min(64, screenWidth - redPixelStartX + 64);
 
            int captureAreaHeight = Math.Min(64, screenHeight - redPixelStartY + 64);
 
            Gdk.Pixbuf outPixBuf = new Gdk.Pixbuf(screenBuffer, Math.Max(0, redPixelStartX - 16), Math.Max(0, redPixelStartY - 16), captureAreaWidth, captureAreaHeight);
 
            //screenBuffer.Save(filename, "png");
 
            outPixBuf.Save(filename, "png");
 
        }
 
        //screenBuffer.Save("screenshot.png", "png");
 
		
 
		return wasCaptured;
 
	}
 

	
 
    protected virtual void OnDebugScreenshot(object sender, System.EventArgs e)
 
    {
 
        int screenWidth, screenHeight;
 
        DesertPaintLab.Settings.Get("ScreenWidth", out screenWidth);
 
        DesertPaintLab.Settings.Get("ScreenHeight", out screenHeight);
 
        rootWindow.GetSize(out screenWidth, out screenHeight);
 
        DesertPaintLab.AppSettings.Get("ScreenWidth", out screenWidth);
 
        DesertPaintLab.AppSettings.Get("ScreenHeight", out screenHeight);
 
        Gdk.Image rootImage = rootWindow.GetImage(0, 0, screenWidth, screenHeight);
 
        screenBuffer.GetFromImage(rootImage, rootImage.Colormap, 0, 0, 0, 0, screenWidth, screenHeight);
 
        string screenshotDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
 
        string filename;
 
        int i = 0;
 
        do
 
        {
 
            ++i;
 
            filename = System.IO.Path.Combine(screenshotDir, String.Format("DesertPaintLab_{0}.png", i));
 
        } while (System.IO.File.Exists(filename));
 
        screenBuffer.Save(filename, "png");
 
    }
 

	
 
	protected virtual void OnCaptureButton(object sender, System.EventArgs e)
 
	{
 
		if (CaptureReactionColor())
 
		{
 
			string warning = "";
 
			if (reactedColor.Red == 0)
 
			{
 
				warning = warning + "\nRed is too low.";
 
			}
 
			if (reactedColor.Green == 0)
 
			{
 
				warning = warning + "\nGreen is too low.";	
 
			}
 
			if (reactedColor.Blue == 0)
 
			{
 
				warning = warning + "\nBlue is too low.";	
 
			}
 
			if (reactedColor.Red == 255)
 
			{
 
				warning = warning + "\nRed is too high.";
 
			}
 
			if (reactedColor.Green == 255)
 
			{
 
				warning = warning + "\nGreen is too high.";	
 
			}
 
			if (reactedColor.Blue == 255)
 
			{
 
				warning = warning + "\nBlue is too high.";	
 
			}
 
			
 
			if (warning.Length != 0)
 
			{
 
				MessageDialog md = new MessageDialog(this, 
 
	            DialogFlags.DestroyWithParent,
 
	            MessageType.Error, ButtonsType.Ok, 
 
	            "Reaction clipped.  You will need to do a " +
 
	            "3-way reaction to test this pair.  Details: " +
 
	            warning);
 
	   
 
				md.Run();
 
				md.Destroy();
 
			}
 
			else
 
			{
 
				this.reactionSwatch.Color = reactedColor;
 
				saveButton.Sensitive = true;
 
			}
 
		}
 
		else
 
		{
 
			MessageDialog md = new MessageDialog(this, 
 
	            DialogFlags.DestroyWithParent,
 
	            MessageType.Error, ButtonsType.Ok, 
 
	            "Pigment Lab dialog box NOT FOUND.  Please ensure " +
 
	            "that there is an unobstructed view of the dialog " +
 
                "and that your interface size is set to 'small' " +
 
	            "when you press the Capture button.");
 
	   
 
			md.Run();
 
			md.Destroy();	
 
		}
 
	}
 
	
 
	protected virtual void OnSaveButton(object sender, System.EventArgs e)
 
	{
 
        if (ReactionRecorder.RecordReaction(profile, expectedColor, reactedColor, reagents))
 
        {
 
            saveButton.Sensitive = false;
 
        }
 
	}
 
	
 
	protected virtual void OnChangedIngredient1(object sender, System.EventArgs e)
 
	{
 
		UpdateIngredients();
 
	}
 
	
 
	protected virtual void OnChangedIngredient2(object sender, System.EventArgs e)
 
	{
 
		UpdateIngredients();
 
	}
 
	
 
	protected virtual void OnChangedIngredient3(object sender, System.EventArgs e)
 
	{
 
		UpdateIngredients();
 

	
 
	}
 
	
 
	protected virtual void OnNewProfile(object sender, System.EventArgs e)
 
	{
 
		if (unsavedData)
 
		{
 
			MessageDialog md = new MessageDialog(this, 
 
	            DialogFlags.DestroyWithParent,
 
	            MessageType.Warning, ButtonsType.OkCancel, 
 
	            "Your last reaction was unsaved." +
...
 
@@ -670,18 +403,17 @@ public partial class MainWindow : Gtk.Wi
 
			}
 
		}
 
		
 
		if (NewProfile())
 
		{
 
			bool ok = profile.Load();
 
            if (ok)
 
            {
 
    			PopulateDropDowns();
 
                recipe.Reactions = profile.Reactions;
 
                ProfileChanged();
 
            }
 
            else
 
            {
 
                MessageDialog md = new MessageDialog(this, 
 
                    DialogFlags.DestroyWithParent,
 
                    MessageType.Warning, ButtonsType.OkCancel, 
 
                    "Failed to load profile: " + profile.LastError);
 
                md.Run();
...
 
@@ -706,17 +438,17 @@ public partial class MainWindow : Gtk.Wi
 
		{
 
			profileSelected = NewProfile();
 
		}
 
		if (profileSelected)
 
		{
 
			bool ok = profile.Load();
 
            if (ok)
 
            {
 
    			PopulateDropDowns();
 
                ProfileChanged();
 
            }
 
            else
 
            {
 
                MessageDialog md = new MessageDialog(this, 
 
                    DialogFlags.DestroyWithParent,
 
                    MessageType.Warning, ButtonsType.OkCancel, 
 
                    "Failed to load profile: " + profile.LastError);
 
                md.Run();
...
 
@@ -741,65 +473,39 @@ public partial class MainWindow : Gtk.Wi
 
	protected virtual void OnMenuExit (object sender, System.EventArgs e)
 
	{
 
		if (ConfirmedExit())
 
		{
 
			Application.Quit();
 
		}
 
	}
 
	
 
	protected virtual void OnExport(object sender, System.EventArgs e)
 
	protected virtual void OnExportToPracticalPaint(object sender, System.EventArgs e)
 
	{
 
		FileChooserDialog fileDialog =
 
			new FileChooserDialog("Select destination file.",
 
				    this, FileChooserAction.Save,
 
			        Gtk.Stock.Cancel, ResponseType.Cancel,
 
		            Gtk.Stock.Save, ResponseType.Accept);
 
		ResponseType resp = (ResponseType)fileDialog.Run();
 
		if (resp == ResponseType.Accept)
 
		{
 
			string fileName = fileDialog.Filename;
 
			string directory = fileDialog.CurrentFolder;
 
			profile.SaveToPP(System.IO.Path.Combine(directory, fileName));
 
		}
 
		fileDialog.Destroy();
 
	}
 
	
 
	protected virtual void RunSimulator(object sender, System.EventArgs e)
 
	{
 
		SimulatorWindow win = new SimulatorWindow(profile);
 
		win.Show();
 
	}
 
	
 
    protected void OnOpenRecipeGenerator(object sender, EventArgs e)
 
    {
 
        RecipeGeneratorWindow win = new RecipeGeneratorWindow(profile);
 
        win.Show();
 
        //RecipeGenerator gen = new RecipeGenerator();
 
        //gen.BeginRecipeGeneration(profile.Reactions, 15, 7);
 
        //MessageDialog md = new MessageDialog(this, 
 
        //    DialogFlags.DestroyWithParent,
 
        //    MessageType.Info, ButtonsType.Close, 
 
        //    "Coming Soon!");
 
        //md.Run();
 
        //md.Destroy();
 
    }
 

	
 
    protected void OnShowReactionStatus(object sender, EventArgs e)
 
    {
 
        ReactionStatusWindow win = new ReactionStatusWindow(profile);
 
        win.Show();
 
    }
 

	
 
    protected void OnShowIngredients(object sender, EventArgs e)
 
    {
 
        ReagentWindow win = new ReagentWindow(profile);
 
        win.Show();
 
    }
 

	
 
    protected void OnExportProfile(object sender, EventArgs e)
 
    {
 
        FileChooserDialog fileDialog =
 
            new FileChooserDialog("Select destination file.",
 
                    this, FileChooserAction.Save,
 
                    Gtk.Stock.Cancel, ResponseType.Cancel,
 
                    Gtk.Stock.Save, ResponseType.Accept);
 
        ResponseType resp = (ResponseType)fileDialog.Run();
...
 
@@ -809,17 +515,17 @@ public partial class MainWindow : Gtk.Wi
 
            string directory = fileDialog.CurrentFolder;
 
            string targetFile = System.IO.Path.Combine(directory, fileName);
 
            if (File.Exists(targetFile))
 
            {
 
                // prompt to overwrite
 
                MessageDialog md = new MessageDialog(this, 
 
                    DialogFlags.DestroyWithParent,
 
                    MessageType.Warning, ButtonsType.OkCancel, 
 
                    "Overwrite profile at" +
 
                    "Overwrite file at " +
 
                    targetFile + "?");
 
       
 
                resp = (ResponseType)md.Run();
 
                md.Destroy();
 
                if (resp == ResponseType.Ok)
 
                {
 
                    File.Delete(targetFile);
 
                    profile.Export(targetFile);
...
 
@@ -851,43 +557,165 @@ public partial class MainWindow : Gtk.Wi
 
                targetFile = System.IO.Path.Combine(directory, fileName);
 
            }
 
            if (Directory.Exists(profile.Directory))
 
            {
 
                // prompt to overwrite
 
                MessageDialog md = new MessageDialog(this, 
 
                    DialogFlags.DestroyWithParent,
 
                    MessageType.Warning, ButtonsType.OkCancel, 
 
                    "Overwrite profile at" +
 
                    directory + "?");
 
                    "Overwrite profile '" +
 
                    profile.Name + "'?");
 
       
 
                resp = (ResponseType)md.Run();
 
                md.Destroy();
 
                if (resp == ResponseType.Ok)
 
                {
 
                    Directory.Delete(profile.Directory, true);
 
                    profile.Import(targetFile);
 
                }
 
            }
 
            else
 
            {
 
                profile.Import(targetFile);
 
            }
 
            bool ok = profile.Load();
 
            if (ok)
 
            {
 
                PopulateDropDowns();
 
                recipe.Reactions = profile.Reactions;
 
                ProfileChanged();
 
            }
 
            else
 
            {
 
                MessageDialog md = new MessageDialog(this, 
 
                    DialogFlags.DestroyWithParent,
 
                    MessageType.Warning, ButtonsType.OkCancel, 
 
                    "Failed to load imported profile: " + profile.LastError);
 
                md.Run();
 
                md.Destroy();
 
            }
 
        }
 
        fileDialog.Destroy();
 
    }
 

	
 
    protected void OnExportRecipeListToWiki(object sender, EventArgs e)
 
    {
 
        Gtk.FileChooserDialog fileDialog =
 
            new Gtk.FileChooserDialog("Select destination file.",
 
                    (Gtk.Window)Toplevel, Gtk.FileChooserAction.Save,
 
                    Gtk.Stock.Cancel, Gtk.ResponseType.Cancel,
 
                    Gtk.Stock.Save, Gtk.ResponseType.Accept);
 
        Gtk.ResponseType resp = (Gtk.ResponseType)fileDialog.Run();
 
        if (resp == Gtk.ResponseType.Accept)
 
        {
 
            string fileName = fileDialog.Filename;
 
            string directory = fileDialog.CurrentFolder;
 
            profile.ExportWikiRecipes(System.IO.Path.Combine(directory, fileName));
 
        }
 
        fileDialog.Destroy();
 
    }
 

	
 
    protected void OnCopyRecipeListToClipboard(object sender, EventArgs e)
 
    {
 
        Gtk.Clipboard clipboard = this.GetClipboard(Gdk.Selection.Clipboard);
 

	
 
        StringWriter writer = new StringWriter();
 
        profile.ExportWikiRecipes(writer);
 

	
 
        clipboard.Text = writer.ToString();
 
    }
 

	
 
    protected void OnSelectCaptureView(object sender, EventArgs e)
 
    {
 
        if (generatorView != null && generatorView.Visible)
 
        {
 
            generatorView.Hide();
 
            contentContainer.Remove(generatorView);
 
        }
 
        if (simulatorView != null && simulatorView.Visible)
 
        {
 
            simulatorView.Hide();
 
            contentContainer.Remove(simulatorView);
 
        }
 
        if (captureView == null)
 
        {
 
            captureView = new CaptureView(profile, screenBuffer);
 
        }
 
        if (captureView.Visible == false)
 
        {
 
            captureView.ResizeChildren();
 
            captureView.CheckResize();
 
            contentContainer.Add(captureView);
 
            captureView.Show();
 
        }
 
        CheckResize();
 

	
 
        // TODO: enable/disable menu options based on view
 
        NewProfileAction.Sensitive = true;
 
        OpenProfileAction.Sensitive = true;
 
        ImportProfileAction.Sensitive = true;
 
}
 

	
 
    protected void OnSelectRecipeGeneratorView(object sender, EventArgs e)
 
    {
 
        if (captureView != null && captureView.Visible)
 
        {
 
            captureView.Hide();
 
            contentContainer.Remove(captureView);
 
        }
 
        if (simulatorView != null && simulatorView.Visible)
 
        {
 
            simulatorView.Hide();
 
            contentContainer.Remove(simulatorView);
 
        }
 
        if (generatorView == null)
 
        {
 
            generatorView = new RecipeGeneratorView(profile);
 
            generatorView.SetStatus += OnStatusUpdate;
 
            generatorView.Started += OnGeneratorRunning;
 
            generatorView.Stopped += OnGeneratorStopped;
 
        }
 
        if (generatorView.Visible == false)
 
        {
 
            generatorView.ResizeChildren();
 
            generatorView.CheckResize();
 
            contentContainer.Add(generatorView);
 
            generatorView.Show();
 
        }
 
        CheckResize();
 

	
 
        // TODO: only when generator is running
 
        NewProfileAction.Sensitive = false;
 
        OpenProfileAction.Sensitive = false;
 
        ImportProfileAction.Sensitive = false;
 
        // TODO: enable/disable menu options based on view
 
    }
 

	
 
    protected void OnSelectSimulatorView(object sender, EventArgs e)
 
    {
 
        if (captureView != null && captureView.Visible)
 
        {
 
            captureView.Hide();
 
            contentContainer.Remove(captureView);
 
        }
 
        if (generatorView != null && generatorView.Visible)
 
        {
 
            generatorView.Hide();
 
            contentContainer.Remove(generatorView);
 
        }
 
        if (simulatorView == null)
 
        {
 
            simulatorView = new SimulatorView(profile);
 
        }
 
        if (simulatorView.Visible == false)
 
        {
 
            simulatorView.ResizeChildren();
 
            simulatorView.CheckResize();
 
            contentContainer.Add(simulatorView);
 
            simulatorView.Show();
 
        }
 
        CheckResize();
 
        // TODO: enable/disable menu options based on view
 
        NewProfileAction.Sensitive = true;
 
        OpenProfileAction.Sensitive = true;
 
        ImportProfileAction.Sensitive = true;
 
    }
 
}
 

	
PaintRecipe.cs
Show inline comments
...
 
@@ -22,16 +22,19 @@
 

	
 
using System;
 
using System.Collections.Generic;
 

	
 
namespace DesertPaintLab
 
{
 
    public class PaintRecipe
 
    {
 
        public static uint PAINT_RECIPE_MIN_CONCENTRATION = 10;
 
        public static uint RIBBON_RECIPE_MIN_CONCENTRATION = 50;
 

	
 
        public struct RGB
 
        {
 
            public int r;
 
            public int g;
 
            public int b;
 
        };
 

	
 
        public class RecipeIngredient
...
 
@@ -331,37 +334,34 @@ namespace DesertPaintLab
 
                
 
                Reagent reagent = ReagentManager.GetReagent(reagentName);
 
                cost += (reagent.Cost * ingredient.quantity);
 
            }
 
            uint batchCount = (uint)Math.Ceiling((double)quantity / (double)cost);  // number of batches require to make quantity
 
            return batchCount * cost;
 
        }
 

	
 
        public bool IsValid
 
        {
 
            get
 
        public bool IsValidForConcentration(uint concentration)
 
            {
 
                uint weight = 0;
 
                foreach (RecipeIngredient ingredient in recipe)
 
                {
 
                    string reagentName = ingredient.name;
 
                    if (reagentName == null)
 
                    {
 
                        continue;   
 
                    }
 
                    
 
                    Reagent reagent = ReagentManager.GetReagent(reagentName);
 
                    if (!reagent.IsCatalyst)
 
                    {
 
                        weight += ingredient.quantity;
 
                    }
 
                }
 
                return (weight >= 10);
 
            }
 
            return (weight >= concentration);
 
        }
 

	
 
        public bool CheckMissingReactions(ref List<KeyValuePair<string, string>> missing)
 
        {
 
            missing.Clear();
 

	
 
            SortedDictionary<string,bool> reagentSet = new SortedDictionary<string,bool>();
 
            List<Reagent> prevReagents = new List<Reagent>();
PlayerProfile.cs
Show inline comments
...
 
@@ -26,52 +26,67 @@ using System.IO;
 
using System.IO.Compression;
 
using System.Collections.Generic;
 
using System.Text.RegularExpressions;
 

 
namespace DesertPaintLab
 
{
 
	public class PlayerProfile
 
	{
 
		string name;
 
        public string Name { get; private set; }
 
		string directory;
 
		string reactFile;
 
        string reagentFile;
 
        string settingsFile;
 
		
 
        static Regex recipeHeaderRegex = new Regex(@"^--- Recipe: (?<colorname>(\w*\s)*\w+)\s*");
 
        static Regex recipeIngredientRegex = new Regex(@"(?<ingredient>(\w+\s)?\w+)\s*\|\s*(?<quantity>\d+)\s*");
 

 
        ReactionSet reactions = new ReactionSet();
 
        // ingredient -> [ingredient, reaction]
 
		//SortedDictionary<string, SortedDictionary<string, Reaction>> reactions =
 
		//	new SortedDictionary<string, SortedDictionary<string, Reaction>>();
 
        SortedDictionary<string, PaintRecipe> recipes;
 
        SortedDictionary<string, PaintRecipe> ribbonRecipes;
 

 
        Settings settings = new Settings();
 
        public Settings ProfileSettings { 
 
            get { 
 
                return settings;
 
            }
 
        }
 

 
        static PlayerProfile current = null;
 

 
        static PlayerProfile Current
 
        {
 
            get {
 
                return current;
 
            }
 
        }
 

 
        public string LastError { get; private set; }
 
		
 
		public PlayerProfile(string name, string directory)
 
		{
 
			this.name = name;
 
			this.Name = name;
 
			this.directory = directory;
 
			this.reactFile = System.IO.Path.Combine(directory, "dp_reactions.txt");
 
            this.reagentFile = System.IO.Path.Combine(directory, "ingredients.txt");
 
            this.settingsFile = System.IO.Path.Combine(directory, "settings");
 
            this.recipes = new SortedDictionary<string, PaintRecipe>();
 
            this.ribbonRecipes = new SortedDictionary<string, PaintRecipe>();
 
            foreach (PaintColor color in Palette.Colors)
 
            {
 
                this.recipes.Add(color.Name, new PaintRecipe());
 
            }
 
            foreach (PaintColor color in Palette.Colors)
 
            {
 
                this.ribbonRecipes.Add(color.Name, new PaintRecipe());
 
            }
 
		}
 

 
        public string Directory
 
        {
 
            get {
 
                return this.directory;
 
            }
 
        }
...
 
@@ -92,23 +107,45 @@ namespace DesertPaintLab
 

 
        public SortedDictionary<string, PaintRecipe> Recipes
 
        {
 
            get {
 
                return this.recipes;
 
            }
 
        }
 

 
        public SortedDictionary<string, PaintRecipe> RibbonRecipes
 
        {
 
            get {
 
                return this.ribbonRecipes;
 
            }
 
        }
 

 
        public int RecipeCount
 
        {
 
            get {
 
                int count = 0;
 
                foreach (PaintRecipe recipe in this.recipes.Values)
 
                {
 
                    if (recipe.IsValid)
 
                    if (recipe.IsValidForConcentration(PaintRecipe.PAINT_RECIPE_MIN_CONCENTRATION))
 
                    {
 
                        ++count;
 
                    }
 
                }
 
                return count;
 
            }
 
        }
 

 
        public int RibbonCount
 
        {
 
            get {
 
                int count = 0;
 
                foreach (PaintRecipe recipe in this.ribbonRecipes.Values)
 
                {
 
                    if (recipe.IsValidForConcentration(PaintRecipe.RIBBON_RECIPE_MIN_CONCENTRATION))
 
                    {
 
                        ++count;
 
                    }
 
                }
 
                return count;
 
            }
 
        }
 
		
...
 
@@ -300,16 +337,18 @@ namespace DesertPaintLab
 
		public void Export(string file)
 
		{
 
            ZipFile.CreateFromDirectory(directory, file);
 
		}
 
		
 
		public bool Load()
 
		{
 
			string line;
 
            settings.Reset();
 
            settings.Load(settingsFile);
 
			reactions.Clear();
 
            if (File.Exists(reagentFile))
 
            {
 
    			ReagentManager.LoadProfileReagents(reagentFile);
 
            }
 
            else
 
            {
 
                LastError = "Failed to find profile reagents file.";
...
 
@@ -331,16 +370,17 @@ namespace DesertPaintLab
 
					reactions.Set(reagent1, reagent2, new Reaction(int.Parse(tokens[2]), int.Parse(tokens[3]), int.Parse(tokens[4])));
 
				}
 
			}
 
            return true;
 
		}
 
		
 
		public void Save()
 
		{
 
            settings.Save(settingsFile);
 
			Reaction reaction;
 
			using (StreamWriter writer = new StreamWriter(reactFile, false))
 
			{
 
                foreach (string reagentName1 in ReagentManager.Names)
 
                {
 
                    // TODO: could be more efficient by only iterating over the names after reagent1
 
                    foreach (string reagentName2 in ReagentManager.Names)
 
                    {
...
 
@@ -356,23 +396,23 @@ namespace DesertPaintLab
 
                                writer.WriteLine(reagent1.PracticalPaintName + " " + reagent2.PracticalPaintName + " " +
 
    							reaction.Red + " " + reaction.Green + " " + reaction.Blue);
 
    					}
 
    				}
 
    			}
 
            }
 
		}
 

 
        public void LoadRecipes()
 
        private void LoadRecipes(SortedDictionary<string, PaintRecipe> recipeDict, string filename, uint concentration)
 
        {
 
            foreach (PaintRecipe recipe in this.recipes.Values)
 
            foreach (PaintRecipe recipe in recipeDict.Values)
 
            {
 
                recipe.Clear();
 
            }
 
            string recipeFile = System.IO.Path.Combine(directory, "dp_recipes.txt");
 
            string recipeFile = System.IO.Path.Combine(directory, filename);
 
            string line;
 
            Match match;
 
            bool inRecipe = false;
 
            PaintRecipe testRecipe = new PaintRecipe();
 
            testRecipe.Reactions = reactions;
 
            string currentRecipeColor = null;
 
            if (File.Exists(recipeFile))
 
            {
...
 
@@ -380,17 +420,20 @@ namespace DesertPaintLab
 
                {
 
                    while ((line = reader.ReadLine()) != null) 
 
                    {
 
                        match = recipeHeaderRegex.Match(line); 
 
                        if (match.Success)
 
                        {
 
                            if (testRecipe != null && currentRecipeColor != null)
 
                            {
 
                                recipes[currentRecipeColor].CopyFrom(testRecipe);
 
                                if (testRecipe.IsValidForConcentration(concentration))
 
                                {
 
                                    recipeDict[currentRecipeColor].CopyFrom(testRecipe);
 
                                }
 
                            }
 
                            testRecipe.Clear();
 
                            currentRecipeColor = match.Groups["colorname"].Value;
 
                            inRecipe = true;
 
                        }
 
                        else if (inRecipe)
 
                        {
 
                            match = recipeIngredientRegex.Match(line);
...
 
@@ -399,48 +442,79 @@ namespace DesertPaintLab
 
                                string ingredient = match.Groups["ingredient"].Value;
 
                                uint quantity = uint.Parse(match.Groups["quantity"].Value);
 
                                testRecipe.AddReagent(ingredient, quantity);
 
                            }
 
                        }
 
                    }
 
                    if (inRecipe)
 
                    {
 
                        recipes[currentRecipeColor].CopyFrom(testRecipe);
 
                        if (testRecipe.IsValidForConcentration(concentration))
 
                        {
 
                            recipeDict[currentRecipeColor].CopyFrom(testRecipe);
 
                        }
 
                    }
 
                }
 
            }
 
        }
 

 
        public void SaveRecipes()
 
        private void SaveRecipes(SortedDictionary<string, PaintRecipe> recipeDict, string filename)
 
        {
 
            if (recipes != null)
 
            if (recipeDict != null)
 
            {
 
                string recipeFile = System.IO.Path.Combine(directory, "dp_recipes.txt");
 
                string recipeFile = System.IO.Path.Combine(directory, filename);
 
                using (StreamWriter writer = new StreamWriter(recipeFile, false))
 
                {
 
                    foreach (KeyValuePair<string, PaintRecipe> pair in recipes)
 
                    foreach (KeyValuePair<string, PaintRecipe> pair in recipeDict)
 
                    {
 
                        writer.WriteLine("--- Recipe: {0}", pair.Key);
 
                        foreach (PaintRecipe.RecipeIngredient ingredient in pair.Value.Ingredients)
 
                        {
 
                            writer.WriteLine("{0,-14} | {1}", ingredient.name, ingredient.quantity);
 
                        }
 
                    }
 
                }
 
            }
 
        }
 

 
        public void LoadRecipes()
 
        {
 
            LoadRecipes(this.recipes, "dp_recipes.txt", PaintRecipe.PAINT_RECIPE_MIN_CONCENTRATION);
 
            LoadRecipes(this.ribbonRecipes, "dp_ribbons.txt", PaintRecipe.RIBBON_RECIPE_MIN_CONCENTRATION);
 
        }
 

 
        public void SaveRecipes()
 
        {
 
            SaveRecipes(this.recipes, "dp_recipes.txt");
 
            SaveRecipes(this.ribbonRecipes, "dp_ribbons.txt");
 
        }
 

 
        public void ExportWikiRecipes(string file)
 
        {
 
            StreamWriter writer = new StreamWriter(file);
 
            ExportWikiFormat(writer);
 
            ExportWikiFormat(writer, this.recipes);
 
        }
 
		
 
        public void ExportWikiRibbons(string file)
 
        {
 
            StreamWriter writer = new StreamWriter(file);
 
            ExportWikiFormat(writer, this.ribbonRecipes);
 
        }
 
		
 
        public void ExportWikiFormat(TextWriter writer)
 
        public void ExportWikiRecipes(TextWriter writer)
 
        {
 
            ExportWikiFormat(writer, this.recipes);
 
        }
 
        
 
        public void ExportWikiRibbons(TextWriter writer)
 
        {
 
            ExportWikiFormat(writer, this.ribbonRecipes);
 
        }
 
        
 
        public void ExportWikiFormat(TextWriter writer, SortedDictionary<string, PaintRecipe> recipeDict)
 
        {
 
            PaintRecipe recipe;
 
            List<KeyValuePair<string, string>> missing = new List<KeyValuePair<string, string>>();
 
            using (writer)
 
            {
 
                writer.WriteLine("{| class='wikitable sortable' border=\"1\" style=\"background-color:#DEB887;\"");
 
                writer.WriteLine("! Color !! Recipe !! Verified");    
 
                foreach (PaintColor color in Palette.Colors)
...
 
@@ -455,17 +529,17 @@ namespace DesertPaintLab
 
                    float minColor = Math.Min(rPortion, Math.Min(gPortion, bPortion));
 
                    float luminance = (maxColor - minColor) * 0.5f;
 
                    if (luminance < 0.5f)
 
                    {
 
                        // dark color gets light text
 
                        colorLine += " color: #FFFFFF;";
 
                    }
 
                    colorLine += "\" | " + color.Name + " || ";
 
                    if (recipes.TryGetValue(color.Name, out recipe))
 
                    if (recipeDict.TryGetValue(color.Name, out recipe))
 
                    {
 
                        foreach (PaintRecipe.RecipeIngredient ingredient in recipe.Ingredients)
 
                        {
 
                            colorLine += " " + ingredient.ToString();
 
                        }
 
                    } 
 
                    else
 
                    {
...
 
@@ -488,16 +562,28 @@ namespace DesertPaintLab
 
            return reactions.Find(reagent1, reagent2);
 
		}
 
		
 
		public void SetReaction(Reagent reagent1, Reagent reagent2, Reaction reaction)
 
		{
 
            reactions.Set(reagent1, reagent2, reaction);
 
		}
 

 
        public void ClearReaction(Reagent reagent1, Reagent reagent2)
 
        {
 
            reactions.Remove(reagent1, reagent2);
 
        }
 

 
        public void SetRecipe(PaintRecipe recipe)
 
        {
 
            string colorName = Palette.FindNearest(recipe.ReactedColor);
 
            recipes[colorName].CopyFrom(recipe);
 
        }
 

 
        public void SetRibbonRecipe(PaintRecipe recipe)
 
        {
 
            string colorName = Palette.FindNearest(recipe.ReactedColor);
 
            ribbonRecipes[colorName].CopyFrom(recipe);
 
        }
 

 
	}
 
}
 

ReactionRecorder.cs
Show inline comments
...
 
@@ -22,91 +22,121 @@
 

	
 
using System;
 

	
 
namespace DesertPaintLab
 
{
 
    // ReactionRecorder - business logic for recording paint reactions
 
    public class ReactionRecorder
 
    {
 
        const int colorTolerance = 2;
 
        const int COLOR_TOLERANCE = 3;
 

	
 
        const int DEFAULT_SWATCH_HEIGHT = 24;
 
        const int DEFAULT_SWATCH_WIDTH = 260;
 
        const int DEFAULT_COLOR_BAR_WIDTH = 306;
 
        const int DEFAULT_RED_BAR_SPACING = 32;
 
        const int DEFAULT_GREEN_BAR_SPACING = 42;
 
        const int DEFAULT_BLUE_BAR_SPACING = 52;
 

	
 
        static int swatchHeight = DEFAULT_SWATCH_HEIGHT;
 
        static int swatchWidth = DEFAULT_SWATCH_WIDTH;
 
        static int colorBarWidth = DEFAULT_COLOR_BAR_WIDTH;
 
        static int redBarSpacing = DEFAULT_RED_BAR_SPACING;
 
        static int greenBarSpacing = DEFAULT_GREEN_BAR_SPACING;
 
        static int blueBarSpacing = DEFAULT_BLUE_BAR_SPACING;
 

	
 
        private static bool IsPapyTexture(byte r, byte g, byte b)
 
        {
 
            return ((r > 0xD0) && (g > 0xC8) && (b > 0xA0)) &&
 
                    ((r < 0xF4) && (g < 0xE0) && (b < 0xC4));
 
            return ((r > 0xD0) && (g >= 0xC4) && (b >= 0x91)) &&
 
                    ((r < 0xF4) && (g <= 0xED) && (b <= 0xCD));
 
        }
 

	
 
        public static void SetPixelMultiplier(int pixelMultiplier)
 
        {
 
            swatchHeight    = DEFAULT_SWATCH_HEIGHT * pixelMultiplier;
 
            swatchWidth     = DEFAULT_SWATCH_WIDTH * pixelMultiplier;
 
            colorBarWidth   = DEFAULT_COLOR_BAR_WIDTH * pixelMultiplier;
 
            redBarSpacing   = DEFAULT_RED_BAR_SPACING * pixelMultiplier;
 
            greenBarSpacing = DEFAULT_GREEN_BAR_SPACING * pixelMultiplier;
 
            blueBarSpacing  = DEFAULT_BLUE_BAR_SPACING * pixelMultiplier;
 
        }
 

	
 
        unsafe private static void ColorAt(byte *pixBytes, int x, int y, int stride, out byte r, out byte g, out byte b)
 
        {
 
            int pixelStart = (y * stride) + (x * 3);
 
                    r = pixBytes[pixelStart];
 
                    g = pixBytes[pixelStart + 1];
 
                    b = pixBytes[pixelStart + 2];
 
        }
 

	
 
        unsafe private static bool IsPossibleBorderPixel(byte* pixBytes, int x, int y, int stride)
 
        {
 
            int testPixelStart = (y * stride) + (x * 3);
 
            byte r = pixBytes[testPixelStart];
 
            byte g = pixBytes[testPixelStart+1];
 
            byte b = pixBytes[testPixelStart+2];
 

	
 
            bool isDarkPixel = false;
 
            bool isPapyAbove = false;
 
            bool isPapyBelow = false;
 
            // 1.) Check if this is a dark pixel.
 
            isDarkPixel = ((r < 0x46) && (g < 0x46) && (b < 0x46));
 
            
 
            // 2.) Check the pixel above it,
 
            // to see if it's from the papy texture.
 
            int otherPixelStart = testPixelStart - stride;
 
            isPapyAbove = ((otherPixelStart >= 0) &&
 
                IsPapyTexture(pixBytes[otherPixelStart++], pixBytes[otherPixelStart++], pixBytes[otherPixelStart]));
 

	
 
            // 3.) Check the pixel below where the swatch should be,
 
            // to see if it's also from the papy texture.
 
            otherPixelStart = testPixelStart + (stride * swatchHeight);
 
            isPapyBelow = (IsPapyTexture(pixBytes[otherPixelStart++], pixBytes[otherPixelStart++], pixBytes[otherPixelStart]));
 

	
 
            bool result = isDarkPixel && isPapyAbove && isPapyBelow;
 
            return result;
 
        }
 

	
 
        unsafe public static bool CaptureReaction(byte* pixBytes, int screenshotWidth, int screenshotHeight, int stride, ref PaintColor reactedColor, ref int redPixelStart)
 
        {
 
            byte pixel_r, pixel_g, pixel_b;
 
            int pixelStart, otherPixelStart;
 
            bool colorMatch;
 
            bool colorMatch = true;
 
            for (int x = 0; x < screenshotWidth - colorBarWidth; ++x)
 
            {
 
                for (int y = 0; y < (screenshotHeight - 53); ++y)
 
                {
 
                    // Look for the color swatch.
 
                    pixelStart = (y * stride) + (x * 3);
 
                    pixel_r = pixBytes[pixelStart];
 
                    pixel_g = pixBytes[pixelStart + 1];
 
                    pixel_b = pixBytes[pixelStart + 2];
 
                    
 
                    // 1.) Check if this is a dark pixel.
 
                    if ((pixel_r < 0x46) && (pixel_g < 0x46) && (pixel_b < 0x46))
 
                    bool foundSwatch = IsPossibleBorderPixel(pixBytes, x, y, stride); // ((pixel_r < 0x46) && (pixel_g < 0x46) && (pixel_b < 0x46));
 
                    if (foundSwatch)
 
                    {
 
                        // 2.) Check the pixel above it,
 
                        // to see if it's from the papy texture.
 
                        otherPixelStart = pixelStart - stride;
 
                        if ((otherPixelStart >= 0) &&
 
                            IsPapyTexture(pixBytes[otherPixelStart++],
 
                                           pixBytes[otherPixelStart++],
 
                                           pixBytes[otherPixelStart]))
 
                        int borderXOffset = 0;
 
                        for (borderXOffset = 0; foundSwatch && (borderXOffset < swatchWidth); ++borderXOffset)
 
                        {
 
                            // 3.) Check the pixel below where the swatch should be,
 
                            // to see if it's also from the papy texture.
 
                            otherPixelStart = pixelStart + (stride * swatchHeight);
 
                            if (IsPapyTexture(pixBytes[otherPixelStart++],
 
                                           pixBytes[otherPixelStart++],
 
                                           pixBytes[otherPixelStart]))
 
                            foundSwatch &= IsPossibleBorderPixel(pixBytes, x + borderXOffset, y, stride);
 
                        }
 
                    }
 

	
 
                    if (foundSwatch)
 
                            {
 
                                // pixBytes[pixelStart] = 0xFF;
 
                                // pixBytes[pixelStart + 1] = 0x00;
 
                                // pixBytes[pixelStart + 2] = 0xFF;
 
                                
 
                        // found a swatch with an appropriate dark top border with papyrus texture above it and papyrus a jump below it
 
                                // 4.) Scan the left border of the potential swatch
 
                                // location.
 
                                colorMatch = true;
 
                                for (int i = 1; i < swatchHeight - 2; ++i)
 
                                {
 
                                    otherPixelStart = pixelStart + (stride * i);
 
                                    if ((Math.Abs(pixel_r - pixBytes[otherPixelStart++]) > colorTolerance) ||
 
                                        (Math.Abs(pixel_g - pixBytes[otherPixelStart++]) > colorTolerance) ||
 
                                        (Math.Abs(pixel_b - pixBytes[otherPixelStart]) > colorTolerance))
 
                            if ((Math.Abs(pixel_r - pixBytes[otherPixelStart++]) > COLOR_TOLERANCE) ||
 
                                (Math.Abs(pixel_g - pixBytes[otherPixelStart++]) > COLOR_TOLERANCE) ||
 
                                (Math.Abs(pixel_b - pixBytes[otherPixelStart]) > COLOR_TOLERANCE))
 
                                    {
 
                                        colorMatch = false;
 
                                        break;
 
                                    }
 
                                }
 
                                
 
                                if (colorMatch)
 
                                {
...
 
@@ -156,18 +186,16 @@ namespace DesertPaintLab
 
                                    }
 
    
 
                                    reactedColor.Blue = (byte)Math.Round((float)bluePixelCount * 255f / (float)colorBarWidth);
 
                                    return true;
 
                                }
 
                            }
 
                        }
 
                    }
 
                }
 
            }
 
            return false;
 
        }
 

	
 
        public static bool RecordReaction(PlayerProfile profile, PaintColor expectedColor, PaintColor reactedColor, Reagent[] reagents)
 
        {
 
            bool saved = false;
 
            int r, g, b;
 
            if (reagents[2] != null)
ReactionSet.cs
Show inline comments
...
 
@@ -54,15 +54,25 @@ namespace DesertPaintLab
 
            if (secondReagentDict == null)
 
            {
 
                secondReagentDict = new SortedDictionary<string, Reaction>();
 
                reactions.Add(reagent1.PracticalPaintName, secondReagentDict);
 
            }
 
            secondReagentDict[reagent2.PracticalPaintName] = reaction;
 
        }
 

	
 
        public void Remove(Reagent reagent1, Reagent reagent2)
 
        {
 
            SortedDictionary<string, Reaction> secondReagentDict = null;
 
            reactions.TryGetValue(reagent1.PracticalPaintName, out secondReagentDict);
 
            if (secondReagentDict != null)
 
            {
 
                secondReagentDict.Remove(reagent2.PracticalPaintName);
 
            }
 
        }
 

	
 
        public void Clear()
 
        {
 
            reactions.Clear();
 
        }
 
    }
 
}
 

	
RecipeGenerator.cs
Show inline comments
...
 
@@ -59,17 +59,18 @@ namespace DesertPaintLab
 
    {
 
        public enum SearchType {
 
            DEPTH_FIRST,
 
            BREADTH_FIRST
 
        };
 

	
 
        public SearchType Mode { get; set; }
 

	
 
        public uint MaxQuantity { get; private set; } // maximum number of total ingredients
 
        public uint MinConcentration { get; private set; } // minimum paint concentration
 
        public uint MaxConcentration { get; private set; } // maximum paint concentration
 
        public uint MaxReagents { get; private set; } // maximum number of reagents to use in the recipe
 
        public uint MinReagents { get; private set; } // minimum number of reagents to use in the recipe
 
        public uint FullQuantityDepth { get; private set; } // at or equal this number of reagents, ignore ingredient settings for max quantity
 
        public uint FullQuantity { get; private set; }  // The max number of a reagent to use at full quantity
 

	
 
        public uint MaxThreads { get; set; }
 

	
 
        ReactionSet reactions;
...
 
@@ -106,17 +107,18 @@ namespace DesertPaintLab
 
            this.reactions = reactions;
 
            foreach (PaintColor color in Palette.Colors)
 
            {
 
                recipes.Add(color.Name, new PaintRecipe());
 
                recipeCosts.Add(color.Name, uint.MaxValue);
 
            }
 
            MinReagents = 1;
 
            MaxReagents = 5;
 
            MaxQuantity = 20;
 
            MinConcentration = 10;
 
            MaxConcentration = 20;
 
        }
 

	
 
        public SortedDictionary<string, PaintRecipe> Recipes
 
        {
 
            get
 
            {
 
                return recipes;
 
            }
...
 
@@ -162,16 +164,18 @@ namespace DesertPaintLab
 
        }
 

	
 
        public void InitRecipes(SortedDictionary<string, PaintRecipe> initialRecipes)
 
        {
 
            if (running)
 
            {
 
                return;
 
            }
 
            recipeCosts.Clear();
 
            recipes.Clear();
 
            foreach (PaintRecipe recipe in initialRecipes.Values)
 
            {
 
                //PaintRecipe recipeCopy = new PaintRecipe(recipe);
 
                AddCheapestRecipe(recipe);
 
            }
 
        }
 

	
 
        private void InitSortedReagents()
...
 
@@ -180,49 +184,50 @@ namespace DesertPaintLab
 
            foreach (string name in ReagentManager.Names)
 
            {
 
                Reagent reagent = ReagentManager.GetReagent(name);
 
                costSortedReagents.Add(reagent);
 
            }
 
            costSortedReagents.Sort(new ReagentCostSort());
 
        }
 

	
 
        public void BeginRecipeGeneration(uint maxQuantity, uint minReagents, uint maxReagents, uint fullQuantityDepth, uint fullQuantity)
 
        public void BeginRecipeGeneration(uint minConcentration, uint maxConcentration, uint minReagents, uint maxReagents, uint fullQuantityDepth, uint fullQuantity)
 
        {
 
            if (running)
 
            {
 
                // Already running - don't start again
 
                return;
 
            }
 

	
 
            this.MaxQuantity = maxQuantity;
 
            this.MinConcentration = minConcentration;
 
            this.MaxConcentration = maxConcentration;
 
            this.MinReagents = minReagents;
 
            this.MaxReagents = maxReagents;
 
            this.FullQuantity = fullQuantity;
 
            this.FullQuantityDepth = fullQuantityDepth;
 

	
 
            // first, sort reagents by cost.
 
            InitSortedReagents();
 

	
 
            totalReagents = (uint)costSortedReagents.Count;
 

	
 
            // Pre-populate recipes list with:
 
            // 1) 1-ingredient recipes @ 10db for all enabled ingredients with a count >= 10
 
            // 1) 1-ingredient recipes @ min concentration for all enabled ingredients with a count >= min concentration
 
            // 2) any previously-generated recipes
 
            int enabledReagentCount = 0;
 
            PaintRecipe recipe = new PaintRecipe();
 
            recipe.Reactions = reactions;
 
            foreach (Reagent reagent in costSortedReagents)
 
            {
 
                if (reagent.Enabled)
 
                {
 
                    if (!reagent.IsCatalyst && ((reagent.RecipeMax >= 10) || ((FullQuantityDepth > 0) && (FullQuantity >= 10))))
 
                    if (!reagent.IsCatalyst && ((reagent.RecipeMax >= minConcentration) || ((FullQuantityDepth > 0) && (FullQuantity >= minConcentration))))
 
                    {
 
                        recipe.Clear();
 
                        recipe.AddReagent(reagent.Name, 10);
 
                        recipe.AddReagent(reagent.Name, minConcentration);
 
                        AddCheapestRecipe(recipe);
 
                    }
 
                    ++enabledReagentCount;
 
                }
 
            }
 
            this.MaxReagents = (uint)Math.Min(enabledReagentCount, this.MaxReagents);
 
            this.MinReagents = (uint)Math.Min(this.MinReagents, this.MaxReagents);
 

	
...
 
@@ -234,17 +239,18 @@ namespace DesertPaintLab
 
            for (uint reagentIdx = 0; reagentIdx < costSortedReagents.Count; ++reagentIdx)
 
            {
 
                if (costSortedReagents[(int)reagentIdx].Enabled)
 
                {
 
                    // queue up all combinations of MinReagents
 
                    RecipeSearchNode initialNode = new RecipeSearchNode(costSortedReagents, reagentIdx);
 
                    initialNode.FullQuantity = FullQuantity;
 
                    initialNode.FullQuantityDepth = FullQuantityDepth;
 
                    initialNode.MaxQuantity = maxQuantity;
 
                    initialNode.MinConcentration = minConcentration;
 
                    initialNode.MaxConcentration = maxConcentration;
 
                    initialNode.MinReagents = minReagents;
 
                    initialNode.MaxReagents = maxReagents;
 

	
 
                    if (MinReagents > 1)
 
                    {
 
                        while (NextReagentSetBreadthFirst(initialNode, 1, minReagents) == true)
 
                        {
 
                            if (initialNode.ReagentCount == minReagents)
...
 
@@ -261,17 +267,17 @@ namespace DesertPaintLab
 
                    }
 
                }
 
            }
 

	
 
            recipeCount = 0;
 

	
 
            if (log != null)
 
            {
 
                log.WriteLine("Begin recipe generation: MaxQuantity={0} MinReagents={1} MaxReagents={2} FullQuantity={3} FullQuantityDepth={4}", MaxQuantity, MinReagents, MaxReagents, FullQuantity, FullQuantityDepth);
 
                log.WriteLine("Begin recipe generation: MaxConcentration={0} MinReagents={1} MaxReagents={2} FullQuantity={3} FullQuantityDepth={4}", MaxConcentration, MinReagents, MaxReagents, FullQuantity, FullQuantityDepth);
 
            }
 
            
 
            // start worker threads to do the actual work
 
            ResumeRecipeGeneration();
 
        }
 

	
 
        public void ResumeRecipeGeneration()
 
        {
...
 
@@ -435,17 +441,17 @@ namespace DesertPaintLab
 
                                int nodeCount = int.Parse(match.Groups["value"].Value);
 
                                for (int i = 0; i < nodeCount; ++i)
 
                                {
 
                                    RecipeSearchNode node = new RecipeSearchNode(costSortedReagents);
 
                                    node.FullQuantity = FullQuantity;
 
                                    node.FullQuantityDepth = FullQuantityDepth;
 
                                    node.MinReagents = MinReagents;
 
                                    node.MaxReagents = MaxReagents;
 
                                    node.MaxQuantity = MaxQuantity;
 
                                    node.MaxConcentration = MaxConcentration;
 
                                    success = success && node.LoadState(reader);
 
                                    if (success)
 
                                    {
 
                                        searchQueue.Enqueue(node);
 
                                    }
 
                                }
 
                                break;
 
                            case "SearchType":
...
 
@@ -481,35 +487,35 @@ namespace DesertPaintLab
 
                lock (workerLock)
 
                {
 
                    ok = searchQueue.TryDequeue(out node);
 
                }
 
                if (ok)
 
                {
 
                    if (Mode == SearchType.DEPTH_FIRST)
 
                    {
 
                        uint targetQuantity = (node.ReagentCount <= FullQuantityDepth) ? ((uint)node.ReagentCount * FullQuantity) : node.MaxQuantity + 1;
 
                        uint targetQuantity = (node.ReagentCount <= FullQuantityDepth) ? ((uint)node.ReagentCount * FullQuantity) : node.MaxConcentration + 1;
 
                        do {
 
                            --targetQuantity;
 
                            node.InitForQuantity(targetQuantity);
 
                        } while (targetQuantity > 10 && (node.CurrentTargetQuantity != node.UsedQuantity));
 
                        } while (targetQuantity > MinConcentration && (node.CurrentTargetQuantity != node.UsedQuantity));
 
    
 
                        while ((ok = IterateDepthFirst(node)) && !requestCancel)
 
                        {
 
                            if (Progress != null)
 
                            {
 
                                Progress(this, null);
 
                            }
 
                        }
 
                    }
 
                    else
 
                    {
 
                        // breadth-first search
 
                        uint targetQuantity = 9;
 
                        uint quantityLimit = (node.ReagentCount <= FullQuantityDepth) ? (FullQuantity * (uint)node.ReagentCount) : node.MaxQuantity;
 
                        uint targetQuantity = MinConcentration-1;
 
                        uint quantityLimit = (node.ReagentCount <= FullQuantityDepth) ? (FullQuantity * (uint)node.ReagentCount) : node.MaxConcentration;
 
                        do {
 
                            ++targetQuantity;
 
                            node.InitForQuantity(targetQuantity);
 
                        } while ((targetQuantity <= quantityLimit) && (node.CurrentTargetQuantity != node.UsedQuantity));
 
    
 
                        while ((ok = IterateBreadthFirst(node)) && !requestCancel)
 
                        {
 
                            if (Progress != null)
...
 
@@ -544,17 +550,17 @@ namespace DesertPaintLab
 
                }
 
            }
 
        }
 

	
 
        // Add the cheapest recipe to the recipe list
 
        // returns the discarded recipe from the pair (or null if no original recipe to replace)
 
        private void AddCheapestRecipe(PaintRecipe recipe)
 
        {
 
            if (recipe.IsValid)
 
            if (recipe.IsValidForConcentration(MinConcentration))
 
            {
 
                recipe.Reactions = reactions;
 

	
 
                string colorName = Palette.FindNearest(recipe.ReactedColor);
 
                //System.Console.WriteLine("Recipe: {0} {1}:", colorName, recipe.Cost);
 
                //foreach (PaintRecipe.RecipeIngredient ingr in recipe.Ingredients)
 
                //{
 
                //    System.Console.WriteLine("    -> {0} {1}", ingr.quantity, ingr.name);
...
 
@@ -569,41 +575,45 @@ namespace DesertPaintLab
 
                            recipes[colorName].CopyFrom(recipe);
 
                            recipeCosts[colorName] = recipe.Cost;
 
                            if (NewRecipe != null)
 
                            {
 
                                NewRecipeEventArgs args = new NewRecipeEventArgs(colorName, recipe);
 
                                NewRecipe(this, args);
 
                            }
 
                        }
 
                        else
 
                        {
 
                            Console.WriteLine("Ignoring recipe - existing cost is cheaper.");
 
                        }
 
                    }
 
                    else
 
                    {
 
                        // This would be an error!
 
                        recipeCosts.Add(colorName, recipe.Cost);
 
                        recipes.Add(colorName, new PaintRecipe(recipe));
 
                        if (NewRecipe != null)
 
                        {
 
                            NewRecipeEventArgs args = new NewRecipeEventArgs(colorName, recipe);
 
                            NewRecipe(this, args);
 
                        }
 
                    }
 
                }
 
            }
 
            //else
 
            //{
 
            //    string msg = String.Format("Recipe is invalid ({0} ingredients)\n", recipe.Ingredients.Count);
 
            //    foreach (PaintRecipe.RecipeIngredient ingr in recipe.Ingredients)
 
            //    {
 
            //        msg += String.Format("    -> {0} {1}", ingr.quantity, ingr.name);
 
            //    }
 
            //    lock (workerLock) {
 
            //        Console.WriteLine(msg);
 
            //    }
 
            //}
 
            else
 
            {
 
                string msg = String.Format("Recipe is invalid ({0} ingredients)\n", recipe.Ingredients.Count);
 
                foreach (PaintRecipe.RecipeIngredient ingr in recipe.Ingredients)
 
                {
 
                    msg += String.Format("    -> {0} {1}", ingr.quantity, ingr.name);
 
                }
 
                lock (workerLock) {
 
                    Console.WriteLine(msg);
 
                }
 
            }
 
        }
 

	
 
        private bool IterateDepthFirst(RecipeSearchNode node)
 
        {
 
            TestCurrentRecipe(node);
 

	
 
            // pick recipe quantities at current recipe ingredients/size
 
            if (NextRecipe(node))
...
 
@@ -649,18 +659,18 @@ namespace DesertPaintLab
 
                    }
 
                    if (node.ReagentCount == node.MinReagents)
 
                    {
 
                        // done
 
                        return false;
 
                    }
 
                    node.ReplaceLastReagent(nextReagent);
 
                }
 
            } while (node.MaxQuantity < (10 + node.CatalystCount));
 
            node.InitForQuantity(node.MaxQuantity);
 
            } while (node.MaxConcentration < (node.MinConcentration + node.CatalystCount));
 
            node.InitForQuantity(node.MaxConcentration);
 

	
 
            //string outStr = "{0} : {1} : ";
 
            //for (int i = 0; i < currentReagents.Count; ++i)
 
            //{
 
            //    Reagent reagent = costSortedReagents[(int)currentReagents[i]];
 
            //    if (i > 0)
 
            //    {
 
            //        outStr += ", ";
...
 
@@ -684,17 +694,17 @@ namespace DesertPaintLab
 
            if (NextRecipe(node))
 
            {
 
                //System.Console.WriteLine("Found next recipe at size {0} qty {1}", node.ReagentCount, node.CurrentTargetQuantity);
 
                return true;
 
            }
 

	
 
            // Try next quantity
 
            uint newQuantity;
 
            uint quantityLimit = ((uint)node.ReagentCount <= FullQuantityDepth) ? ((uint)node.ReagentCount * FullQuantity) : node.MaxQuantity;
 
            uint quantityLimit = ((uint)node.ReagentCount <= FullQuantityDepth) ? ((uint)node.ReagentCount * FullQuantity) : node.MaxConcentration;
 
            do {
 
                newQuantity = node.CurrentTargetQuantity + 1;
 
                //Console.WriteLine("Try quantity {0}", newQuantity);
 
                if (newQuantity <= quantityLimit)
 
                {
 
                    node.InitForQuantity(newQuantity);
 
                    if (node.CurrentTargetQuantity <= node.UsedQuantity)
 
                    {
...
 
@@ -710,18 +720,18 @@ namespace DesertPaintLab
 

	
 
        private bool NextReagentSetBreadthFirst(RecipeSearchNode node, uint minReagents, uint maxReagents)
 
        {
 
            // search all variants at this depth of recipe
 
            // increase recipe depth
 

	
 
            // next reagent in last position
 
            // if at end, pop reagent
 
            //Console.WriteLine("Finding new recipe after quantity {0}/{1} used {2}", newQuantity, node.MaxQuantity, node.UsedQuantity);
 
            node.InitForQuantity(10+node.CatalystCount); // reset quantity
 
            //Console.WriteLine("Finding new recipe after quantity {0}/{1} used {2}", newQuantity, node.MaxConcentration, node.UsedQuantity);
 
            node.InitForQuantity(node.MinConcentration+node.CatalystCount); // reset quantity
 
            int currentDepth = node.ReagentCount;
 
            bool recipeFound = false;
 
            uint nextReagent;
 
            do {
 
                //Console.WriteLine("Current depth: {0}/{1}", currentDepth, node.MaxReagents);
 
                do {
 
                    recipeFound = false;
 
                    // back out until we find a node that can be incremented
...
 
@@ -786,17 +796,17 @@ namespace DesertPaintLab
 
                else
 
                {
 
                    ++currentDepth;
 
                    if (log != null) { lock(log) { log.WriteLine("Increased depth to {0}/{1} [no recipe]", currentDepth, node.MaxReagents); } }
 
                }
 
            } while (currentDepth <= maxReagents);
 
            if (recipeFound)
 
            {
 
                node.InitForQuantity(10+node.CatalystCount); // minimum quantity for this recipe
 
                node.InitForQuantity(node.MinConcentration+node.CatalystCount); // minimum quantity for this recipe
 
                if (node.TestRecipe == null)
 
                {
 
                    node.TestRecipe = new PaintRecipe();
 
                    node.TestRecipe.Reactions = reactions;
 
                }
 
                node.TestRecipe.Clear();
 
                for (int i = 0; i < node.ReagentCount; ++i)
 
                {
...
 
@@ -830,17 +840,17 @@ namespace DesertPaintLab
 
            AddCheapestRecipe(node.TestRecipe);
 
            //if (log != null) { lock(log) { log.WriteLine("Tested recipe: {0}", node.TestRecipe); } }
 
        }
 

	
 
        private bool NextRecipe(RecipeSearchNode node)
 
        {
 
            // check for the next recipe
 
            uint remainingWeight = node.CurrentTargetQuantity - node.CatalystCount;
 
            if (remainingWeight < 10)
 
            if (remainingWeight < MinConcentration)
 
            {
 
                // not possible to make a valid recipe
 
                Console.WriteLine("Insufficient remaining weight");
 
                return false;
 
            }
 
            //uint remainingReagents = (uint)node.Reagents.Count - node.CatalystCount;
 

	
 
            uint depth = (uint)node.ReagentCount;
...
 
@@ -894,17 +904,17 @@ namespace DesertPaintLab
 
            //}
 
            
 
            return (weightToConsume == 0);
 
        }
 

	
 
        private bool NextRecipeSize(RecipeSearchNode node)
 
        {
 
            uint newQuantity = node.CurrentTargetQuantity - 1;
 
            if (newQuantity < (10 + node.CatalystCount))
 
            if (newQuantity < (node.MinConcentration + node.CatalystCount))
 
            {
 
                return false;
 
            }
 

	
 
            node.InitForQuantity(newQuantity);
 
            if (node.CurrentTargetQuantity > node.UsedQuantity)
 
            {
 
                return false;
RecipeGeneratorWindow.cs
Show inline comments
 
deleted file
RecipeSearchNode.cs
Show inline comments
...
 
@@ -43,33 +43,35 @@ namespace DesertPaintLab
 
        public int ReagentCount
 
        {
 
            get
 
            {
 
                return nextReagentPos;
 
            }
 
        }
 

	
 
        public uint MinConcentration { get; set; } = 10;
 

	
 
        bool[] reagentInUse;
 
        List<Reagent> costSortedReagents;
 
        PaintRecipe testRecipe = null;
 
        public PaintRecipe TestRecipe
 
        {
 
            get
 
            {
 
                return testRecipe;
 
            }
 
            set
 
            {
 
                testRecipe = value;
 
            }
 
        }
 

	
 
        public uint CurrentTargetQuantity { get; set; }
 
        public uint MaxQuantity { get; set; }
 
        public uint MaxConcentration { get; set; }
 
        public uint UsedQuantity { get; private set; }
 
        public uint CatalystCount { get; set; }
 
        public uint FullQuantityDepth { get; set; }
 
        public uint FullQuantity { get; set; }
 
        public uint MinReagents { get; set; }
 

	
 
        uint maxReagents;
 
        public uint MaxReagents
...
 
@@ -106,17 +108,17 @@ namespace DesertPaintLab
 
            reagentInUse = new bool[costSortedReagents.Count];
 
            for (uint i = 0; i < costSortedReagents.Count; ++i)
 
            {
 
                reagentInUse[i] = other.reagentInUse[i];
 
            }
 
            nextReagentPos = other.nextReagentPos;
 

	
 
            CurrentTargetQuantity = other.CurrentTargetQuantity;
 
            MaxQuantity = other.MaxQuantity;
 
            MaxConcentration = other.MaxConcentration;
 
            UsedQuantity = other.UsedQuantity;
 
            CatalystCount = other.CatalystCount;
 
            FullQuantityDepth = other.FullQuantityDepth;
 
            FullQuantity = other.FullQuantity;
 
            MinReagents = other.MinReagents;
 
            MaxReagents = other.MaxReagents;
 
            for (int i = 0; i < MaxReagents; ++i)
 
            {
...
 
@@ -280,17 +282,17 @@ namespace DesertPaintLab
 
            }
 
            return ok;
 
        }
 

	
 
        public void InitForQuantity(uint quantity)
 
        {
 
            //System.Console.WriteLine("Init for quantity: {0}, reagent count: {1} ({2} catalysts)", quantity, ReagentCount, CatalystCount);
 
            CurrentTargetQuantity = quantity;
 
            if (CurrentTargetQuantity < (10 + CatalystCount))
 
            if (CurrentTargetQuantity < (MinConcentration + CatalystCount))
 
            {
 
                // invalid quantity
 
                return;
 
            }
 
            UsedQuantity = 0;
 
            uint remainingReagents = ((uint)nextReagentPos - CatalystCount);
 
            uint remainingWeight = CurrentTargetQuantity - CatalystCount;
 
            for (int i = 0; i < nextReagentPos; ++i)
...
 
@@ -337,17 +339,18 @@ namespace DesertPaintLab
 
            {
 
                uint idx = reagents[i];
 
                uint weight = currentWeights[i];
 
                writer.WriteLine("Reagent: {0},{1},{2}", idx, reagentInUse[idx] ? 1 : 0, weight);
 
            }
 
            // pulled from parent: List<Reagent> costSortedReagents;
 
            // new on construct: PaintRecipe testRecipe = null;
 
            writer.WriteLine("CurrentTargetQuantity: {0}", CurrentTargetQuantity);
 
            writer.WriteLine("MaxQuantity: {0}", MaxQuantity);
 
            writer.WriteLine("MinConcentration: {0}", MinConcentration);
 
            writer.WriteLine("MaxConcentration: {0}", MaxConcentration);
 
            writer.WriteLine("UsedQuantity: {0}", UsedQuantity);
 
            writer.WriteLine("CatalystCount: {0}", CatalystCount);
 
            writer.WriteLine("FullQuantity: {0}", FullQuantity);
 
            writer.WriteLine("FullQuantityDepth: {0}", FullQuantityDepth);
 
            writer.WriteLine("---EndNode---");
 
            
 
        }
 

	
...
 
@@ -414,17 +417,29 @@ namespace DesertPaintLab
 
                            {
 
                                uint value = uint.Parse(match.Groups[2].Value);
 
                                CurrentTargetQuantity = value;
 
                            }
 
                            break;
 
                        case "MaxQuantity":
 
                            {
 
                                uint value = uint.Parse(match.Groups[2].Value);
 
                                MaxQuantity = value;
 
                                MaxConcentration = value;
 
                            }
 
                            break;
 
                        case "MinConcentration":
 
                            {
 
                                uint value = uint.Parse(match.Groups[2].Value);
 
                                MinConcentration = value;
 
                            }
 
                            break;
 
                        case "MaxConcentration":
 
                            {
 
                                uint value = uint.Parse(match.Groups[2].Value);
 
                                MaxConcentration = value;
 
                            }
 
                            break;
 
                        case "MinReagents":
 
                            {
 
                                uint value = uint.Parse(match.Groups[2].Value);
 
                                MinReagents = value;
 
                            }
 
                            break;
Settings.cs
Show inline comments
...
 
@@ -2,66 +2,68 @@
 
using System.Collections.Generic;
 
using System.IO;
 
using System.Text.RegularExpressions;
 

	
 
namespace DesertPaintLab
 
{
 
    public class Settings
 
    {
 
        private Settings()
 
        public Settings()
 
        {
 
        }
 

	
 
        private static Dictionary<string, string> _settings = new Dictionary<string, string>();
 
        private Dictionary<string, string> _settings = new Dictionary<string, string>();
 

	
 
        public static void Get(string key, out int value)
 
        public void Get(string key, out int value)
 
        {
 
            value = 0;
 
            string valStr;
 
            if ( _settings.TryGetValue(key.ToLower(), out valStr) )
 
            {
 
                Int32.TryParse(valStr, out value);
 
            }
 
        }
 
        public static void Get(string key, out bool value)
 
        public void Get(string key, out bool value)
 
        {
 
            value = false;
 
            string valStr;
 
            if ( _settings.TryGetValue(key.ToLower(), out valStr) )
 
            {
 
                Boolean.TryParse(valStr, out value);
 
            }
 
        }
 
        public static void Set(string key, int value)
 
        public void Set(string key, int value)
 
        {
 
            _settings[key.ToLower()] = value.ToString();
 
        }
 
        public static void Get(string key, bool value)
 
        public void Set(string key, bool value)
 
        {
 
            _settings[key.ToLower()] = value.ToString();
 
        }
 

	
 
        public static void Save()
 
        public void Reset()
 
        {
 
            string settingsPath = System.IO.Path.Combine(FileUtils.AppDataPath, "settings");
 
            _settings.Clear();
 
        }
 

	
 
        public void Save(string settingsPath)
 
        {
 
            using (StreamWriter writer = new StreamWriter(settingsPath))
 
            {
 
                foreach (KeyValuePair<string, string> pair in _settings)
 
                {
 
                    writer.WriteLine("{0}={1}", pair.Key, pair.Value);
 
                }
 
            }
 
        }
 
    
 
        
 
        static Regex optionEntry = new Regex(@"(?<opt>[^#=][^=]*)=(?<optval>.*)$");
 
        public static bool Load()
 
        public bool Load(string settingsPath)
 
        {
 
            string settingsPath = System.IO.Path.Combine(FileUtils.AppDataPath, "settings");
 
            if (System.IO.File.Exists(settingsPath))
 
            {
 
                string line;
 
                Match match;
 
                using (StreamReader reader = new StreamReader(settingsPath))
 
                {
 
                    while ((line = reader.ReadLine()) != null) 
 
                    {
SimulatorWindow.cs
Show inline comments
 
deleted file
UI/CaptureView.cs
Show inline comments
 
new file 100644
 
using System;
 

	
 
namespace DesertPaintLab
 
{
 
    [System.ComponentModel.ToolboxItem(true)]
 
    public partial class CaptureView : Gtk.Bin
 
    {
 

	
 
        Reagent[] reagents = new Reagent[3];
 
        PaintRecipe recipe = new PaintRecipe();
 

	
 
        PaintColor expectedColor = new PaintColor();
 
        PaintColor reactedColor = new PaintColor();
 

	
 
        PlayerProfile profile = null;
 

	
 
        Gdk.Pixbuf screenBuffer = null;
 

	
 
        bool recordEnabled = true;
 
        bool isCaptured = false;
 

	
 
        public CaptureView(PlayerProfile profile, Gdk.Pixbuf screenBuffer) : base()
 
        {
 
            this.profile = profile;
 
            this.screenBuffer = screenBuffer;
 

	
 
            this.Build();
 

	
 
            reagents[0] = null;
 
            reagents[1] = null;
 
            reagents[2] = null;
 

	
 
            if (unmodifiedSwatch != null)
 
            {
 
                unmodifiedSwatch.Clear();
 
            }
 
            if (reactionSwatch != null)
 
            {
 
                reactionSwatch.Clear();
 
            }
 

	
 
            PopulateDropDowns();
 
            recipe.Reactions = profile.Reactions;
 
        }
 

	
 
        public PlayerProfile Profile
 
        {
 
            set {
 
                profile = value;
 
                PopulateDropDowns();
 
                recipe.Reactions = profile.Reactions;
 
                UpdateIngredients();
 
                // TODO: reset views
 
            }
 
        }
 

	
 
        public void DisableRecord()
 
        {
 
            recordEnabled = false;
 
            recordButton.Sensitive = false;
 
        }
 

	
 
        public void EnableRecord()
 
        {
 
            recordEnabled = true;
 
            if (isCaptured)
 
            {
 
                recordEnabled = true;
 
            }
 
            UpdateIngredients();
 
        }
 

	
 
        public void PopulateDropDowns()
 
        {
 
            ReagentManager.PopulateReagents(ref ingredient1ComboBox);
 
            ReagentManager.PopulateReagents(ref ingredient2ComboBox);
 
            ReagentManager.PopulateReagents(ref ingredient3ComboBox);
 
            
 
            ingredient2ComboBox.Sensitive = false;
 
            ingredient3ComboBox.Sensitive = false;
 
            
 
            Gtk.TreeIter iter;
 
            ingredient1ComboBox.Model.IterNthChild(out iter, 0);
 
            ingredient1ComboBox.SetActiveIter(iter);
 
            ingredient2ComboBox.Model.IterNthChild(out iter, 0);
 
            ingredient2ComboBox.SetActiveIter(iter);
 
            ingredient3ComboBox.Model.IterNthChild(out iter, 0);
 
            ingredient3ComboBox.SetActiveIter(iter);
 
        }
 
        
 
        protected void SetExpectedColor(byte red, byte green, byte blue)
 
        {
 
            expectedColor.Red = red;
 
            expectedColor.Green = green;
 
            expectedColor.Blue = blue;
 
            unmodifiedSwatch.Color = expectedColor;
 
        }
 
        
 
        protected void SetExpectedColor(PaintColor color)
 
        {
 
            SetExpectedColor(color.Red, color.Green, color.Blue);
 
        }
 

	
 
        protected string GetSelectedReagentName(int reagentNum)
 
        {
 
            Gtk.ComboBox[] comboBox = { ingredient1ComboBox, ingredient2ComboBox, ingredient3ComboBox };
 
            Gtk.ComboBox desired = comboBox[reagentNum-1];
 
        
 
            Gtk.TreeIter selectIter;
 
            string reagentName = null;
 
            if (desired.GetActiveIter(out selectIter))
 
            {
 
                reagentName = (string)desired.Model.GetValue(selectIter, 0);
 
            }
 
            if (reagentName != null && reagentName.Length == 0)
 
            {
 
                reagentName = null;
 
            }
 

	
 
            return reagentName;
 
        }
 
        
 
        protected void UpdateIngredients()
 
        {
 
            Reaction reaction1, reaction2;
 
            string reagentName;
 
            reagents[0] = null;
 
            reagents[1] = null;
 
            reagents[2] = null;
 
            
 
            bool reactionKnown = true;
 
            
 
            isCaptured = false;
 
            recordButton.Sensitive = false;
 
            clearReactionButton.Sensitive = false;
 
            clearReactionButton.Visible = false;
 
    
 
            recipe.Clear();
 
            
 
            if ((reagentName = GetSelectedReagentName(1)) == null)
 
            {
 
                // Nothing selected as reagent 1
 
                ingredient2ComboBox.Sensitive = false;
 
                ingredient3ComboBox.Sensitive = false;
 
                unmodifiedSwatch.Clear();
 
                reactionSwatch.Clear();
 
                captureButton.Sensitive = false;
 
                return;
 
            }
 
            recipe.AddReagent(reagentName);
 
            reagents[0] = ReagentManager.GetReagent(reagentName);
 
            ingredient2ComboBox.Sensitive = true;
 
            if ((reagentName = GetSelectedReagentName(2)) == null)
 
            {
 
                ingredient3ComboBox.Sensitive = false;
 
                recordButton.Sensitive = false;
 
                reactionKnown = false;
 
                reactionSwatch.Clear();
 
                return;
 
            }
 

	
 
            recipe.AddReagent(reagentName);
 
            reagents[1] = ReagentManager.GetReagent(reagentName);
 
            ingredient3ComboBox.Sensitive = true;
 
            captureButton.Sensitive = true;
 
            
 
            reaction1 = profile.FindReaction(reagents[0], reagents[1]);
 
            
 
            // TODO: really should handle reagent0==reagent1 better
 
            if ((reaction1 != null) || (reagents[0] == reagents[1]))
 
            {
 
                clearReactionButton.Sensitive = recordEnabled;
 
                clearReactionButton.Visible = true;
 
                ingredient3ComboBox.Sensitive = true;
 
                if ((reagentName = GetSelectedReagentName(3)) != null)
 
                {
 
                    clearReactionButton.Sensitive = false;
 
                    clearReactionButton.Visible = false;
 
                    recipe.AddReagent(reagentName);
 
                    reagents[2] = ReagentManager.GetReagent(reagentName);
 
            
 
                    if (!reactionKnown)
 
                    {
 
                        Gtk.MessageDialog md = new Gtk.MessageDialog((Gtk.Window)Toplevel, 
 
                            Gtk.DialogFlags.DestroyWithParent,
 
                            Gtk.MessageType.Error, Gtk.ButtonsType.Ok, 
 
                            "To do a three-ingredient reaction test, " +
 
                            "you must first recored the reaction of " +
 
                            "the first two ingredients.");
 

	
 
                        md.Run();
 
                        md.Destroy();
 
                        captureButton.Sensitive = false;
 
                    }
 
                    
 
                    reaction1 = profile.FindReaction(reagents[0], reagents[2]);
 
                    reaction2 = profile.FindReaction(reagents[1], reagents[2]);
 
                    
 
                    if (reactionKnown && (reaction1 == null) && (reaction2 == null))
 
                    {
 
                        Gtk.MessageDialog md = new Gtk.MessageDialog((Gtk.Window)Toplevel, 
 
                            Gtk.DialogFlags.DestroyWithParent,
 
                            Gtk.MessageType.Error, Gtk.ButtonsType.Ok, 
 
                            "To do a three-ingredient reaction test, " +
 
                            "you must first record the reaction of " +
 
                            "either the first or second ingredient " +
 
                            "with the third ingredient.");
 

	
 
                        md.Run();
 
                        md.Destroy();   
 
                        captureButton.Sensitive = false;
 
                    }
 
                    
 
                    if ((reaction1 == null) && (reagents[0] != reagents[2]))
 
                    {
 
                        reactionKnown = false;  
 
                    }
 

	
 
                    if ((reaction2 == null) && (reagents[1] != reagents[2]))
 
                    {
 
                        reactionKnown = false;  
 
                    }
 
                }
 
            }
 
            else
 
            {
 
                reactionKnown = false;
 
                ingredient3ComboBox.Sensitive = false;
 
            }
 
        
 
            expectedColor.Set(recipe.BaseColor);
 
            unmodifiedSwatch.Color = expectedColor;
 
            //SetExpectedColor(recipeColor.Red, recipeColor.Green, recipeColor.Blue);
 
            
 
            if (reactionKnown)
 
            {
 
                reactedColor.Set(recipe.ReactedColor);
 
                reactionSwatch.Color = reactedColor;
 
            }
 
            else
 
            {
 
                reactionSwatch.Clear(); 
 
            }
 
        }
 

	
 
        unsafe bool CaptureReactionColor()
 
        {
 
            // Take a screenshot.
 
            int screenWidth, screenHeight;
 
            bool debugScreenshot = false;
 
            bool enableDebugMenu = false;
 
            Gdk.Window rootWindow = Gdk.Global.DefaultRootWindow;
 
            DesertPaintLab.AppSettings.Get("ScreenWidth", out screenWidth);
 
            DesertPaintLab.AppSettings.Get("ScreenHeight", out screenHeight);
 
            DesertPaintLab.AppSettings.Get("EnableDebugMenu", out enableDebugMenu);
 
            DesertPaintLab.AppSettings.Get("DebugScreenshot", out debugScreenshot);
 
            Gdk.Image rootImage = rootWindow.GetImage(0, 0, screenWidth, screenHeight);
 
            screenBuffer.GetFromImage(rootImage, rootImage.Colormap, 0, 0, 0, 0, screenWidth, screenHeight);
 
            //screenBuffer.GetFromDrawable(rootWindow,
 
            //  rootWindow.Colormap, 0, 0, 0, 0, screenWidth, screenHeight);
 
            int stride = screenBuffer.Rowstride;
 
            byte* pixBytes = (byte*)screenBuffer.Pixels;
 
            int redPixelStart = -1;
 
        
 
            isCaptured = ReactionRecorder.CaptureReaction(pixBytes, screenWidth, screenHeight, stride, ref reactedColor, ref redPixelStart);
 
            if (enableDebugMenu && debugScreenshot)
 
            {
 
                if (!isCaptured)
 
                {
 
                    // write out the whole screenshot on a failure to capture
 
                    string screenshotDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
 
                    string filename;
 
                    int i = 0;
 
                    do
 
                    {
 
                        ++i;
 
                        filename = System.IO.Path.Combine(screenshotDir, String.Format("DesertPaintLab_Colormatch{0}.png", i));
 
                    } while (System.IO.File.Exists(filename));
 
                    screenBuffer.Save(filename, "png");
 
                }
 
                else
 
                {
 
                    // record the swatch that was captured
 
                    // convert to pixel offset instead of byte
 
                    int redPixelStartX = (redPixelStart % stride) / 3;
 
                    int redPixelStartY = (redPixelStart / stride);
 
                    // write out the screenshot
 
                    string screenshotDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
 
                    string filename;
 
                    int i = 0;
 
                    do
 
                    {
 
                        ++i;
 
                        filename = System.IO.Path.Combine(screenshotDir, String.Format("DesertPaintLab_Colormatch{0}.png", i));
 
                    } while (System.IO.File.Exists(filename));
 
                    int captureAreaWidth = Math.Min(64, screenWidth - redPixelStartX + 64);
 
                    int captureAreaHeight = Math.Min(64, screenHeight - redPixelStartY + 64);
 
                    Gdk.Pixbuf outPixBuf = new Gdk.Pixbuf(screenBuffer, Math.Max(0, redPixelStartX - 16), Math.Max(0, redPixelStartY - 16), captureAreaWidth, captureAreaHeight);
 
                    //screenBuffer.Save(filename, "png");
 
                    outPixBuf.Save(filename, "png");
 
                }
 
            }
 
            //screenBuffer.Save("screenshot.png", "png");
 
            
 
            return isCaptured;
 
        }
 

	
 
        protected virtual void OnCapture(object sender, System.EventArgs e)
 
        {
 
            if (CaptureReactionColor())
 
            {
 
                string warning = "";
 
                if (reactedColor.Red == 0)
 
                {
 
                    warning = warning + "\nRed is too low.";
 
                }
 
                if (reactedColor.Green == 0)
 
                {
 
                    warning = warning + "\nGreen is too low.";  
 
                }
 
                if (reactedColor.Blue == 0)
 
                {
 
                    warning = warning + "\nBlue is too low.";   
 
                }
 
                if (reactedColor.Red == 255)
 
                {
 
                    warning = warning + "\nRed is too high.";
 
                }
 
                if (reactedColor.Green == 255)
 
                {
 
                    warning = warning + "\nGreen is too high."; 
 
                }
 
                if (reactedColor.Blue == 255)
 
                {
 
                    warning = warning + "\nBlue is too high.";  
 
                }
 
                
 
                if (warning.Length != 0)
 
                {
 
                    isCaptured = true;
 
                    Gtk.MessageDialog md = new Gtk.MessageDialog((Gtk.Window)Toplevel, 
 
                    Gtk.DialogFlags.DestroyWithParent,
 
                    Gtk.MessageType.Error, Gtk.ButtonsType.Ok, 
 
                    "Reaction clipped.  You will need to do a " +
 
                    "3-way reaction to test this pair.  Details: " +
 
                    warning);
 
           
 
                    md.Run();
 
                    md.Destroy();
 
                }
 
                else
 
                {
 
                    this.reactionSwatch.Color = reactedColor;
 
                    recordButton.Sensitive = recordEnabled;
 
                }
 
            }
 
            else
 
            {
 
                Gtk.MessageDialog md = new Gtk.MessageDialog((Gtk.Window)Toplevel, 
 
                    Gtk.DialogFlags.DestroyWithParent,
 
                    Gtk.MessageType.Error, Gtk.ButtonsType.Ok, 
 
                    "Pigment Lab dialog box NOT FOUND.  Please ensure " +
 
                    "that there is an unobstructed view of the dialog " +
 
                    "and that your interface size is set to 'small' " +
 
                    "when you press the Capture button.");
 
           
 
                md.Run();
 
                md.Destroy();   
 
            }
 
        }
 
        
 
        protected virtual void OnRecord(object sender, System.EventArgs e)
 
        {
 
            if (ReactionRecorder.RecordReaction(profile, expectedColor, reactedColor, reagents))
 
            {
 
                recordButton.Sensitive = false;
 
            }
 
        }
 
        
 
        protected virtual void OnChangedIngredient1(object sender, System.EventArgs e)
 
        {
 
            UpdateIngredients();
 
        }
 
        
 
        protected virtual void OnChangedIngredient2(object sender, System.EventArgs e)
 
        {
 
            UpdateIngredients();
 
        }
 
        
 
        protected virtual void OnChangedIngredient3(object sender, System.EventArgs e)
 
        {
 
            UpdateIngredients();
 
    
 
        }
 
        
 
        protected void OnClearReaction(object sender, EventArgs e)
 
        {
 
            string reagentName1 = GetSelectedReagentName(1);
 
            string reagentName2 = GetSelectedReagentName(2);
 
            string reagentName3 = GetSelectedReagentName(3);
 

	
 
            if ((reagentName1 != null) && (reagentName2 != null) && (reagentName3 == null))
 
            {
 
                Reagent reagent1 = ReagentManager.GetReagent(reagentName1);
 
                Reagent reagent2 = ReagentManager.GetReagent(reagentName2);
 

	
 
                if (null != profile.FindReaction(reagent1, reagent2))
 
                {
 
                    Gtk.MessageDialog md = new Gtk.MessageDialog((Gtk.Window)Toplevel, 
 
                        Gtk.DialogFlags.DestroyWithParent,
 
                        Gtk.MessageType.Warning, Gtk.ButtonsType.OkCancel, 
 
                        "This will delete the reaction status between " +
 
                        // TODO: ingredient1Name + " and " + ingredient2Name + "\n\n" +
 
                        "ARE YOU SURE?"
 
                    );
 
        
 
                    Gtk.ResponseType response = (Gtk.ResponseType)md.Run();
 
                    if (response == Gtk.ResponseType.Ok)
 
                    {
 
                        // really delete it
 
                        profile.ClearReaction(reagent1, reagent2);
 
                    }
 
                    md.Destroy();
 
                }
 
            }
 
        }
 
    }
 
}
 

	
UI/RecipeGeneratorView.cs
Show inline comments
 
new file 100644
 
/*
 
 * Copyright (c) 2015, Jason Maltzen
 

	
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 
 of this software and associated documentation files (the "Software"), to deal
 
 in the Software without restriction, including without limitation the rights
 
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
 copies of the Software, and to permit persons to whom the Software is
 
 furnished to do so, subject to the following conditions:
 

	
 
 The above copyright notice and this permission notice shall be included in
 
 all copies or substantial portions of the Software.
 

	
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
 THE SOFTWARE.
 
*/
 

	
 
using System;
 
using System.IO;
 
using System.Collections.Generic;
 
using System.Collections.Concurrent;
 

	
 
namespace DesertPaintLab
 
{
 
    [System.ComponentModel.ToolboxItem(true)]
 
    public partial class RecipeGeneratorView : Gtk.Bin
 
    {
 
        RecipeGenerator generator;
 
        PlayerProfile profile;
 
        bool canceling = false;
 
        bool running = false;
 
        bool pauseForCheckpoint = false;
 

	
 
        const long RECIPE_SAVE_INTERVAL = 30000; // msec between saving recipes
 
        const long CHECKPOINT_INTERVAL = 17000; // msec between saving out generator state
 
        const string PAINT_STATE_FILE = "dp_generator_state";
 
        const string RIBBON_STATE_FILE = "dp_generator_ribbon_state";
 

	
 
        static Gtk.ListStore colorStore = new Gtk.ListStore(typeof(string));
 

	
 
        List<KeyValuePair<string, string>> missingReactions = new List<KeyValuePair<string, string>>();
 

	
 
        long lastProgressUpdate;
 
        long lastStatusUpdate;
 
        long lastProfileSave;
 
        long lastCheckpoint;
 

	
 
        public EventHandler SetStatus;
 
        public EventHandler Started;
 
        public EventHandler Stopped;
 

	
 
        static public Gtk.ListStore RecipeModel
 
        {
 
            get
 
            {
 
                return colorStore;   
 
            }
 
        }
 

	
 
        Gtk.ThreadNotify notifyFinished;
 
        Gtk.ThreadNotify notifyProgress;
 
        Gtk.ThreadNotify notifyNewRecipe;
 

	
 
        ConcurrentQueue<PaintRecipe> pendingNewRecipes = new ConcurrentQueue<PaintRecipe>();
 

	
 
        Gtk.ListStore reagentListStore;
 
        // end reagent view
 

	
 
        public RecipeGeneratorView(PlayerProfile profile) : base()
 
        {
 
            this.profile = profile;
 
            this.Build();
 
            minIngredientsSpinButton.Value = 1; // TODO: read/save profile info
 
            maxIngredientsSpinButton.Value = 5; // TODO: read/save profile info
 
            maxRecipeSpinButton.Value = 20; // TODO: read/save profile info
 
            fullQuantitySpinButton.Value = 20; // TODO: read/save profile info
 
            fullQuantityDepthSpinButton.Value = 4; // TODO: read/save profile info
 

	
 
            fullQuantityDepthSpinButton.SetRange(0, ReagentManager.Names.Count);
 
            maxIngredientsSpinButton.SetRange(1, ReagentManager.Names.Count);
 
            minIngredientsSpinButton.SetRange(1, ReagentManager.Names.Count);
 

	
 

	
 
            Gtk.TreeViewColumn recipeColorColumn = new Gtk.TreeViewColumn();
 
            Gtk.CellRendererText recipeColumnCell = new Gtk.CellRendererText();
 
            recipeColorColumn.PackStart(recipeColumnCell, true);       
 
            recipeColorColumn.Title = "Color";
 

	
 
            recipeList.AppendColumn(recipeColorColumn);
 
            recipeColorColumn.AddAttribute(recipeColumnCell, "text", 0);
 

	
 
            colorStore.Clear();
 

	
 
            colorStore.SetSortColumnId(0, Gtk.SortType.Ascending);
 
            recipeList.Model = RecipeModel;
 

	
 
            recipeList.Selection.Changed += OnColorSelected;
 

	
 
            recipeIngredientsView.AppendColumn("Quantity", new Gtk.CellRendererText(), "text", 0);
 
            recipeIngredientsView.AppendColumn("Ingredient", new Gtk.CellRendererText(), "text", 1);
 
            recipeIngredientsView.Model = new Gtk.ListStore(typeof(string), typeof(string));
 

	
 
            profile.LoadRecipes();
 

	
 
            canceling = false;
 
            running = false;
 
            pauseForCheckpoint = false;
 

	
 
            generator = new RecipeGenerator(profile.Reactions);
 
            int threads;
 
            DesertPaintLab.AppSettings.Get("GeneratorThreads", out threads);
 
            if (threads <= 0) { threads = 15; }
 
            generator.MaxThreads = (uint)threads;
 
            generator.InitRecipes(profile.Recipes);
 

	
 
            generator.Progress += OnProgress;
 
            generator.Finished += OnFinished;
 
            generator.NewRecipe += OnNewRecipe;
 

	
 
            string stateFile = System.IO.Path.Combine(profile.Directory, PAINT_STATE_FILE);
 
            if (System.IO.File.Exists(stateFile))
 
            {
 
                generator.LoadState(stateFile);
 
                if (generator.CanResume)
 
                {
 
                    beginButton.Label = "Restart";
 
                    stopResumeButton.Label = "Resume";
 
                    stopResumeButton.Sensitive = true;
 

	
 
                    maxRecipeSpinButton.Value = Math.Max(generator.MaxConcentration, 14); //
 
                    fullQuantitySpinButton.Value = generator.FullQuantity; // TODO: read/save profile info
 
                    fullQuantityDepthSpinButton.Value = generator.FullQuantityDepth; // TODO: read/save profile info
 
                    maxIngredientsSpinButton.Value = generator.MaxReagents;
 
                    checkButtonRibbon.Active = false;
 
                }
 
            }
 
            //generator.Log = System.IO.Path.Combine(profile.Directory, "dp_log.txt");
 
            countLabel.Text = String.Format("{0} / {1}", profile.RecipeCount, Palette.Count);
 

	
 
            Destroyed += OnDestroyed;
 

	
 
            notifyFinished = new Gtk.ThreadNotify(new Gtk.ReadyEvent(HandleFinished));
 
            notifyProgress = new Gtk.ThreadNotify(new Gtk.ReadyEvent(HandleProgress));
 
            notifyNewRecipe = new Gtk.ThreadNotify(new Gtk.ReadyEvent(HandleNewRecipe));
 

	
 
            // initialize reagent list
 
 
 
            // Add the columns to the TreeView
 
            Gtk.TreeViewColumn reagentEnabledColumn = new Gtk.TreeViewColumn ();
 
            reagentEnabledColumn.Title = "Enabled";
 
            Gtk.CellRendererToggle reagentEnabledCell = new Gtk.CellRendererToggle ();
 
            reagentEnabledCell.Activatable = true;
 
            reagentEnabledCell.Sensitive = true;
 
            reagentEnabledCell.Mode = Gtk.CellRendererMode.Activatable;
 
            reagentEnabledCell.Visible = true;
 
            reagentEnabledCell.Toggled += new Gtk.ToggledHandler(OnReagentEnableToggled);
 
            reagentEnabledColumn.PackStart (reagentEnabledCell, true);
 
            //reagentEnabledColumn.AddAttribute(reagentEnabledCell, "active", 0);
 

	
 
            Gtk.TreeViewColumn reagentNameColumn = new Gtk.TreeViewColumn ();
 
            reagentNameColumn.Title = "Ingredient";
 
            Gtk.CellRendererText reagentNameCell = new Gtk.CellRendererText ();
 
            reagentNameCell.Mode = Gtk.CellRendererMode.Inert;
 
            reagentNameColumn.PackStart (reagentNameCell, true);
 
            reagentNameColumn.AddAttribute(reagentNameCell, "text", 1);
 
            reagentNameColumn.Expand = true;
 

	
 
            Gtk.TreeViewColumn reagentCostColumn = new Gtk.TreeViewColumn ();
 
            reagentCostColumn.Title = "Cost";
 
            Gtk.CellRendererText reagentCostCell = new Gtk.CellRendererText ();
 
            reagentCostCell.Edited += OnReagentCostChanged;
 
            reagentCostCell.Editable = true;
 
            reagentCostCell.Sensitive = true;
 
            reagentCostCell.Mode = Gtk.CellRendererMode.Editable;
 
            reagentCostColumn.PackStart (reagentCostCell, true);
 
            //reagentCostColumn.AddAttribute(reagentCostCell, "text", 0);
 

	
 
            Gtk.TreeViewColumn reagentMaxColumn = new Gtk.TreeViewColumn ();
 
            reagentMaxColumn.Title = "Max";
 
            Gtk.CellRendererText reagentMaxCell = new Gtk.CellRendererText ();
 
            reagentMaxCell.Edited += OnReagentQuantityChanged;
 
            reagentMaxCell.Editable = true;
 
            reagentMaxCell.Sensitive = true;
 
            reagentCostCell.Mode = Gtk.CellRendererMode.Editable;
 
            reagentMaxColumn.PackStart (reagentMaxCell, true);
 
            //reagentMaxColumn.AddAttribute(reagentMaxCell, "text", 0);
 

	
 
            reagentListStore = new Gtk.ListStore(typeof(Reagent), typeof(string), typeof(Reagent), typeof(Reagent));
 
            foreach (string reagentName in ReagentManager.Names)
 
            {
 
                Reagent reagent = ReagentManager.GetReagent(reagentName);
 
                reagentListStore.AppendValues(reagent, reagentName); // , reagent, reagent);
 
            }
 

	
 
            reagentEnabledColumn.SetCellDataFunc (reagentEnabledCell, new Gtk.TreeCellDataFunc (RenderReagentToggle));
 
            reagentCostColumn.SetCellDataFunc (reagentCostCell, new Gtk.TreeCellDataFunc (RenderReagentCost));
 
            reagentMaxColumn.SetCellDataFunc (reagentMaxCell, new Gtk.TreeCellDataFunc (RenderReagentQuantity));
 

	
 
            // Assign the model to the TreeView
 
            reagentListView.Model = reagentListStore;
 
            reagentListView.Sensitive = true;
 

	
 
            reagentListView.AppendColumn(reagentEnabledColumn);
 
            reagentListView.AppendColumn(reagentNameColumn);
 
            reagentListView.AppendColumn(reagentCostColumn);
 
            reagentListView.AppendColumn(reagentMaxColumn);
 

	
 
            bool ribbons = false;
 
            profile.ProfileSettings.Get("Generator.Ribbons", out ribbons);
 
            if (ribbons)
 
            {
 
                checkButtonRibbon.Active = true;
 
                InitStateForRibbons();
 
            }
 
            else
 
            {
 
                checkButtonRibbon.Active = false;
 
                InitStateForPaint();
 
            }
 
            
 
            ShowAll();
 
        }
 

	
 
        private void InitStateForPaint()
 
        {
 
            maxRecipeSpinButton.Adjustment.Lower = PaintRecipe.PAINT_RECIPE_MIN_CONCENTRATION;
 
            fullQuantitySpinButton.Adjustment.Upper = 30;
 
            if (generator == null)
 
            {
 
                generator = new RecipeGenerator(profile.Reactions);
 
                int threads;
 
                DesertPaintLab.AppSettings.Get("GeneratorThreads", out threads);
 
                if (threads <= 0) { threads = 15; }
 
                generator.MaxThreads = (uint)threads;
 

	
 
                generator.Progress += OnProgress;
 
                generator.Finished += OnFinished;
 
                generator.NewRecipe += OnNewRecipe;
 
            }
 
            generator.InitRecipes(profile.Recipes);
 

	
 
            string stateFile = System.IO.Path.Combine(profile.Directory, PAINT_STATE_FILE);
 
            if (System.IO.File.Exists(stateFile))
 
            {
 
                generator.LoadState(stateFile);
 
                if (generator.CanResume)
 
                {
 
                    beginButton.Label = "Restart";
 
                    stopResumeButton.Label = "Resume";
 
                    stopResumeButton.Sensitive = true;
 

	
 
                    maxRecipeSpinButton.Value = Math.Max(generator.MaxConcentration, 14); //
 
                    fullQuantitySpinButton.Value = generator.FullQuantity; // TODO: read/save profile info
 
                    fullQuantityDepthSpinButton.Value = generator.FullQuantityDepth; // TODO: read/save profile info
 
                    maxIngredientsSpinButton.Value = generator.MaxReagents;
 
                }
 
            }
 
            else
 
            {
 
                beginButton.Label = "Start";
 
                stopResumeButton.Label = "Stop";
 
                stopResumeButton.Sensitive = false;
 

	
 
                maxRecipeSpinButton.Value = 14;
 
                //fullQuantitySpinButton.Value = generator.FullQuantity; // TODO: read/save profile info
 
                //fullQuantityDepthSpinButton.Value = generator.FullQuantityDepth; // TODO: read/save profile info
 
                //maxIngredientsSpinButton.Value = generator.MaxReagents;
 
            }
 
            //generator.Log = System.IO.Path.Combine(profile.Directory, "dp_log.txt");
 
            countLabel.Text = String.Format("{0} / {1}", profile.RecipeCount, Palette.Count);
 

	
 
            colorStore.Clear();
 
            foreach (KeyValuePair<string, PaintRecipe> pair in profile.Recipes)
 
            {
 
                if (pair.Value.IsValidForConcentration(PaintRecipe.PAINT_RECIPE_MIN_CONCENTRATION))
 
                {
 
                    string colorName = pair.Key;
 
                    colorStore.AppendValues(colorName);
 
                }
 
            }
 
            recipeList.Show();
 
        }
 

	
 
        private void InitStateForRibbons()
 
        {
 
            maxRecipeSpinButton.Adjustment.Lower = PaintRecipe.RIBBON_RECIPE_MIN_CONCENTRATION;
 
            fullQuantitySpinButton.Adjustment.Upper = 100;
 
            if (generator == null)
 
            {
 
                generator = new RecipeGenerator(profile.Reactions);
 
                int threads;
 
                DesertPaintLab.AppSettings.Get("GeneratorThreads", out threads);
 
                if (threads <= 0) { threads = 15; }
 
                generator.MaxThreads = (uint)threads;
 

	
 
                generator.Progress += OnProgress;
 
                generator.Finished += OnFinished;
 
                generator.NewRecipe += OnNewRecipe;
 
            }
 
            generator.InitRecipes(profile.RibbonRecipes);
 

	
 
            string stateFile = System.IO.Path.Combine(profile.Directory, RIBBON_STATE_FILE);
 
            if (System.IO.File.Exists(stateFile))
 
            {
 
                generator.LoadState(stateFile);
 
                if (generator.CanResume)
 
                {
 
                    beginButton.Label = "Restart";
 
                    stopResumeButton.Label = "Resume";
 
                    stopResumeButton.Sensitive = true;
 

	
 
                    maxRecipeSpinButton.Value = Math.Max(generator.MaxConcentration, PaintRecipe.RIBBON_RECIPE_MIN_CONCENTRATION); //
 
                    fullQuantitySpinButton.Value = generator.FullQuantity; // TODO: read/save profile info
 
                    fullQuantityDepthSpinButton.Value = generator.FullQuantityDepth; // TODO: read/save profile info
 
                    maxIngredientsSpinButton.Value = generator.MaxReagents;
 
                }
 
            }
 
            else
 
            {
 
                beginButton.Label = "Start";
 
                stopResumeButton.Label = "Stop";
 
                stopResumeButton.Sensitive = false;
 

	
 
                maxRecipeSpinButton.Value = PaintRecipe.RIBBON_RECIPE_MIN_CONCENTRATION
 
;
 
                //fullQuantitySpinButton.Value = generator.FullQuantity; // TODO: read/save profile info
 
                //fullQuantityDepthSpinButton.Value = generator.FullQuantityDepth; // TODO: read/save profile info
 
                //maxIngredientsSpinButton.Value = generator.MaxReagents;
 
            }
 

	
 
            countLabel.Text = String.Format("{0} / {1}", profile.RibbonCount, Palette.Count);
 

	
 
            colorStore.Clear();
 
            foreach (KeyValuePair<string, PaintRecipe> pair in profile.RibbonRecipes)
 
            {
 
                if (pair.Value.IsValidForConcentration(PaintRecipe.RIBBON_RECIPE_MIN_CONCENTRATION))
 
                {
 
                    string colorName = pair.Key;
 
                    colorStore.AppendValues(colorName);
 
                }
 
            }
 
            recipeList.Show();
 
        }
 

	
 
        public PlayerProfile Profile {
 
            set {
 
                if (profile != value) {
 
                    // TODO: ensure not running
 
                    profile = value;
 
                    profile.LoadRecipes();
 

	
 
                    generator = new RecipeGenerator(profile.Reactions);
 
                    int threads;
 
                    DesertPaintLab.AppSettings.Get("GeneratorThreads", out threads);
 
                    if (threads <= 0) { threads = 15; }
 
                    generator.MaxThreads = (uint)threads;
 
        
 
                    generator.Progress += OnProgress;
 
                    generator.Finished += OnFinished;
 
                    generator.NewRecipe += OnNewRecipe;
 

	
 
                    if (checkButtonRibbon.Active)
 
                    {
 
                        InitStateForRibbons();
 
                    }
 
                    else
 
                    {
 
                        InitStateForPaint();
 
                    }
 
                }
 
            }
 
        }
 

	
 
        protected void OnMinIngredientsChanged(object sender, EventArgs e)
 
        {
 
            Gtk.SpinButton button = (Gtk.SpinButton) sender;
 
            if (button.ValueAsInt > maxIngredientsSpinButton.ValueAsInt)
 
            {
 
                maxIngredientsSpinButton.Value = button.ValueAsInt;
 
            }
 
            maxIngredientsSpinButton.SetRange(button.ValueAsInt, maxIngredientsSpinButton.Adjustment.Upper);
 
        }
 

	
 
        protected void OnMaxIngredientsChanged(object sender, EventArgs e)
 
        {
 
            Gtk.SpinButton button = (Gtk.SpinButton) sender;
 
            if (button.ValueAsInt < minIngredientsSpinButton.ValueAsInt)
 
            {
 
                minIngredientsSpinButton.Value = button.ValueAsInt;
 
            }
 
            minIngredientsSpinButton.SetRange(1, button.ValueAsInt);
 
            // TODO: save profile setting
 
            // TODO: no longer permit resume
 
        }
 

	
 
        protected void OnMaxRecipeChanged(object sender, EventArgs e)
 
        {
 
            // TODO: save profile setting
 
            // TODO: no longer permit resume
 
        }
 

	
 
        protected void OnFullQuantityDepthChanged(object sender, EventArgs e)
 
        {
 
            // TODO: save profile setting
 
            // TODO: no longer permit resume
 
        }
 

	
 
        protected void OnFullQuantityChanged(object sender, EventArgs e)
 
        {
 
            // TODO: save profile setting
 
            // TODO: no longer permit resume
 
        }
 

	
 
        protected void OnBegin(object sender, EventArgs e)
 
        {
 
            minIngredientsSpinButton.Sensitive = false;
 
            maxIngredientsSpinButton.Sensitive = false;
 
            //TODO ExportToWikiAction.Sensitive = false;
 
            maxRecipeSpinButton.Sensitive = false;
 
            beginButton.Sensitive = false; // TODO: change to "pause"?
 
            stopResumeButton.Sensitive = true;
 
            fullQuantitySpinButton.Sensitive = false;
 
            fullQuantityDepthSpinButton.Sensitive = false;
 
            reagentListView.Sensitive = false;
 
            checkButtonRibbon.Sensitive = false;
 

	
 
            countLabel.Text = String.Format("{0} / {1}", checkButtonRibbon.Active ? profile.RibbonCount : profile.RecipeCount, Palette.Count);
 

	
 
            // TODO: hook up event notifications
 
            // - progress
 
            // - complete
 
            // - new recipe / recipe update
 

	
 
            // Total recipe search count
 
            //int current = ReagentManager.Names.Count;
 
            //long recipePermutations = 1;
 
            //for (int i = 0; i < maxIngredientsSpinButton.ValueAsInt; ++i)
 
            //{
 
            //    recipePermutations *= current;
 
            //    --current;
 
            //}
 
            //System.Console.WriteLine("Will search {0} reagent permutations.", recipePermutations);
 

	
 
            lastProgressUpdate = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
 
            lastStatusUpdate = lastProgressUpdate;
 

	
 
            lastProfileSave = lastProgressUpdate;
 
            lastCheckpoint = lastProgressUpdate;
 

	
 
            running = true;
 
            canceling = false;
 
            pauseForCheckpoint = false;
 
            stopResumeButton.Label = "Pause";
 

	
 
            if (Started != null)
 
            {
 
                Started(this, null);
 
            }
 

	
 
            generator.BeginRecipeGeneration((uint)(checkButtonRibbon.Active ? PaintRecipe.RIBBON_RECIPE_MIN_CONCENTRATION : PaintRecipe.PAINT_RECIPE_MIN_CONCENTRATION), (uint)maxRecipeSpinButton.ValueAsInt, (uint)minIngredientsSpinButton.Value, (uint)maxIngredientsSpinButton.ValueAsInt, (uint)fullQuantityDepthSpinButton.ValueAsInt, (uint)fullQuantitySpinButton.ValueAsInt);
 
        }
 

	
 
        protected void OnStopResume(object sender, EventArgs e)
 
        {
 
            if (generator != null)
 
            {
 
                if (running)
 
                {
 
                    canceling = true;
 
                    pauseForCheckpoint = false;
 
                    generator.Stop();
 
                }
 
                else
 
                {
 
                    // Resume previous run
 
                    //TODO ExportToWikiAction.Sensitive = false;
 
                    reagentListView.Sensitive = false;
 
                    minIngredientsSpinButton.Sensitive = false;
 
                    maxIngredientsSpinButton.Sensitive = false;
 
                    maxRecipeSpinButton.Sensitive = false;
 
                    beginButton.Sensitive = false;
 
                    stopResumeButton.Sensitive = true;
 
                    fullQuantitySpinButton.Sensitive = false;
 
                    fullQuantityDepthSpinButton.Sensitive = false;
 
                    reagentListView.Sensitive = false;
 
                    checkButtonRibbon.Sensitive = false;
 

	
 
                    lastProgressUpdate = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
 
                    lastStatusUpdate = lastProgressUpdate;
 
                    lastProfileSave = lastProgressUpdate;
 
                    lastCheckpoint = lastProgressUpdate;
 

	
 
                    canceling = false;
 
                    pauseForCheckpoint = false;
 
                    running = true;
 
        
 
                    stopResumeButton.Label = "Pause";
 

	
 
                    if (Started != null)
 
                    {
 
                        Started(this, null);
 
                    }
 
                    generator.ResumeRecipeGeneration();
 
                }
 
            }
 
        }
 

	
 
        private void HandleFinished()
 
        {
 
            generator.Wait();
 
            if (pauseForCheckpoint)
 
            {
 
                pauseForCheckpoint = false;
 
                generator.SaveState(System.IO.Path.Combine(profile.Directory, checkButtonRibbon.Active ? RIBBON_STATE_FILE : PAINT_STATE_FILE));
 
                generator.ResumeRecipeGeneration();
 
            }
 
            else
 
            {
 
                running = false;
 
                beginButton.Sensitive = true;
 
                //TODO ExportToWikiAction.Sensitive = true;
 
                stopResumeButton.Sensitive = false;
 
                minIngredientsSpinButton.Sensitive = true;
 
                maxIngredientsSpinButton.Sensitive = true;
 
                maxRecipeSpinButton.Sensitive = true;
 
                fullQuantitySpinButton.Sensitive = true;
 
                fullQuantityDepthSpinButton.Sensitive = true;
 
                reagentListView.Sensitive = true;
 
                checkButtonRibbon.Sensitive = true;
 

	
 
                //generator = null; // don't. Hang on to generator for resume.
 
                profile.SaveRecipes();
 
                if (canceling)
 
                {
 
                    generator.SaveState(System.IO.Path.Combine(profile.Directory, checkButtonRibbon.Active ? RIBBON_STATE_FILE : PAINT_STATE_FILE));
 
                    stopResumeButton.Label = "Resume";
 
                    stopResumeButton.Sensitive = true;
 
                    beginButton.Label = "Restart";
 
                }
 
                else
 
                {
 
                    System.IO.File.Delete(System.IO.Path.Combine(profile.Directory, checkButtonRibbon.Active ? RIBBON_STATE_FILE : PAINT_STATE_FILE));
 
                }
 
                if (Stopped != null)
 
                {
 
                    Stopped(this, null);
 
                }
 
            }
 
        }
 

	
 
        protected void OnFinished(object sender, EventArgs args)
 
        {
 
            notifyFinished.WakeupMain();
 
            //Gtk.Application.Invoke(delegate {
 
            //    HandleFinished();
 
            //});
 
        }
 

	
 
        private void HandleNewRecipe()
 
        {
 
            progressBar.Pulse();
 
            
 
            PaintRecipe recipe = null;
 
            if (pendingNewRecipes.TryDequeue(out recipe))
 
            {
 
                string recipeColor = Palette.FindNearest(recipe.ReactedColor);
 
                // TODO: Add item to recipe list only if not already listed
 
                bool exists = false;
 
                Gtk.TreeIter iter;
 
                if (colorStore.GetIterFirst(out iter))
 
                {
 
                    do
 
                    {
 
                        string color = (string)colorStore.GetValue(iter, 0);
 
                        if (color.Equals(recipeColor))
 
                        {
 
                            exists = true;
 
                            break;
 
                        }
 
                    } while (colorStore.IterNext(ref iter));
 
                }
 
                if (!exists)
 
                {
 
                    //Console.WriteLine("Add new recipe for {0}", recipeColor);
 
                    //    bool isMissingReactions = args.Recipe.CheckMissingReactions(ref missingReactions);
 
                    //    string missingReactionLabel = isMissingReactions ? "X" : "";
 
                    colorStore.AppendValues(recipeColor); // , missingReactionLabel);
 
                    countLabel.Text = String.Format("{0} / {1}", (checkButtonRibbon.Active ? profile.RibbonCount : profile.RecipeCount)+1, Palette.Count);
 
                }
 
                //else
 
                //{
 
                //    Console.WriteLine("Updated recipe for {0}", recipeColor);
 
                //}
 
                if (checkButtonRibbon.Active)
 
                {
 
                    profile.SetRibbonRecipe(recipe);
 
                }
 
                else
 
                {
 
                    profile.SetRecipe(recipe);
 
                }
 
    
 
                long progressTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
 
                long delta = progressTime - lastProfileSave;
 
                if (delta >= RECIPE_SAVE_INTERVAL)
 
                {
 
                    profile.SaveRecipes();
 
                    lastProfileSave = progressTime;
 
                }
 
                Gtk.TreeModel model;
 
                Gtk.TreeSelection selection = recipeList.Selection;
 
                if ((selection != null) && selection.GetSelected(out model, out iter))
 
                {
 
                    string colorName = (string)colorStore.GetValue(iter, 0);
 
                    if (colorName.Equals(recipeColor))
 
                    {
 
                        ShowColor(recipe);
 
                    }
 
                }
 
            }
 
        }
 

	
 
        protected void OnNewRecipe(object sender, NewRecipeEventArgs args)
 
        {
 
            PaintRecipe recipe = new PaintRecipe(args.Recipe); // copy it, so the worker thread can release
 
            lock(this) {
 
                pendingNewRecipes.Enqueue(recipe);
 
            }
 
            notifyNewRecipe.WakeupMain();
 
            //Gtk.Application.Invoke(delegate {
 
            //    HandleNewRecipe();
 
            //});
 
        }
 

	
 
        private void HandleProgress()
 
        {
 
            long progressTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
 
            long delta = progressTime - lastProgressUpdate;
 
            if (delta > 30)
 
            {
 
                lastProgressUpdate = progressTime;
 
                progressBar.Pulse();
 
            }
 
            delta = progressTime - lastStatusUpdate;
 
            if (delta > 500)
 
            {
 
                lastStatusUpdate = progressTime;
 
                if (SetStatus != null)
 
                {
 
                    SetStatus(this, new StatusUpdateEventArgs(String.Format("Recipes searched: {0:N00}", generator.RecipeCount)));
 
                }
 
                //TODO statusLabel.Text = String.Format("Recipes searched: {0:N00}", generator.RecipeCount);
 
            }
 
            delta = progressTime - lastCheckpoint;
 
            if (delta > CHECKPOINT_INTERVAL)
 
            {
 
                lastCheckpoint = progressTime;
 
                pauseForCheckpoint = true;
 
                generator.Stop();
 
            }
 
        }
 

	
 
        protected void OnProgress(object sender, EventArgs args)
 
        {
 
            notifyProgress.WakeupMain();
 
        }
 

	
 
        private void ShowColor(PaintRecipe recipe)
 
        {
 
            Gtk.ListStore store = (Gtk.ListStore)recipeIngredientsView.Model;
 
            store.Clear();
 
            if (recipe.CheckMissingReactions(ref missingReactions))
 
            {
 
                if (SetStatus != null)
 
                {
 
                    SetStatus(this, new StatusUpdateEventArgs("WARNING: This recipe includes reactions that have not yet been recorded."));
 
                }
 
                //TODO statusLabel.Text = "WARNING: This recipe includes reactions that have not yet been recorded.";
 
            }
 
            foreach (PaintRecipe.RecipeIngredient ingredient in recipe.Ingredients)
 
            {
 
                store.AppendValues(ingredient.quantity.ToString(), ingredient.name);
 
            }
 
            paintSwatch.Color = recipe.ReactedColor;
 
        }
 

	
 
        protected void OnColorSelected(object o, EventArgs args)
 
        {
 
            Gtk.TreeModel model;
 
            Gtk.TreeIter iter;
 
            Gtk.TreeSelection selection = recipeList.Selection;
 
            if ((selection != null) && selection.GetSelected(out model, out iter))
 
            {
 
                string colorName = (string)colorStore.GetValue(iter, 0);
 
                PaintRecipe recipe;
 
                if (checkButtonRibbon.Active)
 
                {
 
                    if (profile.RibbonRecipes.TryGetValue(colorName, out recipe))
 
                    {
 
                        ShowColor(recipe);
 
                    }
 
                }
 
                else
 
                {
 
                    if (profile.Recipes.TryGetValue(colorName, out recipe))
 
                    {
 
                        ShowColor(recipe);
 
                    }
 
                }
 
            }
 
        }
 

	
 
        protected void OnShowIngredients(object sender, EventArgs e)
 
        {
 
            ReagentWindow win = new ReagentWindow(profile);
 
            win.Show();
 
        }
 

	
 
        protected void OnDestroyed(object o, EventArgs args)
 
        {
 
            if (running)
 
            {
 
                // window closed while generator running: stop and save
 
                generator.Finished -= OnFinished;
 
                generator.Progress -= OnProgress;
 
                generator.NewRecipe -= OnNewRecipe;
 
                generator.Stop();
 
                generator.Wait();
 
                generator.SaveState(System.IO.Path.Combine(profile.Directory, checkButtonRibbon.Active ? RIBBON_STATE_FILE : PAINT_STATE_FILE));
 
            }
 
        }
 

	
 
        // Reagent view handling
 
        private void RenderReagentToggle (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
 
        {
 
            Reagent reagent = (Reagent) model.GetValue (iter, 0);
 
            Gtk.CellRendererToggle toggle = (cell as Gtk.CellRendererToggle);
 
            toggle.Active = reagent.Enabled;
 
            toggle.Activatable = !reagent.IsCatalyst;
 
            toggle.Mode = reagent.IsCatalyst ? Gtk.CellRendererMode.Inert : Gtk.CellRendererMode.Activatable;
 
        }
 
        private void RenderReagentCost (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
 
        {
 
            Reagent reagent = (Reagent) model.GetValue (iter, 0);
 
            (cell as Gtk.CellRendererText).Text = reagent.Cost.ToString();
 
        }
 
        private void RenderReagentQuantity (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
 
        {
 
            Reagent reagent = (Reagent) model.GetValue (iter, 0);
 
            (cell as Gtk.CellRendererText).Text = reagent.RecipeMax.ToString();
 
        }
 

	
 
        private void OnReagentCostChanged(object o, Gtk.EditedArgs args)
 
        {
 
            uint newCost;
 
            if (uint.TryParse(args.NewText, out newCost))
 
            {
 
                Gtk.TreeIter iter;
 
                reagentListStore.GetIter (out iter, new Gtk.TreePath (args.Path));
 
             
 
                Reagent reagent = (Reagent) reagentListStore.GetValue (iter, 0);
 
                if (reagent.Cost != newCost)
 
                {
 
                    reagent.Cost = newCost;
 
                    SaveReagentSettings();
 
                }
 
            }
 
        }
 

	
 
        private void OnReagentQuantityChanged(object o, Gtk.EditedArgs args)
 
        {
 
            uint newMax;
 
            if (uint.TryParse(args.NewText, out newMax))
 
            {
 
                Gtk.TreeIter iter;
 
                reagentListStore.GetIter (out iter, new Gtk.TreePath (args.Path));
 
             
 
                Reagent reagent = (Reagent) reagentListStore.GetValue (iter, 0);
 
                if (reagent.RecipeMax != newMax)
 
                {
 
                    reagent.RecipeMax = newMax;
 
                    SaveReagentSettings();
 
                }
 
            }
 
        }
 

	
 
        private void OnReagentEnableToggled(object o, Gtk.ToggledArgs args)
 
        {
 
            Gtk.TreeIter iter;
 
            reagentListStore.GetIter (out iter, new Gtk.TreePath (args.Path));
 
         
 
            Reagent reagent = (Reagent) reagentListStore.GetValue (iter, 0);
 
            reagent.Enabled = !reagent.Enabled;
 
            SaveReagentSettings();
 
        }
 

	
 
        private void SaveReagentSettings()
 
        {
 
            // save out state
 
            ReagentManager.SaveProfileReagents(profile.ReagentFile);
 
        }
 

	
 
        protected void OnCopyRecipeToClipboard(object sender, EventArgs e)
 
        {
 
            Gtk.TreeModel model;
 
            Gtk.TreeIter iter;
 
            Gtk.Clipboard clipboard = recipeIngredientsView.GetClipboard(Gdk.Selection.Clipboard);
 
            
 
            Gtk.TreeSelection selection = recipeList.Selection;
 
            if ((selection != null) && selection.GetSelected(out model, out iter))
 
            {
 
                string colorName = (string)colorStore.GetValue(iter, 0);
 
                PaintRecipe recipe;
 
                if (checkButtonRibbon.Active)
 
                {
 
                    if (profile.RibbonRecipes.TryGetValue(colorName, out recipe))
 
                    {
 
                        clipboard.Text = recipe.ToString();
 
                    }
 
                }
 
                else
 
                {
 
                    if (profile.Recipes.TryGetValue(colorName, out recipe))
 
                    {
 
                        clipboard.Text = recipe.ToString();
 
                    }
 
                }
 
            }
 
        }
 

	
 
        protected void OnRecipesToggled(object sender, EventArgs e)
 
        {
 
            if (checkButtonRibbon.Active)
 
            {
 
                // changed to ribbons
 
                InitStateForRibbons();
 
            }
 
            else
 
            {
 
                // changed to paints
 
                InitStateForPaint();
 
            }
 
            profile.ProfileSettings.Set("Generator.Ribbons", checkButtonRibbon.Active);
 
            profile.Save();
 
        }
 
    }
 
}
 

	
 

	
UI/SimulatorView.cs
Show inline comments
 
new file 100644
 
/*
 
 * Copyright (c) 2010, Tess Snider
 

	
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 
 of this software and associated documentation files (the "Software"), to deal
 
 in the Software without restriction, including without limitation the rights
 
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
 copies of the Software, and to permit persons to whom the Software is
 
 furnished to do so, subject to the following conditions:
 

	
 
 The above copyright notice and this permission notice shall be included in
 
 all copies or substantial portions of the Software.
 

	
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
 THE SOFTWARE.
 
*/
 

	
 
using System;
 
using System.Collections.Generic;
 

	
 

	
 
namespace DesertPaintLab
 
{
 
    [System.ComponentModel.ToolboxItem(true)]
 
    public partial class SimulatorView : Gtk.Bin
 
    {
 
        Gtk.ListStore recipeData = new Gtk.ListStore(typeof(string), typeof(int));
 
        PaintRecipe paintRecipe;
 

	
 
        List<IngredientPair> missingWarned = new List<IngredientPair>();
 
        List<KeyValuePair<string, string>> newMissing = new List<KeyValuePair<string, string>>();
 

	
 
        private class IngredientPair
 
        {
 
            public string first;
 
            public string second;
 

	
 
            public IngredientPair(string first, string second)
 
            {
 
                this.first = first;
 
                this.second = second;
 
            }
 
        }
 

	
 
        public PlayerProfile Profile
 
        {
 
            set {
 
                paintRecipe.Clear();
 
                paintRecipe.Reactions = value.Reactions;
 
                UpdateRecipeColor();
 
            }
 
        }
 

	
 
        public SimulatorView(PlayerProfile profile) : base()
 
        {
 
            this.Build ();
 

	
 
            paintRecipe = new PaintRecipe();
 
            paintRecipe.Reactions = profile.Reactions;
 
            
 
            Gtk.TreeViewColumn reagentColumn = new Gtk.TreeViewColumn();
 
            Gtk.CellRendererText reagentColumnCell = new Gtk.CellRendererText();
 
            reagentColumn.PackStart(reagentColumnCell, true);       
 
            reagentColumn.Title = "Ingredient";
 
            
 
            reagentListView.AppendColumn(reagentColumn);
 
            reagentColumn.AddAttribute(reagentColumnCell, "text", 0);
 
            
 
            reagentListView.Model = ReagentManager.NameListModel;
 
            
 
            Gtk.TreeViewColumn additiveColumn = new Gtk.TreeViewColumn();
 
            Gtk.CellRendererText additiveColumnCell = new Gtk.CellRendererText();
 
            additiveColumn.PackStart(additiveColumnCell, true);     
 
            additiveColumn.Title = "Ingredient";
 
            
 
            recipeView.AppendColumn(additiveColumn);
 
            additiveColumn.AddAttribute(additiveColumnCell, "text", 0);
 
            
 
            Gtk.TreeViewColumn qtyColumn = new Gtk.TreeViewColumn();
 
            Gtk.CellRendererText qtyColumnCell = new Gtk.CellRendererText();
 
            qtyColumnCell.Editable = true;
 
            qtyColumnCell.Edited += OnQtyEdited;
 
            qtyColumn.PackStart(qtyColumnCell, true);       
 
            qtyColumn.Title = "Qty";
 
            
 
            recipeView.AppendColumn(qtyColumn);
 
            qtyColumn.AddAttribute(qtyColumnCell, "text", 1);
 
            
 
            recipeView.Model = recipeData;
 
            
 
            recipeData.RowChanged += OnRecipeChanged;
 
            recipeData.RowDeleted += OnRecipeChanged;
 
            recipeData.RowInserted += OnRecipeChanged;
 
            recipeData.RowsReordered += OnRecipeChanged;
 
            
 
        }
 
        
 
        protected virtual void OnAddReagent(object sender, System.EventArgs e)
 
        {
 
            Gtk.TreeModel model;
 
            Gtk.TreeIter iter;
 

	
 
            Gtk.TreeSelection selection = reagentListView.Selection;
 
            if ((selection != null) && selection.GetSelected(out model, out iter))
 
            {                   
 
                recipeData.AppendValues(model.GetValue(iter, 0).ToString(), 1); 
 
                
 
                recipeData.IterNthChild(out iter, recipeView.Children.Length - 1);
 
                
 
                selection = recipeView.Selection;
 
                selection.SelectIter(iter);
 
            } 
 
        }   
 
        
 
        protected void OnQtyEdited(object sender, Gtk.EditedArgs args)
 
        {
 
            Gtk.TreeIter iter;
 
            recipeData.GetIter(out iter, new Gtk.TreePath(args.Path));
 
            
 
            int oldValue = (int)recipeData.GetValue(iter, 1);
 
            
 
            try
 
            {
 
                recipeData.SetValue(iter, 1, int.Parse(args.NewText));
 
                UpdateRecipeColor();
 
            }
 
            catch (Exception)
 
            {
 
                recipeData.SetValue(iter, 1, oldValue);
 
            }
 
        }   
 
    
 
        protected void OnRecipeChanged(object sender, GLib.SignalArgs args)
 
        {
 
            UpdateRecipeColor();
 
        }   
 

	
 
        void UpdateRecipeColor()
 
        {
 
            if (recipeView.Children.Length == 0)
 
            {
 
                paintSwatch.Clear();
 
            }
 
            
 
            paintRecipe.Clear();
 

	
 
            Gtk.TreeIter iter;
 
            string reagentName;
 
            int qty;
 
            
 
            recipeData.GetIterFirst(out iter);
 
            
 
            do
 
            {
 
                reagentName = (string) recipeData.GetValue(iter, 0);
 
                
 
                if (reagentName == null)
 
                {
 
                    continue;   
 
                }
 
                
 
                qty = (int)recipeData.GetValue(iter, 1);
 
                for (int i = 0; i < qty; ++i)
 
                {
 
                    paintRecipe.AddReagent(reagentName);
 
                }
 
            }
 
            while (recipeData.IterNext(ref iter));
 
            
 
            PaintColor resultColor = new PaintColor(paintRecipe.ReactedColor);
 
            paintSwatch.Color = resultColor;
 
            if (paintRecipe.CheckMissingReactions(ref newMissing))
 
            {
 
                string warningMsg = "";
 

	
 
                foreach (KeyValuePair<string, string> newEntry in newMissing)
 
                {
 
                    IngredientPair match = missingWarned.Find(x => (x.first.Equals(newEntry.Key) && x.second.Equals(newEntry.Value)));
 
                    if (match == null)
 
                    {
 
                        match = new IngredientPair(newEntry.Key, newEntry.Value);
 
                        missingWarned.Add(match);
 
                        warningMsg += newEntry.Key + " + " + newEntry.Value + "\n";
 
                    }
 
                }
 
                if (warningMsg.Length > 0)
 
                {
 
                    Gtk.MessageDialog md = new Gtk.MessageDialog((Gtk.Window)Toplevel,
 
                        Gtk.DialogFlags.DestroyWithParent,
 
                        Gtk.MessageType.Warning,
 
                        Gtk.ButtonsType.Ok,
 
                        "These combinations have not yet had reactions recorded:\n\n" +
 
                        warningMsg);
 
                    md.Run();
 
                    md.Destroy();
 
                }
 
            }
 
            
 
        }
 
        
 
        protected virtual void OnIncrementReagent (object sender, System.EventArgs e)
 
        {
 
            Gtk.TreeModel model;
 
            Gtk.TreeIter iter;
 

	
 
            Gtk.TreeSelection selection = recipeView.Selection;
 
            if ((selection != null) && selection.GetSelected(out model, out iter))
 
            {
 
                int oldValue = (int)recipeData.GetValue(iter, 1);
 
                recipeData.SetValue(iter, 1, oldValue + 1);
 
            }
 
            
 
        }
 
        
 
        protected virtual void OnDecrementReagent (object sender, System.EventArgs e)
 
        {
 
            Gtk.TreeModel model;
 
            Gtk.TreeIter iter;
 

	
 
            Gtk.TreeSelection selection = recipeView.Selection;
 
            if ((selection != null) && selection.GetSelected(out model, out iter))
 
            {
 
                int oldValue = (int)recipeData.GetValue(iter, 1);
 
                if (oldValue == 1)
 
                {
 
                    recipeData.Remove(ref iter);
 
                }
 
                else
 
                {
 
                    recipeData.SetValue(iter, 1, oldValue - 1);
 
                }
 
            }           
 
            
 
        }
 

	
 
        protected virtual void OnFlushReagents (object sender, System.EventArgs e)
 
        {
 
            recipeData.Clear();
 
        }
 
    }
 
}
...
 
\ No newline at end of file
gtk-gui/DesertPaintLab.CaptureView.cs
Show inline comments
 
new file 100644
 

	
 
// This file has been generated by the GUI designer. Do not modify.
 
namespace DesertPaintLab
 
{
 
	public partial class CaptureView
 
	{
 
		private global::Gtk.HBox hbox1;
 
		
 
		private global::Gtk.Frame selectIngredientsFrame;
 
		
 
		private global::Gtk.Alignment GtkAlignment;
 
		
 
		private global::Gtk.VBox vbox2;
 
		
 
		private global::Gtk.HBox hbox2;
 
		
 
		private global::Gtk.Label ingredient1Label;
 
		
 
		private global::Gtk.ComboBox ingredient1ComboBox;
 
		
 
		private global::Gtk.HBox hbox3;
 
		
 
		private global::Gtk.Label ingredient2Label;
 
		
 
		private global::Gtk.ComboBox ingredient2ComboBox;
 
		
 
		private global::Gtk.HBox hbox4;
 
		
 
		private global::Gtk.Label ingredient3Label;
 
		
 
		private global::Gtk.ComboBox ingredient3ComboBox;
 
		
 
		private global::Gtk.Button clearReactionButton;
 
		
 
		private global::Gtk.Label selectIngredientsLabel;
 
		
 
		private global::Gtk.Frame unmodifiedColorFrame;
 
		
 
		private global::Gtk.Alignment GtkAlignment1;
 
		
 
		private global::Gtk.VBox vbox3;
 
		
 
		private global::DesertPaintLab.PaintSwatch unmodifiedSwatch;
 
		
 
		private global::Gtk.Button captureButton;
 
		
 
		private global::Gtk.Label unmodifiedLabel;
 
		
 
		private global::Gtk.Frame reactedColorFrame;
 
		
 
		private global::Gtk.Alignment GtkAlignment2;
 
		
 
		private global::Gtk.VBox vbox4;
 
		
 
		private global::DesertPaintLab.PaintSwatch reactionSwatch;
 
		
 
		private global::Gtk.Button recordButton;
 
		
 
		private global::Gtk.Label reactionLabel;
 

	
 
		protected virtual void Build ()
 
		{
 
			global::Stetic.Gui.Initialize (this);
 
			// Widget DesertPaintLab.CaptureView
 
			global::Stetic.BinContainer.Attach (this);
 
			this.Name = "DesertPaintLab.CaptureView";
 
			// Container child DesertPaintLab.CaptureView.Gtk.Container+ContainerChild
 
			this.hbox1 = new global::Gtk.HBox ();
 
			this.hbox1.Name = "hbox1";
 
			this.hbox1.Spacing = 6;
 
			// Container child hbox1.Gtk.Box+BoxChild
 
			this.selectIngredientsFrame = new global::Gtk.Frame ();
 
			this.selectIngredientsFrame.Name = "selectIngredientsFrame";
 
			this.selectIngredientsFrame.BorderWidth = ((uint)(4));
 
			// Container child selectIngredientsFrame.Gtk.Container+ContainerChild
 
			this.GtkAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
 
			this.GtkAlignment.Name = "GtkAlignment";
 
			this.GtkAlignment.LeftPadding = ((uint)(6));
 
			this.GtkAlignment.RightPadding = ((uint)(6));
 
			// Container child GtkAlignment.Gtk.Container+ContainerChild
 
			this.vbox2 = new global::Gtk.VBox ();
 
			this.vbox2.Name = "vbox2";
 
			this.vbox2.Spacing = 6;
 
			// Container child vbox2.Gtk.Box+BoxChild
 
			this.hbox2 = new global::Gtk.HBox ();
 
			this.hbox2.Name = "hbox2";
 
			this.hbox2.Spacing = 6;
 
			// Container child hbox2.Gtk.Box+BoxChild
 
			this.ingredient1Label = new global::Gtk.Label ();
 
			this.ingredient1Label.Name = "ingredient1Label";
 
			this.ingredient1Label.LabelProp = "Ingredient 1:";
 
			this.hbox2.Add (this.ingredient1Label);
 
			global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.ingredient1Label]));
 
			w1.Position = 0;
 
			w1.Expand = false;
 
			w1.Fill = false;
 
			// Container child hbox2.Gtk.Box+BoxChild
 
			this.ingredient1ComboBox = global::Gtk.ComboBox.NewText ();
 
			this.ingredient1ComboBox.Name = "ingredient1ComboBox";
 
			this.hbox2.Add (this.ingredient1ComboBox);
 
			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.ingredient1ComboBox]));
 
			w2.Position = 1;
 
			this.vbox2.Add (this.hbox2);
 
			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox2]));
 
			w3.Position = 0;
 
			w3.Expand = false;
 
			w3.Fill = false;
 
			// Container child vbox2.Gtk.Box+BoxChild
 
			this.hbox3 = new global::Gtk.HBox ();
 
			this.hbox3.Name = "hbox3";
 
			this.hbox3.Spacing = 6;
 
			// Container child hbox3.Gtk.Box+BoxChild
 
			this.ingredient2Label = new global::Gtk.Label ();
 
			this.ingredient2Label.Name = "ingredient2Label";
 
			this.ingredient2Label.LabelProp = "Ingredient 2:";
 
			this.hbox3.Add (this.ingredient2Label);
 
			global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.ingredient2Label]));
 
			w4.Position = 0;
 
			w4.Expand = false;
 
			w4.Fill = false;
 
			// Container child hbox3.Gtk.Box+BoxChild
 
			this.ingredient2ComboBox = global::Gtk.ComboBox.NewText ();
 
			this.ingredient2ComboBox.Name = "ingredient2ComboBox";
 
			this.hbox3.Add (this.ingredient2ComboBox);
 
			global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.ingredient2ComboBox]));
 
			w5.Position = 1;
 
			this.vbox2.Add (this.hbox3);
 
			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox3]));
 
			w6.Position = 1;
 
			w6.Expand = false;
 
			w6.Fill = false;
 
			// Container child vbox2.Gtk.Box+BoxChild
 
			this.hbox4 = new global::Gtk.HBox ();
 
			this.hbox4.Name = "hbox4";
 
			this.hbox4.Spacing = 6;
 
			// Container child hbox4.Gtk.Box+BoxChild
 
			this.ingredient3Label = new global::Gtk.Label ();
 
			this.ingredient3Label.Name = "ingredient3Label";
 
			this.ingredient3Label.LabelProp = "Ingredient 3:";
 
			this.hbox4.Add (this.ingredient3Label);
 
			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.ingredient3Label]));
 
			w7.Position = 0;
 
			w7.Expand = false;
 
			w7.Fill = false;
 
			// Container child hbox4.Gtk.Box+BoxChild
 
			this.ingredient3ComboBox = global::Gtk.ComboBox.NewText ();
 
			this.ingredient3ComboBox.Name = "ingredient3ComboBox";
 
			this.hbox4.Add (this.ingredient3ComboBox);
 
			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.ingredient3ComboBox]));
 
			w8.Position = 1;
 
			this.vbox2.Add (this.hbox4);
 
			global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox4]));
 
			w9.Position = 2;
 
			w9.Expand = false;
 
			w9.Fill = false;
 
			// Container child vbox2.Gtk.Box+BoxChild
 
			this.clearReactionButton = new global::Gtk.Button ();
 
			this.clearReactionButton.Sensitive = false;
 
			this.clearReactionButton.CanFocus = true;
 
			this.clearReactionButton.Name = "clearReactionButton";
 
			this.clearReactionButton.UseUnderline = true;
 
			this.clearReactionButton.Label = "Clear Reaction";
 
			this.vbox2.Add (this.clearReactionButton);
 
			global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.clearReactionButton]));
 
			w10.PackType = ((global::Gtk.PackType)(1));
 
			w10.Position = 3;
 
			w10.Expand = false;
 
			w10.Fill = false;
 
			w10.Padding = ((uint)(6));
 
			this.GtkAlignment.Add (this.vbox2);
 
			this.selectIngredientsFrame.Add (this.GtkAlignment);
 
			this.selectIngredientsLabel = new global::Gtk.Label ();
 
			this.selectIngredientsLabel.Name = "selectIngredientsLabel";
 
			this.selectIngredientsLabel.LabelProp = "<b>Select Ingredients</b>";
 
			this.selectIngredientsLabel.UseMarkup = true;
 
			this.selectIngredientsFrame.LabelWidget = this.selectIngredientsLabel;
 
			this.hbox1.Add (this.selectIngredientsFrame);
 
			global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.selectIngredientsFrame]));
 
			w13.Position = 0;
 
			// Container child hbox1.Gtk.Box+BoxChild
 
			this.unmodifiedColorFrame = new global::Gtk.Frame ();
 
			this.unmodifiedColorFrame.Name = "unmodifiedColorFrame";
 
			this.unmodifiedColorFrame.BorderWidth = ((uint)(4));
 
			// Container child unmodifiedColorFrame.Gtk.Container+ContainerChild
 
			this.GtkAlignment1 = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
 
			this.GtkAlignment1.Name = "GtkAlignment1";
 
			this.GtkAlignment1.LeftPadding = ((uint)(5));
 
			this.GtkAlignment1.TopPadding = ((uint)(5));
 
			this.GtkAlignment1.RightPadding = ((uint)(5));
 
			this.GtkAlignment1.BottomPadding = ((uint)(6));
 
			// Container child GtkAlignment1.Gtk.Container+ContainerChild
 
			this.vbox3 = new global::Gtk.VBox ();
 
			this.vbox3.WidthRequest = 120;
 
			this.vbox3.Name = "vbox3";
 
			this.vbox3.Spacing = 6;
 
			// Container child vbox3.Gtk.Box+BoxChild
 
			this.unmodifiedSwatch = new global::DesertPaintLab.PaintSwatch ();
 
			this.unmodifiedSwatch.WidthRequest = 120;
 
			this.unmodifiedSwatch.HeightRequest = 120;
 
			this.unmodifiedSwatch.Events = ((global::Gdk.EventMask)(256));
 
			this.unmodifiedSwatch.Name = "unmodifiedSwatch";
 
			this.vbox3.Add (this.unmodifiedSwatch);
 
			global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.unmodifiedSwatch]));
 
			w14.Position = 0;
 
			// Container child vbox3.Gtk.Box+BoxChild
 
			this.captureButton = new global::Gtk.Button ();
 
			this.captureButton.CanFocus = true;
 
			this.captureButton.Name = "captureButton";
 
			this.captureButton.UseUnderline = true;
 
			this.captureButton.Label = "Capture";
 
			this.vbox3.Add (this.captureButton);
 
			global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.captureButton]));
 
			w15.Position = 1;
 
			w15.Expand = false;
 
			w15.Fill = false;
 
			this.GtkAlignment1.Add (this.vbox3);
 
			this.unmodifiedColorFrame.Add (this.GtkAlignment1);
 
			this.unmodifiedLabel = new global::Gtk.Label ();
 
			this.unmodifiedLabel.Name = "unmodifiedLabel";
 
			this.unmodifiedLabel.LabelProp = "<b>Unmodified</b>";
 
			this.unmodifiedLabel.UseMarkup = true;
 
			this.unmodifiedLabel.Justify = ((global::Gtk.Justification)(2));
 
			this.unmodifiedColorFrame.LabelWidget = this.unmodifiedLabel;
 
			this.hbox1.Add (this.unmodifiedColorFrame);
 
			global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.unmodifiedColorFrame]));
 
			w18.Position = 1;
 
			w18.Expand = false;
 
			w18.Fill = false;
 
			// Container child hbox1.Gtk.Box+BoxChild
 
			this.reactedColorFrame = new global::Gtk.Frame ();
 
			this.reactedColorFrame.Name = "reactedColorFrame";
 
			this.reactedColorFrame.BorderWidth = ((uint)(4));
 
			// Container child reactedColorFrame.Gtk.Container+ContainerChild
 
			this.GtkAlignment2 = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
 
			this.GtkAlignment2.Name = "GtkAlignment2";
 
			this.GtkAlignment2.LeftPadding = ((uint)(5));
 
			this.GtkAlignment2.TopPadding = ((uint)(5));
 
			this.GtkAlignment2.RightPadding = ((uint)(5));
 
			this.GtkAlignment2.BottomPadding = ((uint)(6));
 
			// Container child GtkAlignment2.Gtk.Container+ContainerChild
 
			this.vbox4 = new global::Gtk.VBox ();
 
			this.vbox4.WidthRequest = 120;
 
			this.vbox4.Name = "vbox4";
 
			this.vbox4.Spacing = 6;
 
			// Container child vbox4.Gtk.Box+BoxChild
 
			this.reactionSwatch = new global::DesertPaintLab.PaintSwatch ();
 
			this.reactionSwatch.WidthRequest = 120;
 
			this.reactionSwatch.HeightRequest = 120;
 
			this.reactionSwatch.Events = ((global::Gdk.EventMask)(256));
 
			this.reactionSwatch.Name = "reactionSwatch";
 
			this.vbox4.Add (this.reactionSwatch);
 
			global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.reactionSwatch]));
 
			w19.Position = 0;
 
			// Container child vbox4.Gtk.Box+BoxChild
 
			this.recordButton = new global::Gtk.Button ();
 
			this.recordButton.CanFocus = true;
 
			this.recordButton.Name = "recordButton";
 
			this.recordButton.UseUnderline = true;
 
			this.recordButton.Label = "Record";
 
			this.vbox4.Add (this.recordButton);
 
			global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.recordButton]));
 
			w20.Position = 1;
 
			w20.Expand = false;
 
			w20.Fill = false;
 
			this.GtkAlignment2.Add (this.vbox4);
 
			this.reactedColorFrame.Add (this.GtkAlignment2);
 
			this.reactionLabel = new global::Gtk.Label ();
 
			this.reactionLabel.Name = "reactionLabel";
 
			this.reactionLabel.LabelProp = "<b>Reacted</b>";
 
			this.reactionLabel.UseMarkup = true;
 
			this.reactionLabel.Justify = ((global::Gtk.Justification)(2));
 
			this.reactedColorFrame.LabelWidget = this.reactionLabel;
 
			this.hbox1.Add (this.reactedColorFrame);
 
			global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.reactedColorFrame]));
 
			w23.Position = 2;
 
			w23.Expand = false;
 
			w23.Fill = false;
 
			this.Add (this.hbox1);
 
			if ((this.Child != null)) {
 
				this.Child.ShowAll ();
 
			}
 
			this.clearReactionButton.Hide ();
 
			this.Hide ();
 
			this.ingredient1ComboBox.Changed += new global::System.EventHandler (this.OnChangedIngredient1);
 
			this.ingredient2ComboBox.Changed += new global::System.EventHandler (this.OnChangedIngredient2);
 
			this.ingredient3ComboBox.Changed += new global::System.EventHandler (this.OnChangedIngredient3);
 
			this.clearReactionButton.Clicked += new global::System.EventHandler (this.OnClearReaction);
 
			this.captureButton.Clicked += new global::System.EventHandler (this.OnCapture);
 
			this.recordButton.Clicked += new global::System.EventHandler (this.OnRecord);
 
		}
 
	}
 
}
gtk-gui/DesertPaintLab.RecipeGeneratorView.cs
Show inline comments
 
new file 100644
 

	
 
// This file has been generated by the GUI designer. Do not modify.
 
namespace DesertPaintLab
 
{
 
	public partial class RecipeGeneratorView
 
	{
 
		private global::Gtk.UIManager UIManager;
 
		
 
		private global::Gtk.VBox vbox2;
 
		
 
		private global::Gtk.HBox hbox1;
 
		
 
		private global::Gtk.VBox vbox8;
 
		
 
		private global::Gtk.HBox hbox2;
 
		
 
		private global::Gtk.SpinButton minIngredientsSpinButton;
 
		
 
		private global::Gtk.Label label1;
 
		
 
		private global::Gtk.HBox hbox7;
 
		
 
		private global::Gtk.SpinButton maxIngredientsSpinButton;
 
		
 
		private global::Gtk.Label label3;
 
		
 
		private global::Gtk.HSeparator hseparator3;
 
		
 
		private global::Gtk.CheckButton checkButtonRibbon;
 
		
 
		private global::Gtk.HBox hbox4;
 
		
 
		private global::Gtk.SpinButton maxRecipeSpinButton;
 
		
 
		private global::Gtk.Label label4;
 
		
 
		private global::Gtk.HSeparator hseparator4;
 
		
 
		private global::Gtk.HBox hbox5;
 
		
 
		private global::Gtk.SpinButton fullQuantityDepthSpinButton;
 
		
 
		private global::Gtk.Label label8;
 
		
 
		private global::Gtk.HSeparator hseparator5;
 
		
 
		private global::Gtk.HBox hbox6;
 
		
 
		private global::Gtk.SpinButton fullQuantitySpinButton;
 
		
 
		private global::Gtk.Label label9;
 
		
 
		private global::Gtk.Frame frame3;
 
		
 
		private global::Gtk.Alignment GtkAlignment1;
 
		
 
		private global::Gtk.ScrolledWindow scrolledwindow2;
 
		
 
		private global::Gtk.TreeView reagentListView;
 
		
 
		private global::Gtk.Label GtkLabel4;
 
		
 
		private global::Gtk.HSeparator hseparator6;
 
		
 
		private global::Gtk.ScrolledWindow GtkScrolledWindow1;
 
		
 
		private global::Gtk.TreeView recipeList;
 
		
 
		private global::Gtk.VBox vbox3;
 
		
 
		private global::Gtk.Frame frame2;
 
		
 
		private global::Gtk.ScrolledWindow GtkScrolledWindow;
 
		
 
		private global::Gtk.TreeView recipeIngredientsView;
 
		
 
		private global::Gtk.Label recipeLabel;
 
		
 
		private global::Gtk.Button button919;
 
		
 
		private global::DesertPaintLab.PaintSwatch paintSwatch;
 
		
 
		private global::Gtk.HBox hbox3;
 
		
 
		private global::Gtk.HSeparator hseparator2;
 
		
 
		private global::Gtk.Button stopResumeButton;
 
		
 
		private global::Gtk.Label countLabel;
 
		
 
		private global::Gtk.Button beginButton;
 
		
 
		private global::Gtk.HSeparator hseparator1;
 
		
 
		private global::Gtk.ProgressBar progressBar;
 

	
 
		protected virtual void Build ()
 
		{
 
			global::Stetic.Gui.Initialize (this);
 
			// Widget DesertPaintLab.RecipeGeneratorView
 
			Stetic.BinContainer w1 = global::Stetic.BinContainer.Attach (this);
 
			this.UIManager = new global::Gtk.UIManager ();
 
			global::Gtk.ActionGroup w2 = new global::Gtk.ActionGroup ("Default");
 
			this.UIManager.InsertActionGroup (w2, 0);
 
			this.Name = "DesertPaintLab.RecipeGeneratorView";
 
			// Container child DesertPaintLab.RecipeGeneratorView.Gtk.Container+ContainerChild
 
			this.vbox2 = new global::Gtk.VBox ();
 
			this.vbox2.Name = "vbox2";
 
			this.vbox2.Spacing = 6;
 
			this.vbox2.BorderWidth = ((uint)(8));
 
			// Container child vbox2.Gtk.Box+BoxChild
 
			this.hbox1 = new global::Gtk.HBox ();
 
			this.hbox1.Name = "hbox1";
 
			this.hbox1.Spacing = 6;
 
			// Container child hbox1.Gtk.Box+BoxChild
 
			this.vbox8 = new global::Gtk.VBox ();
 
			this.vbox8.Name = "vbox8";
 
			this.vbox8.Spacing = 6;
 
			// Container child vbox8.Gtk.Box+BoxChild
 
			this.hbox2 = new global::Gtk.HBox ();
 
			this.hbox2.Name = "hbox2";
 
			this.hbox2.Spacing = 6;
 
			// Container child hbox2.Gtk.Box+BoxChild
 
			this.minIngredientsSpinButton = new global::Gtk.SpinButton (1, 14, 1);
 
			this.minIngredientsSpinButton.CanFocus = true;
 
			this.minIngredientsSpinButton.Name = "minIngredientsSpinButton";
 
			this.minIngredientsSpinButton.Adjustment.PageIncrement = 10;
 
			this.minIngredientsSpinButton.ClimbRate = 1;
 
			this.minIngredientsSpinButton.Numeric = true;
 
			this.minIngredientsSpinButton.Value = 1;
 
			this.hbox2.Add (this.minIngredientsSpinButton);
 
			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.minIngredientsSpinButton]));
 
			w3.Position = 0;
 
			w3.Expand = false;
 
			w3.Fill = false;
 
			// Container child hbox2.Gtk.Box+BoxChild
 
			this.label1 = new global::Gtk.Label ();
 
			this.label1.Name = "label1";
 
			this.label1.LabelProp = "Minimum Ingredients";
 
			this.hbox2.Add (this.label1);
 
			global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label1]));
 
			w4.Position = 1;
 
			w4.Expand = false;
 
			w4.Fill = false;
 
			this.vbox8.Add (this.hbox2);
 
			global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.hbox2]));
 
			w5.Position = 0;
 
			w5.Expand = false;
 
			w5.Fill = false;
 
			// Container child vbox8.Gtk.Box+BoxChild
 
			this.hbox7 = new global::Gtk.HBox ();
 
			this.hbox7.Name = "hbox7";
 
			this.hbox7.Spacing = 6;
 
			// Container child hbox7.Gtk.Box+BoxChild
 
			this.maxIngredientsSpinButton = new global::Gtk.SpinButton (1, 14, 1);
 
			this.maxIngredientsSpinButton.CanFocus = true;
 
			this.maxIngredientsSpinButton.Name = "maxIngredientsSpinButton";
 
			this.maxIngredientsSpinButton.Adjustment.PageIncrement = 10;
 
			this.maxIngredientsSpinButton.ClimbRate = 1;
 
			this.maxIngredientsSpinButton.Numeric = true;
 
			this.maxIngredientsSpinButton.Value = 5;
 
			this.hbox7.Add (this.maxIngredientsSpinButton);
 
			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.maxIngredientsSpinButton]));
 
			w6.Position = 0;
 
			w6.Expand = false;
 
			w6.Fill = false;
 
			// Container child hbox7.Gtk.Box+BoxChild
 
			this.label3 = new global::Gtk.Label ();
 
			this.label3.Name = "label3";
 
			this.label3.LabelProp = "Maximum Ingredients";
 
			this.hbox7.Add (this.label3);
 
			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.label3]));
 
			w7.Position = 1;
 
			w7.Expand = false;
 
			w7.Fill = false;
 
			this.vbox8.Add (this.hbox7);
 
			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.hbox7]));
 
			w8.Position = 1;
 
			w8.Expand = false;
 
			w8.Fill = false;
 
			// Container child vbox8.Gtk.Box+BoxChild
 
			this.hseparator3 = new global::Gtk.HSeparator ();
 
			this.hseparator3.Name = "hseparator3";
 
			this.vbox8.Add (this.hseparator3);
 
			global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.hseparator3]));
 
			w9.Position = 2;
 
			w9.Expand = false;
 
			w9.Fill = false;
 
			// Container child vbox8.Gtk.Box+BoxChild
 
			this.checkButtonRibbon = new global::Gtk.CheckButton ();
 
			this.checkButtonRibbon.CanFocus = true;
 
			this.checkButtonRibbon.Name = "checkButtonRibbon";
 
			this.checkButtonRibbon.Label = "Ribbon Recipes";
 
			this.checkButtonRibbon.DrawIndicator = true;
 
			this.checkButtonRibbon.UseUnderline = true;
 
			this.vbox8.Add (this.checkButtonRibbon);
 
			global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.checkButtonRibbon]));
 
			w10.Position = 3;
 
			w10.Expand = false;
 
			w10.Fill = false;
 
			// Container child vbox8.Gtk.Box+BoxChild
 
			this.hbox4 = new global::Gtk.HBox ();
 
			this.hbox4.Name = "hbox4";
 
			this.hbox4.Spacing = 6;
 
			// Container child hbox4.Gtk.Box+BoxChild
 
			this.maxRecipeSpinButton = new global::Gtk.SpinButton (10, 100, 1);
 
			this.maxRecipeSpinButton.CanFocus = true;
 
			this.maxRecipeSpinButton.Name = "maxRecipeSpinButton";
 
			this.maxRecipeSpinButton.Adjustment.PageIncrement = 10;
 
			this.maxRecipeSpinButton.ClimbRate = 1;
 
			this.maxRecipeSpinButton.Numeric = true;
 
			this.maxRecipeSpinButton.Value = 14;
 
			this.hbox4.Add (this.maxRecipeSpinButton);
 
			global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.maxRecipeSpinButton]));
 
			w11.Position = 0;
 
			w11.Expand = false;
 
			w11.Fill = false;
 
			// Container child hbox4.Gtk.Box+BoxChild
 
			this.label4 = new global::Gtk.Label ();
 
			this.label4.Name = "label4";
 
			this.label4.LabelProp = "Maximum Concentration";
 
			this.label4.UseMarkup = true;
 
			this.label4.Wrap = true;
 
			this.hbox4.Add (this.label4);
 
			global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.label4]));
 
			w12.Position = 1;
 
			w12.Expand = false;
 
			w12.Fill = false;
 
			this.vbox8.Add (this.hbox4);
 
			global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.hbox4]));
 
			w13.Position = 4;
 
			w13.Expand = false;
 
			w13.Fill = false;
 
			// Container child vbox8.Gtk.Box+BoxChild
 
			this.hseparator4 = new global::Gtk.HSeparator ();
 
			this.hseparator4.Name = "hseparator4";
 
			this.vbox8.Add (this.hseparator4);
 
			global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.hseparator4]));
 
			w14.Position = 5;
 
			w14.Expand = false;
 
			w14.Fill = false;
 
			w14.Padding = ((uint)(8));
 
			// Container child vbox8.Gtk.Box+BoxChild
 
			this.hbox5 = new global::Gtk.HBox ();
 
			this.hbox5.Name = "hbox5";
 
			this.hbox5.Spacing = 6;
 
			// Container child hbox5.Gtk.Box+BoxChild
 
			this.fullQuantityDepthSpinButton = new global::Gtk.SpinButton (0, 15, 1);
 
			this.fullQuantityDepthSpinButton.CanFocus = true;
 
			this.fullQuantityDepthSpinButton.Name = "fullQuantityDepthSpinButton";
 
			this.fullQuantityDepthSpinButton.Adjustment.PageIncrement = 10;
 
			this.fullQuantityDepthSpinButton.ClimbRate = 1;
 
			this.fullQuantityDepthSpinButton.Numeric = true;
 
			this.fullQuantityDepthSpinButton.Value = 4;
 
			this.hbox5.Add (this.fullQuantityDepthSpinButton);
 
			global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox5 [this.fullQuantityDepthSpinButton]));
 
			w15.Position = 0;
 
			w15.Expand = false;
 
			w15.Fill = false;
 
			// Container child hbox5.Gtk.Box+BoxChild
 
			this.label8 = new global::Gtk.Label ();
 
			this.label8.Name = "label8";
 
			this.label8.LabelProp = "Full Quantity Depth";
 
			this.hbox5.Add (this.label8);
 
			global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox5 [this.label8]));
 
			w16.Position = 1;
 
			w16.Expand = false;
 
			w16.Fill = false;
 
			this.vbox8.Add (this.hbox5);
 
			global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.hbox5]));
 
			w17.Position = 6;
 
			w17.Expand = false;
 
			w17.Fill = false;
 
			// Container child vbox8.Gtk.Box+BoxChild
 
			this.hseparator5 = new global::Gtk.HSeparator ();
 
			this.hseparator5.Name = "hseparator5";
 
			this.vbox8.Add (this.hseparator5);
 
			global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.hseparator5]));
 
			w18.Position = 7;
 
			w18.Expand = false;
 
			w18.Fill = false;
 
			// Container child vbox8.Gtk.Box+BoxChild
 
			this.hbox6 = new global::Gtk.HBox ();
 
			this.hbox6.Name = "hbox6";
 
			this.hbox6.Spacing = 6;
 
			// Container child hbox6.Gtk.Box+BoxChild
 
			this.fullQuantitySpinButton = new global::Gtk.SpinButton (0, 30, 1);
 
			this.fullQuantitySpinButton.CanFocus = true;
 
			this.fullQuantitySpinButton.Name = "fullQuantitySpinButton";
 
			this.fullQuantitySpinButton.Adjustment.PageIncrement = 10;
 
			this.fullQuantitySpinButton.ClimbRate = 1;
 
			this.fullQuantitySpinButton.Numeric = true;
 
			this.fullQuantitySpinButton.Value = 20;
 
			this.hbox6.Add (this.fullQuantitySpinButton);
 
			global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox6 [this.fullQuantitySpinButton]));
 
			w19.Position = 0;
 
			w19.Expand = false;
 
			w19.Fill = false;
 
			// Container child hbox6.Gtk.Box+BoxChild
 
			this.label9 = new global::Gtk.Label ();
 
			this.label9.Name = "label9";
 
			this.label9.LabelProp = "FullQuantity";
 
			this.hbox6.Add (this.label9);
 
			global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox6 [this.label9]));
 
			w20.Position = 1;
 
			w20.Expand = false;
 
			w20.Fill = false;
 
			this.vbox8.Add (this.hbox6);
 
			global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.hbox6]));
 
			w21.Position = 8;
 
			w21.Expand = false;
 
			w21.Fill = false;
 
			// Container child vbox8.Gtk.Box+BoxChild
 
			this.frame3 = new global::Gtk.Frame ();
 
			this.frame3.Name = "frame3";
 
			this.frame3.ShadowType = ((global::Gtk.ShadowType)(0));
 
			// Container child frame3.Gtk.Container+ContainerChild
 
			this.GtkAlignment1 = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
 
			this.GtkAlignment1.Name = "GtkAlignment1";
 
			this.GtkAlignment1.LeftPadding = ((uint)(12));
 
			// Container child GtkAlignment1.Gtk.Container+ContainerChild
 
			this.scrolledwindow2 = new global::Gtk.ScrolledWindow ();
 
			this.scrolledwindow2.CanFocus = true;
 
			this.scrolledwindow2.Name = "scrolledwindow2";
 
			this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1));
 
			// Container child scrolledwindow2.Gtk.Container+ContainerChild
 
			this.reagentListView = new global::Gtk.TreeView ();
 
			this.reagentListView.WidthRequest = 300;
 
			this.reagentListView.CanFocus = true;
 
			this.reagentListView.Name = "reagentListView";
 
			this.scrolledwindow2.Add (this.reagentListView);
 
			this.GtkAlignment1.Add (this.scrolledwindow2);
 
			this.frame3.Add (this.GtkAlignment1);
 
			this.GtkLabel4 = new global::Gtk.Label ();
 
			this.GtkLabel4.Name = "GtkLabel4";
 
			this.GtkLabel4.LabelProp = "<b>Ingredients</b>";
 
			this.GtkLabel4.UseMarkup = true;
 
			this.frame3.LabelWidget = this.GtkLabel4;
 
			this.vbox8.Add (this.frame3);
 
			global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.frame3]));
 
			w25.PackType = ((global::Gtk.PackType)(1));
 
			w25.Position = 9;
 
			// Container child vbox8.Gtk.Box+BoxChild
 
			this.hseparator6 = new global::Gtk.HSeparator ();
 
			this.hseparator6.Name = "hseparator6";
 
			this.vbox8.Add (this.hseparator6);
 
			global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.hseparator6]));
 
			w26.PackType = ((global::Gtk.PackType)(1));
 
			w26.Position = 10;
 
			w26.Expand = false;
 
			w26.Fill = false;
 
			this.hbox1.Add (this.vbox8);
 
			global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox8]));
 
			w27.Position = 0;
 
			w27.Expand = false;
 
			w27.Fill = false;
 
			// Container child hbox1.Gtk.Box+BoxChild
 
			this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow ();
 
			this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
 
			this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));
 
			// Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
 
			this.recipeList = new global::Gtk.TreeView ();
 
			this.recipeList.WidthRequest = 300;
 
			this.recipeList.CanFocus = true;
 
			this.recipeList.Name = "recipeList";
 
			this.GtkScrolledWindow1.Add (this.recipeList);
 
			this.hbox1.Add (this.GtkScrolledWindow1);
 
			global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow1]));
 
			w29.Position = 1;
 
			// Container child hbox1.Gtk.Box+BoxChild
 
			this.vbox3 = new global::Gtk.VBox ();
 
			this.vbox3.Name = "vbox3";
 
			this.vbox3.Spacing = 6;
 
			// Container child vbox3.Gtk.Box+BoxChild
 
			this.frame2 = new global::Gtk.Frame ();
 
			this.frame2.WidthRequest = 200;
 
			this.frame2.HeightRequest = 200;
 
			this.frame2.Name = "frame2";
 
			this.frame2.ShadowType = ((global::Gtk.ShadowType)(0));
 
			// Container child frame2.Gtk.Container+ContainerChild
 
			this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
 
			this.GtkScrolledWindow.Name = "GtkScrolledWindow";
 
			this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
 
			// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
 
			this.recipeIngredientsView = new global::Gtk.TreeView ();
 
			this.recipeIngredientsView.CanFocus = true;
 
			this.recipeIngredientsView.Name = "recipeIngredientsView";
 
			this.GtkScrolledWindow.Add (this.recipeIngredientsView);
 
			this.frame2.Add (this.GtkScrolledWindow);
 
			this.recipeLabel = new global::Gtk.Label ();
 
			this.recipeLabel.Name = "recipeLabel";
 
			this.recipeLabel.LabelProp = "<b>Recipe</b>";
 
			this.recipeLabel.UseMarkup = true;
 
			this.frame2.LabelWidget = this.recipeLabel;
 
			this.vbox3.Add (this.frame2);
 
			global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.frame2]));
 
			w32.Position = 0;
 
			// Container child vbox3.Gtk.Box+BoxChild
 
			this.button919 = new global::Gtk.Button ();
 
			this.button919.CanFocus = true;
 
			this.button919.Name = "button919";
 
			this.button919.UseUnderline = true;
 
			this.button919.Label = "Copy";
 
			this.vbox3.Add (this.button919);
 
			global::Gtk.Box.BoxChild w33 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.button919]));
 
			w33.Position = 1;
 
			w33.Expand = false;
 
			w33.Fill = false;
 
			// Container child vbox3.Gtk.Box+BoxChild
 
			this.paintSwatch = new global::DesertPaintLab.PaintSwatch ();
 
			this.paintSwatch.HeightRequest = 200;
 
			this.paintSwatch.Events = ((global::Gdk.EventMask)(256));
 
			this.paintSwatch.Name = "paintSwatch";
 
			this.vbox3.Add (this.paintSwatch);
 
			global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.paintSwatch]));
 
			w34.Position = 2;
 
			this.hbox1.Add (this.vbox3);
 
			global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3]));
 
			w35.Position = 2;
 
			w35.Expand = false;
 
			w35.Fill = false;
 
			this.vbox2.Add (this.hbox1);
 
			global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
 
			w36.Position = 0;
 
			// Container child vbox2.Gtk.Box+BoxChild
 
			this.hbox3 = new global::Gtk.HBox ();
 
			this.hbox3.Name = "hbox3";
 
			this.hbox3.Spacing = 6;
 
			// Container child hbox3.Gtk.Box+BoxChild
 
			this.hseparator2 = new global::Gtk.HSeparator ();
 
			this.hseparator2.Name = "hseparator2";
 
			this.hbox3.Add (this.hseparator2);
 
			global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.hseparator2]));
 
			w37.Position = 0;
 
			// Container child hbox3.Gtk.Box+BoxChild
 
			this.stopResumeButton = new global::Gtk.Button ();
 
			this.stopResumeButton.Sensitive = false;
 
			this.stopResumeButton.CanFocus = true;
 
			this.stopResumeButton.Name = "stopResumeButton";
 
			this.stopResumeButton.UseUnderline = true;
 
			this.stopResumeButton.Label = "Stop";
 
			this.hbox3.Add (this.stopResumeButton);
 
			global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.stopResumeButton]));
 
			w38.Position = 1;
 
			w38.Expand = false;
 
			w38.Fill = false;
 
			w38.Padding = ((uint)(20));
 
			// Container child hbox3.Gtk.Box+BoxChild
 
			this.countLabel = new global::Gtk.Label ();
 
			this.countLabel.Name = "countLabel";
 
			this.countLabel.LabelProp = "0/192";
 
			this.hbox3.Add (this.countLabel);
 
			global::Gtk.Box.BoxChild w39 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.countLabel]));
 
			w39.Position = 2;
 
			w39.Expand = false;
 
			w39.Fill = false;
 
			w39.Padding = ((uint)(40));
 
			// Container child hbox3.Gtk.Box+BoxChild
 
			this.beginButton = new global::Gtk.Button ();
 
			this.beginButton.CanFocus = true;
 
			this.beginButton.Name = "beginButton";
 
			this.beginButton.UseUnderline = true;
 
			this.beginButton.Label = "Begin";
 
			this.hbox3.Add (this.beginButton);
 
			global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.beginButton]));
 
			w40.Position = 3;
 
			w40.Expand = false;
 
			w40.Fill = false;
 
			w40.Padding = ((uint)(20));
 
			// Container child hbox3.Gtk.Box+BoxChild
 
			this.hseparator1 = new global::Gtk.HSeparator ();
 
			this.hseparator1.Name = "hseparator1";
 
			this.hbox3.Add (this.hseparator1);
 
			global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.hseparator1]));
 
			w41.Position = 4;
 
			this.vbox2.Add (this.hbox3);
 
			global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox3]));
 
			w42.Position = 1;
 
			w42.Expand = false;
 
			w42.Fill = false;
 
			// Container child vbox2.Gtk.Box+BoxChild
 
			this.progressBar = new global::Gtk.ProgressBar ();
 
			this.progressBar.Name = "progressBar";
 
			this.vbox2.Add (this.progressBar);
 
			global::Gtk.Box.BoxChild w43 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.progressBar]));
 
			w43.PackType = ((global::Gtk.PackType)(1));
 
			w43.Position = 2;
 
			w43.Expand = false;
 
			w43.Fill = false;
 
			this.Add (this.vbox2);
 
			if ((this.Child != null)) {
 
				this.Child.ShowAll ();
 
			}
 
			w1.SetUiManager (UIManager);
 
			this.Hide ();
 
			this.minIngredientsSpinButton.ValueChanged += new global::System.EventHandler (this.OnMinIngredientsChanged);
 
			this.maxIngredientsSpinButton.ValueChanged += new global::System.EventHandler (this.OnMaxIngredientsChanged);
 
			this.checkButtonRibbon.Toggled += new global::System.EventHandler (this.OnRecipesToggled);
 
			this.maxRecipeSpinButton.ValueChanged += new global::System.EventHandler (this.OnMaxRecipeChanged);
 
			this.fullQuantityDepthSpinButton.ValueChanged += new global::System.EventHandler (this.OnFullQuantityDepthChanged);
 
			this.fullQuantitySpinButton.ValueChanged += new global::System.EventHandler (this.OnFullQuantityChanged);
 
			this.button919.Clicked += new global::System.EventHandler (this.OnCopyRecipeToClipboard);
 
			this.stopResumeButton.Clicked += new global::System.EventHandler (this.OnStopResume);
 
			this.beginButton.Clicked += new global::System.EventHandler (this.OnBegin);
 
		}
 
	}
 
}
gtk-gui/DesertPaintLab.RecipeGeneratorWindow.cs
Show inline comments
 
deleted file
gtk-gui/DesertPaintLab.SimulatorView.cs
Show inline comments
 
new file 100644
 

	
 
// This file has been generated by the GUI designer. Do not modify.
 
namespace DesertPaintLab
 
{
 
	public partial class SimulatorView
 
	{
 
		private global::Gtk.HBox hbox1;
 
		
 
		private global::Gtk.ScrolledWindow GtkScrolledWindow;
 
		
 
		private global::Gtk.TreeView reagentListView;
 
		
 
		private global::Gtk.VBox vbox162;
 
		
 
		private global::Gtk.Alignment alignment1;
 
		
 
		private global::Gtk.Button addReagentButton;
 
		
 
		private global::Gtk.Image addReagentButtonImage;
 
		
 
		private global::Gtk.Alignment alignment3;
 
		
 
		private global::Gtk.ScrolledWindow GtkScrolledWindow1;
 
		
 
		private global::Gtk.TreeView recipeView;
 
		
 
		private global::Gtk.VBox vbox3;
 
		
 
		private global::Gtk.Alignment alignment2;
 
		
 
		private global::Gtk.Button button65;
 
		
 
		private global::Gtk.Image image1;
 
		
 
		private global::Gtk.Button button66;
 
		
 
		private global::Gtk.Image image2;
 
		
 
		private global::Gtk.Button button67;
 
		
 
		private global::Gtk.Image image3;
 
		
 
		private global::Gtk.Alignment alignment4;
 
		
 
		private global::DesertPaintLab.PaintSwatch paintSwatch;
 

	
 
		protected virtual void Build ()
 
		{
 
			global::Stetic.Gui.Initialize (this);
 
			// Widget DesertPaintLab.SimulatorView
 
			global::Stetic.BinContainer.Attach (this);
 
			this.Name = "DesertPaintLab.SimulatorView";
 
			// Container child DesertPaintLab.SimulatorView.Gtk.Container+ContainerChild
 
			this.hbox1 = new global::Gtk.HBox ();
 
			this.hbox1.Name = "hbox1";
 
			this.hbox1.Spacing = 6;
 
			this.hbox1.BorderWidth = ((uint)(12));
 
			// Container child hbox1.Gtk.Box+BoxChild
 
			this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
 
			this.GtkScrolledWindow.Name = "GtkScrolledWindow";
 
			this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
 
			// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
 
			this.reagentListView = new global::Gtk.TreeView ();
 
			this.reagentListView.CanFocus = true;
 
			this.reagentListView.Name = "reagentListView";
 
			this.GtkScrolledWindow.Add (this.reagentListView);
 
			this.hbox1.Add (this.GtkScrolledWindow);
 
			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow]));
 
			w2.Position = 0;
 
			// Container child hbox1.Gtk.Box+BoxChild
 
			this.vbox162 = new global::Gtk.VBox ();
 
			this.vbox162.Name = "vbox162";
 
			this.vbox162.Spacing = 6;
 
			// Container child vbox162.Gtk.Box+BoxChild
 
			this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
 
			this.alignment1.Name = "alignment1";
 
			this.vbox162.Add (this.alignment1);
 
			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox162 [this.alignment1]));
 
			w3.Position = 0;
 
			// Container child vbox162.Gtk.Box+BoxChild
 
			this.addReagentButton = new global::Gtk.Button ();
 
			this.addReagentButton.CanFocus = true;
 
			this.addReagentButton.Name = "addReagentButton";
 
			// Container child addReagentButton.Gtk.Container+ContainerChild
 
			this.addReagentButtonImage = new global::Gtk.Image ();
 
			this.addReagentButtonImage.Name = "addReagentButtonImage";
 
			this.addReagentButtonImage.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", global::Gtk.IconSize.Menu);
 
			this.addReagentButton.Add (this.addReagentButtonImage);
 
			this.vbox162.Add (this.addReagentButton);
 
			global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox162 [this.addReagentButton]));
 
			w5.Position = 1;
 
			w5.Expand = false;
 
			w5.Fill = false;
 
			// Container child vbox162.Gtk.Box+BoxChild
 
			this.alignment3 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
 
			this.alignment3.Name = "alignment3";
 
			this.vbox162.Add (this.alignment3);
 
			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox162 [this.alignment3]));
 
			w6.Position = 2;
 
			this.hbox1.Add (this.vbox162);
 
			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox162]));
 
			w7.Position = 1;
 
			w7.Expand = false;
 
			w7.Fill = false;
 
			// Container child hbox1.Gtk.Box+BoxChild
 
			this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow ();
 
			this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
 
			this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));
 
			// Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
 
			this.recipeView = new global::Gtk.TreeView ();
 
			this.recipeView.CanFocus = true;
 
			this.recipeView.Name = "recipeView";
 
			this.recipeView.EnableSearch = false;
 
			this.recipeView.Reorderable = true;
 
			this.GtkScrolledWindow1.Add (this.recipeView);
 
			this.hbox1.Add (this.GtkScrolledWindow1);
 
			global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow1]));
 
			w9.Position = 2;
 
			// Container child hbox1.Gtk.Box+BoxChild
 
			this.vbox3 = new global::Gtk.VBox ();
 
			this.vbox3.Name = "vbox3";
 
			this.vbox3.Spacing = 6;
 
			// Container child vbox3.Gtk.Box+BoxChild
 
			this.alignment2 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
 
			this.alignment2.Name = "alignment2";
 
			this.vbox3.Add (this.alignment2);
 
			global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.alignment2]));
 
			w10.Position = 0;
 
			// Container child vbox3.Gtk.Box+BoxChild
 
			this.button65 = new global::Gtk.Button ();
 
			this.button65.CanFocus = true;
 
			this.button65.Name = "button65";
 
			// Container child button65.Gtk.Container+ContainerChild
 
			this.image1 = new global::Gtk.Image ();
 
			this.image1.Name = "image1";
 
			this.image1.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Menu);
 
			this.button65.Add (this.image1);
 
			this.vbox3.Add (this.button65);
 
			global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.button65]));
 
			w12.Position = 1;
 
			w12.Expand = false;
 
			w12.Fill = false;
 
			// Container child vbox3.Gtk.Box+BoxChild
 
			this.button66 = new global::Gtk.Button ();
 
			this.button66.CanFocus = true;
 
			this.button66.Name = "button66";
 
			// Container child button66.Gtk.Container+ContainerChild
 
			this.image2 = new global::Gtk.Image ();
 
			this.image2.Name = "image2";
 
			this.image2.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Menu);
 
			this.button66.Add (this.image2);
 
			this.vbox3.Add (this.button66);
 
			global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.button66]));
 
			w14.Position = 2;
 
			w14.Expand = false;
 
			w14.Fill = false;
 
			// Container child vbox3.Gtk.Box+BoxChild
 
			this.button67 = new global::Gtk.Button ();
 
			this.button67.CanFocus = true;
 
			this.button67.Name = "button67";
 
			// Container child button67.Gtk.Container+ContainerChild
 
			this.image3 = new global::Gtk.Image ();
 
			this.image3.Name = "image3";
 
			this.image3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-first", global::Gtk.IconSize.Menu);
 
			this.button67.Add (this.image3);
 
			this.vbox3.Add (this.button67);
 
			global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.button67]));
 
			w16.Position = 3;
 
			w16.Expand = false;
 
			w16.Fill = false;
 
			// Container child vbox3.Gtk.Box+BoxChild
 
			this.alignment4 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
 
			this.alignment4.Name = "alignment4";
 
			this.vbox3.Add (this.alignment4);
 
			global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.alignment4]));
 
			w17.Position = 4;
 
			this.hbox1.Add (this.vbox3);
 
			global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3]));
 
			w18.Position = 3;
 
			w18.Expand = false;
 
			w18.Fill = false;
 
			// Container child hbox1.Gtk.Box+BoxChild
 
			this.paintSwatch = new global::DesertPaintLab.PaintSwatch ();
 
			this.paintSwatch.WidthRequest = 200;
 
			this.paintSwatch.Events = ((global::Gdk.EventMask)(256));
 
			this.paintSwatch.Name = "paintSwatch";
 
			this.hbox1.Add (this.paintSwatch);
 
			global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.paintSwatch]));
 
			w19.Position = 4;
 
			this.Add (this.hbox1);
 
			if ((this.Child != null)) {
 
				this.Child.ShowAll ();
 
			}
 
			this.Hide ();
 
			this.addReagentButton.Clicked += new global::System.EventHandler (this.OnAddReagent);
 
			this.button65.Clicked += new global::System.EventHandler (this.OnIncrementReagent);
 
			this.button66.Clicked += new global::System.EventHandler (this.OnDecrementReagent);
 
			this.button67.Clicked += new global::System.EventHandler (this.OnFlushReagents);
 
		}
 
	}
 
}
gtk-gui/DesertPaintLab.SimulatorWindow.cs
Show inline comments
 
deleted file
gtk-gui/MainWindow.cs
Show inline comments
...
 
@@ -6,97 +6,55 @@ public partial class MainWindow
 
	private global::Gtk.UIManager UIManager;
 
	
 
	private global::Gtk.Action FileAction;
 
	
 
	private global::Gtk.Action HelpAction;
 
	
 
	private global::Gtk.Action AboutAction;
 
	
 
	private global::Gtk.Action NewProfileAction;
 
	
 
	private global::Gtk.Action OpenProfileAction;
 
	
 
	private global::Gtk.Action ExitAction;
 
	
 
	private global::Gtk.Action ExportForPracticalPaintAction;
 
	
 
	private global::Gtk.Action WindowAction;
 
	
 
	private global::Gtk.Action RunSimulatorAction;
 
	
 
	private global::Gtk.Action DebugAction;
 
	
 
	private global::Gtk.Action ScreenshotAction;
 
	
 
	private global::Gtk.Action ReactionStatusAction;
 
	
 
	private global::Gtk.Action ViewAction;
 
	
 
	private global::Gtk.RadioAction CaptureAction;
 
	
 
	private global::Gtk.RadioAction SimulatorAction;
 
	
 
	private global::Gtk.RadioAction RecipeGeneratorAction;
 
	
 
	private global::Gtk.Action RecipesAction;
 
	
 
	private global::Gtk.Action ReactionStatusAction;
 
	private global::Gtk.Action ExportRecipesAction;
 
	
 
	private global::Gtk.Action CopyRecipesToClipboardAction;
 
	
 
	private global::Gtk.Action ProfileAction;
 
	
 
	private global::Gtk.Action IngredientsAction;
 
	private global::Gtk.Action NewProfileAction;
 
	
 
	private global::Gtk.Action OpenProfileAction;
 
	
 
	private global::Gtk.Action ImportProfileAction;
 
	
 
	private global::Gtk.Action ExportProfileAction;
 
	
 
	private global::Gtk.Action ImportProfileAction;
 
	private global::Gtk.Action ExportForPracticalPaintAction;
 
	
 
	private global::Gtk.VBox vbox1;
 
	
 
	private global::Gtk.MenuBar menubar1;
 
	
 
	private global::Gtk.HBox hbox1;
 
	
 
	private global::Gtk.Frame frame2;
 
	
 
	private global::Gtk.Alignment GtkAlignment;
 
	
 
	private global::Gtk.VBox vbox3;
 
	
 
	private global::Gtk.HBox hbox6;
 
	
 
	private global::Gtk.Label label4;
 
	
 
	private global::Gtk.ComboBox ingredient1ComboBox;
 
	
 
	private global::Gtk.HBox hbox7;
 
	
 
	private global::Gtk.Label label5;
 
	
 
	private global::Gtk.ComboBox ingredient2ComboBox;
 
	
 
	private global::Gtk.HBox hbox8;
 
	
 
	private global::Gtk.Label label6;
 
	private global::Gtk.MenuBar menu;
 
	
 
	private global::Gtk.ComboBox ingredient3ComboBox;
 
	
 
	private global::Gtk.Label GtkLabel2;
 
	
 
	private global::Gtk.Frame frame3;
 
	
 
	private global::Gtk.Alignment GtkAlignment1;
 
	
 
	private global::Gtk.VBox vbox4;
 
	
 
	private global::DesertPaintLab.PaintSwatch unmodifiedSwatch;
 
	
 
	private global::Gtk.Button captureButton;
 
	
 
	private global::Gtk.Label GtkLabel25;
 
	
 
	private global::Gtk.Frame frame4;
 
	
 
	private global::Gtk.Alignment GtkAlignment2;
 
	
 
	private global::Gtk.VBox vbox5;
 
	
 
	private global::DesertPaintLab.PaintSwatch reactionSwatch;
 
	
 
	private global::Gtk.Button saveButton;
 
	
 
	private global::Gtk.Label GtkLabel26;
 
	private global::Gtk.Alignment contentContainer;
 
	
 
	private global::Gtk.Statusbar statusBar;
 

	
 
	protected virtual void Build ()
 
	{
 
		global::Stetic.Gui.Initialize (this);
 
		// Widget MainWindow
 
		this.UIManager = new global::Gtk.UIManager ();
...
 
@@ -105,299 +63,122 @@ public partial class MainWindow
 
		this.FileAction.ShortLabel = "_File";
 
		w1.Add (this.FileAction, "<Alt>f");
 
		this.HelpAction = new global::Gtk.Action ("HelpAction", "_Help", null, null);
 
		this.HelpAction.ShortLabel = "_Help";
 
		w1.Add (this.HelpAction, "<Alt>a");
 
		this.AboutAction = new global::Gtk.Action ("AboutAction", "_About...", null, null);
 
		this.AboutAction.ShortLabel = "_About...";
 
		w1.Add (this.AboutAction, "<Alt>a");
 
		this.NewProfileAction = new global::Gtk.Action ("NewProfileAction", "_New Profile...", null, null);
 
		this.NewProfileAction.ShortLabel = "_New Profile...";
 
		w1.Add (this.NewProfileAction, "<Alt>n");
 
		this.OpenProfileAction = new global::Gtk.Action ("OpenProfileAction", "_Open Profile...", null, null);
 
		this.OpenProfileAction.ShortLabel = "_Open Profile...";
 
		w1.Add (this.OpenProfileAction, "<Alt>o");
 
		this.ExitAction = new global::Gtk.Action ("ExitAction", "E_xit", null, null);
 
		this.ExitAction.ShortLabel = "E_xit";
 
		w1.Add (this.ExitAction, "<Alt>x");
 
		this.ExportForPracticalPaintAction = new global::Gtk.Action ("ExportForPracticalPaintAction", "Export for _PracticalPaint...", null, null);
 
		this.ExportForPracticalPaintAction.ShortLabel = "Export for _PracticalPaint...";
 
		w1.Add (this.ExportForPracticalPaintAction, null);
 
		this.WindowAction = new global::Gtk.Action ("WindowAction", "_Window", null, null);
 
		this.WindowAction.ShortLabel = "_Window";
 
		w1.Add (this.WindowAction, null);
 
		this.RunSimulatorAction = new global::Gtk.Action ("RunSimulatorAction", "_Run Simulator", null, null);
 
		this.RunSimulatorAction.ShortLabel = "_Run Simulator";
 
		w1.Add (this.RunSimulatorAction, null);
 
		this.DebugAction = new global::Gtk.Action ("DebugAction", "Debug", null, null);
 
		this.DebugAction.ShortLabel = "Debug";
 
		w1.Add (this.DebugAction, null);
 
		this.ScreenshotAction = new global::Gtk.Action ("ScreenshotAction", "Screenshot", null, null);
 
		this.ScreenshotAction.ShortLabel = "Screenshot";
 
		w1.Add (this.ScreenshotAction, null);
 
		this.RecipesAction = new global::Gtk.Action ("RecipesAction", "Recipes", null, null);
 
		this.RecipesAction.ShortLabel = "Recipe Generator";
 
		w1.Add (this.RecipesAction, null);
 
		this.ReactionStatusAction = new global::Gtk.Action ("ReactionStatusAction", "Reaction Status", null, null);
 
		this.ReactionStatusAction.ShortLabel = "Reaction Status";
 
		w1.Add (this.ReactionStatusAction, null);
 
		this.IngredientsAction = new global::Gtk.Action ("IngredientsAction", "Ingredients", null, null);
 
		this.IngredientsAction.ShortLabel = "Ingredients";
 
		w1.Add (this.IngredientsAction, null);
 
		this.ViewAction = new global::Gtk.Action ("ViewAction", "View", null, null);
 
		this.ViewAction.ShortLabel = "View";
 
		w1.Add (this.ViewAction, null);
 
		this.CaptureAction = new global::Gtk.RadioAction ("CaptureAction", "Capture", null, null, 0);
 
		this.CaptureAction.Group = new global::GLib.SList (global::System.IntPtr.Zero);
 
		this.CaptureAction.ShortLabel = "Capture";
 
		w1.Add (this.CaptureAction, null);
 
		this.SimulatorAction = new global::Gtk.RadioAction ("SimulatorAction", "Simulator", null, null, 0);
 
		this.SimulatorAction.Group = this.CaptureAction.Group;
 
		this.SimulatorAction.ShortLabel = "Simulator";
 
		w1.Add (this.SimulatorAction, null);
 
		this.RecipeGeneratorAction = new global::Gtk.RadioAction ("RecipeGeneratorAction", "Recipe Generator", null, null, 0);
 
		this.RecipeGeneratorAction.Group = this.SimulatorAction.Group;
 
		this.RecipeGeneratorAction.ShortLabel = "Recipe Generator";
 
		w1.Add (this.RecipeGeneratorAction, null);
 
		this.RecipesAction = new global::Gtk.Action ("RecipesAction", "Recipes...", null, null);
 
		this.RecipesAction.ShortLabel = "Recipes...";
 
		w1.Add (this.RecipesAction, null);
 
		this.ExportRecipesAction = new global::Gtk.Action ("ExportRecipesAction", "Export Recipes", null, null);
 
		this.ExportRecipesAction.ShortLabel = "Export Recipes";
 
		w1.Add (this.ExportRecipesAction, null);
 
		this.CopyRecipesToClipboardAction = new global::Gtk.Action ("CopyRecipesToClipboardAction", "Copy to Clipboard", null, null);
 
		this.CopyRecipesToClipboardAction.ShortLabel = "Copy to Clipboard";
 
		w1.Add (this.CopyRecipesToClipboardAction, null);
 
		this.ProfileAction = new global::Gtk.Action ("ProfileAction", "Profile...", null, null);
 
		this.ProfileAction.ShortLabel = "Profile...";
 
		w1.Add (this.ProfileAction, null);
 
		this.NewProfileAction = new global::Gtk.Action ("NewProfileAction", "New Profile", null, null);
 
		this.NewProfileAction.ShortLabel = "New Profile";
 
		w1.Add (this.NewProfileAction, null);
 
		this.OpenProfileAction = new global::Gtk.Action ("OpenProfileAction", "Open Profile", null, null);
 
		this.OpenProfileAction.ShortLabel = "Open Profile";
 
		w1.Add (this.OpenProfileAction, null);
 
		this.ImportProfileAction = new global::Gtk.Action ("ImportProfileAction", "Import Profile", null, null);
 
		this.ImportProfileAction.ShortLabel = "Import Profile";
 
		w1.Add (this.ImportProfileAction, null);
 
		this.ExportProfileAction = new global::Gtk.Action ("ExportProfileAction", "Export Profile", null, null);
 
		this.ExportProfileAction.ShortLabel = "Export Profile";
 
		w1.Add (this.ExportProfileAction, null);
 
		this.ImportProfileAction = new global::Gtk.Action ("ImportProfileAction", "Import Profile", null, null);
 
		this.ImportProfileAction.ShortLabel = "Import Profile";
 
		w1.Add (this.ImportProfileAction, null);
 
		this.ExportForPracticalPaintAction = new global::Gtk.Action ("ExportForPracticalPaintAction", "Export for PracticalPaint", null, null);
 
		this.ExportForPracticalPaintAction.ShortLabel = "Export for PracticalPaint";
 
		w1.Add (this.ExportForPracticalPaintAction, null);
 
		this.UIManager.InsertActionGroup (w1, 0);
 
		this.AddAccelGroup (this.UIManager.AccelGroup);
 
		this.Name = "MainWindow";
 
		this.Title = "Desert Paint Lab";
 
		this.WindowPosition = ((global::Gtk.WindowPosition)(4));
 
		// Container child MainWindow.Gtk.Container+ContainerChild
 
		this.vbox1 = new global::Gtk.VBox ();
 
		this.vbox1.Name = "vbox1";
 
		// Container child vbox1.Gtk.Box+BoxChild
 
		this.UIManager.AddUiFromString ("<ui><menubar name='menubar1'><menu name='FileAction' action='FileAction'><menuitem name='NewProfileAction' action='NewProfileAction'/><menuitem name='OpenProfileAction' action='OpenProfileAction'/><menuitem name='ExportForPracticalPaintAction' action='ExportForPracticalPaintAction'/><menuitem name='ExportProfileAction' action='ExportProfileAction'/><menuitem name='ImportProfileAction' action='ImportProfileAction'/><separator/><menuitem name='ExitAction' action='ExitAction'/></menu><menu name='WindowAction' action='WindowAction'><menuitem name='RunSimulatorAction' action='RunSimulatorAction'/><menuitem name='RecipesAction' action='RecipesAction'/><menuitem name='IngredientsAction' action='IngredientsAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='AboutAction' action='AboutAction'/><menuitem name='ReactionStatusAction' action='ReactionStatusAction'/></menu><menu name='DebugAction' action='DebugAction'><menuitem name='ScreenshotAction' action='ScreenshotAction'/></menu></menubar></ui>");
 
		this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menubar1")));
 
		this.menubar1.Name = "menubar1";
 
		this.vbox1.Add (this.menubar1);
 
		global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.menubar1]));
 
		this.UIManager.AddUiFromString ("<ui><menubar name='menu'><menu name='FileAction' action='FileAction'><menu name='ProfileAction' action='ProfileAction'><menuitem name='NewProfileAction' action='NewProfileAction'/><menuitem name='OpenProfileAction' action='OpenProfileAction'/><menuitem name='ImportProfileAction' action='ImportProfileAction'/><menuitem name='ExportProfileAction' action='ExportProfileAction'/><menuitem name='ExportForPracticalPaintAction' action='ExportForPracticalPaintAction'/></menu><menu name='RecipesAction' action='RecipesAction'><menuitem name='ExportRecipesAction' action='ExportRecipesAction'/><menuitem name='CopyRecipesToClipboardAction' action='CopyRecipesToClipboardAction'/></menu><separator/><menuitem name='ExitAction' action='ExitAction'/></menu><menu name='ViewAction' action='ViewAction'><menuitem name='CaptureAction' action='CaptureAction'/><menuitem name='SimulatorAction' action='SimulatorAction'/><menuitem name='RecipeGeneratorAction' action='RecipeGeneratorAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='AboutAction' action='AboutAction'/><menuitem name='ReactionStatusAction' action='ReactionStatusAction'/></menu><menu name='DebugAction' action='DebugAction'><menuitem name='ScreenshotAction' action='ScreenshotAction'/></menu></menubar></ui>");
 
		this.menu = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menu")));
 
		this.menu.Name = "menu";
 
		this.vbox1.Add (this.menu);
 
		global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.menu]));
 
		w2.Position = 0;
 
		w2.Expand = false;
 
		w2.Fill = false;
 
		// Container child vbox1.Gtk.Box+BoxChild
 
		this.hbox1 = new global::Gtk.HBox ();
 
		this.hbox1.Name = "hbox1";
 
		this.hbox1.Spacing = 6;
 
		this.hbox1.BorderWidth = ((uint)(4));
 
		// Container child hbox1.Gtk.Box+BoxChild
 
		this.frame2 = new global::Gtk.Frame ();
 
		this.frame2.Name = "frame2";
 
		this.frame2.BorderWidth = ((uint)(4));
 
		// Container child frame2.Gtk.Container+ContainerChild
 
		this.GtkAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
 
		this.GtkAlignment.Name = "GtkAlignment";
 
		this.GtkAlignment.LeftPadding = ((uint)(6));
 
		this.GtkAlignment.RightPadding = ((uint)(6));
 
		// Container child GtkAlignment.Gtk.Container+ContainerChild
 
		this.vbox3 = new global::Gtk.VBox ();
 
		this.vbox3.Name = "vbox3";
 
		this.vbox3.Homogeneous = true;
 
		this.vbox3.Spacing = 6;
 
		// Container child vbox3.Gtk.Box+BoxChild
 
		this.hbox6 = new global::Gtk.HBox ();
 
		this.hbox6.Name = "hbox6";
 
		this.hbox6.Spacing = 6;
 
		// Container child hbox6.Gtk.Box+BoxChild
 
		this.label4 = new global::Gtk.Label ();
 
		this.label4.Name = "label4";
 
		this.label4.LabelProp = "Ingredient 1:";
 
		this.hbox6.Add (this.label4);
 
		global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox6 [this.label4]));
 
		w3.Position = 0;
 
		w3.Expand = false;
 
		w3.Fill = false;
 
		// Container child hbox6.Gtk.Box+BoxChild
 
		this.ingredient1ComboBox = global::Gtk.ComboBox.NewText ();
 
		this.ingredient1ComboBox.Name = "ingredient1ComboBox";
 
		this.hbox6.Add (this.ingredient1ComboBox);
 
		global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox6 [this.ingredient1ComboBox]));
 
		w4.Position = 1;
 
		this.vbox3.Add (this.hbox6);
 
		global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox6]));
 
		w5.Position = 0;
 
		w5.Expand = false;
 
		w5.Fill = false;
 
		// Container child vbox3.Gtk.Box+BoxChild
 
		this.hbox7 = new global::Gtk.HBox ();
 
		this.hbox7.Name = "hbox7";
 
		this.hbox7.Spacing = 6;
 
		// Container child hbox7.Gtk.Box+BoxChild
 
		this.label5 = new global::Gtk.Label ();
 
		this.label5.Name = "label5";
 
		this.label5.LabelProp = "Ingredient 2:";
 
		this.hbox7.Add (this.label5);
 
		global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.label5]));
 
		w6.Position = 0;
 
		w6.Expand = false;
 
		w6.Fill = false;
 
		// Container child hbox7.Gtk.Box+BoxChild
 
		this.ingredient2ComboBox = global::Gtk.ComboBox.NewText ();
 
		this.ingredient2ComboBox.Name = "ingredient2ComboBox";
 
		this.hbox7.Add (this.ingredient2ComboBox);
 
		global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.ingredient2ComboBox]));
 
		w7.Position = 1;
 
		this.vbox3.Add (this.hbox7);
 
		global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox7]));
 
		w8.Position = 1;
 
		w8.Expand = false;
 
		w8.Fill = false;
 
		// Container child vbox3.Gtk.Box+BoxChild
 
		this.hbox8 = new global::Gtk.HBox ();
 
		this.hbox8.Name = "hbox8";
 
		this.hbox8.Spacing = 6;
 
		// Container child hbox8.Gtk.Box+BoxChild
 
		this.label6 = new global::Gtk.Label ();
 
		this.label6.Name = "label6";
 
		this.label6.LabelProp = "Ingredient 3:";
 
		this.hbox8.Add (this.label6);
 
		global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox8 [this.label6]));
 
		w9.Position = 0;
 
		w9.Expand = false;
 
		w9.Fill = false;
 
		// Container child hbox8.Gtk.Box+BoxChild
 
		this.ingredient3ComboBox = global::Gtk.ComboBox.NewText ();
 
		this.ingredient3ComboBox.Name = "ingredient3ComboBox";
 
		this.hbox8.Add (this.ingredient3ComboBox);
 
		global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox8 [this.ingredient3ComboBox]));
 
		w10.Position = 1;
 
		this.vbox3.Add (this.hbox8);
 
		global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox8]));
 
		w11.Position = 2;
 
		w11.Expand = false;
 
		w11.Fill = false;
 
		this.GtkAlignment.Add (this.vbox3);
 
		this.frame2.Add (this.GtkAlignment);
 
		this.GtkLabel2 = new global::Gtk.Label ();
 
		this.GtkLabel2.Name = "GtkLabel2";
 
		this.GtkLabel2.LabelProp = "<b>Select Ingredients</b>";
 
		this.GtkLabel2.UseMarkup = true;
 
		this.frame2.LabelWidget = this.GtkLabel2;
 
		this.hbox1.Add (this.frame2);
 
		global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.frame2]));
 
		w14.Position = 0;
 
		// Container child hbox1.Gtk.Box+BoxChild
 
		this.frame3 = new global::Gtk.Frame ();
 
		this.frame3.Name = "frame3";
 
		this.frame3.BorderWidth = ((uint)(4));
 
		// Container child frame3.Gtk.Container+ContainerChild
 
		this.GtkAlignment1 = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
 
		this.GtkAlignment1.Name = "GtkAlignment1";
 
		this.GtkAlignment1.LeftPadding = ((uint)(5));
 
		this.GtkAlignment1.TopPadding = ((uint)(5));
 
		this.GtkAlignment1.RightPadding = ((uint)(5));
 
		this.GtkAlignment1.BottomPadding = ((uint)(6));
 
		// Container child GtkAlignment1.Gtk.Container+ContainerChild
 
		this.vbox4 = new global::Gtk.VBox ();
 
		this.vbox4.WidthRequest = 120;
 
		this.vbox4.Name = "vbox4";
 
		this.vbox4.Spacing = 6;
 
		// Container child vbox4.Gtk.Box+BoxChild
 
		this.unmodifiedSwatch = new global::DesertPaintLab.PaintSwatch ();
 
		this.unmodifiedSwatch.Events = ((global::Gdk.EventMask)(256));
 
		this.unmodifiedSwatch.Name = "unmodifiedSwatch";
 
		this.vbox4.Add (this.unmodifiedSwatch);
 
		global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.unmodifiedSwatch]));
 
		w15.Position = 0;
 
		// Container child vbox4.Gtk.Box+BoxChild
 
		this.captureButton = new global::Gtk.Button ();
 
		this.captureButton.WidthRequest = 100;
 
		this.captureButton.CanFocus = true;
 
		this.captureButton.Name = "captureButton";
 
		this.captureButton.UseUnderline = true;
 
		this.captureButton.Label = "Capture";
 
		this.vbox4.Add (this.captureButton);
 
		global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.captureButton]));
 
		w16.Position = 1;
 
		w16.Expand = false;
 
		w16.Fill = false;
 
		this.GtkAlignment1.Add (this.vbox4);
 
		this.frame3.Add (this.GtkAlignment1);
 
		this.GtkLabel25 = new global::Gtk.Label ();
 
		this.GtkLabel25.Name = "GtkLabel25";
 
		this.GtkLabel25.LabelProp = "<b>Unmodified</b>";
 
		this.GtkLabel25.UseMarkup = true;
 
		this.frame3.LabelWidget = this.GtkLabel25;
 
		this.hbox1.Add (this.frame3);
 
		global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.frame3]));
 
		w19.Position = 1;
 
		w19.Expand = false;
 
		w19.Fill = false;
 
		// Container child hbox1.Gtk.Box+BoxChild
 
		this.frame4 = new global::Gtk.Frame ();
 
		this.frame4.Name = "frame4";
 
		this.frame4.BorderWidth = ((uint)(4));
 
		// Container child frame4.Gtk.Container+ContainerChild
 
		this.GtkAlignment2 = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
 
		this.GtkAlignment2.WidthRequest = 130;
 
		this.GtkAlignment2.Name = "GtkAlignment2";
 
		this.GtkAlignment2.LeftPadding = ((uint)(5));
 
		this.GtkAlignment2.TopPadding = ((uint)(5));
 
		this.GtkAlignment2.RightPadding = ((uint)(5));
 
		this.GtkAlignment2.BottomPadding = ((uint)(6));
 
		// Container child GtkAlignment2.Gtk.Container+ContainerChild
 
		this.vbox5 = new global::Gtk.VBox ();
 
		this.vbox5.WidthRequest = 120;
 
		this.vbox5.Name = "vbox5";
 
		this.vbox5.Spacing = 6;
 
		// Container child vbox5.Gtk.Box+BoxChild
 
		this.reactionSwatch = new global::DesertPaintLab.PaintSwatch ();
 
		this.reactionSwatch.Events = ((global::Gdk.EventMask)(256));
 
		this.reactionSwatch.Name = "reactionSwatch";
 
		this.vbox5.Add (this.reactionSwatch);
 
		global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.reactionSwatch]));
 
		w20.Position = 0;
 
		// Container child vbox5.Gtk.Box+BoxChild
 
		this.saveButton = new global::Gtk.Button ();
 
		this.saveButton.WidthRequest = 100;
 
		this.saveButton.CanFocus = true;
 
		this.saveButton.Name = "saveButton";
 
		this.saveButton.UseUnderline = true;
 
		this.saveButton.Label = "Record";
 
		this.vbox5.Add (this.saveButton);
 
		global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.saveButton]));
 
		w21.Position = 1;
 
		w21.Expand = false;
 
		w21.Fill = false;
 
		this.GtkAlignment2.Add (this.vbox5);
 
		this.frame4.Add (this.GtkAlignment2);
 
		this.GtkLabel26 = new global::Gtk.Label ();
 
		this.GtkLabel26.Name = "GtkLabel26";
 
		this.GtkLabel26.LabelProp = "<b>Reaction</b>";
 
		this.GtkLabel26.UseMarkup = true;
 
		this.frame4.LabelWidget = this.GtkLabel26;
 
		this.hbox1.Add (this.frame4);
 
		global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.frame4]));
 
		w24.Position = 2;
 
		w24.Expand = false;
 
		w24.Fill = false;
 
		this.vbox1.Add (this.hbox1);
 
		global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));
 
		w25.Position = 1;
 
		this.contentContainer = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
 
		this.contentContainer.Name = "contentContainer";
 
		this.contentContainer.LeftPadding = ((uint)(8));
 
		this.contentContainer.TopPadding = ((uint)(6));
 
		this.contentContainer.RightPadding = ((uint)(8));
 
		this.contentContainer.BottomPadding = ((uint)(5));
 
		this.vbox1.Add (this.contentContainer);
 
		global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.contentContainer]));
 
		w3.Position = 1;
 
		// Container child vbox1.Gtk.Box+BoxChild
 
		this.statusBar = new global::Gtk.Statusbar ();
 
		this.statusBar.Name = "statusBar";
 
		this.statusBar.Spacing = 6;
 
		this.vbox1.Add (this.statusBar);
 
		global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.statusBar]));
 
		w26.Position = 2;
 
		w26.Expand = false;
 
		w26.Fill = false;
 
		global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.statusBar]));
 
		w4.Position = 2;
 
		w4.Expand = false;
 
		w4.Fill = false;
 
		this.Add (this.vbox1);
 
		if ((this.Child != null)) {
 
			this.Child.ShowAll ();
 
		}
 
		this.DefaultWidth = 629;
 
		this.DefaultHeight = 265;
 
		this.DefaultWidth = 732;
 
		this.DefaultHeight = 384;
 
		this.Show ();
 
		this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent);
 
		this.AboutAction.Activated += new global::System.EventHandler (this.OnAbout);
 
		this.ExitAction.Activated += new global::System.EventHandler (this.OnMenuExit);
 
		this.ScreenshotAction.Activated += new global::System.EventHandler (this.OnDebugScreenshot);
 
		this.ReactionStatusAction.Activated += new global::System.EventHandler (this.OnShowReactionStatus);
 
		this.CaptureAction.Toggled += new global::System.EventHandler (this.OnSelectCaptureView);
 
		this.SimulatorAction.Toggled += new global::System.EventHandler (this.OnSelectSimulatorView);
 
		this.RecipeGeneratorAction.Toggled += new global::System.EventHandler (this.OnSelectRecipeGeneratorView);
 
		this.ExportRecipesAction.Activated += new global::System.EventHandler (this.OnExportRecipeListToWiki);
 
		this.CopyRecipesToClipboardAction.Activated += new global::System.EventHandler (this.OnCopyRecipeListToClipboard);
 
		this.NewProfileAction.Activated += new global::System.EventHandler (this.OnNewProfile);
 
		this.OpenProfileAction.Activated += new global::System.EventHandler (this.OnOpenProfile);
 
		this.ExitAction.Activated += new global::System.EventHandler (this.OnMenuExit);
 
		this.ExportForPracticalPaintAction.Activated += new global::System.EventHandler (this.OnExport);
 
		this.RunSimulatorAction.Activated += new global::System.EventHandler (this.RunSimulator);
 
		this.ScreenshotAction.Activated += new global::System.EventHandler (this.OnDebugScreenshot);
 
		this.RecipesAction.Activated += new global::System.EventHandler (this.OnOpenRecipeGenerator);
 
		this.ReactionStatusAction.Activated += new global::System.EventHandler (this.OnShowReactionStatus);
 
		this.IngredientsAction.Activated += new global::System.EventHandler (this.OnShowIngredients);
 
		this.ImportProfileAction.Activated += new global::System.EventHandler (this.OnImportProfile);
 
		this.ExportProfileAction.Activated += new global::System.EventHandler (this.OnExportProfile);
 
		this.ImportProfileAction.Activated += new global::System.EventHandler (this.OnImportProfile);
 
		this.ingredient1ComboBox.Changed += new global::System.EventHandler (this.OnChangedIngredient1);
 
		this.ingredient2ComboBox.Changed += new global::System.EventHandler (this.OnChangedIngredient2);
 
		this.ingredient3ComboBox.Changed += new global::System.EventHandler (this.OnChangedIngredient3);
 
		this.captureButton.Clicked += new global::System.EventHandler (this.OnCaptureButton);
 
		this.saveButton.Clicked += new global::System.EventHandler (this.OnSaveButton);
 
		this.ExportForPracticalPaintAction.Activated += new global::System.EventHandler (this.OnExportToPracticalPaint);
 
	}
 
}
gtk-gui/gui.stetic
Show inline comments
...
 
@@ -3,17 +3,17 @@
 
  <configuration>
 
    <images-root-path>..</images-root-path>
 
    <target-gtk-version>2.12</target-gtk-version>
 
  </configuration>
 
  <import>
 
    <widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
 
    <widget-library name="../bin/Debug/DesertPaintLab.exe" internal="true" />
 
  </import>
 
  <widget class="Gtk.Window" id="MainWindow" design-size="629 265">
 
  <widget class="Gtk.Window" id="MainWindow" design-size="732 384">
 
    <action-group name="Default">
 
      <action id="FileAction">
 
        <property name="Type">Action</property>
 
        <property name="Accelerator">&lt;Alt&gt;f</property>
 
        <property name="Label" translatable="yes">_File</property>
 
        <property name="ShortLabel" translatable="yes">_File</property>
 
      </action>
 
      <action id="HelpAction">
...
 
@@ -24,120 +24,158 @@
 
      </action>
 
      <action id="AboutAction">
 
        <property name="Type">Action</property>
 
        <property name="Accelerator">&lt;Alt&gt;a</property>
 
        <property name="Label" translatable="yes">_About...</property>
 
        <property name="ShortLabel" translatable="yes">_About...</property>
 
        <signal name="Activated" handler="OnAbout" />
 
      </action>
 
      <action id="NewProfileAction">
 
        <property name="Type">Action</property>
 
        <property name="Accelerator">&lt;Alt&gt;n</property>
 
        <property name="Label" translatable="yes">_New Profile...</property>
 
        <property name="ShortLabel" translatable="yes">_New Profile...</property>
 
        <signal name="Activated" handler="OnNewProfile" />
 
      </action>
 
      <action id="OpenProfileAction">
 
        <property name="Type">Action</property>
 
        <property name="Accelerator">&lt;Alt&gt;o</property>
 
        <property name="Label" translatable="yes">_Open Profile...</property>
 
        <property name="ShortLabel" translatable="yes">_Open Profile...</property>
 
        <signal name="Activated" handler="OnOpenProfile" />
 
      </action>
 
      <action id="ExitAction">
 
        <property name="Type">Action</property>
 
        <property name="Accelerator">&lt;Alt&gt;x</property>
 
        <property name="Label" translatable="yes">E_xit</property>
 
        <property name="ShortLabel" translatable="yes">E_xit</property>
 
        <signal name="Activated" handler="OnMenuExit" />
 
      </action>
 
      <action id="ExportForPracticalPaintAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Export for _PracticalPaint...</property>
 
        <property name="ShortLabel" translatable="yes">Export for _PracticalPaint...</property>
 
        <signal name="Activated" handler="OnExport" />
 
      </action>
 
      <action id="WindowAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">_Window</property>
 
        <property name="ShortLabel" translatable="yes">_Window</property>
 
      </action>
 
      <action id="RunSimulatorAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">_Run Simulator</property>
 
        <property name="ShortLabel" translatable="yes">_Run Simulator</property>
 
        <signal name="Activated" handler="RunSimulator" />
 
      </action>
 
      <action id="DebugAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Debug</property>
 
        <property name="ShortLabel" translatable="yes">Debug</property>
 
      </action>
 
      <action id="ScreenshotAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Screenshot</property>
 
        <property name="ShortLabel" translatable="yes">Screenshot</property>
 
        <signal name="Activated" handler="OnDebugScreenshot" />
 
      </action>
 
      <action id="RecipesAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Recipes</property>
 
        <property name="ShortLabel" translatable="yes">Recipe Generator</property>
 
        <signal name="Activated" handler="OnOpenRecipeGenerator" />
 
      </action>
 
      <action id="ReactionStatusAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Reaction Status</property>
 
        <property name="ShortLabel" translatable="yes">Reaction Status</property>
 
        <signal name="Activated" handler="OnShowReactionStatus" />
 
      </action>
 
      <action id="IngredientsAction">
 
      <action id="ViewAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">View</property>
 
        <property name="ShortLabel" translatable="yes">View</property>
 
      </action>
 
      <action id="CaptureAction">
 
        <property name="Type">Radio</property>
 
        <property name="Label" translatable="yes">Capture</property>
 
        <property name="ShortLabel" translatable="yes">Capture</property>
 
        <property name="DrawAsRadio">False</property>
 
        <property name="Active">True</property>
 
        <property name="Value">0</property>
 
        <property name="Group">viewGroup</property>
 
        <signal name="Toggled" handler="OnSelectCaptureView" />
 
      </action>
 
      <action id="SimulatorAction">
 
        <property name="Type">Radio</property>
 
        <property name="Label" translatable="yes">Simulator</property>
 
        <property name="ShortLabel" translatable="yes">Simulator</property>
 
        <property name="DrawAsRadio">False</property>
 
        <property name="Active">False</property>
 
        <property name="Value">0</property>
 
        <property name="Group">viewGroup</property>
 
        <signal name="Toggled" handler="OnSelectSimulatorView" />
 
      </action>
 
      <action id="RecipeGeneratorAction">
 
        <property name="Type">Radio</property>
 
        <property name="Label" translatable="yes">Recipe Generator</property>
 
        <property name="ShortLabel" translatable="yes">Recipe Generator</property>
 
        <property name="DrawAsRadio">False</property>
 
        <property name="Active">False</property>
 
        <property name="Value">0</property>
 
        <property name="Group">viewGroup</property>
 
        <signal name="Toggled" handler="OnSelectRecipeGeneratorView" />
 
      </action>
 
      <action id="RecipesAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Ingredients</property>
 
        <property name="ShortLabel" translatable="yes">Ingredients</property>
 
        <signal name="Activated" handler="OnShowIngredients" />
 
        <property name="Label" translatable="yes">Recipes...</property>
 
        <property name="ShortLabel" translatable="yes">Recipes...</property>
 
      </action>
 
      <action id="ExportRecipesAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Export Recipes</property>
 
        <property name="ShortLabel" translatable="yes">Export Recipes</property>
 
        <signal name="Activated" handler="OnExportRecipeListToWiki" />
 
      </action>
 
      <action id="CopyRecipesToClipboardAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Copy to Clipboard</property>
 
        <property name="ShortLabel" translatable="yes">Copy to Clipboard</property>
 
        <signal name="Activated" handler="OnCopyRecipeListToClipboard" />
 
      </action>
 
      <action id="ProfileAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Profile...</property>
 
        <property name="ShortLabel" translatable="yes">Profile...</property>
 
      </action>
 
      <action id="NewProfileAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">New Profile</property>
 
        <property name="ShortLabel" translatable="yes">New Profile</property>
 
        <signal name="Activated" handler="OnNewProfile" />
 
      </action>
 
      <action id="OpenProfileAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Open Profile</property>
 
        <property name="ShortLabel" translatable="yes">Open Profile</property>
 
        <signal name="Activated" handler="OnOpenProfile" />
 
      </action>
 
      <action id="ImportProfileAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Import Profile</property>
 
        <property name="ShortLabel" translatable="yes">Import Profile</property>
 
        <signal name="Activated" handler="OnImportProfile" />
 
      </action>
 
      <action id="ExportProfileAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Export Profile</property>
 
        <property name="ShortLabel" translatable="yes">Export Profile</property>
 
        <signal name="Activated" handler="OnExportProfile" />
 
      </action>
 
      <action id="ImportProfileAction">
 
      <action id="ExportForPracticalPaintAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Import Profile</property>
 
        <property name="ShortLabel" translatable="yes">Import Profile</property>
 
        <signal name="Activated" handler="OnImportProfile" />
 
        <property name="Label" translatable="yes">Export for PracticalPaint</property>
 
        <property name="ShortLabel" translatable="yes">Export for PracticalPaint</property>
 
        <signal name="Activated" handler="OnExportToPracticalPaint" />
 
      </action>
 
    </action-group>
 
    <property name="MemberName" />
 
    <property name="Title" translatable="yes">Desert Paint Lab</property>
 
    <property name="WindowPosition">CenterOnParent</property>
 
    <signal name="DeleteEvent" handler="OnDeleteEvent" />
 
    <child>
 
      <widget class="Gtk.VBox" id="vbox1">
 
        <property name="MemberName" />
 
        <child>
 
          <widget class="Gtk.MenuBar" id="menubar1">
 
          <widget class="Gtk.MenuBar" id="menu">
 
            <property name="MemberName" />
 
            <node name="menubar1" type="Menubar">
 
            <node name="menu" type="Menubar">
 
              <node type="Menu" action="FileAction">
 
                <node type="Menu" action="ProfileAction">
 
                <node type="Menuitem" action="NewProfileAction" />
 
                <node type="Menuitem" action="OpenProfileAction" />
 
                <node type="Menuitem" action="ExportForPracticalPaintAction" />
 
                  <node type="Menuitem" action="ImportProfileAction" />
 
                <node type="Menuitem" action="ExportProfileAction" />
 
                <node type="Menuitem" action="ImportProfileAction" />
 
                  <node type="Menuitem" action="ExportForPracticalPaintAction" />
 
                </node>
 
                <node type="Menu" action="RecipesAction">
 
                  <node type="Menuitem" action="ExportRecipesAction" />
 
                  <node type="Menuitem" action="CopyRecipesToClipboardAction" />
 
                </node>
 
                <node type="Separator" />
 
                <node type="Menuitem" action="ExitAction" />
 
              </node>
 
              <node type="Menu" action="WindowAction">
 
                <node type="Menuitem" action="RunSimulatorAction" />
 
                <node type="Menuitem" action="RecipesAction" />
 
                <node type="Menuitem" action="IngredientsAction" />
 
              <node type="Menu" action="ViewAction">
 
                <node type="Menuitem" action="CaptureAction" />
 
                <node type="Menuitem" action="SimulatorAction" />
 
                <node type="Menuitem" action="RecipeGeneratorAction" />
 
              </node>
 
              <node type="Menu" action="HelpAction">
 
                <node type="Menuitem" action="AboutAction" />
 
                <node type="Menuitem" action="ReactionStatusAction" />
 
              </node>
 
              <node type="Menu" action="DebugAction">
 
                <node type="Menuitem" action="ScreenshotAction" />
 
              </node>
...
 
@@ -146,303 +184,29 @@
 
          <packing>
 
            <property name="Position">0</property>
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.HBox" id="hbox1">
 
            <property name="MemberName" />
 
            <property name="Spacing">6</property>
 
            <property name="BorderWidth">4</property>
 
            <child>
 
              <widget class="Gtk.Frame" id="frame2">
 
                <property name="MemberName" />
 
                <property name="BorderWidth">4</property>
 
                <child>
 
                  <widget class="Gtk.Alignment" id="GtkAlignment">
 
                    <property name="MemberName" />
 
                    <property name="Xalign">0</property>
 
                    <property name="Yalign">0</property>
 
                    <property name="LeftPadding">6</property>
 
                    <property name="RightPadding">6</property>
 
                    <child>
 
                      <widget class="Gtk.VBox" id="vbox3">
 
                        <property name="MemberName" />
 
                        <property name="Homogeneous">True</property>
 
                        <property name="Spacing">6</property>
 
                        <child>
 
                          <widget class="Gtk.HBox" id="hbox6">
 
                            <property name="MemberName" />
 
                            <property name="Spacing">6</property>
 
                            <child>
 
                              <widget class="Gtk.Label" id="label4">
 
                                <property name="MemberName" />
 
                                <property name="LabelProp" translatable="yes">Ingredient 1:</property>
 
                              </widget>
 
                              <packing>
 
                                <property name="Position">0</property>
 
                                <property name="AutoSize">True</property>
 
                                <property name="Expand">False</property>
 
                                <property name="Fill">False</property>
 
                              </packing>
 
                            </child>
 
                            <child>
 
                              <widget class="Gtk.ComboBox" id="ingredient1ComboBox">
 
          <widget class="Gtk.Alignment" id="contentContainer">
 
                                <property name="MemberName" />
 
                                <property name="IsTextCombo">True</property>
 
                                <property name="Items" translatable="yes" />
 
                                <signal name="Changed" handler="OnChangedIngredient1" />
 
                              </widget>
 
                              <packing>
 
                                <property name="Position">1</property>
 
                                <property name="AutoSize">False</property>
 
                              </packing>
 
                            </child>
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">0</property>
 
                            <property name="AutoSize">True</property>
 
                            <property name="Expand">False</property>
 
                            <property name="Fill">False</property>
 
                          </packing>
 
                        </child>
 
                        <child>
 
                          <widget class="Gtk.HBox" id="hbox7">
 
                            <property name="MemberName" />
 
                            <property name="Spacing">6</property>
 
            <property name="LeftPadding">8</property>
 
            <property name="TopPadding">6</property>
 
            <property name="RightPadding">8</property>
 
            <property name="BottomPadding">5</property>
 
                            <child>
 
                              <widget class="Gtk.Label" id="label5">
 
                                <property name="MemberName" />
 
                                <property name="LabelProp" translatable="yes">Ingredient 2:</property>
 
                              </widget>
 
                              <packing>
 
                                <property name="Position">0</property>
 
                                <property name="AutoSize">True</property>
 
                                <property name="Expand">False</property>
 
                                <property name="Fill">False</property>
 
                              </packing>
 
                            </child>
 
                            <child>
 
                              <widget class="Gtk.ComboBox" id="ingredient2ComboBox">
 
                                <property name="MemberName" />
 
                                <property name="IsTextCombo">True</property>
 
                                <property name="Items" translatable="yes" />
 
                                <signal name="Changed" handler="OnChangedIngredient2" />
 
                              </widget>
 
                              <packing>
 
                                <property name="Position">1</property>
 
                                <property name="AutoSize">False</property>
 
                              </packing>
 
              <placeholder />
 
                            </child>
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">1</property>
 
                            <property name="AutoSize">True</property>
 
                            <property name="Expand">False</property>
 
                            <property name="Fill">False</property>
 
                          </packing>
 
                        </child>
 
                        <child>
 
                          <widget class="Gtk.HBox" id="hbox8">
 
                            <property name="MemberName" />
 
                            <property name="Spacing">6</property>
 
                            <child>
 
                              <widget class="Gtk.Label" id="label6">
 
                                <property name="MemberName" />
 
                                <property name="LabelProp" translatable="yes">Ingredient 3:</property>
 
                              </widget>
 
                              <packing>
 
                                <property name="Position">0</property>
 
                                <property name="AutoSize">True</property>
 
                                <property name="Expand">False</property>
 
                                <property name="Fill">False</property>
 
                              </packing>
 
                            </child>
 
                            <child>
 
                              <widget class="Gtk.ComboBox" id="ingredient3ComboBox">
 
                                <property name="MemberName" />
 
                                <property name="IsTextCombo">True</property>
 
                                <property name="Items" translatable="yes" />
 
                                <signal name="Changed" handler="OnChangedIngredient3" />
 
                              </widget>
 
                              <packing>
 
                                <property name="Position">1</property>
 
                                <property name="AutoSize">False</property>
 
                              </packing>
 
                            </child>
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">2</property>
 
                            <property name="AutoSize">True</property>
 
                            <property name="Expand">False</property>
 
                            <property name="Fill">False</property>
 
                          </packing>
 
                        </child>
 
                      </widget>
 
                    </child>
 
                  </widget>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Label" id="GtkLabel2">
 
                    <property name="MemberName" />
 
                    <property name="LabelProp" translatable="yes">&lt;b&gt;Select Ingredients&lt;/b&gt;</property>
 
                    <property name="UseMarkup">True</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="type">label_item</property>
 
                  </packing>
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">0</property>
 
                <property name="AutoSize">False</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Frame" id="frame3">
 
                <property name="MemberName" />
 
                <property name="BorderWidth">4</property>
 
                <child>
 
                  <widget class="Gtk.Alignment" id="GtkAlignment1">
 
                    <property name="MemberName" />
 
                    <property name="Xalign">0</property>
 
                    <property name="Yalign">0</property>
 
                    <property name="LeftPadding">5</property>
 
                    <property name="TopPadding">5</property>
 
                    <property name="RightPadding">5</property>
 
                    <property name="BottomPadding">6</property>
 
                    <child>
 
                      <widget class="Gtk.VBox" id="vbox4">
 
                        <property name="MemberName" />
 
                        <property name="WidthRequest">120</property>
 
                        <property name="Spacing">6</property>
 
                        <child>
 
                          <widget class="DesertPaintLab.PaintSwatch" id="unmodifiedSwatch">
 
                            <property name="MemberName" />
 
                            <property name="Events">ButtonPressMask</property>
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">0</property>
 
                            <property name="AutoSize">True</property>
 
                          </packing>
 
                        </child>
 
                        <child>
 
                          <widget class="Gtk.Button" id="captureButton">
 
                            <property name="MemberName" />
 
                            <property name="WidthRequest">100</property>
 
                            <property name="CanFocus">True</property>
 
                            <property name="Type">TextOnly</property>
 
                            <property name="Label" translatable="yes">Capture</property>
 
                            <property name="UseUnderline">True</property>
 
                            <signal name="Clicked" handler="OnCaptureButton" />
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">1</property>
 
                            <property name="AutoSize">True</property>
 
                            <property name="Expand">False</property>
 
                            <property name="Fill">False</property>
 
                          </packing>
 
                        </child>
 
                      </widget>
 
                    </child>
 
                  </widget>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Label" id="GtkLabel25">
 
                    <property name="MemberName" />
 
                    <property name="LabelProp" translatable="yes">&lt;b&gt;Unmodified&lt;/b&gt;</property>
 
                    <property name="UseMarkup">True</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="type">label_item</property>
 
                  </packing>
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">1</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Frame" id="frame4">
 
                <property name="MemberName" />
 
                <property name="BorderWidth">4</property>
 
                <child>
 
                  <widget class="Gtk.Alignment" id="GtkAlignment2">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">130</property>
 
                    <property name="Xalign">0</property>
 
                    <property name="Yalign">0</property>
 
                    <property name="LeftPadding">5</property>
 
                    <property name="TopPadding">5</property>
 
                    <property name="RightPadding">5</property>
 
                    <property name="BottomPadding">6</property>
 
                    <child>
 
                      <widget class="Gtk.VBox" id="vbox5">
 
                        <property name="MemberName" />
 
                        <property name="WidthRequest">120</property>
 
                        <property name="Spacing">6</property>
 
                        <child>
 
                          <widget class="DesertPaintLab.PaintSwatch" id="reactionSwatch">
 
                            <property name="MemberName" />
 
                            <property name="Events">ButtonPressMask</property>
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">0</property>
 
                            <property name="AutoSize">True</property>
 
                          </packing>
 
                        </child>
 
                        <child>
 
                          <widget class="Gtk.Button" id="saveButton">
 
                            <property name="MemberName" />
 
                            <property name="WidthRequest">100</property>
 
                            <property name="CanFocus">True</property>
 
                            <property name="Type">TextOnly</property>
 
                            <property name="Label" translatable="yes">Record</property>
 
                            <property name="UseUnderline">True</property>
 
                            <signal name="Clicked" handler="OnSaveButton" />
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">1</property>
 
                            <property name="AutoSize">True</property>
 
                            <property name="Expand">False</property>
 
                            <property name="Fill">False</property>
 
                          </packing>
 
                        </child>
 
                      </widget>
 
                    </child>
 
                  </widget>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Label" id="GtkLabel26">
 
                    <property name="MemberName" />
 
                    <property name="LabelProp" translatable="yes">&lt;b&gt;Reaction&lt;/b&gt;</property>
 
                    <property name="UseMarkup">True</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="type">label_item</property>
 
                  </packing>
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">2</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">1</property>
 
            <property name="AutoSize">False</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.Statusbar" id="statusBar">
 
            <property name="MemberName" />
 
            <property name="Spacing">6</property>
 
          </widget>
 
          <packing>
...
 
@@ -758,20 +522,1172 @@ You can either import an existing Practi
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
      </widget>
 
    </child>
 
  </widget>
 
  <widget class="Gtk.Window" id="DesertPaintLab.SimulatorWindow" design-size="804 390">
 
  <widget class="Gtk.Dialog" id="DesertPaintLab.ScreenCheckDialog" design-size="378 245">
 
    <property name="MemberName" />
 
    <property name="Title" translatable="yes">Screen Check</property>
 
    <property name="WindowPosition">CenterOnParent</property>
 
    <property name="Modal">True</property>
 
    <property name="BorderWidth">9</property>
 
    <property name="Buttons">1</property>
 
    <property name="HelpButton">False</property>
 
    <child internal-child="VBox">
 
      <widget class="Gtk.VBox" id="dialog1_VBox">
 
        <property name="MemberName" />
 
        <child>
 
          <widget class="Gtk.VBox" id="vbox2">
 
            <property name="MemberName" />
 
            <property name="Spacing">20</property>
 
            <property name="BorderWidth">20</property>
 
            <child>
 
              <widget class="Gtk.HBox" id="hbox1">
 
                <property name="MemberName" />
 
                <property name="Spacing">20</property>
 
                <property name="BorderWidth">10</property>
 
                <child>
 
                  <widget class="Gtk.Label" id="label1">
 
                    <property name="MemberName" />
 
                    <property name="LabelProp" translatable="yes">Screen Resolution</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">0</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Entry" id="screenWidthEntry">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">50</property>
 
                    <property name="CanFocus">True</property>
 
                    <property name="IsEditable">True</property>
 
                    <property name="InvisibleChar">●</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">1</property>
 
                    <property name="AutoSize">True</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Entry" id="screenHeightEntry">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">50</property>
 
                    <property name="CanFocus">True</property>
 
                    <property name="IsEditable">True</property>
 
                    <property name="InvisibleChar">●</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">2</property>
 
                    <property name="AutoSize">True</property>
 
                  </packing>
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">0</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.HBox" id="hbox2">
 
                <property name="MemberName" />
 
                <property name="Spacing">20</property>
 
                <property name="BorderWidth">10</property>
 
                <child>
 
                  <widget class="Gtk.Label" id="label2">
 
                    <property name="MemberName" />
 
                    <property name="LabelProp" translatable="yes">Game Pixel Width in Screen Pixels</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">0</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Entry" id="gamePixelWidthEntry">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">50</property>
 
                    <property name="CanFocus">True</property>
 
                    <property name="IsEditable">True</property>
 
                    <property name="InvisibleChar">●</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">1</property>
 
                    <property name="AutoSize">False</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <placeholder />
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">1</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <placeholder />
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">0</property>
 
            <property name="AutoSize">True</property>
 
          </packing>
 
        </child>
 
      </widget>
 
    </child>
 
    <child internal-child="ActionArea">
 
      <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
 
        <property name="MemberName" />
 
        <property name="Spacing">10</property>
 
        <property name="BorderWidth">5</property>
 
        <property name="Size">1</property>
 
        <property name="LayoutStyle">End</property>
 
        <child>
 
          <widget class="Gtk.Button" id="buttonOk">
 
            <property name="MemberName" />
 
            <property name="CanDefault">True</property>
 
            <property name="CanFocus">True</property>
 
            <property name="UseStock">True</property>
 
            <property name="Type">StockItem</property>
 
            <property name="StockId">gtk-ok</property>
 
            <property name="ResponseId">-5</property>
 
            <property name="label">gtk-ok</property>
 
          </widget>
 
          <packing>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
      </widget>
 
    </child>
 
  </widget>
 
  <widget class="Gtk.Window" id="DesertPaintLab.ReactionStatusWindow" design-size="400 300">
 
    <property name="MemberName" />
 
    <property name="Title" translatable="yes">Reaction Status</property>
 
    <property name="WindowPosition">CenterOnParent</property>
 
    <child>
 
      <widget class="Gtk.ScrolledWindow" id="scroller">
 
        <property name="MemberName" />
 
        <property name="CanFocus">True</property>
 
        <property name="ShadowType">In</property>
 
        <child>
 
          <widget class="Gtk.Viewport" id="GtkViewport">
 
            <property name="MemberName" />
 
            <property name="ShadowType">None</property>
 
            <child>
 
              <widget class="Gtk.VBox" id="resultbox">
 
                <property name="MemberName" />
 
                <property name="Spacing">6</property>
 
                <child>
 
                  <placeholder />
 
                </child>
 
                <child>
 
                  <placeholder />
 
                </child>
 
                <child>
 
                  <placeholder />
 
                </child>
 
              </widget>
 
            </child>
 
          </widget>
 
        </child>
 
      </widget>
 
    </child>
 
  </widget>
 
  <widget class="Gtk.Window" id="DesertPaintLab.ReagentWindow" design-size="400 357">
 
    <property name="MemberName" />
 
    <property name="Title" translatable="yes">ReagentWindow</property>
 
    <property name="WindowPosition">CenterOnParent</property>
 
    <child>
 
      <widget class="Gtk.VBox" id="vbox2">
 
        <property name="MemberName" />
 
        <property name="Spacing">6</property>
 
        <property name="BorderWidth">8</property>
 
        <child>
 
          <widget class="Gtk.Frame" id="frame3">
 
            <property name="MemberName" />
 
            <property name="ShadowType">None</property>
 
            <child>
 
              <widget class="Gtk.Alignment" id="GtkAlignment">
 
                <property name="MemberName" />
 
                <property name="Xalign">0</property>
 
                <property name="Yalign">0</property>
 
                <property name="LeftPadding">12</property>
 
                <child>
 
                  <widget class="Gtk.Table" id="ingredientTable">
 
                    <property name="MemberName" />
 
                    <property name="NRows">3</property>
 
                    <property name="NColumns">3</property>
 
                    <property name="RowSpacing">6</property>
 
                    <property name="ColumnSpacing">6</property>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                  </widget>
 
                </child>
 
              </widget>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Label" id="GtkLabel">
 
                <property name="MemberName" />
 
                <property name="LabelProp" translatable="yes">&lt;b&gt;Ingredients&lt;/b&gt;</property>
 
                <property name="UseMarkup">True</property>
 
              </widget>
 
              <packing>
 
                <property name="type">label_item</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">0</property>
 
            <property name="AutoSize">True</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.HButtonBox" id="hbuttonbox3">
 
            <property name="MemberName" />
 
            <property name="Size">2</property>
 
            <child>
 
              <widget class="Gtk.Button" id="okButton">
 
                <property name="MemberName" />
 
                <property name="WidthRequest">80</property>
 
                <property name="CanFocus">True</property>
 
                <property name="Type">TextOnly</property>
 
                <property name="Label" translatable="yes">Ok</property>
 
                <property name="UseUnderline">True</property>
 
                <signal name="Clicked" handler="OnOK" />
 
              </widget>
 
              <packing>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Button" id="cancelButton">
 
                <property name="MemberName" />
 
                <property name="WidthRequest">80</property>
 
                <property name="CanFocus">True</property>
 
                <property name="Type">TextOnly</property>
 
                <property name="Label" translatable="yes">Cancel</property>
 
                <property name="UseUnderline">True</property>
 
                <signal name="Clicked" handler="OnCancel" />
 
              </widget>
 
              <packing>
 
                <property name="Position">1</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="PackType">End</property>
 
            <property name="Position">1</property>
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
      </widget>
 
    </child>
 
  </widget>
 
  <widget class="Gtk.Bin" id="DesertPaintLab.CaptureView" design-size="646 210">
 
    <property name="MemberName" />
 
    <property name="Visible">False</property>
 
    <child>
 
      <widget class="Gtk.HBox" id="hbox1">
 
        <property name="MemberName" />
 
        <property name="Spacing">6</property>
 
        <child>
 
          <widget class="Gtk.Frame" id="selectIngredientsFrame">
 
            <property name="MemberName" />
 
            <property name="BorderWidth">4</property>
 
            <child>
 
              <widget class="Gtk.Alignment" id="GtkAlignment">
 
                <property name="MemberName" />
 
                <property name="Xalign">0</property>
 
                <property name="Yalign">0</property>
 
                <property name="LeftPadding">6</property>
 
                <property name="RightPadding">6</property>
 
                <child>
 
                  <widget class="Gtk.VBox" id="vbox2">
 
                    <property name="MemberName" />
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="Gtk.HBox" id="hbox2">
 
                        <property name="MemberName" />
 
                        <property name="Spacing">6</property>
 
                        <child>
 
                          <widget class="Gtk.Label" id="ingredient1Label">
 
                            <property name="MemberName" />
 
                            <property name="LabelProp" translatable="yes">Ingredient 1:</property>
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">0</property>
 
                            <property name="AutoSize">True</property>
 
                            <property name="Expand">False</property>
 
                            <property name="Fill">False</property>
 
                          </packing>
 
                        </child>
 
                        <child>
 
                          <widget class="Gtk.ComboBox" id="ingredient1ComboBox">
 
                            <property name="MemberName" />
 
                            <property name="IsTextCombo">True</property>
 
                            <property name="Items" translatable="yes" />
 
                            <signal name="Changed" handler="OnChangedIngredient1" />
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">1</property>
 
                            <property name="AutoSize">False</property>
 
                          </packing>
 
                        </child>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.HBox" id="hbox3">
 
                        <property name="MemberName" />
 
                        <property name="Spacing">6</property>
 
                        <child>
 
                          <widget class="Gtk.Label" id="ingredient2Label">
 
                            <property name="MemberName" />
 
                            <property name="LabelProp" translatable="yes">Ingredient 2:</property>
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">0</property>
 
                            <property name="AutoSize">True</property>
 
                            <property name="Expand">False</property>
 
                            <property name="Fill">False</property>
 
                          </packing>
 
                        </child>
 
                        <child>
 
                          <widget class="Gtk.ComboBox" id="ingredient2ComboBox">
 
                            <property name="MemberName" />
 
                            <property name="IsTextCombo">True</property>
 
                            <property name="Items" translatable="yes" />
 
                            <signal name="Changed" handler="OnChangedIngredient2" />
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">1</property>
 
                            <property name="AutoSize">False</property>
 
                          </packing>
 
                        </child>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.HBox" id="hbox4">
 
                        <property name="MemberName" />
 
                        <property name="Spacing">6</property>
 
                        <child>
 
                          <widget class="Gtk.Label" id="ingredient3Label">
 
                            <property name="MemberName" />
 
                            <property name="LabelProp" translatable="yes">Ingredient 3:</property>
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">0</property>
 
                            <property name="AutoSize">True</property>
 
                            <property name="Expand">False</property>
 
                            <property name="Fill">False</property>
 
                          </packing>
 
                        </child>
 
                        <child>
 
                          <widget class="Gtk.ComboBox" id="ingredient3ComboBox">
 
                            <property name="MemberName" />
 
                            <property name="IsTextCombo">True</property>
 
                            <property name="Items" translatable="yes" />
 
                            <signal name="Changed" handler="OnChangedIngredient3" />
 
                          </widget>
 
                          <packing>
 
                            <property name="Position">1</property>
 
                            <property name="AutoSize">False</property>
 
                          </packing>
 
                        </child>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">2</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Button" id="clearReactionButton">
 
                        <property name="MemberName" />
 
                        <property name="Visible">False</property>
 
                        <property name="Sensitive">False</property>
 
                        <property name="CanFocus">True</property>
 
                        <property name="Type">TextOnly</property>
 
                        <property name="Label" translatable="yes">Clear Reaction</property>
 
                        <property name="UseUnderline">True</property>
 
                        <signal name="Clicked" handler="OnClearReaction" />
 
                      </widget>
 
                      <packing>
 
                        <property name="PackType">End</property>
 
                        <property name="Position">3</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                        <property name="Padding">6</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                </child>
 
              </widget>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Label" id="selectIngredientsLabel">
 
                <property name="MemberName" />
 
                <property name="LabelProp" translatable="yes">&lt;b&gt;Select Ingredients&lt;/b&gt;</property>
 
                <property name="UseMarkup">True</property>
 
              </widget>
 
              <packing>
 
                <property name="type">label_item</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">0</property>
 
            <property name="AutoSize">False</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.Frame" id="unmodifiedColorFrame">
 
            <property name="MemberName" />
 
            <property name="BorderWidth">4</property>
 
            <child>
 
              <widget class="Gtk.Alignment" id="GtkAlignment1">
 
                <property name="MemberName" />
 
                <property name="Xalign">0</property>
 
                <property name="Yalign">0</property>
 
                <property name="LeftPadding">5</property>
 
                <property name="TopPadding">5</property>
 
                <property name="RightPadding">5</property>
 
                <property name="BottomPadding">6</property>
 
                <child>
 
                  <widget class="Gtk.VBox" id="vbox3">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">120</property>
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="DesertPaintLab.PaintSwatch" id="unmodifiedSwatch">
 
                        <property name="MemberName" />
 
                        <property name="WidthRequest">120</property>
 
                        <property name="HeightRequest">120</property>
 
                        <property name="Events">ButtonPressMask</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Button" id="captureButton">
 
                        <property name="MemberName" />
 
                        <property name="CanFocus">True</property>
 
                        <property name="Type">TextOnly</property>
 
                        <property name="Label" translatable="yes">Capture</property>
 
                        <property name="UseUnderline">True</property>
 
                        <signal name="Clicked" handler="OnCapture" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                </child>
 
              </widget>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Label" id="unmodifiedLabel">
 
                <property name="MemberName" />
 
                <property name="LabelProp" translatable="yes">&lt;b&gt;Unmodified&lt;/b&gt;</property>
 
                <property name="UseMarkup">True</property>
 
                <property name="Justify">Center</property>
 
              </widget>
 
              <packing>
 
                <property name="type">label_item</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">1</property>
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.Frame" id="reactedColorFrame">
 
            <property name="MemberName" />
 
            <property name="BorderWidth">4</property>
 
            <child>
 
              <widget class="Gtk.Alignment" id="GtkAlignment2">
 
                <property name="MemberName" />
 
                <property name="Xalign">0</property>
 
                <property name="Yalign">0</property>
 
                <property name="LeftPadding">5</property>
 
                <property name="TopPadding">5</property>
 
                <property name="RightPadding">5</property>
 
                <property name="BottomPadding">6</property>
 
                <child>
 
                  <widget class="Gtk.VBox" id="vbox4">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">120</property>
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="DesertPaintLab.PaintSwatch" id="reactionSwatch">
 
                        <property name="MemberName" />
 
                        <property name="WidthRequest">120</property>
 
                        <property name="HeightRequest">120</property>
 
                        <property name="Events">ButtonPressMask</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Button" id="recordButton">
 
    <property name="MemberName" />
 
    <property name="Title" translatable="yes">Simulator</property>
 
    <property name="WindowPosition">CenterOnParent</property>
 
                        <property name="CanFocus">True</property>
 
                        <property name="Type">TextOnly</property>
 
                        <property name="Label" translatable="yes">Record</property>
 
                        <property name="UseUnderline">True</property>
 
                        <signal name="Clicked" handler="OnRecord" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                </child>
 
              </widget>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Label" id="reactionLabel">
 
                <property name="MemberName" />
 
                <property name="LabelProp" translatable="yes">&lt;b&gt;Reacted&lt;/b&gt;</property>
 
                <property name="UseMarkup">True</property>
 
                <property name="Justify">Center</property>
 
              </widget>
 
              <packing>
 
                <property name="type">label_item</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">2</property>
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
      </widget>
 
    </child>
 
  </widget>
 
  <widget class="Gtk.Bin" id="DesertPaintLab.RecipeGeneratorView" design-size="880 577">
 
    <action-group name="Default" />
 
    <property name="MemberName" />
 
    <property name="Visible">False</property>
 
    <child>
 
      <widget class="Gtk.VBox" id="vbox2">
 
        <property name="MemberName" />
 
        <property name="Spacing">6</property>
 
        <property name="BorderWidth">8</property>
 
        <child>
 
          <widget class="Gtk.HBox" id="hbox1">
 
            <property name="MemberName" />
 
            <property name="Spacing">6</property>
 
            <child>
 
              <widget class="Gtk.VBox" id="vbox8">
 
                <property name="MemberName" />
 
                <property name="Spacing">6</property>
 
                <child>
 
                  <widget class="Gtk.HBox" id="hbox2">
 
                    <property name="MemberName" />
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="Gtk.SpinButton" id="minIngredientsSpinButton">
 
                        <property name="MemberName" />
 
                        <property name="CanFocus">True</property>
 
                        <property name="Lower">1</property>
 
                        <property name="Upper">14</property>
 
                        <property name="PageIncrement">10</property>
 
                        <property name="StepIncrement">1</property>
 
                        <property name="ClimbRate">1</property>
 
                        <property name="Numeric">True</property>
 
                        <property name="Value">1</property>
 
                        <signal name="ValueChanged" handler="OnMinIngredientsChanged" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="label1">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">Minimum Ingredients</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">0</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HBox" id="hbox7">
 
                    <property name="MemberName" />
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="Gtk.SpinButton" id="maxIngredientsSpinButton">
 
                        <property name="MemberName" />
 
                        <property name="CanFocus">True</property>
 
                        <property name="Lower">1</property>
 
                        <property name="Upper">14</property>
 
                        <property name="PageIncrement">10</property>
 
                        <property name="StepIncrement">1</property>
 
                        <property name="ClimbRate">1</property>
 
                        <property name="Numeric">True</property>
 
                        <property name="Value">5</property>
 
                        <signal name="ValueChanged" handler="OnMaxIngredientsChanged" after="yes" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="label3">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">Maximum Ingredients</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">1</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HSeparator" id="hseparator3">
 
                    <property name="MemberName" />
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">2</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.CheckButton" id="checkButtonRibbon">
 
                    <property name="MemberName" />
 
                    <property name="CanFocus">True</property>
 
                    <property name="Label" translatable="yes">Ribbon Recipes</property>
 
                    <property name="DrawIndicator">True</property>
 
                    <property name="HasLabel">True</property>
 
                    <property name="UseUnderline">True</property>
 
                    <signal name="Toggled" handler="OnRecipesToggled" />
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">3</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HBox" id="hbox4">
 
                    <property name="MemberName" />
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="Gtk.SpinButton" id="maxRecipeSpinButton">
 
                        <property name="MemberName" />
 
                        <property name="CanFocus">True</property>
 
                        <property name="Lower">10</property>
 
                        <property name="Upper">100</property>
 
                        <property name="PageIncrement">10</property>
 
                        <property name="StepIncrement">1</property>
 
                        <property name="ClimbRate">1</property>
 
                        <property name="Numeric">True</property>
 
                        <property name="Value">14</property>
 
                        <signal name="ValueChanged" handler="OnMaxRecipeChanged" after="yes" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="label4">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">Maximum Concentration</property>
 
                        <property name="UseMarkup">True</property>
 
                        <property name="Wrap">True</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">4</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HSeparator" id="hseparator4">
 
                    <property name="MemberName" />
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">5</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                    <property name="Padding">8</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HBox" id="hbox5">
 
                    <property name="MemberName" />
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="Gtk.SpinButton" id="fullQuantityDepthSpinButton">
 
                        <property name="MemberName" />
 
                        <property name="CanFocus">True</property>
 
                        <property name="Upper">15</property>
 
                        <property name="PageIncrement">10</property>
 
                        <property name="StepIncrement">1</property>
 
                        <property name="ClimbRate">1</property>
 
                        <property name="Numeric">True</property>
 
                        <property name="Value">4</property>
 
                        <signal name="ValueChanged" handler="OnFullQuantityDepthChanged" after="yes" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="label8">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">Full Quantity Depth</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">6</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HSeparator" id="hseparator5">
 
                    <property name="MemberName" />
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">7</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HBox" id="hbox6">
 
                    <property name="MemberName" />
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="Gtk.SpinButton" id="fullQuantitySpinButton">
 
                        <property name="MemberName" />
 
                        <property name="CanFocus">True</property>
 
                        <property name="Upper">30</property>
 
                        <property name="PageIncrement">10</property>
 
                        <property name="StepIncrement">1</property>
 
                        <property name="ClimbRate">1</property>
 
                        <property name="Numeric">True</property>
 
                        <property name="Value">20</property>
 
                        <signal name="ValueChanged" handler="OnFullQuantityChanged" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="label9">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">FullQuantity</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">8</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Frame" id="frame3">
 
                    <property name="MemberName" />
 
                    <property name="ShadowType">None</property>
 
                    <child>
 
                      <widget class="Gtk.Alignment" id="GtkAlignment1">
 
                        <property name="MemberName" />
 
                        <property name="Xalign">0</property>
 
                        <property name="Yalign">0</property>
 
                        <property name="LeftPadding">12</property>
 
                        <child>
 
                          <widget class="Gtk.ScrolledWindow" id="scrolledwindow2">
 
                            <property name="MemberName" />
 
                            <property name="CanFocus">True</property>
 
                            <property name="ShadowType">In</property>
 
                            <child>
 
                              <widget class="Gtk.TreeView" id="reagentListView">
 
                                <property name="MemberName" />
 
                                <property name="WidthRequest">300</property>
 
                                <property name="CanFocus">True</property>
 
                              </widget>
 
                            </child>
 
                          </widget>
 
                        </child>
 
                      </widget>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="GtkLabel4">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">&lt;b&gt;Ingredients&lt;/b&gt;</property>
 
                        <property name="UseMarkup">True</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="type">label_item</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="PackType">End</property>
 
                    <property name="Position">9</property>
 
                    <property name="AutoSize">True</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HSeparator" id="hseparator6">
 
                    <property name="MemberName" />
 
                  </widget>
 
                  <packing>
 
                    <property name="PackType">End</property>
 
                    <property name="Position">10</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">0</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow1">
 
                <property name="MemberName" />
 
                <property name="ShadowType">In</property>
 
                <child>
 
                  <widget class="Gtk.TreeView" id="recipeList">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">300</property>
 
                    <property name="CanFocus">True</property>
 
                    <property name="ShowScrollbars">True</property>
 
                  </widget>
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">1</property>
 
                <property name="AutoSize">True</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.VBox" id="vbox3">
 
                <property name="MemberName" />
 
                <property name="Spacing">6</property>
 
                <child>
 
                  <widget class="Gtk.Frame" id="frame2">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">200</property>
 
                    <property name="HeightRequest">200</property>
 
                    <property name="ShadowType">None</property>
 
                    <child>
 
                      <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
 
                        <property name="MemberName" />
 
                        <property name="ShadowType">In</property>
 
                        <child>
 
                          <widget class="Gtk.TreeView" id="recipeIngredientsView">
 
                            <property name="MemberName" />
 
                            <property name="CanFocus">True</property>
 
                            <property name="ShowScrollbars">True</property>
 
                          </widget>
 
                        </child>
 
                      </widget>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="recipeLabel">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">&lt;b&gt;Recipe&lt;/b&gt;</property>
 
                        <property name="UseMarkup">True</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="type">label_item</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">0</property>
 
                    <property name="AutoSize">True</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Button" id="button919">
 
                    <property name="MemberName" />
 
                    <property name="CanFocus">True</property>
 
                    <property name="Type">TextOnly</property>
 
                    <property name="Label" translatable="yes">Copy</property>
 
                    <property name="UseUnderline">True</property>
 
                    <signal name="Clicked" handler="OnCopyRecipeToClipboard" />
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">1</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="DesertPaintLab.PaintSwatch" id="paintSwatch">
 
                    <property name="MemberName" />
 
                    <property name="HeightRequest">200</property>
 
                    <property name="Events">ButtonPressMask</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">2</property>
 
                    <property name="AutoSize">True</property>
 
                  </packing>
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">2</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">0</property>
 
            <property name="AutoSize">False</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.HBox" id="hbox3">
 
            <property name="MemberName" />
 
            <property name="Spacing">6</property>
 
            <child>
 
              <widget class="Gtk.HSeparator" id="hseparator2">
 
                <property name="MemberName" />
 
              </widget>
 
              <packing>
 
                <property name="Position">0</property>
 
                <property name="AutoSize">True</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Button" id="stopResumeButton">
 
                <property name="MemberName" />
 
                <property name="Sensitive">False</property>
 
                <property name="CanFocus">True</property>
 
                <property name="Type">TextOnly</property>
 
                <property name="Label" translatable="yes">Stop</property>
 
                <property name="UseUnderline">True</property>
 
                <signal name="Clicked" handler="OnStopResume" />
 
              </widget>
 
              <packing>
 
                <property name="Position">1</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
                <property name="Padding">20</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Label" id="countLabel">
 
                <property name="MemberName" />
 
                <property name="LabelProp" translatable="yes">0/192</property>
 
              </widget>
 
              <packing>
 
                <property name="Position">2</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
                <property name="Padding">40</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Button" id="beginButton">
 
                <property name="MemberName" />
 
                <property name="CanFocus">True</property>
 
                <property name="Type">TextOnly</property>
 
                <property name="Label" translatable="yes">Begin</property>
 
                <property name="UseUnderline">True</property>
 
                <signal name="Clicked" handler="OnBegin" />
 
              </widget>
 
              <packing>
 
                <property name="Position">3</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
                <property name="Padding">20</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.HSeparator" id="hseparator1">
 
                <property name="MemberName" />
 
              </widget>
 
              <packing>
 
                <property name="Position">4</property>
 
                <property name="AutoSize">True</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">1</property>
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.ProgressBar" id="progressBar">
 
            <property name="MemberName" />
 
          </widget>
 
          <packing>
 
            <property name="PackType">End</property>
 
            <property name="Position">2</property>
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
      </widget>
 
    </child>
 
  </widget>
 
  <widget class="Gtk.Bin" id="DesertPaintLab.SimulatorView" design-size="801 414">
 
    <property name="MemberName" />
 
    <property name="Visible">False</property>
 
    <child>
 
      <widget class="Gtk.HBox" id="hbox1">
 
        <property name="MemberName" />
 
        <property name="Spacing">6</property>
 
        <property name="BorderWidth">12</property>
 
        <child>
 
          <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
 
            <property name="MemberName" />
...
 
@@ -969,893 +1885,9 @@ You can either import an existing Practi
 
          <packing>
 
            <property name="Position">4</property>
 
            <property name="AutoSize">False</property>
 
          </packing>
 
        </child>
 
      </widget>
 
    </child>
 
  </widget>
 
  <widget class="Gtk.Dialog" id="DesertPaintLab.ScreenCheckDialog" design-size="378 245">
 
    <property name="MemberName" />
 
    <property name="Title" translatable="yes">Screen Check</property>
 
    <property name="WindowPosition">CenterOnParent</property>
 
    <property name="Modal">True</property>
 
    <property name="BorderWidth">9</property>
 
    <property name="Buttons">1</property>
 
    <property name="HelpButton">False</property>
 
    <child internal-child="VBox">
 
      <widget class="Gtk.VBox" id="dialog1_VBox">
 
        <property name="MemberName" />
 
        <child>
 
          <widget class="Gtk.VBox" id="vbox2">
 
            <property name="MemberName" />
 
            <property name="Spacing">20</property>
 
            <property name="BorderWidth">20</property>
 
            <child>
 
              <widget class="Gtk.HBox" id="hbox1">
 
                <property name="MemberName" />
 
                <property name="Spacing">20</property>
 
                <property name="BorderWidth">10</property>
 
                <child>
 
                  <widget class="Gtk.Label" id="label1">
 
                    <property name="MemberName" />
 
                    <property name="LabelProp" translatable="yes">Screen Resolution</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">0</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Entry" id="screenWidthEntry">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">50</property>
 
                    <property name="CanFocus">True</property>
 
                    <property name="IsEditable">True</property>
 
                    <property name="InvisibleChar">●</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">1</property>
 
                    <property name="AutoSize">True</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Entry" id="screenHeightEntry">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">50</property>
 
                    <property name="CanFocus">True</property>
 
                    <property name="IsEditable">True</property>
 
                    <property name="InvisibleChar">●</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">2</property>
 
                    <property name="AutoSize">True</property>
 
                  </packing>
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">0</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.HBox" id="hbox2">
 
                <property name="MemberName" />
 
                <property name="Spacing">20</property>
 
                <property name="BorderWidth">10</property>
 
                <child>
 
                  <widget class="Gtk.Label" id="label2">
 
                    <property name="MemberName" />
 
                    <property name="LabelProp" translatable="yes">Game Pixel Width in Screen Pixels</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">0</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Entry" id="gamePixelWidthEntry">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">50</property>
 
                    <property name="CanFocus">True</property>
 
                    <property name="IsEditable">True</property>
 
                    <property name="InvisibleChar">●</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">1</property>
 
                    <property name="AutoSize">False</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <placeholder />
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">1</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <placeholder />
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">0</property>
 
            <property name="AutoSize">True</property>
 
          </packing>
 
        </child>
 
      </widget>
 
    </child>
 
    <child internal-child="ActionArea">
 
      <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
 
        <property name="MemberName" />
 
        <property name="Spacing">10</property>
 
        <property name="BorderWidth">5</property>
 
        <property name="Size">1</property>
 
        <property name="LayoutStyle">End</property>
 
        <child>
 
          <widget class="Gtk.Button" id="buttonOk">
 
            <property name="MemberName" />
 
            <property name="CanDefault">True</property>
 
            <property name="CanFocus">True</property>
 
            <property name="UseStock">True</property>
 
            <property name="Type">StockItem</property>
 
            <property name="StockId">gtk-ok</property>
 
            <property name="ResponseId">-5</property>
 
            <property name="label">gtk-ok</property>
 
          </widget>
 
          <packing>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
      </widget>
 
    </child>
 
  </widget>
 
  <widget class="Gtk.Window" id="DesertPaintLab.ReactionStatusWindow" design-size="400 300">
 
    <property name="MemberName" />
 
    <property name="Title" translatable="yes">Reaction Status</property>
 
    <property name="WindowPosition">CenterOnParent</property>
 
    <child>
 
      <widget class="Gtk.ScrolledWindow" id="scroller">
 
        <property name="MemberName" />
 
        <property name="CanFocus">True</property>
 
        <property name="ShadowType">In</property>
 
        <child>
 
          <widget class="Gtk.Viewport" id="GtkViewport">
 
            <property name="MemberName" />
 
            <property name="ShadowType">None</property>
 
            <child>
 
              <widget class="Gtk.VBox" id="resultbox">
 
                <property name="MemberName" />
 
                <property name="Spacing">6</property>
 
                <child>
 
                  <placeholder />
 
                </child>
 
                <child>
 
                  <placeholder />
 
                </child>
 
                <child>
 
                  <placeholder />
 
                </child>
 
              </widget>
 
            </child>
 
          </widget>
 
        </child>
 
      </widget>
 
    </child>
 
  </widget>
 
  <widget class="Gtk.Window" id="DesertPaintLab.RecipeGeneratorWindow" design-size="887 577">
 
    <action-group name="Default">
 
      <action id="ExportAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Export</property>
 
        <property name="ShortLabel" translatable="yes">Export</property>
 
      </action>
 
      <action id="ExportToWikiAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Export to Wiki</property>
 
        <property name="ShortLabel" translatable="yes">Export to Wiki</property>
 
        <signal name="Activated" handler="OnExportToWiki" />
 
      </action>
 
      <action id="SettingsAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Settings</property>
 
        <property name="ShortLabel" translatable="yes">Tools</property>
 
      </action>
 
      <action id="IngredientsAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Ingredients</property>
 
        <property name="ShortLabel" translatable="yes">Ingredients</property>
 
        <signal name="Activated" handler="OnShowIngredients" />
 
      </action>
 
      <action id="CopyToClipboardAction">
 
        <property name="Type">Action</property>
 
        <property name="Label" translatable="yes">Copy to Clipboard</property>
 
        <property name="ShortLabel" translatable="yes">Copy to Clipboard</property>
 
        <signal name="Activated" handler="OnCopyRecipeListToClipboard" />
 
      </action>
 
    </action-group>
 
    <property name="MemberName" />
 
    <property name="Title" translatable="yes">Recipe Generator</property>
 
    <property name="WindowPosition">CenterOnParent</property>
 
    <child>
 
      <widget class="Gtk.VBox" id="vbox2">
 
        <property name="MemberName" />
 
        <property name="Spacing">6</property>
 
        <property name="BorderWidth">8</property>
 
        <child>
 
          <widget class="Gtk.MenuBar" id="menubar1">
 
            <property name="MemberName" />
 
            <node name="menubar1" type="Menubar">
 
              <node type="Menu" action="ExportAction">
 
                <node type="Menuitem" action="ExportToWikiAction" />
 
                <node type="Menuitem" action="CopyToClipboardAction" />
 
              </node>
 
            </node>
 
          </widget>
 
          <packing>
 
            <property name="Position">0</property>
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.HBox" id="hbox1">
 
            <property name="MemberName" />
 
            <property name="Spacing">6</property>
 
            <child>
 
              <widget class="Gtk.VBox" id="vbox8">
 
                <property name="MemberName" />
 
                <property name="Spacing">6</property>
 
                <child>
 
                  <widget class="Gtk.HBox" id="hbox2">
 
                    <property name="MemberName" />
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="Gtk.SpinButton" id="minIngredientsSpinButton">
 
                        <property name="MemberName" />
 
                        <property name="CanFocus">True</property>
 
                        <property name="Lower">1</property>
 
                        <property name="Upper">14</property>
 
                        <property name="PageIncrement">10</property>
 
                        <property name="StepIncrement">1</property>
 
                        <property name="ClimbRate">1</property>
 
                        <property name="Numeric">True</property>
 
                        <property name="Value">1</property>
 
                        <signal name="ValueChanged" handler="OnMinIngredientsChanged" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="label1">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">Minimum Ingredients</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">0</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HBox" id="hbox7">
 
                    <property name="MemberName" />
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="Gtk.SpinButton" id="maxIngredientsSpinButton">
 
                        <property name="MemberName" />
 
                        <property name="CanFocus">True</property>
 
                        <property name="Lower">1</property>
 
                        <property name="Upper">14</property>
 
                        <property name="PageIncrement">10</property>
 
                        <property name="StepIncrement">1</property>
 
                        <property name="ClimbRate">1</property>
 
                        <property name="Numeric">True</property>
 
                        <property name="Value">5</property>
 
                        <signal name="ValueChanged" handler="OnMaxIngredientsChanged" after="yes" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="label3">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">Maximum Ingredients</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">1</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HSeparator" id="hseparator3">
 
                    <property name="MemberName" />
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">2</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HBox" id="hbox4">
 
                    <property name="MemberName" />
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="Gtk.SpinButton" id="maxRecipeSpinButton">
 
                        <property name="MemberName" />
 
                        <property name="CanFocus">True</property>
 
                        <property name="Lower">10</property>
 
                        <property name="Upper">100</property>
 
                        <property name="PageIncrement">10</property>
 
                        <property name="StepIncrement">1</property>
 
                        <property name="ClimbRate">1</property>
 
                        <property name="Numeric">True</property>
 
                        <property name="Value">14</property>
 
                        <signal name="ValueChanged" handler="OnMaxRecipeChanged" after="yes" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="label4">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">Max Total Quantity</property>
 
                        <property name="UseMarkup">True</property>
 
                        <property name="Wrap">True</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">3</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HSeparator" id="hseparator4">
 
                    <property name="MemberName" />
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">4</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                    <property name="Padding">8</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HBox" id="hbox5">
 
                    <property name="MemberName" />
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="Gtk.SpinButton" id="fullQuantityDepthSpinButton">
 
                        <property name="MemberName" />
 
                        <property name="CanFocus">True</property>
 
                        <property name="Upper">15</property>
 
                        <property name="PageIncrement">10</property>
 
                        <property name="StepIncrement">1</property>
 
                        <property name="ClimbRate">1</property>
 
                        <property name="Numeric">True</property>
 
                        <property name="Value">4</property>
 
                        <signal name="ValueChanged" handler="OnFullQuantityDepthChanged" after="yes" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="label8">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">Full Quantity Depth</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">5</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HSeparator" id="hseparator5">
 
                    <property name="MemberName" />
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">6</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HBox" id="hbox6">
 
                    <property name="MemberName" />
 
                    <property name="Spacing">6</property>
 
                    <child>
 
                      <widget class="Gtk.SpinButton" id="fullQuantitySpinButton">
 
                        <property name="MemberName" />
 
                        <property name="CanFocus">True</property>
 
                        <property name="Upper">30</property>
 
                        <property name="PageIncrement">10</property>
 
                        <property name="StepIncrement">1</property>
 
                        <property name="ClimbRate">1</property>
 
                        <property name="Numeric">True</property>
 
                        <property name="Value">20</property>
 
                        <signal name="ValueChanged" handler="OnFullQuantityChanged" />
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">0</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="label9">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">FullQuantity</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="Position">1</property>
 
                        <property name="AutoSize">True</property>
 
                        <property name="Expand">False</property>
 
                        <property name="Fill">False</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">7</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Frame" id="frame3">
 
                    <property name="MemberName" />
 
                    <property name="ShadowType">None</property>
 
                    <child>
 
                      <widget class="Gtk.Alignment" id="GtkAlignment1">
 
                        <property name="MemberName" />
 
                        <property name="Xalign">0</property>
 
                        <property name="Yalign">0</property>
 
                        <property name="LeftPadding">12</property>
 
                        <child>
 
                          <widget class="Gtk.ScrolledWindow" id="scrolledwindow2">
 
                            <property name="MemberName" />
 
                            <property name="CanFocus">True</property>
 
                            <property name="ShadowType">In</property>
 
                            <child>
 
                              <widget class="Gtk.TreeView" id="reagentListView">
 
                                <property name="MemberName" />
 
                                <property name="WidthRequest">300</property>
 
                                <property name="CanFocus">True</property>
 
                              </widget>
 
                            </child>
 
                          </widget>
 
                        </child>
 
                      </widget>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="GtkLabel4">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">&lt;b&gt;Ingredients&lt;/b&gt;</property>
 
                        <property name="UseMarkup">True</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="type">label_item</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="PackType">End</property>
 
                    <property name="Position">8</property>
 
                    <property name="AutoSize">True</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.HSeparator" id="hseparator6">
 
                    <property name="MemberName" />
 
                  </widget>
 
                  <packing>
 
                    <property name="PackType">End</property>
 
                    <property name="Position">9</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">0</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow1">
 
                <property name="MemberName" />
 
                <property name="ShadowType">In</property>
 
                <child>
 
                  <widget class="Gtk.TreeView" id="recipeList">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">300</property>
 
                    <property name="CanFocus">True</property>
 
                    <property name="ShowScrollbars">True</property>
 
                  </widget>
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">1</property>
 
                <property name="AutoSize">True</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.VBox" id="vbox3">
 
                <property name="MemberName" />
 
                <property name="Spacing">6</property>
 
                <child>
 
                  <widget class="Gtk.Frame" id="frame2">
 
                    <property name="MemberName" />
 
                    <property name="WidthRequest">200</property>
 
                    <property name="HeightRequest">200</property>
 
                    <property name="ShadowType">None</property>
 
                    <child>
 
                      <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
 
                        <property name="MemberName" />
 
                        <property name="ShadowType">In</property>
 
                        <child>
 
                          <widget class="Gtk.TreeView" id="recipeIngredientsView">
 
                            <property name="MemberName" />
 
                            <property name="CanFocus">True</property>
 
                            <property name="ShowScrollbars">True</property>
 
                          </widget>
 
                        </child>
 
                      </widget>
 
                    </child>
 
                    <child>
 
                      <widget class="Gtk.Label" id="recipeLabel">
 
                        <property name="MemberName" />
 
                        <property name="LabelProp" translatable="yes">&lt;b&gt;Recipe&lt;/b&gt;</property>
 
                        <property name="UseMarkup">True</property>
 
                      </widget>
 
                      <packing>
 
                        <property name="type">label_item</property>
 
                      </packing>
 
                    </child>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">0</property>
 
                    <property name="AutoSize">True</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="Gtk.Button" id="button919">
 
                    <property name="MemberName" />
 
                    <property name="CanFocus">True</property>
 
                    <property name="Type">TextOnly</property>
 
                    <property name="Label" translatable="yes">Copy</property>
 
                    <property name="UseUnderline">True</property>
 
                    <signal name="Clicked" handler="OnCopyRecipeToClipboard" />
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">1</property>
 
                    <property name="AutoSize">True</property>
 
                    <property name="Expand">False</property>
 
                    <property name="Fill">False</property>
 
                  </packing>
 
                </child>
 
                <child>
 
                  <widget class="DesertPaintLab.PaintSwatch" id="paintSwatch">
 
                    <property name="MemberName" />
 
                    <property name="HeightRequest">200</property>
 
                    <property name="Events">ButtonPressMask</property>
 
                  </widget>
 
                  <packing>
 
                    <property name="Position">2</property>
 
                    <property name="AutoSize">True</property>
 
                  </packing>
 
                </child>
 
              </widget>
 
              <packing>
 
                <property name="Position">2</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">1</property>
 
            <property name="AutoSize">False</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.HBox" id="hbox3">
 
            <property name="MemberName" />
 
            <property name="Spacing">6</property>
 
            <child>
 
              <widget class="Gtk.HSeparator" id="hseparator2">
 
                <property name="MemberName" />
 
              </widget>
 
              <packing>
 
                <property name="Position">0</property>
 
                <property name="AutoSize">True</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Button" id="stopResumeButton">
 
                <property name="MemberName" />
 
                <property name="Sensitive">False</property>
 
                <property name="CanFocus">True</property>
 
                <property name="Type">TextOnly</property>
 
                <property name="Label" translatable="yes">Stop</property>
 
                <property name="UseUnderline">True</property>
 
                <signal name="Clicked" handler="OnStopResume" />
 
              </widget>
 
              <packing>
 
                <property name="Position">1</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
                <property name="Padding">20</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Label" id="countLabel">
 
                <property name="MemberName" />
 
                <property name="LabelProp" translatable="yes">0/192</property>
 
              </widget>
 
              <packing>
 
                <property name="Position">2</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
                <property name="Padding">40</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Button" id="beginButton">
 
                <property name="MemberName" />
 
                <property name="CanFocus">True</property>
 
                <property name="Type">TextOnly</property>
 
                <property name="Label" translatable="yes">Begin</property>
 
                <property name="UseUnderline">True</property>
 
                <signal name="Clicked" handler="OnBegin" />
 
              </widget>
 
              <packing>
 
                <property name="Position">3</property>
 
                <property name="AutoSize">True</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
                <property name="Padding">20</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.HSeparator" id="hseparator1">
 
                <property name="MemberName" />
 
              </widget>
 
              <packing>
 
                <property name="Position">4</property>
 
                <property name="AutoSize">True</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">2</property>
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.Label" id="statusLabel">
 
            <property name="MemberName" />
 
          </widget>
 
          <packing>
 
            <property name="PackType">End</property>
 
            <property name="Position">3</property>
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.ProgressBar" id="progressBar">
 
            <property name="MemberName" />
 
          </widget>
 
          <packing>
 
            <property name="PackType">End</property>
 
            <property name="Position">4</property>
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
      </widget>
 
    </child>
 
  </widget>
 
  <widget class="Gtk.Window" id="DesertPaintLab.ReagentWindow" design-size="400 357">
 
    <property name="MemberName" />
 
    <property name="Title" translatable="yes">ReagentWindow</property>
 
    <property name="WindowPosition">CenterOnParent</property>
 
    <child>
 
      <widget class="Gtk.VBox" id="vbox2">
 
        <property name="MemberName" />
 
        <property name="Spacing">6</property>
 
        <property name="BorderWidth">8</property>
 
        <child>
 
          <widget class="Gtk.Frame" id="frame3">
 
            <property name="MemberName" />
 
            <property name="ShadowType">None</property>
 
            <child>
 
              <widget class="Gtk.Alignment" id="GtkAlignment">
 
                <property name="MemberName" />
 
                <property name="Xalign">0</property>
 
                <property name="Yalign">0</property>
 
                <property name="LeftPadding">12</property>
 
                <child>
 
                  <widget class="Gtk.Table" id="ingredientTable">
 
                    <property name="MemberName" />
 
                    <property name="NRows">3</property>
 
                    <property name="NColumns">3</property>
 
                    <property name="RowSpacing">6</property>
 
                    <property name="ColumnSpacing">6</property>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                    <child>
 
                      <placeholder />
 
                    </child>
 
                  </widget>
 
                </child>
 
              </widget>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Label" id="GtkLabel">
 
                <property name="MemberName" />
 
                <property name="LabelProp" translatable="yes">&lt;b&gt;Ingredients&lt;/b&gt;</property>
 
                <property name="UseMarkup">True</property>
 
              </widget>
 
              <packing>
 
                <property name="type">label_item</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="Position">0</property>
 
            <property name="AutoSize">True</property>
 
          </packing>
 
        </child>
 
        <child>
 
          <widget class="Gtk.HButtonBox" id="hbuttonbox3">
 
            <property name="MemberName" />
 
            <property name="Size">2</property>
 
            <child>
 
              <widget class="Gtk.Button" id="okButton">
 
                <property name="MemberName" />
 
                <property name="WidthRequest">80</property>
 
                <property name="CanFocus">True</property>
 
                <property name="Type">TextOnly</property>
 
                <property name="Label" translatable="yes">Ok</property>
 
                <property name="UseUnderline">True</property>
 
                <signal name="Clicked" handler="OnOK" />
 
              </widget>
 
              <packing>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
            <child>
 
              <widget class="Gtk.Button" id="cancelButton">
 
                <property name="MemberName" />
 
                <property name="WidthRequest">80</property>
 
                <property name="CanFocus">True</property>
 
                <property name="Type">TextOnly</property>
 
                <property name="Label" translatable="yes">Cancel</property>
 
                <property name="UseUnderline">True</property>
 
                <signal name="Clicked" handler="OnCancel" />
 
              </widget>
 
              <packing>
 
                <property name="Position">1</property>
 
                <property name="Expand">False</property>
 
                <property name="Fill">False</property>
 
              </packing>
 
            </child>
 
          </widget>
 
          <packing>
 
            <property name="PackType">End</property>
 
            <property name="Position">1</property>
 
            <property name="AutoSize">True</property>
 
            <property name="Expand">False</property>
 
            <property name="Fill">False</property>
 
          </packing>
 
        </child>
 
      </widget>
 
    </child>
 
  </widget>
 
</stetic-interface>
...
 
\ No newline at end of file
0 comments (0 inline, 0 general)