Esempio n. 1
0
 private void TurretEditLayout_Destroyed(object sender, EventArgs e)
 {
     GtkHelpers.FlushAllDeferredEvents();
 }
Esempio n. 2
0
        public void SetTurret(string selectedStr)
        {
            GtkHelpers.FlushAllDeferredEvents();

            Destroyed += TurretEditLayout_Destroyed;

            if (null != Layout)
            {
                Layout.Hide();
                Layout.Destroy();
                Layout        = null;
                FireRateField = null;
                DPSfield      = null;
            }

            Turrets = LevelManager.GetTurrets();
            for (int i = 0; i < Turrets.Count; i++)
            {
                if (Turrets[i].Name == selectedStr)
                {
                    Turret = Turrets[i];
                }
            }

            Layout = new VBox(false, 0);
            AddWithViewport(Layout);

            HBox field = GtkHelpers.TextEntryField("Turret Name", Turret.Name, Name_Changed, true);

            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.TextEntryField("Asset", Turret.Asset, Asset_Changed, true);
            Layout.PackStart(field, false, false, 0);
            field.Show();


            FireRateField = GtkHelpers.TextEntryField("Fire Rate", Turret.FireRate.ToString(), FireRate_Changed, true, GtkHelpers.ValueType.Float);
            Layout.PackStart(FireRateField, false, false, 0);
            FireRateField.Show();


            field = GtkHelpers.TextEntryField("Range", Turret.Range.ToString(), Range_Changed, true, GtkHelpers.ValueType.Float);
            Layout.PackStart(field, false, false, 0);
            field.Show();


            field = GtkHelpers.TextEntryField("Cost", Turret.Cost.ToString(), Cost_Changed, true, GtkHelpers.ValueType.Float);
            Layout.PackStart(field, false, false, 0);
            field.Show();


            List <Projectile> projectiles = LevelManager.GetProjectiles();

            ProjectileNames = new List <string>();
            int currIndex = 0;

            for (int i = 0; i < projectiles.Count; i++)
            {
                ProjectileNames.Add(projectiles[i].Name);
                if (projectiles[i].Name == Turret.Projectile)
                {
                    currIndex = i;
                }
            }

            field = GtkHelpers.ComboBox("Projectile", ProjectileNames.ToArray(), currIndex, Projectile_Changed, true);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            DPSfield = GtkHelpers.TextEntryField("Damage per Sec", Turret.Cost.ToString(), DPS_Changed, true, GtkHelpers.ValueType.Float);
            Layout.PackStart(DPSfield, false, false, 0);
            DPSfield.Show();

            RecalculateDPS();

            Show();
            ShowAll();
        }
Esempio n. 3
0
 private void LevelAnalysisLayout_Destroyed(object sender, EventArgs e)
 {
     GtkHelpers.FlushAllDeferredEvents();
 }
Esempio n. 4
0
        public void SetLevel(LevelDescription desc)
        {
            GtkHelpers.FlushAllDeferredEvents();

            Destroyed += LevelAnalysisLayout_Destroyed;

            if (null != Layout)
            {
                Layout.Hide();
                Layout.Destroy();
                Layout             = null;
                SaveSolutionColumn = null;
                LoadSolutionColumn = null;
            }

            LevelDesc = desc;
            LoadAndValidateLevelDesc();

            Solution = LevelManager.ReadLevelSolution(desc.Name);
            if (null == Solution)
            {
                Solution = new LevelSolution();
                Solution.AssumedHandMissileFrequency    = HandMissileFreqency;
                Solution.AssumedHandMissileAvgDamagePct = HandMissileDamantPctAverage;
            }

            TurretSelections = new Dictionary <int, int>();
            RecalculateAllStats();

            Layout = new VBox(false, 0);
            AddWithViewport(Layout);

            HBox field = GtkHelpers.ReadOnlyTextField("Level Name", desc.Name);

            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.ReadOnlyTextField("Lives", desc.Lives.ToString());
            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.ReadOnlyTextField("Starting Coins", desc.StartingCoins.ToString());
            Layout.PackStart(field, false, false, 0);
            field.Show();


            field = GtkHelpers.TextEntryField("Hand Missile Frequency (sec)", HandMissileFreqency.ToString(), AssumedFireRatePerSecChanged_Changed, true, GtkHelpers.ValueType.Float);
            Layout.PackStart(field, false, false, 0);
            field.Show();


            field = GtkHelpers.TextEntryField("Hand Missile Average Accuracy Handicap", HandMissileDamantPctAverage.ToString(), AssumedHandMissileAccuracyHandicap_Changed, true, GtkHelpers.ValueType.Float);
            Layout.PackStart(field, false, false, 0);
            field.Show();


            WavesTree = new TreeView();
            Layout.PackStart(WavesTree, false, false, 0);
            WavesTree.Show();
            WavesTree.ButtonReleaseEvent += WavesTree_ButtonReleaseEvent;

            List <EnemyDescription> enemies  = LevelManager.GetEnemies();
            ComboBoxText            comboBox = new ComboBoxText();

            foreach (EnemyDescription enemy in enemies)
            {
                comboBox.AppendText(enemy.Name);
            }
            comboBox.Active = 0;


            TreeViewColumn enemyCoumn          = new TreeViewColumn();
            TreeViewColumn countColumn         = new TreeViewColumn();
            TreeViewColumn difficultyColumn    = new TreeViewColumn();
            TreeViewColumn singleEnemyColumn   = new TreeViewColumn();
            TreeViewColumn maxHPPSColumn       = new TreeViewColumn();
            TreeViewColumn maxDPSColumn        = new TreeViewColumn();
            TreeViewColumn simColumn           = new TreeViewColumn();
            TreeViewColumn turretCostVsMaxCoin = new TreeViewColumn();
            TreeViewColumn issuesColumn        = new TreeViewColumn();


            CellRendererText textCellRenderer = new CellRendererText();

            textCellRenderer.Editable = false;

            enemyCoumn.PackStart(textCellRenderer, true);
            enemyCoumn.Title = "Enemy";
            enemyCoumn.AddAttribute(textCellRenderer, "text", 1);
            WavesTree.AppendColumn(enemyCoumn);

            countColumn.PackStart(textCellRenderer, true);
            countColumn.Title = "Count";
            countColumn.AddAttribute(textCellRenderer, "text", 2);
            WavesTree.AppendColumn(countColumn);

            difficultyColumn.PackStart(textCellRenderer, true);
            difficultyColumn.Title = "Difficulty Multiplier";
            difficultyColumn.AddAttribute(textCellRenderer, "text", 3);
            WavesTree.AppendColumn(difficultyColumn);

            //
            // Add column:  Max damage that can be dished to a single enemy given turret coverage + enemy speed
            //

            singleEnemyColumn.PackStart(textCellRenderer, true);
            singleEnemyColumn.Title = "Single Enemy Damage";
            singleEnemyColumn.AddAttribute(textCellRenderer, "text", 4);
            WavesTree.AppendColumn(singleEnemyColumn);

            //
            // Add column: Max hit points of the wave
            //

            maxHPPSColumn.PackStart(textCellRenderer, true);
            maxHPPSColumn.Title = "Max Hitpoints/s";
            maxHPPSColumn.AddAttribute(textCellRenderer, "text", 5);
            WavesTree.AppendColumn(maxHPPSColumn);

            //
            // Add column: Max damage of all the turrets combined firing at full capacity
            //

            maxDPSColumn.PackStart(textCellRenderer, true);
            maxDPSColumn.Title = "Max DPS overall";
            maxDPSColumn.AddAttribute(textCellRenderer, "text", 6);
            WavesTree.AppendColumn(maxDPSColumn);


            //
            // Add column: Simulated damage / kills
            //

            simColumn.PackStart(textCellRenderer, true);
            simColumn.Title = "Sim damage/kills";
            simColumn.AddAttribute(textCellRenderer, "text", 7);
            WavesTree.AppendColumn(simColumn);


            //
            // Add column: Max coin earned by start of wave
            //


            turretCostVsMaxCoin.PackStart(textCellRenderer, true);
            turretCostVsMaxCoin.Title = "Coin Need/Avail";
            turretCostVsMaxCoin.AddAttribute(textCellRenderer, "text", 8);
            WavesTree.AppendColumn(turretCostVsMaxCoin);

            //
            // Solution save/load
            //


            SaveSolutionColumn = new TreeViewColumn();
            LoadSolutionColumn = new TreeViewColumn();;

            SaveSolutionColumn.PackStart(textCellRenderer, true);
            SaveSolutionColumn.Title = "Save Solution";
            SaveSolutionColumn.AddAttribute(textCellRenderer, "text", 9);
            WavesTree.AppendColumn(SaveSolutionColumn);


            LoadSolutionColumn.PackStart(textCellRenderer, true);
            LoadSolutionColumn.Title = "Load Solution";
            LoadSolutionColumn.AddAttribute(textCellRenderer, "text", 10);
            WavesTree.AppendColumn(LoadSolutionColumn);


            //
            // Add column: Issues
            //


            issuesColumn.PackStart(textCellRenderer, true);
            issuesColumn.Title = "Issues";
            issuesColumn.AddAttribute(textCellRenderer, "markup", 11);
            WavesTree.AppendColumn(issuesColumn);

            WavesModel               = new ListStore(typeof(int), typeof(string), typeof(int), typeof(float), typeof(float), typeof(float), typeof(float), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
            WavesTree.Model          = WavesModel;
            WavesTree.Selection.Mode = SelectionMode.Single;


            PopulateTreeWithWaves(desc);


            Table map = GetFieldTable(desc);

            Layout.PackStart(map, false, true, 0);
            map.Show();


            //
            // Allowed turrets
            //

            field = new HBox(true, 10);
            Layout.PackStart(field, true, false, 0);
            field.Show();

            AllowedTurretTree = new TreeView();

            TreeViewColumn availCol   = new TreeViewColumn();
            TreeViewColumn allowedCol = new TreeViewColumn();


            allowedCol.PackStart(textCellRenderer, true);
            allowedCol.Title = "Allowed Turrets";
            allowedCol.AddAttribute(textCellRenderer, "text", 1);
            AllowedTurretTree.AppendColumn(allowedCol);

            AllowedTurretModel               = new ListStore(typeof(int), typeof(string));
            AllowedTurretTree.Model          = AllowedTurretModel;
            AllowedTurretTree.Selection.Mode = SelectionMode.Multiple;

            field.PackEnd(AllowedTurretTree, true, true, 0);
            AllowedTurretTree.Show();

            PopulateTurretTrees(desc);


            Show();
            ShowAll();
        }
Esempio n. 5
0
        public void SetLevel(LevelDescription desc)
        {
            GtkHelpers.FlushAllDeferredEvents();

            Destroyed += LevelEditLayout_Destroyed;

            if (null != Layout)
            {
                Layout.Hide();
                Layout.Destroy();
                Layout = null;
            }

            LevelDesc = desc;

            Layout = new VBox(false, 0);
            AddWithViewport(Layout);

            HBox field = GtkHelpers.TextEntryField("Level Name", desc.Name, Name_Changed, true);

            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.TextEntryField("Lives", desc.Lives.ToString(), Lives_Changed, true, GtkHelpers.ValueType.Int);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.ComboBox("Width", LayoutOptions, (desc.FieldWidth / 5 - 1), Width_Changed, true);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.ComboBox("Depth", LayoutOptions, (desc.FieldDepth / 5 - 1), Depth_Changed, true);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.TextEntryField("Starting Coins", desc.StartingCoins.ToString(), StartingCoins_Changed, true, GtkHelpers.ValueType.Int);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.TextEntryField("Description Heading", desc.DescriptionHeading, DescriptionHeading_Changed);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.TextEntryField("Description Body", desc.DescriptionBody, DescriptionBody_Changed);
            Layout.PackStart(field, false, false, 0);
            field.Show();


            WavesTree = new TreeView();
            Layout.PackStart(WavesTree, false, false, 0);
            WavesTree.Show();

            List <EnemyDescription> enemies  = LevelManager.GetEnemies();
            ComboBoxText            comboBox = new ComboBoxText();

            foreach (EnemyDescription enemy in enemies)
            {
                comboBox.AppendText(enemy.Name);
            }
            comboBox.Active = 0;


            TreeViewColumn enemyCoumn            = new TreeViewColumn();
            TreeViewColumn countColumn           = new TreeViewColumn();
            TreeViewColumn difficultyColumn      = new TreeViewColumn();
            TreeViewColumn descriptionBodyColumn = new TreeViewColumn();

            CellRendererCombo comboCellRenderer = new CellRendererCombo();

            comboCellRenderer.Editable   = true;
            comboCellRenderer.Edited    += ComboCellRenderer_Edited;
            comboCellRenderer.TextColumn = 0;
            comboCellRenderer.HasEntry   = false;

            CellRendererText countCellRenderer = new CellRendererText();

            countCellRenderer.Editable = true;
            countCellRenderer.Edited  += CountCell_Edited;


            CellRendererText difficultyCellRenderer = new CellRendererText();

            difficultyCellRenderer.Editable = true;
            difficultyCellRenderer.Edited  += DifficultyCell_Edited;

            CellRendererText descriptionbodyRenderer = new CellRendererText();

            descriptionbodyRenderer.Editable = true;
            descriptionbodyRenderer.Edited  += DescriptionbodyRenderer_Edited;

            enemyCoumn.PackStart(comboCellRenderer, true);
            enemyCoumn.Title = "Enemy";
            enemyCoumn.AddAttribute(comboCellRenderer, "text", 1);
            WavesTree.AppendColumn(enemyCoumn);

            countColumn.PackStart(countCellRenderer, true);
            countColumn.Title = "Count";
            countColumn.AddAttribute(countCellRenderer, "text", 2);
            WavesTree.AppendColumn(countColumn);

            difficultyColumn.PackStart(difficultyCellRenderer, true);
            difficultyColumn.Title = "Difficulty Multiplier";
            difficultyColumn.AddAttribute(difficultyCellRenderer, "text", 3);
            WavesTree.AppendColumn(difficultyColumn);

            descriptionBodyColumn.PackStart(descriptionbodyRenderer, true);
            descriptionBodyColumn.Title = "Description Body";
            descriptionBodyColumn.AddAttribute(difficultyCellRenderer, "text", 4);
            WavesTree.AppendColumn(descriptionBodyColumn);

            //
            // Add column:  Max damage that can be dished to a single enemy given turret coverage + enemy speed
            //

            //
            // Add column: Max hit points of the wave
            //

            //
            // Add column: Max hit points of all the turrets combined firing at full capacity
            //

            //
            // Add column: Given all the factors, theoretical headroom of DPS
            //

            WavesModel               = new ListStore(typeof(int), typeof(string), typeof(int), typeof(float), typeof(string));
            WavesTree.Model          = WavesModel;
            WavesTree.Selection.Mode = SelectionMode.Single;

            PopulateTreeWithWaves(desc);

            field = new HBox(false, 5);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            Button b = new Button("+");

            b.Clicked += NewWave_Clicked;
            b.Show();
            field.PackStart(b, false, false, 0);

            b          = new Button("-");
            b.Clicked += RemoveWave_Clicked;
            b.Show();
            field.PackStart(b, false, false, 0);


            Table map = GetFieldTable(desc);

            Layout.PackStart(map, false, true, 0);
            map.Show();

            ErrorEntry            = new Entry();
            ErrorEntry.IsEditable = false;
            ErrorEntry.Text       = "No issues";
            Layout.PackStart(ErrorEntry, false, false, 10);
            ErrorEntry.Show();

            ValidateDescriptionAndReportIssues();

            //
            // Allowed turrets
            //

            field = new HBox(true, 10);
            Layout.PackStart(field, true, false, 0);
            field.Show();

            AvailTurretTree   = new TreeView();
            AllowedTurretTree = new TreeView();

            TreeViewColumn availCol   = new TreeViewColumn();
            TreeViewColumn allowedCol = new TreeViewColumn();

            CellRendererText availCellrenderer = new CellRendererText();

            availCellrenderer.Editable = false;

            CellRendererText allowedCellRenderer = new CellRendererText();

            allowedCellRenderer.Editable = false;

            availCol.PackStart(availCellrenderer, true);
            availCol.Title = "Not allowed turrets";
            availCol.AddAttribute(availCellrenderer, "text", 1);
            AvailTurretTree.AppendColumn(availCol);


            allowedCol.PackStart(allowedCellRenderer, true);
            allowedCol.Title = "Allowed Turrets";
            allowedCol.AddAttribute(allowedCellRenderer, "text", 1);
            AllowedTurretTree.AppendColumn(allowedCol);

            AvailTurretModel               = new ListStore(typeof(int), typeof(string));
            AvailTurretTree.Model          = AvailTurretModel;
            AvailTurretTree.Selection.Mode = SelectionMode.Multiple;

            AllowedTurretModel               = new ListStore(typeof(int), typeof(string));
            AllowedTurretTree.Model          = AllowedTurretModel;
            AllowedTurretTree.Selection.Mode = SelectionMode.Multiple;

            field.PackStart(AvailTurretTree, true, true, 0);
            AvailTurretTree.Show();

            VBox turretButtons = new VBox(true, 0);

            field.PackStart(turretButtons, true, true, 0);
            turretButtons.Show();

            b = new Button(">>");
            turretButtons.PackStart(b, false, false, 0);
            b.Clicked += AddAllTurrets_Clicked;
            b.Show();

            b = new Button(">");
            turretButtons.PackStart(b, false, false, 0);
            b.Clicked += AddSelectedTurrets_Clicked;
            b.Show();

            b = new Button("<");
            turretButtons.PackStart(b, false, false, 0);
            b.Clicked += RemoveSelectedTurrets_Clicked;
            b.Show();

            b = new Button("<<");
            turretButtons.PackStart(b, false, false, 0);
            b.Clicked += RemoveAllTurrets_Clicked;
            b.Show();

            field.PackEnd(AllowedTurretTree, true, true, 0);
            AllowedTurretTree.Show();

            PopulateTurretTrees(desc);


            Show();
            ShowAll();
        }
Esempio n. 6
0
        public void SetEnemy(string selectedStr)
        {
            GtkHelpers.FlushAllDeferredEvents();

            Destroyed += EnemyEditLayout_Destroyed;

            if (null != Layout)
            {
                Layout.Hide();
                Layout.Destroy();
                Layout = null;
            }

            Enemies = LevelManager.GetEnemies();
            Enemy   = null;
            for (int i = 0; i < Enemies.Count; i++)
            {
                if (Enemies[i].Name == selectedStr)
                {
                    Enemy = Enemies[i];
                }
            }

            if (Enemy == null)
            {
                throw new Exception("Could not find Enemy " + selectedStr);
            }

            Layout = new VBox(false, 0);
            AddWithViewport(Layout);

            HBox field = GtkHelpers.TextEntryField("Enemy Name", Enemy.Name, Name_Changed, true);

            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.TextEntryField("Asset", Enemy.Asset, Asset_Changed, true);
            Layout.PackStart(field, false, false, 0);
            field.Show();


            field = GtkHelpers.TextEntryField("Hit Points", Enemy.HitPoints.ToString(), HitPoints_Changed, true, GtkHelpers.ValueType.Int);
            Layout.PackStart(field, false, false, 0);
            field.Show();


            field = GtkHelpers.TextEntryField("Movement Speed", Enemy.MovementSpeed.ToString(), MovementSpeed_Changed, true, GtkHelpers.ValueType.Float);
            Layout.PackStart(field, false, false, 0);
            field.Show();


            field = GtkHelpers.TextEntryField("Spawn Rate", Enemy.SpawnRate.ToString(), SpawnRate_Changed, true, GtkHelpers.ValueType.Float);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.TextEntryField("Coins", Enemy.Coins.ToString(), Coins_Changed, true, GtkHelpers.ValueType.Float);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            Show();
            ShowAll();
        }
Esempio n. 7
0
        public void SetProjectile(string selectedStr)
        {
            GtkHelpers.FlushAllDeferredEvents();

            Destroyed += ProjectileEditLayout_Destroyed;

            if (null != Layout)
            {
                Layout.Hide();
                Layout.Destroy();
                Layout = null;
            }

            Projectiles = LevelManager.GetProjectiles();
            Projectile  = null;
            for (int i = 0; i < Projectiles.Count; i++)
            {
                if (Projectiles[i].Name == selectedStr)
                {
                    Projectile = Projectiles[i];
                }
            }

            if (Projectile == null)
            {
                throw new Exception("Could not find Projectile " + selectedStr);
            }

            Layout = new VBox(false, 0);
            AddWithViewport(Layout);

            HBox field = GtkHelpers.TextEntryField("Projectile Name", Projectile.Name, Name_Changed, true);

            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.TextEntryField("Asset", Projectile.Asset, Asset_Changed, true);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.TextEntryField("Impact Asset", Projectile.ImpactAsset, ImpactAsset_Changed, true);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            field = GtkHelpers.TextEntryField("AirSpeed", Projectile.AirSpeed.ToString(), AirSpeed_Changed, true, GtkHelpers.ValueType.Float);
            Layout.PackStart(field, false, false, 0);
            field.Show();



            EffectsTree = new TreeView();
            Layout.PackStart(EffectsTree, false, false, 0);
            EffectsTree.Show();

            ComboBoxText comboBox = new ComboBoxText();

            foreach (string name in Enum.GetNames(typeof(ProjectileEffectType)))
            {
                comboBox.AppendText(name);
            }
            comboBox.Active = 0;


            TreeViewColumn typeCoumn      = new TreeViewColumn();
            TreeViewColumn impactColumn   = new TreeViewColumn();
            TreeViewColumn durationColumn = new TreeViewColumn();
            TreeViewColumn radiusColumn   = new TreeViewColumn();

            CellRendererText durationCellRenderer = new CellRendererText();

            durationCellRenderer.Editable = true;
            durationCellRenderer.Edited  += DurationCell_Edited;


            CellRendererText impactCellRenderer = new CellRendererText();

            impactCellRenderer.Editable = true;
            impactCellRenderer.Edited  += ImpactCell_Edited;

            CellRendererText radiusCellRenderer = new CellRendererText();

            radiusCellRenderer.Editable = true;
            radiusCellRenderer.Edited  += RadiusCellRenderer_Edited;

            CellRendererCombo comboCellRenderer = new CellRendererCombo();

            comboCellRenderer.Editable   = true;
            comboCellRenderer.Edited    += ComboCellRenderer_Edited;
            comboCellRenderer.TextColumn = 0;
            comboCellRenderer.HasEntry   = false;

            typeCoumn.PackStart(comboCellRenderer, true);
            typeCoumn.Title = "Type";
            typeCoumn.AddAttribute(comboCellRenderer, "text", 1);
            EffectsTree.AppendColumn(typeCoumn);

            durationColumn.PackStart(durationCellRenderer, true);
            durationColumn.Title = "Duration";
            durationColumn.AddAttribute(durationCellRenderer, "text", 2);
            EffectsTree.AppendColumn(durationColumn);

            impactColumn.PackStart(impactCellRenderer, true);
            impactColumn.Title = "Impact";
            impactColumn.AddAttribute(impactCellRenderer, "text", 3);
            EffectsTree.AppendColumn(impactColumn);


            radiusColumn.PackStart(radiusCellRenderer, true);
            radiusColumn.Title = "Radius";
            radiusColumn.AddAttribute(radiusCellRenderer, "text", 4);
            EffectsTree.AppendColumn(radiusColumn);

            EffectsModel               = new ListStore(typeof(int), typeof(string), typeof(float), typeof(float), typeof(float));
            EffectsTree.Model          = EffectsModel;
            EffectsTree.Selection.Mode = SelectionMode.Single;

            PopulateTreeWithEffects();


            field = new HBox(false, 5);
            Layout.PackStart(field, false, false, 0);
            field.Show();

            Button b = new Button("+");

            b.Clicked += NewEffect_Clicked;
            b.Show();
            field.PackStart(b, false, false, 0);

            b          = new Button("-");
            b.Clicked += RemoveEffect_Clicked;
            b.Show();
            field.PackStart(b, false, false, 0);

            Show();
            ShowAll();
        }