Exemplo n.º 1
0
		protected override bool OnMatchSelected (TreeModel filter, TreeIter iter){
			Entry entry = (Entry)Entry;
			entry.Text = ((ItemTag)filter.GetValue(iter,0)).Name;
			entry.FinishEditing();
			entry.RemoveWidget();
			return true;
		}
Exemplo n.º 2
0
        public Eventos()
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build ();
            for (int h = 0; h < 65; h++)
                cmdHoraInicio.AppendText (DateTime.Parse("08:00").AddMinutes(15.0*(double)h).ToString("HH:mm"));

            for (int h = 1; h < 20; h++)
                cmbDuracion.AppendText (DateTime.Parse("00:00").AddMinutes(15.0*(double)h).ToString("HH:mm"));

            Gtk.TreeIter iter = new Gtk.TreeIter();
            cmdHoraInicio.Model.GetIterFirst(out iter);
            cmdHoraInicio.SetActiveIter(iter);

            cmbDuracion.Model.GetIterFirst(out iter);
            cmbDuracion.SetActiveIter(iter);

            txtinfoContacto.Changed += (sender, e) => ValidarEvento();
            txtNombreEvento.Changed += (sender, e) => ValidarEvento();
            txtPatrocinadoPor.Changed += (sender, e) => ValidarEvento();
            txtPrecioEvento.Changed += (sender, e) => ValidarEvento();
            calFechaEvento.DaySelected += (sender, e) => ValidarEvento();
            cmdHoraInicio.Changed += (sender, e) => ValidarEvento();
            cmbDuracion.Changed += (sender, e) => ValidarEvento();

            ValidarEvento();
        }
Exemplo n.º 3
0
 public void InitGrub()
 {
     if(!MainClass.boRoot)
     {
         BTN_RemoveEntry.Visible = false;
         BTN_AddEntry.Visible = false;
         BTN_Save.Visible = false;
         BTN_Apply.Visible = false;
         BTN_Modify.Visible=false;
         SAI_Hdd.Visible = false;
         LIB_Root.Visible=true;
     }
     else
     {
         LIB_Root.Visible=false;
     }
     model.Clear();
     CBO_Entry.Model=model;
     int i = 0;
     TreeIter iter =new TreeIter();
     foreach (GrubEntry entry in MainClass.grub.Entrys)
     {
         string titre=entry.title;
         iter=model.AppendValues(titre,i);
         if(i==0)
             CBO_Entry.SetActiveIter(iter);
         i++;
     }
     SAI_Default.Text=MainClass.grub.GetDefault().ToString();
     SAI_TimeOut.Text=MainClass.grub.GetTimeout().ToString();
     SAI_Gfx.Text=MainClass.grub.GetGfx();
 }
Exemplo n.º 4
0
        public pases()
        {
            this.Build ();

            cmbPerfilPase.PackStart(crt1,false);
            cmbPerfilPase.PackStart(crt2,false);
            cmbPerfilPase.AddAttribute(crt1, "text", 1);
            cmbPerfilPase.Model = lsPerfilPase;

            string c = "SELECT `ID_perfil`, `nombre_perfil`, `cantidad_pases`, `dias_validos`, `precio_individual`, `fecha_expiracion`, `razon`, `disponibles`, `ilimitado`, `utilizados` FROM `perfil_pases` WHERE deshabilitado=0";
            MySQL.consultar(c);

            while (MySQL.Reader.Read())
            {
                lsPerfilPase.AppendValues(
                    MySQL.Reader["ID_perfil"].ToString(),			//0
                    MySQL.Reader["nombre_perfil"].ToString(),		//1
                    MySQL.Reader["cantidad_pases"].ToString(),		//2
                    MySQL.Reader["dias_validos"].ToString(), 		//3
                    MySQL.Reader["precio_individual"].ToString(), 	//4
                    MySQL.Reader["fecha_expiracion"].ToString(), 	//5
                    MySQL.Reader["razon"].ToString(), 				//6
                    MySQL.Reader["disponibles"].ToString(), 		//7
                    MySQL.Reader["ilimitado"].ToString(), 			//8
                    MySQL.Reader["utilizados"].ToString()			//9
                    );
            }

            Gtk.TreeIter iter = new Gtk.TreeIter();
            lsPerfilPase.GetIterFirst(out iter);
            cmbPerfilPase.SetActiveIter(iter);
        }
Exemplo n.º 5
0
        protected virtual void OnCmdGrabarClicked(object sender, System.EventArgs e)
        {
            TreeIter iter = new TreeIter();

            if (tvLista.Model.GetIterFirst(out iter)) {
            do {
                if (tvLista.Model.GetValue(iter,cafeteria.tvLista_Col_Cantidad).ToString() != "0")
                {
                    MySQL.consultar("INSERT INTO `cafeteria_stock` (`ID_articulo`, `stock`, `fecha`, `ingresado_por`) " +
                    "VALUES(" +
                            "'" + tvLista.Model.GetValue(iter,cafeteria.tvLista_Col_ID_articulo).ToString() + "'," +
                            "'" + tvLista.Model.GetValue(iter,cafeteria.tvLista_Col_Cantidad).ToString() + "'," +
                            "NOW()," +
                            auth.ID_usuario +
                            ")");
                }
            } while(tvLista.Model.IterNext(ref iter));
            }
            MySQL.consultar("INSERT INTO `cafeteria_ingresos` (`ID_ingreso`, `descripcion`, `comprador`, `ingresado_por`, `fechatiempo`, `total_compra`) " +
            "VALUES(" +
            "0, " +
            "'"+txtDetalle.Buffer.Text+"'," +
            "'"+txtComprador.Text+"'," +
            ""+auth.ID_usuario+"," +
            "NOW()," +
            "'"+txtTotalCompra.Text+"'" +
            ")");

            Gtk.MessageDialog Mensaje = new MessageDialog(this, DialogFlags.Modal, MessageType.Info, ButtonsType.Close, "Ingreso realizado.\nEsta ventana se cerrará");
            Mensaje.Title="Éxito";
            Mensaje.Run();
            Mensaje.Destroy();
            this.Destroy();
            return;
        }
Exemplo n.º 6
0
    public DocsTreeView(Gtk.TextView rtv, OurParserTask r)
    {
        tv = rtv;
        AppendColumn("Name", new Gtk.CellRendererText());
        AppendColumn("Result", new Gtk.CellRendererPixbuf());

        RulesHint = true;

        Columns[0].SetCellDataFunc(Columns[0].CellRenderers[0],
                new Gtk.TreeCellDataFunc(RenderName));
        Columns[1].SetCellDataFunc(Columns[1].CellRenderers[0],
                new Gtk.TreeCellDataFunc(RenderIcon));

        Columns[0].Expand = true;

        Gtk.TreeStore mres_store = new Gtk.TreeStore(
                typeof(IParsed));
        Model = mres_store;

        Selection.Changed += new EventHandler(OnSelection);

        Gtk.TreeIter iter = new Gtk.TreeIter();
        foreach (ParsedDocument doc in r.Docs) {
            iter = mres_store.AppendValues(doc);
            foreach (IParsed m in doc.Results)
                if (m.Result > 0)
                    mres_store.AppendValues(iter, m);
        }
    }
Exemplo n.º 7
0
 public void LoadData(TreeViewBackend treeBackend, TreeModel treeModel, TreeIter iter)
 {
     this.treeModel = treeModel;
     this.iter = iter;
     cellView.Initialize (this);
     Visible = cellView.Visible;
 }
        protected override void UpdateSelection(TreeIter iter, bool active)
        {
            TreeStore store = Model as TreeStore;
            PlayerLongoMatch player = (PlayerLongoMatch)store.GetValue (iter, COL_VALUE);

            /* Check all children */
            if (player == localTeam || player == visitorTeam) {
                TreeIter child;
                store.IterChildren (out child, iter);

                filter.IgnoreUpdates = true;
                while (store.IterIsValid (child)) {
                    PlayerLongoMatch childPlayer = (PlayerLongoMatch)store.GetValue (child, COL_VALUE);
                    filter.FilterPlayer (childPlayer, active);
                    store.SetValue (child, COL_ACTIVE, active);
                    store.IterNext (ref child);
                }
                filter.IgnoreUpdates = false;
            } else {
                filter.FilterPlayer (player, active);
                if (!active) {
                    TreeIter team;
                    /* Uncheck the team check button */
                    if (local.List.Contains (player))
                        team = localIter;
                    else
                        team = visitorIter;
                    store.SetValue (team, COL_ACTIVE, false);
                }
            }

            store.SetValue (iter, COL_ACTIVE, active);
            filter.Update ();
        }
Exemplo n.º 9
0
        private void OnPixbufCellLayout(CellLayout layout, CellRenderer cell,
                                         TreeModel model, TreeIter iter)
        {
            CellRendererPixbuf pixbufCell = (cell as CellRendererPixbuf);

            IVirtualDevice device = (IVirtualDevice) model.GetValue (iter, 0);

            switch (device.DeviceType) {
            case VirtualDeviceType.HardDisk:
                pixbufCell.Pixbuf = hdPixbuf;
                break;
            case VirtualDeviceType.CdRom:
                pixbufCell.Pixbuf = cdromPixbuf;
                break;
            case VirtualDeviceType.Ethernet:
                pixbufCell.Pixbuf = ethernetPixbuf;
                break;
            case VirtualDeviceType.Floppy:
                pixbufCell.Pixbuf = floppyPixbuf;
                break;
            default:
                pixbufCell.Pixbuf = null;
                break;
            }
        }
Exemplo n.º 10
0
        public static void CellDataHandler (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            SourceRowRenderer renderer = cell as SourceRowRenderer;
            if (renderer == null) {
                return;
            }

            var type = model.GetValue (iter, (int)SourceModel.Columns.Type);
            if (type == null || (SourceModel.EntryType) type != SourceModel.EntryType.Source) {
                renderer.Visible = false;
                return;
            }

            Source source = model.GetValue (iter, 0) as Source;
            renderer.Source = source;
            renderer.Iter = iter;

            if (source == null) {
                return;
            }

            renderer.Visible = true;
            renderer.Text = source.Name;
            renderer.Sensitive = source.CanActivate;
        }
		public HelpTree () : base (GettextCatalog.GetString ("Help"), Gtk.Stock.Help)
		{
			tree_view = new MonoDevelop.Ide.Gui.Components.PadTreeView ();

			tree_view.AppendColumn ("name_col", tree_view.TextRenderer, "text", 0);
			tree_view.RowExpanded += new Gtk.RowExpandedHandler (RowExpanded);
			tree_view.Selection.Changed += new EventHandler (RowActivated);
			
			store = new TreeStore (typeof (string), typeof (Node));
			tree_view.Model = store;
			tree_view.HeadersVisible = false;
			
			scroller = new MonoDevelop.Components.CompactScrolledWindow ();
			scroller.ShadowType = Gtk.ShadowType.None;
			scroller.Add (tree_view);
			
			if (HelpService.HelpTree != null) {
				root_iter = store.AppendValues (GettextCatalog.GetString ("Mono Documentation"), HelpService.HelpTree);
				PopulateNode (root_iter);
	
				tree_view.ExpandRow (new TreePath ("0"), false);
				TreeIter child_iter;
			start:
				if (store.IterChildren (out child_iter, root_iter)) {
					do {
						if (!store.IterHasChild (child_iter)) {
							store.Remove (ref child_iter);
							goto start;
						}
					} while (store.IterNext (ref child_iter));
				}
			}
			Control.ShowAll ();
		}
Exemplo n.º 12
0
		public GtkTreeModelResult (Widget parent, TreeModel treeModel, int column, TreeIter iter) : base (parent)
		{
			ParentWidget = parent;
			TModel = treeModel;
			Column = column;
			resultIter = iter;
		}
Exemplo n.º 13
0
        private void BuildMediaTypeCombo ()
        {
            var store = media_type_store = new TreeStore (typeof (IA.MediaType), typeof (string));
            var combo = media_type_combo = new ComboBox ();
            combo.Model = store;

            all_iter = store.AppendValues (null, Catalog.GetString ("All"));

            mediatypes = new Dictionary<IA.FieldValue, TreeIter> ();
            foreach (var mediatype in IA.MediaType.Options.OrderBy (t => t.Name)) {
                if (mediatype.Id != "software") {
                    var iter = store.AppendValues (mediatype, mediatype.Name);
                    mediatypes.Add (mediatype, iter);

                    if (mediatype.Children != null) {
                        foreach (var child in mediatype.Children.OrderBy (t => t.Name)) {
                            var child_iter = store.AppendValues (iter, child, child.Name);
                            mediatypes.Add (child, child_iter);

                            // FIXME should remember the last selected one in a schema or per-source in the db
                            if (child.Id == "etree")
                                combo.SetActiveIter (child_iter);
                        }
                    }
                }
            }

            var cell = new CellRendererText ();
            combo.PackStart (cell, true);
            combo.AddAttribute (cell, "text", 1);

            PackStart (new Label (Catalog.GetString ("Collection:")), false, false, 0);
            PackStart (combo, false, false, 0);
        }
Exemplo n.º 14
0
		protected override bool OnMatchSelected (TreeModel filter, TreeIter iter){
			Location.Item = (Model.Item)filter.GetValue(iter,0);
			Entry entry = (Entry)Entry;
			entry.FinishEditing();
			entry.RemoveWidget();
			return true;
		}
Exemplo n.º 15
0
        public int GetPhotoCountByIter(TreeIter iter)
        {
            if ( ! IterIsValid (iter))
                return -1;

            return (int) GetValue (iter, 1);
        }
Exemplo n.º 16
0
        public Uri GetUriByIter(TreeIter iter)
        {
            if ( ! IterIsValid (iter))
                return null;

            return (Uri) GetValue (iter, 2);
        }
        public void SetNodeContent(TreeIter iter, Table2D table2D)
        {
            store.SetValue (iter, (int)ColumnNr2D.Obj, table2D);

            store.SetValue (iter, (int)ColumnNr2D.Category, table2D.Category);
            store.SetValue (iter, (int)ColumnNr2D.Toggle, false);
            store.SetValue (iter, (int)ColumnNr2D.Title, table2D.Title);
            store.SetValue (iter, (int)ColumnNr2D.UnitY, table2D.UnitY);

            store.SetValue (iter, (int)ColumnNr2D.NameX, table2D.NameX);
            store.SetValue (iter, (int)ColumnNr2D.UnitX, table2D.UnitX);

            store.SetValue (iter, (int)ColumnNr2D.CountX, table2D.CountX);

            store.SetValue (iter, (int)ColumnNr2D.Xmin, table2D.Xmin);
            store.SetValue (iter, (int)ColumnNr2D.Xmax, table2D.Xmax);

            store.SetValue (iter, (int)ColumnNr2D.Multiplier, table2D.Multiplier);
            store.SetValue (iter, (int)ColumnNr2D.Offset, table2D.Offset);

            store.SetValue (iter, (int)ColumnNr2D.Location, table2D.Location);
            store.SetValue (iter, (int)ColumnNr2D.XPos, table2D.RangeX.Pos);
            store.SetValue (iter, (int)ColumnNr2D.YPos, table2D.RangeY.Pos);
            store.SetValue (iter, (int)ColumnNr2D.Description, table2D.Description);
            Toggle (iter, table2D.Selected);

            SetNodeContentTypeChanged (iter, table2D);
        }
Exemplo n.º 18
0
 public iFolderViewItem(iFolderHolder holder, iFolderViewGroup group, TreeIter iter, int maxWidth)
 {
     this.holder = holder;
        this.group = group;
        this.iter = iter;
        this.maxWidth = maxWidth;
        this.CanFocus = true;
        this.bSelected = false;
        this.bMouseIsHovering = false;
        this.ModifyBg(StateType.Normal, this.Style.Base(StateType.Normal));
        this.ModifyBase(StateType.Normal, this.Style.Base(StateType.Normal));
        currentName = "";
        currentLocation = "";
        currentStatus = "";
        LoadImages();
        SetPixbufs();
        this.Add(CreateWidgets());
        this.WidthRequest = this.maxWidth;
        this.Realized +=
     new EventHandler(OnWidgetRealized);
        TargetEntry[] targets =
     new TargetEntry[]
     {
      new TargetEntry ("text/ifolder-id", 0, (uint)iFolderWindow.DragTargetType.iFolderID)
     };
        this.DragDataGet += new DragDataGetHandler(HandleDragDataGet);
        Drag.SourceSet(this, Gdk.ModifierType.Button1Mask, targets, Gdk.DragAction.Move);
 }
Exemplo n.º 19
0
        public string GetFolderNameByIter(TreeIter iter)
        {
            if ( ! IterIsValid (iter))
                return null;

            return (string) GetValue (iter, 0);
        }
		void AddEntry (TreeIter iter, SolutionItem entry)
		{
			string icon;
			if (entry.ParentFolder == null)
				icon = MonoDevelop.Ide.Gui.Stock.Solution;
			else if (entry is SolutionFolder)
				icon = MonoDevelop.Ide.Gui.Stock.SolutionFolderClosed;
			else if (entry is Project)
				icon = ((Project)entry).StockIcon;
			else
				icon = MonoDevelop.Ide.Gui.Stock.Project;
			
			bool visible = builder.CanBuild (entry);
			bool selected = selectedEntries.ContainsKey (entry);
			
			if (!(entry is SolutionFolder) && !visible)
				return;
			
			if (!iter.Equals (TreeIter.Zero))
				iter = store.AppendValues (iter, icon, entry.Name, entry, selected && visible, visible);
			else
				iter = store.AppendValues (icon, entry.Name, entry, selected && visible, visible);
			
			if (selected)
				tree.ExpandToPath (store.GetPath (iter));
			
			if (entry is SolutionFolder) {
				foreach (SolutionItem ce in ((SolutionFolder)entry).Items) {
					AddEntry (iter, ce);
				}
			}
		}
Exemplo n.º 21
0
        /// <summary>
        /// Override the default filter mechanism so that we show only
        /// completed tasks in this group.
        /// </summary>
        /// <param name="model">
        /// A <see cref="TreeModel"/>
        /// </param>
        /// <param name="iter">
        /// A <see cref="TreeIter"/>
        /// </param>
        /// <returns>
        /// A <see cref="System.Boolean"/>
        /// </returns>
        protected override bool FilterTasks(TreeModel model, TreeIter iter)
        {
            // Don't show any task here if showCompletedTasks is false
            if (!showCompletedTasks)
                return false;

            ITask task = model.GetValue (iter, 0) as ITask;
            if (task == null || task.State != TaskState.Completed)
                return false;

            // Make sure that the task fits into the specified range depending
            // on what the user has set the range slider to be.
            if (task.CompletionDate < this.timeRangeStart)
                return false;

            if (task.CompletionDate == DateTime.MinValue)
                return true; // Just in case

            // Don't show tasks in the completed group that were completed
            // today.  Tasks completed today should still appear under their
            // original group until tomorrow.
            DateTime today = DateTime.Now;

            if (today.Year == task.CompletionDate.Year
                    && today.DayOfYear == task.CompletionDate.DayOfYear)
                return false;

            return true;
        }
Exemplo n.º 22
0
		public MonoRuntimePanelWidget()
		{
			this.Build();
			
			labelRunning.Markup = GettextCatalog.GetString ("MonoDevelop is currently running on <b>{0}</b>.", Runtime.SystemAssemblyService.CurrentRuntime.DisplayName);
			store = new ListStore (typeof(string), typeof(object));
			tree.Model = store;
			
			CellRendererText crt = new CellRendererText ();
			tree.AppendColumn ("Runtime", crt, "markup", 0);
			TargetRuntime defRuntime = IdeApp.Preferences.DefaultTargetRuntime;
			
			foreach (TargetRuntime tr in Runtime.SystemAssemblyService.GetTargetRuntimes ()) {
				string name = tr.DisplayName;
				TreeIter it;
				if (tr == defRuntime) {
					name = "<b>" + name + " (Default)</b>";
					defaultIter = it = store.AppendValues (name, tr);
				} else
					it = store.AppendValues (name, tr);
				if (tr.IsRunning)
					runningIter = it;
			}
			
			tree.Selection.Changed += HandleChanged;
			UpdateButtons ();
		}
Exemplo n.º 23
0
        protected void SaveArticulo(object sender, EventArgs e)
        {
            String nombreArticulo = entryNombre.Text;
            int indiceCatArticulo = comboBoxCategoria.Active;
            TreeIter treeIter = new TreeIter ();

            comboBoxCategoria.Model.GetIterFirst (out treeIter);

            for (int j =0; j<indiceCatArticulo; j++) {

                comboBoxCategoria.Model.IterNext(ref treeIter);

            }
            IList categoriaModel = (IList) comboBoxCategoria.Model.GetValue (treeIter, 0);

            int categoriaId = int.Parse(categoriaModel [0].ToString());
            decimal precio = Convert.ToDecimal(spinButtonPrecio.Value);
            IList nuevaRow = new List<object>();
            nuevaRow.Add (nombreArticulo);
            nuevaRow.Add (categoriaId);
            nuevaRow.Add (precio);
            PersisterHelper.Save ("Articulo", nuevaRow);

            this.Destroy();
        }
        public HelpTree()
            : base(GettextCatalog.GetString ("Help"), Gtk.Stock.Help)
        {
            tree_view = new TreeView ();

            tree_view.AppendColumn ("name_col", new CellRendererText (), "text", 0);
            tree_view.RowExpanded += new Gtk.RowExpandedHandler (RowExpanded);
            tree_view.Selection.Changed += new EventHandler (RowActivated);

            store = new TreeStore (typeof (string), typeof (Node));
            root_iter = store.AppendValues (GettextCatalog.GetString ("Mono Documentation"), Runtime.Documentation.HelpTree);

            PopulateNode (root_iter);

            tree_view.Model = store;
            tree_view.HeadersVisible = false;

            scroller = new ScrolledWindow ();
            scroller.ShadowType = Gtk.ShadowType.In;
            scroller.Add (tree_view);

            tree_view.ExpandRow (new TreePath ("0"), false);
            TreeIter child_iter;
            start:
            store.IterChildren (out child_iter, root_iter);
            do {
                if (!store.IterHasChild (child_iter)) {
                    store.Remove (ref child_iter);
                    goto start;
                }
            } while (store.IterNext (ref child_iter));

            Control.ShowAll ();
        }
Exemplo n.º 25
0
	public ImageInfo () : base (null, null)
	{
		store = new TreeStore ((int)TypeFundamentals.TypeString,
				       (int)TypeFundamentals.TypeString);
		
		tv = new TreeView (store);
		tv.HeadersVisible = true;

		TreeViewColumn NameCol = new TreeViewColumn ();
		CellRenderer NameRenderer = new CellRendererText ();

		NameCol.Title = "Name";
		NameCol.PackStart (NameRenderer, true);
		NameCol.AddAttribute (NameRenderer, "markup", 0);
		tv.AppendColumn (NameCol);

		TreeViewColumn ValueCol = new TreeViewColumn ();
		CellRenderer ValueRenderer = new CellRendererText ();
		ValueCol.Title = "Value";
		ValueCol.PackStart (ValueRenderer, false);
		ValueCol.AddAttribute (ValueRenderer, "text", 1);
		tv.AppendColumn (ValueCol);

		//
		// Populate tree
		//

		TreeIter iter = new TreeIter ();
		PopulateGeneral (out iter);
		PopulateDetails (out iter);
		Add (tv);
	}
 protected void OnButtonOkClicked(object sender, EventArgs e)
 {
     //Получаем из листа новые значения
     parameters = new Dictionary<string, string> ();
     TreeIter iter = new TreeIter ();
     if (!parametersListStore.GetIterFirst (out iter))
         return;
     do {
         string key = (string)parametersListStore.GetValue (iter, 0);
         string value = (string)parametersListStore.GetValue (iter, 1);
         parameters.Add (key, value);
     } while (parametersListStore.IterNext (ref iter));
     //Добавляем или обновляем.
     foreach (var pair in parameters) {
         string value = String.Empty;
         if (MainSupport.BaseParameters.All.TryGetValue (pair.Key, out value)) {
             if (value == pair.Value)
                 continue;
         }
         MainSupport.BaseParameters.UpdateParameter (QSMain.ConnectionDB, pair.Key, pair.Value);
     }
     //Удаляем
     foreach (var pair in MainSupport.BaseParameters.All.ToList()) {
         if (!parameters.ContainsKey (pair.Key))
             MainSupport.BaseParameters.RemoveParameter (QSMain.ConnectionDB, pair.Key);
     }
 }
Exemplo n.º 27
0
    private void TextDataFunc(CellLayout cell_layout, CellRenderer renderer, TreeModel model, TreeIter iter)
    {
        CellRendererText textRenderer = (CellRendererText) renderer;
        Tilegroup group = (Tilegroup) Model.GetValue(iter, 0);

        textRenderer.Text = group.Name;
    }
 protected void OnButtonDeleteClicked(object sender, EventArgs e)
 {
     TreeIter iter = new TreeIter ();
     if (!treeParameters.Selection.GetSelected (out iter))
         return;
     parametersListStore.Remove (ref iter);
 }
Exemplo n.º 29
0
        public ApplicationWidget(Project project,Gtk.Window parent)
        {
            parentWindow =parent;
            this.Build();
            this.project = project;

            cbType = new ComboBox();

            ListStore projectModel = new ListStore(typeof(string), typeof(string));
            CellRendererText textRenderer = new CellRendererText();
            cbType.PackStart(textRenderer, true);
            cbType.AddAttribute(textRenderer, "text", 0);

            cbType.Model= projectModel;

            TreeIter ti = new TreeIter();
            foreach(SettingValue ds in MainClass.Settings.ApplicationType){// MainClass.Settings.InstallLocations){
                if(ds.Value == this.project.ApplicationType){
                    ti = projectModel.AppendValues(ds.Display,ds.Value);
                    cbType.SetActiveIter(ti);
                } else  projectModel.AppendValues(ds.Display,ds.Value);
            }
            if(cbType.Active <0)
                cbType.Active =0;

            tblGlobal.Attach(cbType, 1, 2, 0,1, AttachOptions.Fill|AttachOptions.Expand, AttachOptions.Fill|AttachOptions.Expand, 0, 0);

            afc = new ApplicationFileControl(project.AppFile,ApplicationFileControl.Mode.EditNoSaveButton,parentWindow);
            vbox2.PackEnd(afc, true, true, 0);
        }
Exemplo n.º 30
0
		private static void ProcessType (TreeIter parent, System.Type t)
		{
			foreach (MemberInfo mi in t.GetMembers ()) {
 				store.AppendValues (parent, mi.Name, mi.ToString ());
				count++;
			}
		}
Exemplo n.º 31
0
        static void ToggleDataFunc(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            Gtk.CellRendererToggle toggleRenderer = (Gtk.CellRendererToggle)cell;
            TaskListEntry          task           = model.GetValue(iter, DataColumns.Task) as TaskListEntry;

            if (task == null)
            {
                toggleRenderer.Visible = false;
                return;
            }
            toggleRenderer.Active = task.Completed;
        }
Exemplo n.º 32
0
        void RenderDistance(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, TreeModel model, Gtk.TreeIter iter)
        {
            var bot = model.GetValue(iter, 0) as MonitoringBot;

            if (bot != null)
            {
                //var market = viewModel.GetSymbolInformation(bot.Symbol);
                (cell as Gtk.CellRendererText).Text = bot?.Distance.ToString("N2") + "%";
            }
        }
Exemplo n.º 33
0
        void RenderTargetPrice(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, TreeModel model, Gtk.TreeIter iter)
        {
            var bot = model.GetValue(iter, 0) as MonitoringBot;

            if (bot != null)
            {
                var market = viewModel.GetSymbolInformation(bot.Symbol);
                (cell as Gtk.CellRendererText).Text = bot?.TargetPrice.ToString(market?.PriceFmt);
            }
        }
Exemplo n.º 34
0
        void RenderPrice(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, TreeModel model, Gtk.TreeIter iter)
        {
            var bot = model.GetValue(iter, 0) as MonitoringBot;

            if (bot != null)
            {
                var market = viewModel.GetSymbolInformation(bot.Symbol);
                if (bot?.LastPrice > bot?.PrevLastPrice.GetValueOrDefault())
                {
                    (cell as Gtk.CellRendererText).ForegroundGdk = bullColor;
                }
                else if (bot?.LastPrice < bot?.PrevLastPrice.GetValueOrDefault())
                {
                    (cell as Gtk.CellRendererText).ForegroundGdk = bearColor;
                }
                else
                {
                    (cell as Gtk.CellRendererText).Background = null;
                    (cell as Gtk.CellRendererText).Foreground = null;
                }
                (cell as Gtk.CellRendererText).Text = bot?.LastPrice.ToString(market?.PriceFmt);
            }
        }
Exemplo n.º 35
0
        void RenderSymbol(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, TreeModel model, Gtk.TreeIter iter)
        {
            var bot = model.GetValue(iter, 0) as MonitoringBot;

            if (bot != null)
            {
                var market = viewModel.GetSymbolInformation(bot.Symbol);
                if (market?.QuoteAsset == "BTC")
                {
                    (cell as Gtk.CellRendererText).Foreground = "orange";
                }
                else if (market?.QuoteAsset == "USD")
                {
                    (cell as Gtk.CellRendererText).Foreground = "lightgreen";
                }
                else if (market?.QuoteAsset == "USDT")
                {
                    (cell as Gtk.CellRendererText).Foreground = "green";
                }
                (cell as Gtk.CellRendererText).Text = market?.BaseAsset + " / " + market?.QuoteAsset;
            }
        }
        void TreeSelectionChanged(object o, EventArgs args)
        {
            Revision d = SelectedRevision;

            changedpathstore.Clear();
            textviewDetails.Buffer.Clear();

            if (d == null)
            {
                return;
            }

            revertButton.GetNativeWidget <Gtk.Widget> ().Sensitive = revertToButton.GetNativeWidget <Gtk.Widget> ().Sensitive = true;
            Gtk.TreeIter selectIter = Gtk.TreeIter.Zero;
            bool         select     = false;

            foreach (RevisionPath rp in info.Repository.GetRevisionChanges(d))
            {
                Xwt.Drawing.Image actionIcon;
                string            action = null;
                if (rp.Action == RevisionAction.Add)
                {
                    action     = GettextCatalog.GetString("Add");
                    actionIcon = ImageService.GetIcon(Gtk.Stock.Add, Gtk.IconSize.Menu);
                }
                else if (rp.Action == RevisionAction.Delete)
                {
                    action     = GettextCatalog.GetString("Delete");
                    actionIcon = ImageService.GetIcon(Gtk.Stock.Remove, Gtk.IconSize.Menu);
                }
                else if (rp.Action == RevisionAction.Modify)
                {
                    action     = GettextCatalog.GetString("Modify");
                    actionIcon = ImageService.GetIcon("gtk-edit", Gtk.IconSize.Menu);
                }
                else if (rp.Action == RevisionAction.Replace)
                {
                    action     = GettextCatalog.GetString("Replace");
                    actionIcon = ImageService.GetIcon("gtk-edit", Gtk.IconSize.Menu);
                }
                else
                {
                    action     = rp.ActionDescription;
                    actionIcon = ImageService.GetIcon(MonoDevelop.Ide.Gui.Stock.Empty, Gtk.IconSize.Menu);
                }
                Xwt.Drawing.Image fileIcon = DesktopService.GetIconForFile(rp.Path, Gtk.IconSize.Menu);
                var iter = changedpathstore.AppendValues(actionIcon, action, fileIcon, System.IO.Path.GetFileName(rp.Path), System.IO.Path.GetDirectoryName(rp.Path), rp.Path, null);
                changedpathstore.AppendValues(iter, null, null, null, null, null, rp.Path, null);
                if (rp.Path == preselectFile)
                {
                    selectIter = iter;
                    select     = true;
                }
            }
            if (!string.IsNullOrEmpty(d.Email))
            {
                imageUser.Show();
                imageUser.LoadUserIcon(d.Email, 32);
            }
            else
            {
                imageUser.Hide();
            }

            labelAuthor.Text = d.Author;
            labelDate.Text   = d.Time.ToString();
            string rev = d.Name;

            if (rev.Length > 15)
            {
                currentRevisionShortened = true;
                rev = d.ShortName;
            }
            else
            {
                currentRevisionShortened = false;
            }

            labelRevision.Text          = GettextCatalog.GetString("revision: {0}", rev);
            textviewDetails.Buffer.Text = d.Message;

            if (select)
            {
                treeviewFiles.Selection.SelectIter(selectIter);
                treeviewFiles.ExpandRow(treeviewFiles.Model.GetPath(selectIter), true);
            }
        }
Exemplo n.º 37
0
        static void DescriptionDataFunc(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            var           textRenderer = (CellRendererText)cell;
            TaskListEntry task         = model.GetValue(iter, DataColumns.Task) as TaskListEntry;
            var           text         = model.GetValue(iter, DataColumns.Description) as string;

            if (task == null)
            {
                if (model.IterParent(out iter, iter))
                {
                    task = model.GetValue(iter, DataColumns.Task) as TaskListEntry;
                    if (task == null)
                    {
                        textRenderer.Text = "";
                        return;
                    }
                }
                else
                {
                    textRenderer.Text = "";
                    return;
                }
            }
            SetText(textRenderer, model, iter, task, text);
        }
        static void AuthorFunc(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            string filter = GetCurrentFilter(model);

            CellRendererText renderer = (CellRendererText)cell;
            var    rev    = (Revision)model.GetValue(iter, 0);
            string author = rev.Author;

            if (string.IsNullOrEmpty(author))
            {
                return;
            }
            int idx = author.IndexOf("<", StringComparison.Ordinal);

            if (idx >= 0 && idx < author.IndexOf(">", StringComparison.Ordinal))
            {
                author = author.Substring(0, idx).Trim();
            }
            if (string.IsNullOrEmpty(filter))
            {
                renderer.Text = author;
            }
            else
            {
                renderer.Markup = EscapeWithFilterMarker(author, filter);
            }
        }
        static void GraphFunc(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            var renderer = (RevisionGraphCellRenderer)cell;

            Gtk.TreeIter node;
            model.GetIterFirst(out node);

            renderer.FirstNode = node.Equals(iter);
            model.IterNthChild(out node, model.IterNChildren() - 1);
            renderer.LastNode = node.Equals(iter);
        }
        static void DateFunc(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererText renderer = (CellRendererText)cell;
            var    rev = (Revision)model.GetValue(iter, 0);
            string day;

            // Grab today's day and the start of tomorrow's day to make Today/Yesterday calculations.
            var now = DateTime.Now;
            var age = new DateTime(now.Year, now.Month, now.Day).AddDays(1) - rev.Time;

            if (age.Days >= 0 && age.Days < 1)               // Check whether it's a commit that's less than a day away. Also discard future commits.
            {
                day = GettextCatalog.GetString("Today");
            }
            else if (age.Days < 2)                 // Check whether it's a commit from yesterday.
            {
                day = GettextCatalog.GetString("Yesterday");
            }
            else
            {
                day = rev.Time.ToShortDateString();
            }
            renderer.Text = string.Format("{0} {1:HH:mm}", day, rev.Time);
        }
Exemplo n.º 41
0
 private void RenderSubcat(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
 {
     (cell as Gtk.CellRendererText).Markup = (string)model.GetValue(iter, 0);
 }
Exemplo n.º 42
0
        static void CategoryDataFunc(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell;
            var task = model.GetValue(iter, DataColumns.Task) as TaskListEntry;

            if (task == null)
            {
                textRenderer.Text = "";
                return;
            }
            SetText(textRenderer, model, iter, task, task.Category ?? "");
        }
Exemplo n.º 43
0
        static void DateFunc(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            var renderer = (CellRendererText)cell;
            var revision = (Revision)model.GetValue(iter, 0);
            // Grab today's day and the start of tomorrow's day to make Today/Yesterday calculations.
            var now = DateTime.Now;
            var age = new DateTime(now.Year, now.Month, now.Day).AddDays(1) - revision.Time;

            renderer.Text = age.Days >= 2 ?
                            revision.Time.ToShortDateString() :
                            revision.Time.Humanize(utcDate: false, dateToCompareAgainst: now);
        }
Exemplo n.º 44
0
        static void LineDataFunc(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell;
            TaskListEntry        task         = model.GetValue(iter, DataColumns.Task) as TaskListEntry;

            if (task == null)
            {
                textRenderer.Text = "";
                return;
            }
            SetText(textRenderer, model, iter, task, task.Line != 0 ? task.Line.ToString() : "");
        }
Exemplo n.º 45
0
        static void FileDataFunc(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell;
            TaskListEntry        task         = model.GetValue(iter, DataColumns.Task) as TaskListEntry;

            if (task == null)
            {
                textRenderer.Text = "";
                return;
            }

            string tmpPath  = "";
            string fileName = "";

            try {
                tmpPath  = GetPath(task);
                fileName = Path.GetFileName(tmpPath);
            } catch (Exception) {
                fileName = tmpPath;
            }

            SetText(textRenderer, model, iter, task, fileName);
        }
Exemplo n.º 46
0
 //ACCION QUE CAMBIA EL COLOR DEL TEXTO PARA CUANDO SE GUARDA EN LA BASE DE DATOS
 void cambia_colores_fila(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
 {
     if ((string)lista_almacenes.Model.GetValue(iter, 12) == "URGENTE")
     {
         if (cell.GetType().ToString() == "Gtk.CellRendererToggle")
         {
             (cell as Gtk.CellRendererToggle).CellBackground = "red";
         }
         if (cell.GetType().ToString() == "Gtk.CellRendererText")
         {
             (cell as Gtk.CellRendererText).CellBackground = "red";
         }
     }
     else
     {
         if (cell.GetType().ToString() == "Gtk.CellRendererToggle")
         {
             (cell as Gtk.CellRendererToggle).CellBackground = "white";
         }
         if (cell.GetType().ToString() == "Gtk.CellRendererText")
         {
             (cell as Gtk.CellRendererText).CellBackground = "white";
         }
     }
 }
Exemplo n.º 47
0
        void RenderSymbol(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, TreeModel model, Gtk.TreeIter iter)
        {
            var ticker = model.GetValue(iter, 0) as PriceTicker;

            if (ticker != null)
            {
                var market = viewModel.GetSymbolInformation(ticker.Symbol);
                if (market.QuoteAsset.Equals("BTC", StringComparison.CurrentCultureIgnoreCase))
                {
                    (cell as Gtk.CellRendererText).Foreground = "orange";
                }
                else if (market.QuoteAsset.Equals("ETH", StringComparison.CurrentCultureIgnoreCase))
                {
                    (cell as Gtk.CellRendererText).Foreground = "darkgray";
                }
                else if (market.QuoteAsset.Equals("BNB", StringComparison.CurrentCultureIgnoreCase))
                {
                    (cell as Gtk.CellRendererText).Foreground = "brown";
                }
                else if (market.QuoteAsset.Equals("USD", StringComparison.CurrentCultureIgnoreCase))
                {
                    (cell as Gtk.CellRendererText).Foreground = "lightgreen";
                }
                else if (market.QuoteAsset.Equals("USDT", StringComparison.CurrentCultureIgnoreCase))
                {
                    (cell as Gtk.CellRendererText).Foreground = "green";
                }
                else
                {
                    (cell as Gtk.CellRendererText).Foreground = null;
                }
                (cell as Gtk.CellRendererText).Text = market.BaseAsset.ToUpper() + "/" + market.QuoteAsset.ToUpper();
            }
        }
Exemplo n.º 48
0
        void RenderPropertyName(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            bool   selected     = (bool)store.GetValue(iter, colCheckedIndex);
            string propertyName = (string)store.GetValue(iter, colPropertyNameIndex);
            string error;

            CellRendererText cellRendererText = (CellRendererText)cell;

            if (!selected || IsValidPropertyName(propertyName, out error))
            {
                cellRendererText.Foreground = "black";
            }
            else
            {
                cellRendererText.Foreground = "red";
            }

            cellRendererText.Text = propertyName;
        }
Exemplo n.º 49
0
        void GroupData(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererPropertyGroup rc = (CellRendererPropertyGroup)cell;

            rc.IsGroup = (bool)model.GetValue(iter, 2);
            rc.Text    = (string)model.GetValue(iter, 0);

            PropertyDescriptor prop = (PropertyDescriptor)model.GetValue(iter, 1);

            if (prop != null)
            {
                InstanceData idata = (InstanceData)model.GetValue(iter, 3);
                rc.SensitiveProperty = prop.EnabledFor(idata.Instance) && prop.VisibleFor(idata.Instance);
            }
            else
            {
                rc.SensitiveProperty = true;
            }
        }
Exemplo n.º 50
0
        protected virtual void RenderTreeCell(Gtk.TreeViewColumn _column, Gtk.CellRenderer _cell, Gtk.TreeModel _model, Gtk.TreeIter _iter)
        {
            object    o    = _model.GetValue(_iter, 0);
            MovieNode node = o as MovieNode;

            Gdk.Color background = new Gdk.Color(255, 255, 255);
            if (node != null && (_model.GetPath(_iter).Indices[1] % 2) == 0)
            {
                background = new Gdk.Color(240, 240, 255);
            }
            if (_cell is Gtk.CellRendererText)
            {
                if (node != null)
                {
                    switch (_column.SortColumnId)
                    {
                    case 0: (_cell as Gtk.CellRendererText).Text = node.Title; break;

                    case 1: (_cell as Gtk.CellRendererText).Text = node.Year; break;

                    case 2: (_cell as Gtk.CellRendererText).Text = node.Set; break;

                    case 4: (_cell as Gtk.CellRendererText).Text = node.Filename; break;
                    }
                }
                else if (o is KeyNode && _column.SortColumnId == 0)
                {
                    (_cell as Gtk.CellRendererText).Markup = ((KeyNode)o).Markup;
                }
                else
                {
                    (_cell as Gtk.CellRendererText).Text = "";
                }
                (_cell as Gtk.CellRendererText).BackgroundGdk = background;
            }
            else if (_cell is TreeItemCellRenderer)
            {
                TreeItemCellRenderer render = (TreeItemCellRenderer)_cell;
                render.CellBackgroundGdk = background;
                render.Pixbuf            = null;
                if (node != null)
                {
                    render.Text   = node.Title;
                    render.Pixbuf = node.StatusIcon;
                }
                else
                {
                    render.Text = ((KeyNode)o).Key;
                }
            }
            else
            {
                if (node != null)
                {
                    switch (_column.SortColumnId)
                    {
                    case 0: (_cell as Gtk.CellRendererPixbuf).Pixbuf = node.StatusIcon; break;

                    case 3: (_cell as Gtk.CellRendererPixbuf).Pixbuf = node.RatingIcon; break;
                    }
                }
                else
                {
                    (_cell as Gtk.CellRendererPixbuf).Pixbuf = Images.Empty;
                }
                (_cell as Gtk.CellRendererPixbuf).CellBackgroundGdk = background;
            }
        }
Exemplo n.º 51
0
        void RenderBuyVolume(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, TreeModel model, Gtk.TreeIter iter)
        {
            var ticker = model.GetValue(iter, 0) as PriceTicker;

            if (ticker != null)
            {
                var market = viewModel.GetSymbolInformation(ticker.Symbol);
                if (ticker?.BuyVolume * 2m > ticker?.Volume.GetValueOrDefault())
                {
                    (cell as Gtk.CellRendererText).ForegroundGdk = bullColor;
                }
                else if (ticker?.BuyVolume * 2m < ticker?.Volume.GetValueOrDefault())
                {
                    (cell as Gtk.CellRendererText).ForegroundGdk = bearColor;
                }
                else
                {
                    (cell as Gtk.CellRendererText).Foreground = null;
                }
                (cell as Gtk.CellRendererText).Text = ticker?.BuyVolume.ToString("N0");
            }
        }
Exemplo n.º 52
0
        void PropertyData(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererProperty rc = (CellRendererProperty)cell;
            bool group = (bool)model.GetValue(iter, 2);

            if (group)
            {
                rc.SetData(null, null, null);
            }
            else
            {
                PropertyDescriptor prop     = (PropertyDescriptor)model.GetValue(iter, 1);
                PropertyEditorCell propCell = PropertyEditorCell.GetPropertyCell(prop);
                InstanceData       idata    = (InstanceData)model.GetValue(iter, 3);
                propCell.Initialize(tree, prop, idata.Instance);
                rc.SetData(idata.Instance, prop, propCell);
            }
        }
Exemplo n.º 53
0
        void RenderChange(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, TreeModel model, Gtk.TreeIter iter)
        {
            var ticker = model.GetValue(iter, 0) as PriceTicker;

            if (ticker != null)
            {
                var market = viewModel.GetSymbolInformation(ticker.Symbol);
                if (ticker?.PriceChangePercent > 0M)
                {
                    (cell as Gtk.CellRendererText).ForegroundGdk = bullColor;
                }
                else if (ticker?.PriceChangePercent < 0M)
                {
                    (cell as Gtk.CellRendererText).ForegroundGdk = bearColor;
                }
                else
                {
                    (cell as Gtk.CellRendererText).Foreground = "gray";
                }
                (cell as Gtk.CellRendererText).Text = ticker?.PriceChangePercent?.ToString("N2") + "%";
            }
        }
Exemplo n.º 54
0
        void RenderVolume(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, TreeModel model, Gtk.TreeIter iter)
        {
            var ticker = model.GetValue(iter, 0) as PriceTicker;

            if (ticker != null)
            {
                var market = viewModel.GetSymbolInformation(ticker.Symbol);
                (cell as Gtk.CellRendererText).Text = ticker?.Volume?.ToString("N0");
            }
        }
        static void AuthorIconFunc(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererImage renderer = (CellRendererImage)cell;
            var rev = (Revision)model.GetValue(iter, 0);

            if (string.IsNullOrEmpty(rev.Email))
            {
                return;
            }
            ImageLoader img = ImageService.GetUserIcon(rev.Email, 16);

            renderer.Image = img.Image;
            if (img.Downloading)
            {
                img.Completed += (sender, e) => {
                    renderer.Image = img.Image;
                    if (((ListStore)model).IterIsValid(iter))
                    {
                        model.EmitRowChanged(model.GetPath(iter), iter);
                    }
                };
            }
        }
Exemplo n.º 56
0
        void RenderPrice(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, TreeModel model, Gtk.TreeIter iter)
        {
            var ticker = model.GetValue(iter, 0) as PriceTicker;

            if (ticker != null)
            {
                var market = viewModel.GetSymbolInformation(ticker.Symbol);
                if (ticker?.LastPrice > ticker?.PrevLastPrice.GetValueOrDefault())
                {
                    //(cell as Gtk.CellRendererText).Foreground = "white";
                    (cell as Gtk.CellRendererText).ForegroundGdk = bullColor;
                    //GLib.Timeout.Add(200, () => LOL(cell as CellRendererText, bullColor) );
                }
                else if (ticker?.LastPrice < ticker?.PrevLastPrice.GetValueOrDefault())
                {
                    //(cell as Gtk.CellRendererText).Foreground = "white";
                    (cell as Gtk.CellRendererText).ForegroundGdk = bearColor;
                    //GLib.Timeout.Add(200, () => { return LOL(cell as CellRendererText, bearColor); } );
                }
                else
                {
                    (cell as Gtk.CellRendererText).Background = null;
                    (cell as Gtk.CellRendererText).Foreground = null;
                }
                (cell as Gtk.CellRendererText).Text = ticker?.LastPrice.ToString(market.PriceFmt);
            }
        }
        static void RevisionFunc(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            string filter = GetCurrentFilter(model);

            CellRendererText renderer = (CellRendererText)cell;
            var rev = model.GetValue(iter, 0).ToString();

            if (string.IsNullOrEmpty(filter))
            {
                renderer.Text = rev;
            }
            else
            {
                renderer.Markup = EscapeWithFilterMarker(rev, filter);
            }
        }
        static void SetDiffCellData(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererDiff rc = (CellRendererDiff)cell;

            string[] lines = (string[])model.GetValue(iter, colDiff);
            if (lines == null)
            {
                lines = new string[] { (string)model.GetValue(iter, colOperation) }
            }
            ;

            rc.InitCell(tree_column.TreeView, ((TreeStore)model).IterDepth(iter) != 0, lines, model.GetPath(iter));
        }
        static void MessageFunc(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            string filter = GetCurrentFilter(model);

            CellRendererText renderer = (CellRendererText)cell;
            var rev = (Revision)model.GetValue(iter, 0);

            if (string.IsNullOrEmpty(rev.Message))
            {
                renderer.Text = GettextCatalog.GetString("(No message)");
            }
            else
            {
                string message = Revision.FormatMessage(rev.Message);
                int    idx     = message.IndexOf('\n');
                if (idx > 0)
                {
                    message = message.Substring(0, idx);
                }
                if (string.IsNullOrEmpty(filter))
                {
                    renderer.Text = message;
                }
                else
                {
                    renderer.Markup = EscapeWithFilterMarker(message, filter);
                }
            }
        }
Exemplo n.º 60
0
        void RenderStatus(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, TreeModel model, Gtk.TreeIter iter)
        {
            var ticker = model.GetValue(iter, 0) as PriceTicker;

            if (ticker != null)
            {
                var market = viewModel.GetSymbolInformation(ticker.Symbol);
                if (market.Status == "BREAK")
                {
                    (cell as Gtk.CellRendererText).Foreground = "red";
                }
                else
                {
                    (cell as Gtk.CellRendererText).Foreground = null;
                }
                (cell as Gtk.CellRendererText).Text = market.Status;
            }
        }