Changeset - dd3cd8c7f2ba
[Not reviewed]
default
0 2 0
Jason Maltzen (jmaltzen) - 9 years ago 2015-12-27 11:01:22
jason.maltzen@unsanctioned.net
Fix up toggling of reagents in recipe generator window.
2 files changed with 11 insertions and 7 deletions:
0 comments (0 inline, 0 general)
RecipeGeneratorWindow.cs
Show inline comments
...
 
@@ -155,4 +155,5 @@ namespace DesertPaintLab
 
            reagentEnabledCell.Sensitive = true;
 
            reagentEnabledCell.Mode = Gtk.CellRendererMode.Activatable;
 
            reagentEnabledCell.Visible = true;
 
            reagentEnabledCell.Toggled += new Gtk.ToggledHandler(OnReagentEnableToggled);
 
            reagentEnabledColumn.PackStart (reagentEnabledCell, true);
...
 
@@ -162,4 +163,5 @@ namespace DesertPaintLab
 
            reagentNameColumn.Title = "Ingredient";
 
            Gtk.CellRendererText reagentNameCell = new Gtk.CellRendererText ();
 
            reagentNameCell.Mode = Gtk.CellRendererMode.Inert;
 
            reagentNameColumn.PackStart (reagentNameCell, true);
 
            reagentNameColumn.AddAttribute(reagentNameCell, "text", 1);
...
 
@@ -172,4 +174,5 @@ namespace DesertPaintLab
 
            reagentCostCell.Editable = true;
 
            reagentCostCell.Sensitive = true;
 
            reagentCostCell.Mode = Gtk.CellRendererMode.Editable;
 
            reagentCostColumn.PackStart (reagentCostCell, true);
 
            //reagentCostColumn.AddAttribute(reagentCostCell, "text", 0);
...
 
@@ -181,4 +184,5 @@ namespace DesertPaintLab
 
            reagentMaxCell.Editable = true;
 
            reagentMaxCell.Sensitive = true;
 
            reagentCostCell.Mode = Gtk.CellRendererMode.Editable;
 
            reagentMaxColumn.PackStart (reagentMaxCell, true);
 
            //reagentMaxColumn.AddAttribute(reagentMaxCell, "text", 0);
...
 
@@ -197,4 +201,5 @@ namespace DesertPaintLab
 
            // Assign the model to the TreeView
 
            reagentListView.Model = reagentListStore;
 
            reagentListView.Sensitive = true;
 

	
 
            reagentListView.AppendColumn(reagentEnabledColumn);
...
 
@@ -203,4 +208,6 @@ namespace DesertPaintLab
 
            reagentListView.AppendColumn(reagentMaxColumn);
 
            
 
            reagentListView.
 
            
 
            ShowAll();
 
        }
...
 
@@ -332,5 +339,5 @@ namespace DesertPaintLab
 
                fullQuantitySpinButton.Sensitive = true;
 
                fullQuantityDepthSpinButton.Sensitive = true;
 
                reagentListView.Sensitive = false;
 
                reagentListView.Sensitive = true;
 
                //generator = null; // don't. Hang on to generator for resume.
 
                profile.SaveRecipes();
...
 
@@ -511,4 +518,5 @@ namespace DesertPaintLab
 
            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)
...
 
@@ -559,15 +567,11 @@ namespace DesertPaintLab
 
        private void OnReagentEnableToggled(object o, Gtk.ToggledArgs args)
 
        {
 
            Gtk.CellRendererToggle btn = (Gtk.CellRendererToggle)o;
 
            Gtk.TreeIter iter;
 
            reagentListStore.GetIter (out iter, new Gtk.TreePath (args.Path));
 
         
 
            Reagent reagent = (Reagent) reagentListStore.GetValue (iter, 0);
 
            if (btn.Active != reagent.Enabled)
 
            {
 
                reagent.Enabled = btn.Active;
 
            reagent.Enabled = !reagent.Enabled;
 
                SaveReagentSettings();
 
            }
 
        }
 

	
 
        private void SaveReagentSettings()
gtk-gui/gui.stetic
Show inline comments
...
 
@@ -7,5 +7,5 @@
 
  <import>
 
    <widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
 
    <widget-library name="../bin/Debug/DesertPaintLab.exe" internal="true" />
 
    <widget-library name="../bin/Release/DesertPaintLab.exe" internal="true" />
 
  </import>
 
  <widget class="Gtk.Window" id="MainWindow" design-size="629 265">
0 comments (0 inline, 0 general)