Esempio n. 1
0
        /// <summary>
        /// Setups the nodeview.
        /// </summary>
        private void SetupNodeView()
        {
            nvSequenceOptionsStore = new NodeStore (typeof(SequenceOperationTreeNode));

            nvSequenceOptions.NodeStore = nvSequenceOptionsStore;
            nvSequenceOptions.AppendColumn (new TreeViewColumn ("Time", new CellRendererText (), "text", 0));
            nvSequenceOptions.AppendColumn (new TreeViewColumn ("Duration", new CellRendererText (), "text", 1));
            nvSequenceOptions.AppendColumn (new TreeViewColumn ("State", new CellRendererText (), "text", 2));

            nvSequenceOptions.ButtonPressEvent += new ButtonPressEventHandler (OnSequenceOptionsButtonPress);
            nvSequenceOptions.KeyPressEvent += new KeyPressEventHandler (OnSequenceOptionsKeyPress);
            nvSequenceOptions.RowActivated += (o, args) => {
                var node = ((o as NodeView).NodeSelection.SelectedNode as SequenceOperationTreeNode);
                ActiveNode = node;
                sbDays.Value = node.SeqOp.Duration.Days;
                sbHours.Value = node.SeqOp.Duration.Hours;
                sbMinutes.Value = node.SeqOp.Duration.Minutes;
                sbSeconds.Value = node.SeqOp.Duration.Seconds;
                sbMilliSec.Value = node.SeqOp.Duration.Milliseconds;
                cbState.Active = (node.SeqOp.State == DPinState.HIGH) ? 0 : 1;

                btnRemoveOperation.Sensitive = true;

                SwitchToApplyBtn ();
            };

            nvSequenceOptions.Show ();
        }
Esempio n. 2
0
 /// <summary>
 /// Removes a operation.
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 protected void OnBtnRemoveOperationClicked(object sender, EventArgs e)
 {
     if (ActiveNode != null) {
         PinSequence.Chain.RemoveAt (ActiveNode.Index);
         DisplaySequenceInfos ();
         btnRemoveOperation.Sensitive = false;
         ActiveNode = null;
     }
 }