Example #1
0
        /// <summary>
        /// Callback method executed when row/rows is/are selected
        /// </summary>
        /// <param name="o">TreeSelection object</param>
        /// <param name="args">Event arguments</param>
        void OnSelectionChanged(object o, EventArgs args)
        {
            TreeSelection selection = (TreeSelection)o;

            ITreeModel filtered;

            TreePath[] selectedRows = selection.GetSelectedRows(out filtered);

            // Clear a list storing PID to kill
            _processIdToKill.Clear();

            TreeIter iter;

            if (selectedRows.Length > 0)
            {
                for (int i = 0; i < selectedRows.Length; i++)
                {
                    filtered.GetIter(out iter, selectedRows[i]);

                    int id;
                    int.TryParse(filtered.GetValue(iter, 0).ToString(), out id);

                    if (id != 0)
                    {
                        _processIdToKill.Add(id);
                    }
                }
            }
            else
            {
                Console.WriteLine("Node is null.");
            }
        }
Example #2
0
 public void OnEnable()
 {
     if (!selectionObject)
     {
         selectionObject = ScriptableObject.CreateInstance <TreeSelection>();
     }
 }
Example #3
0
        void OnKeysTreeViewSelectionChange(object sender, EventArgs e)
        {
            TreeSelection sel = sender as TreeSelection;
            TreeModel     model;
            TreeIter      iter;

            accelComplete = false;

            if (sel.GetSelected(out model, out iter) && model.GetValue(iter, commandCol) != null)
            {
                accelEntry.Sensitive = true;
                CurrentBinding       = (string)model.GetValue(iter, bindingCol);
                //grab focus AFTER the selection event, or focus gets screwy
                GLib.Timeout.Add(10, delegate {
                    accelEntry.GrabFocus();
                    return(false);
                });
                accelIncomplete = false;
                accelComplete   = true;
            }
            else
            {
                accelEntry.Sensitive = false;
                CurrentBinding       = string.Empty;
            }
        }
Example #4
0
        protected void OnTvwUserRolCursorChanged(object sender, EventArgs e)
        {
            TreeSelection seleccion = (sender as TreeView).Selection;
            TreeIter      iter;
            TreeModel     model;

            if (seleccion.GetSelected(out model, out iter))
            {
                int i = 1; // contador // se usa para recorrer las posiciones del cbx
                while (true)
                {
                    this.cbxUser.Active = i;
                    if (this.cbxUser.ActiveText == model.GetValue(iter, 1).ToString())
                    {
                        break;
                    }
                    i++;
                }

                i = 1;
                while (true)
                {
                    this.cbxRol.Active = i;
                    if (this.cbxRol.ActiveText == model.GetValue(iter, 5).ToString())
                    {
                        break;
                    }
                    i++;
                }
            }
        }
Example #5
0
        private FileTemplate GetSelectedTemplate()
        {
            /*Gtk.TreeIter iter;
             * if (cbFileTemplates.GetActiveIter(out iter)){
             *      return  (FileTemplate)cbFileTemplates.Model.GetValue(iter, 3);
             * } else return null;*/
            TreeSelection ts = tvItem1.Selection;

            TreeIter ti = new TreeIter();

            if (ts.GetSelected(out ti))
            {
                return((FileTemplate)tvItem1.Model.GetValue(ti, 3));
            }
            else
            {
                return(null);
            }

            /*TreePath[] tp = ts.GetSelectedRows();
             * if (tp.Length < 1)
             *      return null;*/

            //return  (FileTemplate)tvItem1.Model.GetValue(ti, 3);
        }
Example #6
0
    protected void ontblPortsCursorChanged(object sender, EventArgs e)
    {
        TreeSelection selection = (sender as TreeView).Selection;

        TreeModel model;
        Boolean   selected = false;
        Boolean   conected = false;

        if (selection.GetSelected(out model, out iterSelected))
        {
            lblPuerto.LabelProp = "<span foreground=\"black\" size=\"xx-large\" weight=\"bold\">" + model.GetValue(iterSelected, 0) + "</span>";
            string status = model.GetValue(iterSelected, 2).ToString().ToLower();
            if (status.Equals("desconectado", StringComparison.CurrentCultureIgnoreCase))
            {
                imgPortStatus.Pixbuf  = new Gdk.Pixbuf(Directory.GetCurrentDirectory() + @"/Assets/Images/off.png");
                btnconnect.Visible    = true;
                btndisconnect.Visible = false;
                conected = false;
            }
            else if (status.Equals("conectado", StringComparison.CurrentCultureIgnoreCase))
            {
                imgPortStatus.Pixbuf  = new Gdk.Pixbuf(Directory.GetCurrentDirectory() + @"/Assets/Images/on.png");
                btndisconnect.Visible = true;
                btnconnect.Visible    = false;
                conected = true;
            }
            selected = true;

            fraCnnConfig.Visible = btnconnect.Visible;
        }

        fraPortDetail.Visible = selected;
        fraSendData.Visible   = conected;
    }
Example #7
0
        override protected bool SelectFunction(TreeSelection selection, TreeModel model, TreePath path, bool selected)
        {
            TreePath [] selectedRows;

            selectedRows = selection.GetSelectedRows();
            if (!selected && selectedRows.Length > 0)
            {
                object currentSelected;
                object firstSelected;

                firstSelected = GetValueFromPath(selectedRows [0]);
                // No multiple selection for players
                if (selectedRows.Length == 1 && firstSelected is Player)
                {
                    return(false);
                }
                currentSelected = GetValueFromPath(path);
                if (currentSelected is Player)
                {
                    return(false);
                }
                return(true);
            }
            // Always unselect
            return(true);
        }
Example #8
0
        protected void OnBtnDeleteIFiClicked(object sender, EventArgs e)
        {
            TreeSelection ts = tvIgnoreFiles.Selection;

            TreeIter ti = new TreeIter();

            ts.GetSelected(out ti);

            TreePath[] tp = ts.GetSelectedRows();
            if (tp.Length < 1)
            {
                return;
            }

            IgnoreFolder iFol = (IgnoreFolder)tvIgnoreFiles.Model.GetValue(ti, 3);

            if (iFol == null)
            {
                return;
            }

            MessageDialogs md     = new MessageDialogs(MessageDialogs.DialogButtonType.YesNo, MainClass.Languages.Translate("delete_resolution", iFol.Folder), "", Gtk.MessageType.Question, parentWindow);
            int            result = md.ShowDialog();

            if (result != (int)Gtk.ResponseType.Yes)
            {
                return;
            }

            ignoreFile.Remove(iFol);
            storeIFi.Remove(ref ti);
        }
Example #9
0
        public AddSet(Config cfg)
        {
            this.cfg = cfg;
            this.Build();
            CellRendererText renderer = new CellRendererText();

            instances.AppendColumn("Instance", renderer, "text", 0);
            instances_store = new TreeStore(typeof(string));
            instances.Model = instances_store;
            for (int i = 0; i < cfg.sets.Count; ++i)
            {
                counterset.AppendText(cfg.sets [i].Name);
            }
            instances.Selection.Changed += delegate {
                TreeSelection ts = instances.Selection;
                TreeIter      iter;
                TreeModel     mod;
                if (ts.GetSelected(out mod, out iter))
                {
                    instance = mod.GetValue(iter, 0) as string;
                }
            };
            if (cfg.sets.Count > 0)
            {
                counterset.Active = 0;
            }
        }
Example #10
0
        /// <summary>
        /// Selection has Owner or Current
        /// </summary>
        /// <returns>true if it has owner or Current</returns>
        public bool SelectionHasOwnerOrCurrent()
        {
            TreeModel tModel;

            TreeSelection tSelect   = UserTreeView.Selection;
            Array         treePaths = tSelect.GetSelectedRows(out tModel);

            // remove compiler warning
            if (tModel != null)
            {
                tModel = null;
            }

            foreach (TreePath tPath in treePaths)
            {
                TreeIter iter;

                if (UserTreeStore.GetIter(out iter, tPath))
                {
                    iFolderUser user =
                        (iFolderUser)UserTreeStore.GetValue(iter, 0);
                    if (user.UserID == ifolder.OwnerID)
                    {
                        return(true);
                    }
                    if (user.UserID == ifolder.CurrentUserID)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Example #11
0
        protected void OnBtnEditIFiClicked(object sender, EventArgs e)
        {
            TreeSelection ts = tvIgnoreFiles.Selection;

            TreeIter ti = new TreeIter();

            ts.GetSelected(out ti);

            TreePath[] tp = ts.GetSelectedRows();
            if (tp.Length < 1)
            {
                return;
            }

            IgnoreFolder iFol = (IgnoreFolder)tvIgnoreFiles.Model.GetValue(ti, 3);

            if (String.IsNullOrEmpty(iFol.Folder))
            {
                return;
            }

            EntryDialog ed     = new EntryDialog(iFol.Folder, MainClass.Languages.Translate("new_name"), parentWindow);
            int         result = ed.Run();

            if (result == (int)ResponseType.Ok)
            {
                if (!String.IsNullOrEmpty(ed.TextEntry))
                {
                    iFol.Folder = ed.TextEntry;
                    storeIFi.SetValues(ti, ed.TextEntry, iFol.IsForIde, iFol.IsForPublish, iFol);
                }
            }
            ed.Destroy();
        }
Example #12
0
 protected void OnEditarClicked(object send, EventArgs eA)
 {
     try
     {
         TreeSelection treeSelection = (TreeSelection)treeView.Selection;
         treeSelection.GetSelected(out TreeIter iter);
         List <string> values = new List <string>();
         for (int i = 0; i < campos.Count; i++)
         {
             Console.WriteLine(treeView.Model.GetValue(iter, i).ToString());
             values.Add(treeView.Model.GetValue(iter, i).ToString());
         }
         List <string> copyCampos = new List <string>(campos);
         copyCampos.RemoveAt(0);
         List <string> copyValues = new List <string>(values);
         copyValues.RemoveAt(0);
         List <string> entrysText      = new List <string>();
         WindowAction  ventanaAcciones = new WindowAction("productos", copyCampos, copyValues);
         ventanaAcciones.Destroyed += (sender, e) =>
         {
             entrysText = ventanaAcciones.GetEntrysContent();
             Actions.Edit(dbCommand, copyCampos, entrysText, "productos", "id", values[0]);
             List <string> valoresCeldas = new List <string>(Actions.List(dbCommand, "productos"));
             treeViewHelper.BuildTreeView(valoresCeldas, campos, treeView);
         };
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         MessageDialog alert = new MessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Warning, ButtonsType.Ok, "¡SELECCIONE UNA FILA PARA EDITARLA!");
         alert.Run();
         alert.Destroy();
     }
 }
Example #13
0
        protected virtual void OnBtnDeleteFilterClicked(object sender, System.EventArgs e)
        {
            TreeSelection ts = tvFilter.Selection;

            TreeIter ti = new TreeIter();

            ts.GetSelected(out ti);

            TreePath[] tp = ts.GetSelectedRows();
            if (tp.Length < 1)
            {
                return;
            }

            LogicalSystem cd = (LogicalSystem)tvFilter.Model.GetValue(ti, 1);

            if (cd == null)
            {
                return;
            }

            MessageDialogs md     = new MessageDialogs(MessageDialogs.DialogButtonType.YesNo, MainClass.Languages.Translate("delete_filter", cd.Display), "", Gtk.MessageType.Question, parentWindow);
            int            result = md.ShowDialog();

            if (result != (int)Gtk.ResponseType.Yes)
            {
                return;
            }

            conditions.Remove(cd);
            maskStore.Clear();
            filterStore.Remove(ref ti);
        }
Example #14
0
        /// <summary>
        /// update command from selected row in command file area
        /// </summary>
        private void GetCommandFromList()
        {
            // clear text
            TxtCmd.Text = "";
            MainClass.GtkWait();

            // obtain row content
            TreeSelection ts = LstCommands.Selection;
            TreeIter      ti;
            bool          issel = ts.GetSelected(out ti);

            // if no row selected
            if (!issel)
            {
                return;
            }

            string command = (string)lsCommands.GetValue(ti, 0);

            // check for empty row
            if (command.Trim() == "")
            {
                return;
            }


            // check for comments
            if (command.Trim().IndexOf("#") == 0)
            {
                return;
            }


            TxtCmd.Text = command.Substring(31);
        }
Example #15
0
        protected void onBnFace2Remove(object sender, EventArgs e)
        {
            TreeSelection selection = treeviewFace2.Selection;
            TreeModel     model;
            TreeIter      iter;

            if (selection.CountSelectedRows() == 1)
            {
                TreePath tp     = selection.GetSelectedRows()[0];
                int      iPlace = tp.Indices[0];

                if (selection.GetSelected(out model, out iter))
                {
                    // get the face1 list
                    //

                    Dictionary <String, String>         cardDefinition = CardGeneratorDB.Instance.getRowFromTable(CardGeneratorDB.TABLECardDefinitions, "FaceCardName", _SelectedCardTypeName);
                    List <CardDefinitions.CardDefClass> face1          = CardDefinitions.faceCardStructureFromJSONString(cardDefinition["Face2"]);
                    face1.RemoveAt(iPlace);
                    String face1JSONString = CardDefinitions.JSONStringFromfaceCardStructure(face1);

                    CardGeneratorDB.Instance.updateRowField(CardGeneratorDB.TABLECardDefinitions, CardGeneratorDB.COLUMNCardDefinitionID, cardDefinition[CardGeneratorDB.COLUMNCardDefinitionID], "Face2", face1JSONString);

                    SelectCardType(_SelectedCardTypeName);
                }
            }
        }
Example #16
0
        protected void OnButton164Clicked(object sender, EventArgs e)
        {
            TreeSelection selection = treeview1.Selection;
            TreeIter      iter;
            TreeModel     model;

            if (selection.GetSelected(out model, out iter))
            {
                Dictionary <String, String> modifyAction = new Dictionary <string, string> ();
                modifyAction.Add("action", "remove");
                //modifyAction.Add ("client_ip", model.GetValue (iter, 0).ToString());
                modifyAction.Add("agent_id", model.GetValue(iter, 1).ToString());
                modifyAction.Add("resource_ip", model.GetValue(iter, 2).ToString());
                modifyAction.Add("gpu_uuid", gpuInfo["gpu_uuid"]);
                modifyAction.Add("assign_type", gpuInfo ["assign_type"]);
                clientChanges.Add(modifyAction);
                agentListView = (TreeStore)model;
                agentListView.Remove(ref iter);
                UpdateProvisionRate(CountNodes(agentListView));
            }
            else
            {
                MessageDialog msg = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, "No Client Selected");
                msg.Response += (o, args) => {
                    if (args.ResponseId == ResponseType.Ok)
                    {
                        msg.Destroy();
                    }
                };
                msg.Show();
            }

            treeview1.Model = agentListView;
            treeview1.ExpandAll();
        }
Example #17
0
        private void RenderServiceColumn(
            TreeViewColumn column,
            CellRenderer cell,
            TreeModel model,
            TreeIter iter)
        {
            string        markup    = (string)model.GetValue(iter, 1);
            TreeSelection selection = (column.TreeView as TreeView).Selection;

            if (selection.IterIsSelected(iter))
            {
                if (column.TreeView.HasFocus)
                {
                    markup = markup.Replace(this.SecondaryTextColor, this.SecondaryTextColorSelected);
                }
                else
                {
                    markup = markup.Replace(this.SecondaryTextColorSelected, this.SecondaryTextColor);
                }
            }
            else
            {
                markup = markup.Replace(this.SecondaryTextColorSelected, this.SecondaryTextColor);
            }

            (cell as CellRendererText).Markup = markup;
        }
Example #18
0
        protected void OnTvwOpcRolCursorChanged(object sender, EventArgs e)
        {
            TreeSelection seleccion = (sender as TreeView).Selection;
            TreeIter      iter;
            TreeModel     model;

            if (seleccion.GetSelected(out model, out iter))
            {
                int i = 1;   //Contador
                while (true) //Ciclo sea infinito
                {
                    this.cbxRol.Active = i;
                    if (this.cbxRol.ActiveText == model.GetValue(iter, 1).ToString())
                    {
                        break;
                    }
                    i++;
                }
                i = 1;       //Contador
                while (true) //Cilco sea infinito
                {
                    this.cbxOpcion.Active = i;
                    if (this.cbxOpcion.ActiveText == model.GetValue(iter, 3).ToString())
                    {
                        break;
                    }
                    i++;
                }
            }
        }
Example #19
0
        public ProcessSelector()
        {
            this.Build();

            CellRendererText t = new CellRendererText();

            treeview.AppendColumn("Process", t, "text", 0);

            treeview.Selection.Changed += delegate {
                TreeSelection ts = treeview.Selection;
                TreeIter      iter;
                TreeModel     mod;
                if (ts.GetSelected(out mod, out iter))
                {
                    string proc = mod.GetValue(iter, 0) as string;
                    int    r;

                    if (Int32.TryParse(proc.Substring(0, proc.IndexOf('/')), out r))
                    {
                        pid = r;
                    }
                }
            };

            procstore = new TreeStore(typeof(String));
            UpdateTreeView();
            treeview.Model = procstore;

            UpdateTreeView();
        }
Example #20
0
        void HandleSelectionChanged(object sender, EventArgs e)
        {
            TreeSelection selection = (TreeSelection)sender;

            //TreeIter iterCell = new TreeIter ();
            //selection.GetSelected (out iterCell);

            TreePath[] paths = selection.GetSelectedRows();
            T[]        items = new T[paths.Length];
            for (int n = 0; n < paths.Length; n++)
            {
                TreeIter iter;
                Model.GetIter(out iter, paths[n]);
                items[n] = (T)Model.GetValue(iter, 0);
            }

            SelectedItems = items;

            var itemEvent = ItemSelected;

            if (itemEvent != null)
            {
                itemEvent(items);
            }
        }
Example #21
0
        void OnKeysTreeViewSelectionChange(object sender, EventArgs e)
        {
            TreeSelection sel = sender as TreeSelection;
            TreeModel     model;
            TreeIter      iter;
            Command       selCommand = null;

            if (sel.GetSelected(out model, out iter) && model.GetValue(iter, commandCol) != null)
            {
                selCommand = model.GetValue(iter, commandCol) as Command;
                if (CurrentSelectedBinding?.Command == selCommand)                 // command is already selected
                {
                    return;
                }

                accelComplete = false;
                var binding = model.GetValue(iter, bindingCol) as string;
                iter = filterModel.ConvertIterToChildIter(iter);
                CurrentSelectedBinding = new KeyBindingSelectedEventArgs(binding.Split(new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries), 0, selCommand, iter);
                accelIncomplete        = false;
                accelComplete          = true;
                accelEntry.Sensitive   = true;
            }
            else
            {
                accelEntry.Sensitive   = updateButton.Sensitive = addButton.Sensitive = false;
                CurrentSelectedBinding = null;
            }
        }
Example #22
0
        protected void OnButton44Clicked(object sender, EventArgs e)
        {
            TreeModel     model;
            TreeIter      iter;
            TreeSelection selection = treeview6.Selection;
            String        clientIp  = combobox2.ActiveText.Split(':') [0];
            String        clientId  = combobox2.ActiveText.Split(':') [1];

            if (selection.GetSelected(out model, out iter))
            {
                Dictionary <String, String> assignEntry = new Dictionary <string, string> ();
                assignEntry.Add("action", "remove");
                assignEntry.Add("resource_ip", model.GetValue(iter, 0).ToString());
                assignEntry.Add("gpu_uuid", model.GetValue(iter, 2).ToString());
                assignEntry.Add("assign_type", model.GetValue(iter, 3).ToString());
                assignEntry.Add("agent_id", clientId);
                AssignmentChange.Add(assignEntry);

                gpuAssignView.Remove(ref iter);
                treeview6.Model = gpuAssignView;
            }
            else
            {
                MessageDialog msg = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, "No Assignment Entry has been selected");
                msg.Response += (o, args) => {
                    if (args.ResponseId == ResponseType.Ok)
                    {
                        msg.Destroy();
                    }
                };
                msg.ShowAll();
            }
        }
Example #23
0
        protected virtual void OnBtnDeleteFieldClicked(object sender, System.EventArgs e)
        {
            TreeSelection ts = tvFields.Selection;

            TreeIter ti = new TreeIter();

            ts.GetSelected(out ti);

            TreePath[] tp = ts.GetSelectedRows();
            if (tp.Length < 1)
            {
                return;
            }

            FieldTable cd = (FieldTable)tvFields.Model.GetValue(ti, 2);

            if (cd == null)
            {
                return;
            }

            MessageDialogs md     = new MessageDialogs(MessageDialogs.DialogButtonType.YesNo, MainClass.Languages.Translate("delete_field", cd.Name), "", Gtk.MessageType.Question, this);
            int            result = md.ShowDialog();

            if (result != (int)Gtk.ResponseType.Yes)
            {
                return;
            }

            fields.Remove(cd);
            fieldsStore.Remove(ref ti);
        }
Example #24
0
        protected void OnTreeview4RowActivated(object o, RowActivatedArgs args)
        {
            TreeSelection selectedRow = treeview4.Selection;
            TreeModel     model;
            TreeIter      iter;
            TreeIter      parentIter;
            Dictionary <String, String> gpuInfo = new Dictionary <string, string> ();

            if (selectedRow.GetSelected(out model, out iter) &&
                model.IterParent(out parentIter, iter))
            {
                ShowGpuDetailInfo(model.GetValue(iter, 3).ToString());
                if (!AssignmentInProcess)
                {
                    gpuInfo.Add("resource_ip", model.GetValue(iter, 0).ToString());
                    gpuInfo.Add("gpu_id", model.GetValue(iter, 2).ToString());
                    gpuInfo.Add("gpu_uuid", model.GetValue(iter, 3).ToString());
                    gpuInfo.Add("gpu_model", model.GetValue(iter, 4).ToString());
                    gpuInfo.Add("assign_type", model.GetValue(iter, 5).ToString());

                    DialogModifyGpuAssign modifyAssignByGpu = new DialogModifyGpuAssign(gpuInfo, ServerIp, TcpPort);
                    modifyAssignByGpu.Hidden += (object sender, EventArgs e) => {
                        LoadAllGpuList();
                        modifyAssignByGpu.Destroy();
                    };
                    modifyAssignByGpu.ShowAll();
                }
            }
        }
Example #25
0
        void OnPreferencesTreeViewSelectionChanged(object o, EventArgs args)
        {
            TreeSelection sel = (TreeSelection)o;
            TreeModel     tm;
            TreeIter      ti;

            if (sel.GetSelected(out tm, out ti))
            {
                IPluginPreferences ipp = (IPluginPreferences)tm.GetValue(ti, 1);

                // If user tried to select a header row, keep the previous selection
                if (ipp == null)
                {
                    sel.SelectIter(selectedIter);
                    return;
                }

                if (PreferencesPaned.Child2 != null)
                {
                    PreferencesPaned.Remove(PreferencesPaned.Child2);
                }

                PreferencesPaned.Pack2(ipp.Widget, true, false);
                ipp.LoadPreferences();
                ipp.Widget.ShowAll();

                selectedIter = ti;
            }
        }
Example #26
0
        private void OnMigrateAccount(object o, EventArgs args)
        {
            TreeSelection tSelect = AccTreeView.Selection;

            if (tSelect.CountSelectedRows() == 1)
            {
                TreeModel tModel;
                TreeIter  iter;

                tSelect.GetSelected(out tModel, out iter);
//				string id = (string) tModel.GetValue(iter, 0);
                MigrationWizard migratewiz = null;                 //new MigrationWizard(GetName(id), GetHomeLocation(id), ifws, this);

                migratewiz.TransientFor = topLevelWindow;
                if (!Util.RegisterModalWindow(migratewiz))
                {
                    try
                    {
                        Util.CurrentModalWindow.Present();
                    }
                    catch {}
                    migratewiz.Destroy();
                    return;
                }
                migratewiz.ShowAll();

                /*
                 *      if(curDomains.Count == 0)
                 *      {
                 *              this.Hide();
                 *              this.Destroy();
                 *      }
                 */
            }
        }
Example #27
0
        protected void OnTwHuespedCursorChanged(object sender, EventArgs e)
        {
            TreeSelection seleccion = (sender as TreeView).Selection;
            TreeIter      iter;
            TreeModel     model;

            if (seleccion.GetSelected(out model, out iter))
            {
                tbh.Id_huesped = Convert.ToInt32(model.GetValue(iter, 0).ToString());
                tbh.Cedula     = model.GetValue(iter, 1).ToString();
                tbh.Nombres    = model.GetValue(iter, 2).ToString();
                tbh.Apellidos  = model.GetValue(iter, 3).ToString();
                tbh.Telefono   = model.GetValue(iter, 4).ToString();
                tbh.Email      = model.GetValue(iter, 5).ToString();

                txtNombres.Text   = tbh.Nombres;
                txtApellidos.Text = tbh.Apellidos;
                txtCedula.Text    = tbh.Cedula;

                //tus.Id_user = Convert.ToInt32(model.GetValue(iter, 0).ToString());
                //this.txtusuario.Text = model.GetValue(iter, 1).ToString();
                //this.txtnombres.Text = model.GetValue(iter, 2).ToString();
                //this.txtapellidos.Text = model.GetValue(iter, 3).ToString();
                //this.txtemail.Text = model.GetValue(iter, 4).ToString();
            }
        }
Example #28
0
 /// <summary>
 /// Update Widget Sensitivity
 /// </summary>
 private void UpdateWidgetSensitivity()
 {
     if (curDomains.Count > 0)
     {
         TreeSelection tSelect = AccTreeView.Selection;
         if (tSelect == null)
         {
             MigrateButton.Sensitive = false;
             DetailsButton.Sensitive = false;
         }
         if (tSelect.CountSelectedRows() == 1)
         {
             MigrateButton.Sensitive = true;
             DetailsButton.Sensitive = true;
         }
         else
         {
             // Nothing is selected
             //AddButton.Sensitive			= false;
             MigrateButton.Sensitive = false;
             DetailsButton.Sensitive = false;
         }
     }
     else
     {
         MigrateButton.Sensitive = false;
         DetailsButton.Sensitive = false;
     }
 }
Example #29
0
        protected void ontblPortsCursorChanged(object sender, EventArgs e)
        {
            TreeSelection selection = (sender as TreeView).Selection;

            TreeModel model;

            if (selection.GetSelected(out model, out iterSelected))
            {
                txtPuerto.Text = model.GetValue(iterSelected, 0).ToString();
                txtalias.Text  = model.GetValue(iterSelected, 1).ToString();
                txtDesc.Text   = model.GetValue(iterSelected, 2).ToString();

                string baudRate = model.GetValue(iterSelected, 3).ToString();
                string parity   = model.GetValue(iterSelected, 4).ToString();
                string databits = model.GetValue(iterSelected, 5).ToString();
                string stopbits = model.GetValue(iterSelected, 6).ToString();

                this.SelIterCmb(cmbBaudRate, baudRate);
                this.SelIterCmb(cmbParity, parity);
                this.SelIterCmb(cmbDatabits, databits);
                this.SelIterCmb(cmbStopbits, stopbits);

                ChangeFormMode(FormMode.Edit);
                txtalias.GrabFocus();
            }
        }
Example #30
0
        //static void OnSelectRecord(object sender, RowActivatedArgs a){
        static void OnSelectRecord(object sender, EventArgs a)
        {
            //var ra = ListRecords.Selection.Data;

            /* debug
             * QuickGTK.Info($"Activated {ra}");
             * foreach(string k in ra.Keys){
             *  var v = ra[k];
             *  QuickGTK.Info($"Key {k}\nValue {v}");
             * }
             * // */
            TreeSelection selection = (sender as TreeView).Selection;
            TreeModel     model;
            TreeIter      iter;

            if (selection.GetSelected(out model, out iter))
            {
                var rec = (model.GetValue(iter, 0) as string);
                //QuickGTK.Info(rec);
                Field2Gui.SelectRecord(rec);
                sc_rec = rec;
                ButRemove.Sensitive = true;
            }
            else
            {
                Pages.Sensitive     = false;
                ButRemove.Sensitive = false;
                ButRename.Sensitive = false;
                ButDupe.Sensitive   = false;
            }
        }