public MassAccrualCreation()
        {
            this.Build ();

            MainClass.ComboAccrualYearsFill (comboYear);

            //Создаем таблицу "Договора"
            ContractsListStore = new Gtk.ListStore (typeof (bool), typeof(int), typeof (string), typeof (string), typeof (string), typeof (string),
                                                    typeof (string), typeof (decimal), typeof (bool), typeof(int));

            CellRendererToggle CellSelect = new CellRendererToggle();
            CellSelect.Activatable = true;
            CellSelect.Toggled += onCellSelectToggled;
            TreeViewColumn SelectColumn = new TreeViewColumn("Выбор", CellSelect, "active", (int)ContractsCol.selected);
            SelectColumn.SetCellDataFunc (CellSelect, new Gtk.TreeCellDataFunc (RenderSelectColumn));

            treeviewContracts.AppendColumn(SelectColumn);
            treeviewContracts.AppendColumn("Номер", new Gtk.CellRendererText (), "text", (int)ContractsCol.number);
            treeviewContracts.AppendColumn("Место", new Gtk.CellRendererText (), "text", (int)ContractsCol.place);
            treeviewContracts.AppendColumn("Арендатор", new Gtk.CellRendererText (), "text", (int)ContractsCol.lessee);
            treeviewContracts.AppendColumn("Дата окончания", new Gtk.CellRendererText (), "text", (int)ContractsCol.end_date);
            treeviewContracts.AppendColumn("Сумма", new Gtk.CellRendererText (), "text", (int)ContractsCol.sum_text);

            ContractsFilter = new Gtk.TreeModelFilter (ContractsListStore, null);
            ContractsFilter.VisibleFunc = new Gtk.TreeModelFilterVisibleFunc (FilterTreeContracts);
            treeviewContracts.Model = ContractsFilter;
            treeviewContracts.ShowAll();

            comboMonth.Active = DateTime.Now.Month;
            CalculateSelected ();
        }
		public MonoDroidBuildOptionsWidget ()
		{
			this.Build ();
			
			linkerCombo.AppendText ("Don't link"); //MtouchLinkMode.None
			linkerCombo.AppendText ("Link SDK assemblies only"); //MtouchLinkMode.SdkOnly
			linkerCombo.AppendText ("Link all assemblies"); //MtouchLinkMode.All
			
			i18NTreeView.Model = i18nStore;
			
			var toggle = new CellRendererToggle ();
			i18NTreeView.AppendColumn ("", toggle, "active", 1);
			i18NTreeView.AppendColumn ("", new CellRendererText (), "text", 0);
			i18NTreeView.HeadersVisible = false;
			toggle.Toggled += delegate(object o, ToggledArgs args) {
				TreeIter iter;
				if (i18nStore.GetIter (out iter, new TreePath (args.Path)))
					i18nStore.SetValue (iter, 1, !(bool)i18nStore.GetValue (iter, 1));
			};
			
			abisTreeView.Model = abisStore;

			var abiToggle = new CellRendererToggle ();
			abisTreeView.AppendColumn ("", abiToggle, "active", 1);
			abisTreeView.AppendColumn ("", new CellRendererText (), "text", 0);
			abisTreeView.HeadersVisible = false;
			abiToggle.Toggled += delegate (object o, ToggledArgs args) {
				TreeIter iter;
				if (abisStore.GetIter (out iter, new TreePath (args.Path)))
					abisStore.SetValue (iter, 1, !(bool)abisStore.GetValue (iter, 1));
			};
			
			ShowAll ();
		}
            public CombineConfigurationPanelWidget(IProperties CustomizationObject)
                : base("Base.glade", "CombineConfigurationsPanel")
            {
                configuration = (CombineConfiguration)((IProperties)CustomizationObject).GetProperty("Config");

                store = new TreeStore (typeof(object), typeof(string), typeof(bool), typeof(string));
                configsList.Model = store;
                configsList.HeadersVisible = true;

                TreeViewColumn col = new TreeViewColumn ();
                CellRendererText sr = new CellRendererText ();
                col.PackStart (sr, true);
                col.Expand = true;
                col.AddAttribute (sr, "text", 1);
                col.Title = "Solution Item";
                configsList.AppendColumn (col);

                CellRendererToggle tt = new CellRendererToggle ();
                tt.Activatable = true;
                tt.Toggled += new ToggledHandler (OnBuildToggled);
                configsList.AppendColumn ("Build", tt, "active", 2);
                configsList.AppendColumn ("Configuration", new CellRendererText (), "text", 3);

                foreach (CombineConfigurationEntry ce in configuration.Entries)
                    store.AppendValues (ce, ce.Entry.Name, ce.Build, ce.ConfigurationName);
            }
		public void Initialize (TreeView treeView)
		{
			var column = new TreeViewColumn ();

			var toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Toggled += ToggleRendererToggled;
			column.PackStart (toggleRenderer, false);
			column.AddAttribute (toggleRenderer, "active", 0);

			var pixbufRenderer = new CellRendererImage ();
			column.PackStart (pixbufRenderer, false);
			column.AddAttribute (pixbufRenderer, "image", 1);

			var textRenderer = new CellRendererText ();
			column.PackStart (textRenderer, true);
			column.AddAttribute (textRenderer, "text", 2);
			column.Expand = true;

			treeView.AppendColumn (column);
			foreach (object obj in GetValidMembers ()) {
				var member = obj as ISymbol;
				if (member != null) {
					Store.AppendValues (false, ImageService.GetIcon (member.GetStockIcon (), IconSize.Menu), member.ToDisplayString (Ambience.LabelFormat), member);
					continue;
				}

				var tuple = obj as Tuple<ISymbol, bool>;
				if (tuple != null) {
					Store.AppendValues (false, ImageService.GetIcon (tuple.Item1.GetStockIcon (), IconSize.Menu), tuple.Item1.ToDisplayString (Ambience.LabelFormat), tuple);
					continue;
				}
			}
			
			treeView.Model = store;
		}
Example #5
0
        public TaskTree(Builder builder)
        {
            builder.Autoconnect (this);

            filter = new TreeModelFilter (tasksList, null);
            filter.VisibleFunc = TasksTreeFilterFunc;
            tasksTreeView.Model = filter;

            tasksTreeView.Selection.Changed += TasksTreeView_Selection_Changed;

            showDoneCheckButton.Toggled += (sender, e) => filter.Refilter ();

            searchTaskButton.Clicked += (sender, e) => filter.Refilter ();

            searchTaskEntry.Activated += (sender, e) => filter.Refilter ();

            var toggleCell = new CellRendererToggle ();
            toggleCell.Toggled += ToggleCell_Toggled;
            AddColumn ("", toggleCell, null, new object[]{ "active", 1 });

            AddColumn ("Title", new CellRendererText (), RenderCell, new Object [] { "text", 2 });
            AddColumn ("Deadline", new CellRendererText (), RenderCell, new Object [] { "text", 3 });
            AddColumn ("Priority", new CellRendererText (), RenderCell, new Object [] { "text", 4 });

            TaskManager.Instance.TaskChanged += TaskChanged;
        }
		public CounterSelectorDialog ()
		{
			this.Build ();
			
			HasSeparator = false;
			store = new TreeStore (typeof(bool), typeof(string), typeof(CounterCategory), typeof(Counter), typeof(bool));
			treeCounters.Model = store;
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererToggle crt = new CellRendererToggle ();
			col.PackStart (crt, false);
			col.AddAttribute (crt, "active", 0);
			col.AddAttribute (crt, "visible", 4);
			
			CellRendererText crx = new CellRendererText ();
			col.PackStart (crx, true);
			col.AddAttribute (crx, "text", 1);
			treeCounters.AppendColumn (col);
			
			foreach (CounterCategory cat in App.Service.GetCategories ())
				AppendCategory (TreeIter.Zero, cat);
			
			UpdateSelectedCounters ();
			treeCounters.ExpandAll ();
			
			crt.Toggled += CrtToggled;
		}
		public IncludeNewFilesDialog (string title, FilePath baseDirectory)
		{
			this.Build ();
			this.Title = title;
			this.baseDirectory = baseDirectory;
			
			treeviewFiles.Model = store;
			
			treeviewFiles.HeadersVisible = false; // Headers are untranslated because they're hidden as default
			
			TreeViewColumn textColumn = new TreeViewColumn ();
			
			CellRendererToggle toggleRender = new CellRendererToggle ();
			toggleRender.Toggled += ToggleRenderToggled;
			textColumn.PackStart (toggleRender, false);
			textColumn.AddAttribute (toggleRender, "active", Columns.IsToggled);
			
			textColumn.Title = "Name";
			var pixbufRenderer = new CellRendererImage ();
			textColumn.PackStart (pixbufRenderer, false);
			textColumn.AddAttribute (pixbufRenderer, "image", Columns.IconOpened);
			textColumn.AddAttribute (pixbufRenderer, "image-expander-open", Columns.IconOpened);
			textColumn.AddAttribute (pixbufRenderer, "image-expander-closed", Columns.IconClosed);
			
			CellRendererText textRenderer = new CellRendererText ();
			textColumn.PackStart (textRenderer, false);
			textColumn.AddAttribute (textRenderer, "text", Columns.Text);
			treeviewFiles.AppendColumn (textColumn);
			buttonExcludeAll.Clicked += ButtonExcludeAllClicked;
			buttonIncludeAll.Clicked += ButtonIncludeAllClicked;
			buttonOk.Clicked += ButtonOkClicked;
		}
Example #8
0
		public TableMappingWidget (bool showCheckBoxes)
		{
			store = new ListStore (typeof (bool), typeof (TableContainer));
			list = new TreeView (store);
			
			TreeViewColumn colName = new TreeViewColumn ();
			colName.Title = AddinCatalog.GetString ("Name");

			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Activatable = true;
			toggleRenderer.Toggled += new ToggledHandler (SelectToggled);
			colName.PackStart (toggleRenderer, false);
			CellRendererText nameRenderer = new CellRendererText ();
			colName.PackStart (nameRenderer, true);

			TreeViewColumn colClassName = new TreeViewColumn ();
			colClassName.Title = AddinCatalog.GetString ("Class Name");
			CellRendererText propNameRenderer = new CellRendererText ();
			propNameRenderer.Editable = true;
			propNameRenderer.Edited += new EditedHandler (ClassNameEdited);
			colClassName.PackStart (propNameRenderer, true);
			
			colName.SetCellDataFunc (nameRenderer, new CellLayoutDataFunc (NameDataFunc));
			colClassName.SetCellDataFunc (propNameRenderer, new CellLayoutDataFunc (ClassNameDataFunc));

			list.AppendColumn (colName);
			list.AppendColumn (colClassName);
			list.HeadersVisible = true;
			
			this.Add (list);
		}
        public AddInManagerDialog()
        {
            this.BorderWidth = 12;
            this.Title = GettextCatalog.GetString ("AddInManager");
            this.TransientFor = (Window) WorkbenchSingleton.Workbench;
            this.SetDefaultSize (400, 350);

            ScrolledWindow sw = new ScrolledWindow ();
            sw.ShadowType = ShadowType.In;
            TreeView tv = new TreeView ();
            tv.Selection.Changed += new EventHandler (OnSelectionChanged);
            tv.RowActivated += new RowActivatedHandler (OnRowActivated);

            CellRendererToggle toggle = new CellRendererToggle ();
            toggle.Toggled += OnCellToggled;
            tv.AppendColumn (GettextCatalog.GetString ("Enabled"), toggle, "active", 0);
            tv.AppendColumn (GettextCatalog.GetString ("AddIn Name"), new CellRendererText (), "text", 1);
            tv.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 2);
            sw.Add (tv);

            this.AddButton (Gtk.Stock.Close, ResponseType.Close);

            LoadAddIns ();
            tv.Model = store;
            this.VBox.Add (sw);

            addinDetails = new AddInDetailsFrame ();
            this.VBox.Add (addinDetails);
            this.ShowAll ();
        }
        public GacReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            store = new TreeStore (typeof (string), typeof (string), typeof(string), typeof(bool), typeof(string));
            treeView = new TreeView (store);

            TreeViewColumn firstColumn = new TreeViewColumn ();
            firstColumn.Title = GettextCatalog.GetString ("Reference Name");
            CellRendererToggle tog_render = new CellRendererToggle ();
            tog_render.Toggled += new Gtk.ToggledHandler (AddReference);
            firstColumn.PackStart (tog_render, false);
            firstColumn.AddAttribute (tog_render, "active", 3);

            CellRendererText text_render = new CellRendererText ();
            firstColumn.PackStart (text_render, true);
            firstColumn.AddAttribute (text_render, "text", 0);

            treeView.AppendColumn (firstColumn);
            treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 1);
            // FIXME: this seems useless
            //treeView.AppendColumn (GettextCatalog.GetString ("Path"), new CellRendererText (), "text", 2);

            store.SetSortColumnId (0, SortType.Ascending);
            store.SetSortFunc (0, new TreeIterCompareFunc (SortTree));

            PrintCache();
            ScrolledWindow sc = new ScrolledWindow ();
            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add (treeView);
            this.PackStart (sc, true, true, 0);
            ShowAll ();
            BorderWidth = 6;
        }
Example #11
0
        public AddObjectClassDialog(Connection conn)
        {
            objectClasses = new List<string> ();

            ui = new Glade.XML (null, "lat.glade", "addObjectClassDialog", null);
            ui.Autoconnect (this);

            store = new ListStore (typeof (bool), typeof (string));

            CellRendererToggle crt = new CellRendererToggle();
            crt.Activatable = true;
            crt.Toggled += OnClassToggled;

            objClassTreeView.AppendColumn ("Enabled", crt, "active", 0);
            objClassTreeView.AppendColumn ("Name", new CellRendererText (), "text", 1);

            objClassTreeView.Model = store;

            try {

                foreach (string n in conn.Data.ObjectClasses)
                    store.AppendValues (false, n);

            } catch (Exception e) {

                store.AppendValues (false, "Error getting object classes");
                Log.Debug (e);
            }

            addObjectClassDialog.Icon = Global.latIcon;
            addObjectClassDialog.Resize (300, 400);
            addObjectClassDialog.Run ();
            addObjectClassDialog.Destroy ();
        }
        private void InitializeListView(TreeView treeView, ListStore store, String nameColumnTitle, 
                                      IEnumerable<ItemSetting> data, ToggledHandler includeToggleHandler) 
        {
            treeView.Model = store;

            //create columns with associated cell renderings
            CellRendererText nameRenderer = new CellRendererText();
            TreeViewColumn nameColumn = treeView.AppendColumn(nameColumnTitle, nameRenderer);
            nameColumn.SetCellDataFunc(nameRenderer, new TreeCellDataFunc(RenderName));            

            CellRendererText typeRenderer = new CellRendererText();
            TreeViewColumn typeColumn = treeView.AppendColumn("Type", typeRenderer);
            typeColumn.SetCellDataFunc(typeRenderer, new TreeCellDataFunc(RenderType));   

            CellRendererToggle includeCheckBoxRenderer = new CellRendererToggle();
            TreeViewColumn includeColumn = treeView.AppendColumn("Include", includeCheckBoxRenderer);
            includeColumn.SetCellDataFunc(includeCheckBoxRenderer, new TreeCellDataFunc(RenderIncludeCheckBox));
            includeCheckBoxRenderer.Activatable = true;
            includeCheckBoxRenderer.Toggled += includeToggleHandler;

            //fill store with data
            foreach (ItemSetting item in data) 
            {
                store.AppendValues(item, item, item);
            }
        }
        public ManageSitesDialog(SetupService service, Builder builder, IntPtr handle) : base(handle)
        {
            builder.Autoconnect(this);
//			TransientFor = parent;
//			Services.PlaceDialog (this, parent);
            this.service            = service;
            treeStore               = new Gtk.ListStore(typeof(string), typeof(string), typeof(bool));
            repoTree.Model          = treeStore;
            repoTree.HeadersVisible = false;
            var crt = new Gtk.CellRendererToggle();

            crt.Toggled += HandleRepoToggled;
            repoTree.AppendColumn("", crt, "active", 2);
            repoTree.AppendColumn("", new Gtk.CellRendererText(), "markup", 1);
            repoTree.Selection.Changed += new EventHandler(OnSelect);

            AddinRepository[] reps = service.Repositories.GetRepositories();
            foreach (AddinRepository rep in reps)
            {
                AppendRepository(rep);
            }

            btnRemove.Sensitive = false;

            //Wire buttons
            btnRemove.Clicked += OnRemove;
            btnAdd.Clicked    += OnAdd;

            ShowAll();
        }
        void PopulateTree()
        {
            Gtk.ListStore subjectListStore = new Gtk.ListStore(typeof(bool), typeof(string));
            treeview.Model = subjectListStore;

            Gtk.TreeViewColumn includeColumn = new Gtk.TreeViewColumn();
            Gtk.TreeViewColumn subjectColumn = new Gtk.TreeViewColumn();
            includeColumn.Title = "Include";
            subjectColumn.Title = "Subject";
            treeview.AppendColumn(includeColumn);
            treeview.AppendColumn(subjectColumn);

            for (int i = 0; i < categories.Count; i++)
            {
                var t = new Gtk.ToggleButton(i.ToString());
                subjectListStore.AppendValues(t, categories[i].ToString());
            }

            Gtk.CellRendererToggle toggleCell = new Gtk.CellRendererToggle();
            Gtk.CellRendererText   textCell   = new Gtk.CellRendererText();

            includeColumn.PackStart(toggleCell, true);
            subjectColumn.PackStart(textCell, true);

            includeColumn.AddAttribute(toggleCell, "active", 0);
            subjectColumn.AddAttribute(textCell, "text", 1);

            toggleCell.Active   = true;
            toggleCell.Toggled += ToggleHandler;

            SetAllToTrue();
        }
        public SharingConfigDialog ()
        {
            this.Build ();
            categoriesTreeView.Model = model;

            var complete_column = new TreeViewColumn ();

            var toggle_render = new CellRendererToggle ();
            toggle_render.Toggled += CellRendererToggle_Toggled;
            complete_column.PackStart (toggle_render, false);
            complete_column.SetCellDataFunc (toggle_render, new TreeCellDataFunc (ToggleDataFunc));

            var pix_render = new CellRendererPixbuf () { Mode = CellRendererMode.Inert };
            complete_column.PackStart (pix_render, false);
            complete_column.SetCellDataFunc (pix_render, new TreeCellDataFunc (IconDataFunc));

            var text_render = new CellRendererText () { Mode = CellRendererMode.Inert };
            complete_column.PackStart (text_render, true);
            complete_column.SetCellDataFunc (text_render, new TreeCellDataFunc (NameDataFunc));
    
            categoriesTreeView.AppendColumn (complete_column);

            empty_pixbuf.Fill(0xffffff00);

            Update ();

            LoadPreferences ();
        }
Example #16
0
        void AddColumns()
        {
            Gtk.CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

            Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle();
            toggleRender.Toggled += new ToggledHandler(ItemToggled);

            TreeViewColumn col;

            col = view.AppendColumn("!", iconRender, "pixbuf", DataColumns.Type);

            col = view.AppendColumn("", toggleRender);
            col.SetCellDataFunc(toggleRender, new Gtk.TreeCellDataFunc(ToggleDataFunc));

            col = view.AppendColumn(GettextCatalog.GetString("Line"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(LineDataFunc));

            col = view.AppendColumn(GettextCatalog.GetString("Description"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(DescriptionDataFunc));
            col.Resizable = true;

            col = view.AppendColumn(GettextCatalog.GetString("File"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(FileDataFunc));
            col.Resizable = true;

            col = view.AppendColumn(GettextCatalog.GetString("Project"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(ProjectDataFunc));
            col.Resizable = true;

            col = view.AppendColumn(GettextCatalog.GetString("Path"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(PathDataFunc));
            col.Resizable = true;
        }
		public CombineConfigurationPanelWidget (MultiConfigItemOptionsDialog parentDialog)
		{
			Build ();
			
			this.parentDialog = parentDialog;
			store = new ListStore (typeof(object), typeof(string), typeof(bool));
			configsList.Model = store;
			configsList.HeadersVisible = true;
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererText sr = new CellRendererText ();
			col.PackStart (sr, true);
			col.Expand = true;
			col.AddAttribute (sr, "text", 1);
			col.Title = GettextCatalog.GetString ("Solution Item");
			configsList.AppendColumn (col);
			col.SortColumnId = 1;
			
			CellRendererToggle tt = new CellRendererToggle ();
			tt.Activatable = true;
			tt.Toggled += new ToggledHandler (OnBuildToggled);
			configsList.AppendColumn (GettextCatalog.GetString ("Build"), tt, "active", 2);
			
			CellRendererComboBox comboCell = new CellRendererComboBox ();
			comboCell.Changed += new ComboSelectionChangedHandler (OnConfigSelectionChanged);
			configsList.AppendColumn (GettextCatalog.GetString ("Configuration"), comboCell, new TreeCellDataFunc (OnSetConfigurationsData));
			store.SetSortColumnId (1, SortType.Ascending);
		}
Example #18
0
        public SearchTransactionsWindow(ManagerFile managerFile) :
            base(Gtk.WindowType.Toplevel)
        {
            this.Build();
            this.defaultDate        = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
            startDate.Text          = defaultDate;
            endDate.Text            = defaultDate;
            this.searchTransactions = new SearchTransactions(managerFile);
            bankAccountCombo.FillBankAccounts(searchTransactions.managerFile.GetObjects());

            CellRendererToggle toggle = new Gtk.CellRendererToggle();

            Gtk.TreeViewColumn toggleColumn = new Gtk.TreeViewColumn("X", toggle, "active", 1);
            toggle.Toggled += checkToggled;
//			toggleColumn.SortColumnId = -2; // GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID

            Gtk.CellRendererText dateCell   = new Gtk.CellRendererText();
            Gtk.TreeViewColumn   dateColumn = new Gtk.TreeViewColumn("Date", dateCell, "text", 2);
            dateColumn.SortColumnId = 2;
            Gtk.TreeViewColumn amountColumn = new Gtk.TreeViewColumn("Amount", new Gtk.CellRendererText(), "text", 6);
            amountColumn.SortColumnId = 3;

            Gtk.CellRendererText descriptionCell   = new Gtk.CellRendererText();
            Gtk.TreeViewColumn   descriptionColumn = new Gtk.TreeViewColumn("Description", descriptionCell, "text", 4);
            descriptionColumn.SortColumnId = 4;
            Gtk.TreeViewColumn bankAccountColumn = new Gtk.TreeViewColumn("Account", new Gtk.CellRendererText(), "text", 5);
            bankAccountColumn.SortColumnId = 5;

            transactionsTreeView.AppendColumn(toggleColumn);
            transactionsTreeView.AppendColumn(dateColumn);
            transactionsTreeView.AppendColumn(amountColumn);
            transactionsTreeView.AppendColumn(descriptionColumn);
            transactionsTreeView.AppendColumn(bankAccountColumn);
        }
        public ProjectSelectorWidget()
        {
            this.Build();

            store = new TreeStore (typeof(string), typeof(string), typeof(object), typeof(bool), typeof(bool));
            tree.Model = store;

            tree.HeadersVisible = false;
            TreeViewColumn col = new TreeViewColumn ();
            Gtk.CellRendererToggle ctog = new CellRendererToggle ();
            ctog.Toggled += OnToggled;
            col.PackStart (ctog, false);
            var cr = new CellRendererImage ();
            col.PackStart (cr, false);
            Gtk.CellRendererText crt = new Gtk.CellRendererText();
            crt.Mode &= ~CellRendererMode.Activatable;
            col.PackStart (crt, true);
            col.AddAttribute (cr, "stock-id", 0);
            col.AddAttribute (crt, "markup", 1);
            col.AddAttribute (ctog, "active", 3);
            col.AddAttribute (ctog, "visible", 4);
            tree.AppendColumn (col);

            tree.Selection.Changed += HandleTreeSelectionChanged;
        }
		public ManageSitesDialog (SetupService service, Builder builder, IntPtr handle): base (handle)
		{
			builder.Autoconnect (this);
//			TransientFor = parent;
//			Services.PlaceDialog (this, parent);
			this.service = service;
			treeStore = new Gtk.ListStore (typeof (string), typeof (string), typeof(bool));
			repoTree.Model = treeStore;
			repoTree.HeadersVisible = false;
			var crt = new Gtk.CellRendererToggle ();
			crt.Toggled += HandleRepoToggled;
			repoTree.AppendColumn ("", crt, "active", 2);
			repoTree.AppendColumn ("", new Gtk.CellRendererText (), "markup", 1);
			repoTree.Selection.Changed += new EventHandler(OnSelect);
			
			AddinRepository[] reps = service.Repositories.GetRepositories ();
			foreach (AddinRepository rep in reps)
				AppendRepository (rep);

			btnRemove.Sensitive = false;

			//Wire buttons
			btnRemove.Clicked += OnRemove;
			btnAdd.Clicked += OnAdd;

			ShowAll ();
		}
Example #21
0
 protected override void CreateCellRenderers()
 {
     CellRendererToggle renderer = new CellRendererToggle();
     this.PackStart(renderer, false);
     this.AddAttribute(renderer, "active", Mapping.AddValueMapping(GType.Boolean, GetActive));
     this.AddAttribute(renderer, "inconsistent", Mapping.AddValueMapping(GType.Boolean, GetInconsistent));
 }
		public ContextActionPanelWidget (string mimeType)
		{
			this.mimeType = mimeType;
			this.Build ();
			
			var col = new TreeViewColumn ();
			
			var togRender = new CellRendererToggle ();
			togRender.Toggled += delegate(object o, ToggledArgs args) {
				TreeIter iter;
				if (!treeStore.GetIterFromString (out iter, args.Path)) 
					return;
				bool enabled = (bool)treeStore.GetValue (iter, 1);
				treeStore.SetValue (iter, 1, !enabled);
			};
			col.PackStart (togRender, false);
			col.AddAttribute (togRender, "active", 1);
			
			var textRender = new CellRendererText ();
			col.PackStart (textRender, true);
			col.AddAttribute (textRender, "text", 0);
			
			treeviewContextActions.AppendColumn (col);
			treeviewContextActions.HeadersVisible = false;
			treeviewContextActions.Model = treeStore;
			
			FillTreeStore ();
			treeviewContextActions.Selection.Changed += HandleTreeviewContextActionsSelectionChanged;
		}
		public ContextActionPanelWidget (string mimeType)
		{
			this.mimeType = mimeType;
			this.Build ();
			
			var col = new TreeViewColumn ();
			
			searchentryFilter.Ready = true;
			searchentryFilter.Visible = true;
			searchentryFilter.Entry.Changed += ApplyFilter;

			var togRender = new CellRendererToggle ();
			togRender.Toggled += delegate(object o, ToggledArgs args) {
				TreeIter iter;
				if (!treeStore.GetIterFromString (out iter, args.Path)) 
					return;
				var provider = (CodeActionProvider)treeStore.GetValue (iter, 2);
				providerStates [provider] = !providerStates [provider];
				treeStore.SetValue (iter, 1, providerStates [provider]);
			};
			col.PackStart (togRender, false);
			col.AddAttribute (togRender, "active", 1);
			
			var textRender = new CellRendererText ();
			col.PackStart (textRender, true);
			col.AddAttribute (textRender, "markup", 0);
			
			treeviewContextActions.AppendColumn (col);
			treeviewContextActions.HeadersVisible = false;
			treeviewContextActions.Model = treeStore;
			GetAllProviderStates ();
			FillTreeStore (null);
			treeviewContextActions.Selection.Changed += HandleTreeviewContextActionsSelectionChanged;
		}
		public SelectSchemaWidget ()
		{
			store = new ListStore (typeof (bool), typeof (ISchemaContainer));
			list = new TreeView (store);
			
			TreeViewColumn col = new TreeViewColumn ();

			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Activatable = true;
			toggleRenderer.Toggled += new ToggledHandler (ItemToggled);
			col.PackStart (toggleRenderer, false);
			
			CellRendererPixbuf pixbufRenderer = new CellRendererPixbuf ();
			col.PackStart (pixbufRenderer, false);

			CellRendererText textRenderer = new CellRendererText ();
			col.PackStart (textRenderer, true);

			col.SetCellDataFunc (textRenderer, new CellLayoutDataFunc (TextDataFunc));
			col.SetCellDataFunc (pixbufRenderer, new CellLayoutDataFunc (PixbufDataFunc));

			list.AppendColumn (col);
			list.HeadersVisible = false;
			
			this.Add (list);
		}
        private void InitializeConfigListView()
        {
            m_configStore = new Gtk.ListStore(typeof(ConfigItemSetting), typeof(ConfigItemSetting), 
                                              typeof(ConfigItemSetting), typeof(ConfigItemSetting));

            this.configView.Model = m_configStore;
            
            //create columns with associated cell renderings
            CellRendererText nameRenderer = new CellRendererText();
            TreeViewColumn nameColumn = this.configView.AppendColumn("Config Parameter", nameRenderer);
            nameColumn.SetCellDataFunc(nameRenderer, new TreeCellDataFunc(RenderName));            

            CellRendererText aliasRenderer = new CellRendererText();
            TreeViewColumn aliasColumn = this.configView.AppendColumn("Alias", aliasRenderer);
            aliasColumn.SetCellDataFunc(aliasRenderer, new TreeCellDataFunc(RenderAlias));
            aliasRenderer.Editable = true;
            aliasRenderer.Edited += AliasEdited;

            CellRendererText typeRenderer = new CellRendererText();
            TreeViewColumn typeColumn = this.configView.AppendColumn("Type", typeRenderer);
            typeColumn.SetCellDataFunc(typeRenderer, new TreeCellDataFunc(RenderType));   
            
            CellRendererToggle includeCheckBoxRenderer = new CellRendererToggle();
            TreeViewColumn includeColumn = this.configView.AppendColumn("Include", includeCheckBoxRenderer);
            includeColumn.SetCellDataFunc(includeCheckBoxRenderer, new TreeCellDataFunc(RenderIncludeCheckBox));
            includeCheckBoxRenderer.Activatable = true;
            includeCheckBoxRenderer.Toggled += IncludeCheckBoxToggled;
            
            //fill store with data
            foreach (ItemSetting item in m_setup.ConfigSettings.Values) 
            {
                m_configStore.AppendValues(item, item, item, item);
            }
        }
		TreeViewColumn CreateTreeViewColumn ()
		{
			var column = new TreeViewColumn ();
			column.Spacing = 0;

			var dummyRenderer = new CellRendererImage ();
			dummyRenderer.Width = 1;
			dummyRenderer.Xpad = 0;
			column.PackStart (dummyRenderer, false);

			var checkBoxRenderer = new CellRendererToggle ();
			checkBoxRenderer.Toggled += PackageSourceCheckBoxToggled;
			checkBoxRenderer.Xpad = 7;
			checkBoxRenderer.Ypad = 12;
			checkBoxRenderer.Xalign = 0;
			checkBoxRenderer.Yalign = 0;
			column.PackStart (checkBoxRenderer, false);
			column.AddAttribute (checkBoxRenderer, "active", IsEnabledCheckBoxColumn);

			var iconRenderer = new CellRendererImage ();
			iconRenderer.StockSize = IconSize.Dnd;
			iconRenderer.Xalign = 0;
			iconRenderer.Xpad = 0;
			column.PackStart (iconRenderer, false);
			column.AddAttribute (iconRenderer, "icon-id", PackageSourceIconColumn);

			var packageSourceRenderer = new PackageSourceCellRenderer ();
			packageSourceRenderer.Mode = CellRendererMode.Activatable;
			column.PackStart (packageSourceRenderer, true);
			column.AddAttribute (packageSourceRenderer, "package-source", PackageSourceViewModelColumn);

			return column;
		}
Example #27
0
		private void AddColumns (TreeView treeView)
		{
			// column for fixed toggles
			CellRendererToggle rendererToggle = new CellRendererToggle ();
			rendererToggle.Toggled += new ToggledHandler (FixedToggled);
			TreeViewColumn column =  new TreeViewColumn ("Fixed?", rendererToggle, "active", Column.Fixed);

			// set this column to a fixed sizing (of 50 pixels)
			column.Sizing = TreeViewColumnSizing.Fixed;
			column.FixedWidth = 50;
			treeView.AppendColumn (column);

			// column for bug numbers
			CellRendererText rendererText = new CellRendererText ();
			column = new TreeViewColumn ("Bug number", rendererText, "text", Column.Number);
			column.SortColumnId = (int) Column.Number;
			treeView.AppendColumn (column);

			// column for severities
			rendererText = new CellRendererText ();
			column = new TreeViewColumn ("Severity", rendererText, "text", Column.Severity);
			column.SortColumnId = (int) Column.Severity;
			treeView.AppendColumn(column);

			// column for description
			rendererText = new CellRendererText ();
			column = new TreeViewColumn ("Description", rendererText, "text", Column.Description);
			column.SortColumnId = (int) Column.Description;
			treeView.AppendColumn (column);
		}
		public void Initialize (Gtk.TreeView treeView)
		{
			TreeViewColumn column = new TreeViewColumn ();

			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Toggled += ToggleRendererToggled;
			column.PackStart (toggleRenderer, false);
			column.AddAttribute (toggleRenderer, "active", 0);

			var pixbufRenderer = new CellRendererPixbuf ();
			column.PackStart (pixbufRenderer, false);
			column.AddAttribute (pixbufRenderer, "pixbuf", 1);

			CellRendererText textRenderer = new CellRendererText ();
			column.PackStart (textRenderer, true);
			column.AddAttribute (textRenderer, "text", 2);
			column.Expand = true;

			treeView.AppendColumn (column);
			Ambience ambience = AmbienceService.GetAmbienceForFile (options.Document.FileName);
			foreach (IBaseMember member in GetValidMembers ()) {
				Store.AppendValues (false, ImageService.GetPixbuf (member.StockIcon, IconSize.Menu), ambience.GetString (member, member.MemberType == MonoDevelop.Projects.Dom.MemberType.Parameter ? OutputFlags.IncludeParameterName : OutputFlags.ClassBrowserEntries), member);
			}
			
			treeView.Model = store;
		}
		public void Initialize (Gtk.TreeView treeView)
		{
			TreeViewColumn column = new TreeViewColumn ();

			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Toggled += ToggleRendererToggled;
			column.PackStart (toggleRenderer, false);
			column.AddAttribute (toggleRenderer, "active", 0);

			var pixbufRenderer = new CellRendererPixbuf ();
			column.PackStart (pixbufRenderer, false);
			column.AddAttribute (pixbufRenderer, "pixbuf", 1);

			CellRendererText textRenderer = new CellRendererText ();
			column.PackStart (textRenderer, true);
			column.AddAttribute (textRenderer, "text", 2);
			column.Expand = true;

			treeView.AppendColumn (column);
			Ambience ambience = AmbienceService.GetAmbienceForFile (options.Document.FileName);
			foreach (object obj in GetValidMembers ()) {
				var member = obj as IEntity;
				if (member != null) {
					Store.AppendValues (false, ImageService.GetPixbuf (member.GetStockIcon (), IconSize.Menu), ambience.GetString (member, OutputFlags.ClassBrowserEntries), member);
					continue;
				}
				
				var variable = obj as IVariable;
				if (variable != null)
					Store.AppendValues (false, ImageService.GetPixbuf (variable.GetStockIcon (), IconSize.Menu), variable.Name, variable);
				
			}
			
			treeView.Model = store;
		}
Example #30
0
        public PackageBuilderMainPage()
        {
            this.Build();

            /*
            1 -- Node Data
            */
            m_packageContentStore = new Gtk.TreeStore(typeof(PackageFileSourceInfo));
            this.treeView.Model = m_packageContentStore;

            //create columns with associated cell renderings
            CellRendererText nameRenderer = new CellRendererText();
            TreeViewColumn nameColumn = treeView.AppendColumn("Name", nameRenderer);
            nameColumn.SetCellDataFunc(nameRenderer, new TreeCellDataFunc(RenderName));

            CellRendererToggle hasComponentsCheckBoxRenderer = new CellRendererToggle();
            TreeViewColumn hasComponentsColumn = treeView.AppendColumn("Has Components", hasComponentsCheckBoxRenderer);
            hasComponentsColumn.SetCellDataFunc(hasComponentsCheckBoxRenderer, new TreeCellDataFunc(RenderHasComponentCheckBox));
            hasComponentsCheckBoxRenderer.Activatable = true;
            hasComponentsCheckBoxRenderer.Toggled += HasComponentCheckBoxToggled;

            CellRendererToggle hasTypesCheckBoxRenderer = new CellRendererToggle();
            TreeViewColumn hasTypesColumn = treeView.AppendColumn("Has Types", hasTypesCheckBoxRenderer);
            hasTypesColumn.SetCellDataFunc(hasTypesCheckBoxRenderer, new TreeCellDataFunc(RenderHasTypesCheckBox));
            hasTypesCheckBoxRenderer.Activatable = true;
            hasTypesCheckBoxRenderer.Toggled += HasTypesCheckBoxToggled;

            this.treeView.Selection.Mode = Gtk.SelectionMode.Multiple;

            EnableDrop();
        }
Example #31
0
        private void ToggleCellDataFunc(Gtk.TreeViewColumn column,
                                        Gtk.CellRenderer cell,
                                        Gtk.TreeModel model,
                                        Gtk.TreeIter iter)
        {
            Gtk.CellRendererToggle crt = cell as Gtk.CellRendererToggle;
            ITaskList taskList         = model.GetValue(iter, 0) as ITaskList;

            if (taskList == null)
            {
                crt.Active = true;
                return;
            }

            // If the setting is null or empty, show all taskLists
            if (taskListsToHide == null || taskListsToHide.Count == 0)
            {
                crt.Active = true;
                return;
            }

            // Check to see if the taskList is specified in the list
            if (taskListsToHide.Contains(taskList.Name))
            {
                crt.Active = false;
                return;
            }

            crt.Active = true;
        }
		public WebDeployLaunchDialog (AspNetAppProject project)
		{
			this.Build();
			
			this.project = project;
			
			//set up the sort order 
			targetStore.SetSortFunc (LISTCOL_Text, delegate (TreeModel m, TreeIter a, TreeIter b) {
				return string.Compare ((string) m.GetValue (a, LISTCOL_Text), (string) m.GetValue (b, LISTCOL_Text));
			});
			targetStore.SetSortColumnId (LISTCOL_Text, SortType.Ascending);
			
			//set up the view
			targetView.Model = targetStore;
			targetView.HeadersVisible = false;
			
			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Activatable = true;
			toggleRenderer.Xpad = 6;
			TreeViewColumn checkCol = new TreeViewColumn ("", toggleRenderer, "active", LISTCOL_Checked);
			checkCol.Expand = false;
			targetView.AppendColumn (checkCol);
			toggleRenderer.Toggled += HandleToggle;
			
			CellRendererText textRenderer = new CellRendererText ();
			textRenderer.WrapMode = Pango.WrapMode.WordChar;
			targetView.AppendColumn ("", textRenderer, "markup", LISTCOL_Text);
			
			fillStore ();
		}
        public MultiChooserDialog(IList options, IList banned)
        {
            base.Modal = true;
            base.HeightRequest = 400;
            base.WidthRequest = 250;
            //TODO: i18n
            base.Title = GettextCatalog.GetString ("Choose elements");
            base.AddButton(GettextCatalog.GetString ("_Cancel"), Gtk.ResponseType.Cancel);
            base.AddButton(GettextCatalog.GetString ("_Accept"), Gtk.ResponseType.Accept);
            base.Response += new Gtk.ResponseHandler(OnResponse);

            TreeView treeView = new TreeView();
            treeView.HeadersVisible = false;
            _store = new ListStore(typeof(bool), typeof(string));
            treeView.Model = _store;
            CellRendererToggle crtgl = new CellRendererToggle();
            crtgl.Activatable = true;
            crtgl.Toggled += new ToggledHandler(CheckboxToggledHandler);
            TreeViewColumn column = new TreeViewColumn ();
            column.PackStart(crtgl, false);
            column.AddAttribute(crtgl, "active", 0);
            treeView.AppendColumn(column);
            CellRendererText crtxt = new CellRendererText ();
            column = new TreeViewColumn ();
            column.PackStart(crtxt, false);
            column.AddAttribute(crtxt, "text", 1);
            treeView.AppendColumn(column);
            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Add(treeView);
            treeView.Show();
            base.VBox.Add(sw);
            ShowList(options, banned);
            sw.Show();
        }
        private void BuildColumns()
        {
            Gtk.CellRendererToggle toggler = new Gtk.CellRendererToggle ();
            torrentTreeView.AppendColumn ("", toggler, "active", 1);
            torrentTreeView.AppendColumn ("Filename", new CellRendererText(), "text", 0);

            toggler.Toggled += OnToggled;
        }
Example #35
0
        private void BuildColumns()
        {
            Gtk.CellRendererToggle toggler = new Gtk.CellRendererToggle();
            torrentTreeView.AppendColumn("", toggler, "active", 1);
            torrentTreeView.AppendColumn("Filename", new CellRendererText(), "text", 0);

            toggler.Toggled += OnToggled;
        }
		public StartupOptionsPanelWidget (Solution sol)
		{
			this.Build();
			this.sol = sol;
			
			startupItems = new List<SolutionItem> ();
			foreach (SolutionItem it in sol.GetAllItems<SolutionItem> ()) {
				// Include in the list if it can run in any of the existing execution modes and configurations
				foreach (IExecutionModeSet mset in Runtime.ProcessService.GetExecutionModes ()) {
					bool matched = false;
					foreach (IExecutionMode mode in mset.ExecutionModes) {
						foreach (SolutionConfiguration sc in sol.Configurations) {
							if (it.CanExecute (new ExecutionContext (mode, null, IdeApp.Workspace.ActiveExecutionTarget), sc.Selector)) {
								startupItems.Add (it);
								matched = true;
								break;
							}
						}
						if (matched)
							break;
					}
					if (matched)
						break;
				}
			}
			
			listStore = new ListStore (typeof(SolutionFolderItem), typeof(bool), typeof(string));
			treeItems.Model = listStore;
			treeItems.SearchColumn = -1; // disable the interactive search

			CellRendererToggle crt = new CellRendererToggle ();
			treeItems.AppendColumn ("", crt, "active", 1);
			treeItems.AppendColumn (GettextCatalog.GetString ("Project"), new CellRendererText (), "text", 2);
			
			if (startupItems.Count > 0) {
				for (int n=0; n<startupItems.Count; n++) {
					SolutionItem it = startupItems [n];
					comboItems.AppendText (it.Name);
					listStore.AppendValues (it, sol.MultiStartupItems.Contains (it), it.Name);
					if (sol.StartupItem == it)
						comboItems.Active = n;
				}
			}
			else {
				comboItems.AppendText (GettextCatalog.GetString ("The solution does not contain any executable project"));
				comboItems.Active = 0;
				comboItems.Sensitive = false;
				radioMulti.Sensitive = false;
				radioSingle.Sensitive = false;
			}
			
			radioSingle.Active = sol.SingleStartup;
			radioMulti.Active = !sol.SingleStartup;
			UpdateButtons ();
			
			crt.Toggled += OnItemToggled;
			treeItems.Selection.Changed += OnSelectionChanged;
		}
Example #37
0
        static void ToggleDataFunc(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            Gtk.CellRendererToggle toggleRenderer = (Gtk.CellRendererToggle)cell;
            Task task = model.GetValue(iter, DataColumns.Task) as Task;

            if (task == null)
            {
                return;
            }
            toggleRenderer.Active = task.Completed;
        }
Example #38
0
        void AddColumns()
        {
            CellRendererImage iconRender = new CellRendererImage();

            Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle();
            toggleRender.Toggled += new ToggledHandler(ItemToggled);

            TreeViewColumn col;

            col = view.AppendColumn("!", iconRender, "image", DataColumns.Type);

            col = view.AppendColumn("", toggleRender);
            col.SetCellDataFunc(toggleRender, new Gtk.TreeCellDataFunc(ToggleDataFunc));

            col = view.AppendColumn(GettextCatalog.GetString("Line"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(LineDataFunc));

            var descriptionCellRenderer = new DescriptionCellRendererText();

            view.RegisterRenderForFontChanges(descriptionCellRenderer);
            var descriptionCol = view.AppendColumn(GettextCatalog.GetString("Description"), descriptionCellRenderer);

            descriptionCol.SetCellDataFunc(descriptionCellRenderer, new Gtk.TreeCellDataFunc(DescriptionDataFunc));
            descriptionCol.Resizable                 = true;
            descriptionCellRenderer.WrapMode         = Pango.WrapMode.Word;
            descriptionCellRenderer.PreferedMaxWidth = IdeApp.Workbench.RootWindow.Allocation.Width / 3;

            descriptionCol.AddNotification("width", delegate
            {
                descriptionCellRenderer.WrapWidth = descriptionCol.Width;
                store.Foreach((model, path, iter) =>
                {
                    model.EmitRowChanged(path, iter);
                    return(false);
                });
            });

            col = view.AppendColumn(GettextCatalog.GetString("File"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(FileDataFunc));
            col.Resizable = true;

            col = view.AppendColumn(GettextCatalog.GetString("Project"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(ProjectDataFunc));
            col.Resizable = true;

            col = view.AppendColumn(GettextCatalog.GetString("Path"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(PathDataFunc));
            col.Resizable = true;

            col = view.AppendColumn(GettextCatalog.GetString("Category"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(CategoryDataFunc));
            col.Resizable = true;
        }
Example #39
0
 public ObjectMapViewer()
 {
     Build();
     fileStore      = new Gtk.ListStore(typeof(object), typeof(string), typeof(bool));
     fileList.Model = fileStore;
     Gtk.CellRendererToggle ctog = new Gtk.CellRendererToggle();
     ctog.Toggled += OnToggled;
     fileList.AppendColumn("Base", ctog, "active", 2);
     fileList.AppendColumn("File", new Gtk.CellRendererText(), "text", 1);
     fileList.CursorChanged       += new EventHandler(OnSelectionChanged);
     allObjectsTree.TypeActivated += OnAllObjectsTreeTypeActivated;
     notebook.Page = 0;
 }
Example #40
0
        void InitializeRings()
        {
            nvRings.NodeStore = RingStore;
            var toggleCell = new Gtk.CellRendererToggle();

            toggleCell.Activatable = true;
            toggleCell.Toggled    += OnRingToggled;

            nvRings.AppendColumn("d", toggleCell, "active", 0);
            nvRings.AppendColumn("Image", new Gtk.CellRendererPixbuf(), "pixbuf", 1);
            nvRings.AppendColumn("Name", new Gtk.CellRendererText(), "text", 2);
            nvRings.ShowAll();
        }
Example #41
0
        private void buildColumns()
        {
            addressColumn    = new TreeViewColumn();
            clientColumn     = new TreeViewColumn();
            downColumn       = new TreeViewColumn();
            upColumn         = new TreeViewColumn();
            seedingColumn    = new TreeViewColumn();
            interestedColumn = new TreeViewColumn();

            addressColumn.Title    = _("IP Address");
            clientColumn.Title     = _("Client");
            downColumn.Title       = _("DL Speed");
            upColumn.Title         = _("UP Speed");
            seedingColumn.Title    = _("Seeding");
            interestedColumn.Title = _("Interested");

            addressColumn.Expand    = true;
            clientColumn.Expand     = true;
            downColumn.Expand       = true;
            upColumn.Expand         = true;
            seedingColumn.Expand    = true;
            interestedColumn.Expand = true;

            Gtk.CellRendererText   addressCell    = new Gtk.CellRendererText();
            Gtk.CellRendererText   clientCell     = new Gtk.CellRendererText();
            Gtk.CellRendererText   downCell       = new Gtk.CellRendererText();
            Gtk.CellRendererText   upCell         = new Gtk.CellRendererText();
            Gtk.CellRendererToggle seedingCell    = new Gtk.CellRendererToggle();
            Gtk.CellRendererToggle interestedCell = new Gtk.CellRendererToggle();

            addressColumn.PackStart(addressCell, true);
            clientColumn.PackStart(clientCell, true);
            downColumn.PackStart(downCell, true);
            upColumn.PackStart(upCell, true);
            seedingColumn.PackStart(seedingCell, true);
            interestedColumn.PackStart(interestedCell, true);

            addressColumn.SetCellDataFunc(addressCell, new Gtk.TreeCellDataFunc(RenderAddress));
            clientColumn.SetCellDataFunc(clientCell, new Gtk.TreeCellDataFunc(RenderClient));
            downColumn.SetCellDataFunc(downCell, new Gtk.TreeCellDataFunc(RenderDown));
            upColumn.SetCellDataFunc(upCell, new Gtk.TreeCellDataFunc(RenderUp));
            seedingColumn.SetCellDataFunc(seedingCell, new Gtk.TreeCellDataFunc(RenderSeeding));
            interestedColumn.SetCellDataFunc(interestedCell, new Gtk.TreeCellDataFunc(RenderInterested));

            AppendColumn(addressColumn);
            AppendColumn(clientColumn);
            AppendColumn(downColumn);
            AppendColumn(upColumn);
            AppendColumn(seedingColumn);
            AppendColumn(interestedColumn);
        }
Example #42
0
//  void NoteIconCellDataFunc (Gtk.TreeViewColumn tree_column,
//    Gtk.CellRenderer cell, Gtk.TreeModel tree_model,
//    Gtk.TreeIter iter)
//  {
//   Gtk.CellRendererPixbuf crp = cell as Gtk.CellRendererPixbuf;
//   Task task = tree_model.GetValue (iter, 0) as Task;
//   if (task != null && task.OriginNoteUri != string.Empty)
//    crp.Pixbuf = note_pixbuf;
//   else
//    crp.Pixbuf = null;
//  }

        void ToggleCellDataFunc(Gtk.TreeViewColumn tree_column,
                                Gtk.CellRenderer cell, Gtk.TreeModel tree_model,
                                Gtk.TreeIter iter)
        {
            Gtk.CellRendererToggle crt = cell as Gtk.CellRendererToggle;
            Task task = tree_model.GetValue(iter, 0) as Task;

            if (task == null)
            {
                crt.Active = false;
            }
            else
            {
                crt.Active = task.IsComplete;
            }
        }
Example #43
0
 private void AddTreeViewColumn(Gtk.TreeView treeView, int i, string name, bool toggle)
 {
     Gtk.TreeViewColumn col = new Gtk.TreeViewColumn();
     col.Title = name;
     treeView.AppendColumn(col);
     Gtk.CellRenderer cell;
     if (toggle)
     {
         cell = new Gtk.CellRendererToggle();
     }
     else
     {
         cell = new Gtk.CellRendererText();
     }
     col.PackStart(cell, true);
     col.AddAttribute(cell, "text", i);
 }
Example #44
0
        private void TaskToggleCellDataFunc(Gtk.TreeViewColumn column,
                                            Gtk.CellRenderer cell,
                                            Gtk.TreeModel model,
                                            Gtk.TreeIter iter)
        {
            Gtk.CellRendererToggle crt = cell as Gtk.CellRendererToggle;
            ITask task = model.GetValue(iter, 0) as ITask;

            if (task == null)
            {
                crt.Active = false;
            }
            else
            {
                crt.Active =
                    task.State == TaskState.Active ? false : true;
            }
        }
        public SongDuplicateView()
        {
            Gtk.ScrolledWindow Scroll = new Gtk.ScrolledWindow();
            Gtk.TreeView       Tree   = new Gtk.TreeView();
            Gtk.VBox           vbox   = new Gtk.VBox(false, 1);
            Gtk.HBox           hbox   = new Gtk.HBox(false, 1);
            Tree.RowActivated += OnRowClicked;
            //Buttons For Header
            Gtk.Button removeButton = new Gtk.Button();
            removeButton.Label    = AddinManager.CurrentLocalizer.GetString("Remove Selected Songs");
            removeButton.Clicked += OnRemoveCommand;
            Gtk.Button deleteButton = new Gtk.Button();
            deleteButton.Label    = AddinManager.CurrentLocalizer.GetString("Delete Selected Songs");
            deleteButton.Clicked += OnDeleteCommand;

            //Create 5 columns, first column is a checkbox, next 4 are text boxes
            Gtk.CellRendererToggle selectCell = new Gtk.CellRendererToggle();
            selectCell.Activatable = true;
            selectCell.Toggled    += OnSelectToggled;
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Select"), selectCell, "active", 0);
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Track Number"), new Gtk.CellRendererText(), "text", 1);
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Song Title"), new Gtk.CellRendererText(), "text", 2);
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Artist"), new Gtk.CellRendererText(), "text", 3);
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Album"), new Gtk.CellRendererText(), "text", 4);
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("File"), new Gtk.CellRendererText(), "text", 5);
            // Remove From Library, Delete From Drive, Song Name, Artist Name, Album Name, Formated URI, Actual URI, Database Track ID
            MusicListStore = new Gtk.ListStore(typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(int));
            Tree.Model     = MusicListStore;
            //Pack the Tree in a scroll window
            Scroll.Add(Tree);
            //Pack the buttons in a hbox
            hbox.PackStart(removeButton, false, false, 0);
            hbox.PackStart(deleteButton, false, false, 0);
            //pack the hbox->buttons and Scroll->Tree in a Vbox, tell the Scroll window to Expand and Fill the vbox
            vbox.PackStart(hbox, false, false, 0);
            vbox.PackStart(Scroll, true, true, 0);
            //pack the vbox in the Rounded Frame
            Add(vbox);
            //Finally, show everything
            ShowAll();
        }
Example #46
0
        public ManageSitesDialog(Gtk.Window parent, SetupService service)
        {
            Build();
            TransientFor = parent;
            Services.PlaceDialog(this, parent);
            this.service            = service;
            treeStore               = new Gtk.ListStore(typeof(string), typeof(string), typeof(bool));
            repoTree.Model          = treeStore;
            repoTree.HeadersVisible = false;
            var crt = new Gtk.CellRendererToggle();

            crt.Toggled += HandleRepoToggled;
            repoTree.AppendColumn("", crt, "active", 2);
            repoTree.AppendColumn("", new Gtk.CellRendererText(), "markup", 1);
            repoTree.Selection.Changed += new EventHandler(OnSelect);

            AddinRepository[] reps = service.Repositories.GetRepositories();
            foreach (AddinRepository rep in reps)
            {
                AppendRepository(rep);
            }

            btnRemove.Sensitive = false;
        }
        public Gtk.TreeViewColumn AppendCheckBoxColumn(string name, ToggledHandler CheckBoxToggled, bool editable = false)
        {
            var newColumn = new Gtk.TreeViewColumn();

            newColumn.Title = name;

            var cellRenderer = new Gtk.CellRendererToggle();

            cellRenderer.Activatable = editable;
            if (CheckBoxToggled != null)
            {
                cellRenderer.Toggled += CheckBoxToggled;
            }

            newColumn.PackStart(cellRenderer, true);

            Columns.Add(newColumn);

            newColumn.Data["cellRenderer"] = cellRenderer;
            newColumn.Data["cellType"]     = "active";
            newColumn.Data["cellTypeOf"]   = typeof(bool);

            return(newColumn);
        }
Example #48
0
    private void _initNodeStore()
    {
        CellRendererToggle colorToggle = new Gtk.CellRendererToggle();

        colorToggle.Toggled += (object o, ToggledArgs args) =>
        {
            VectorFile vf = (VectorFile)(NodeFileList.NodeStore.GetNode(new TreePath(args.Path)));
            vf.ExportColorArt = !vf.ExportColorArt;
        };

        CellRendererToggle lineToggle = new Gtk.CellRendererToggle();

        lineToggle.Toggled += (object o, ToggledArgs args) =>
        {
            VectorFile vf = (VectorFile)(NodeFileList.NodeStore.GetNode(new TreePath(args.Path)));
            vf.ExportLineArt = !vf.ExportLineArt;
        };

        CellRendererToggle mergedToggle = new Gtk.CellRendererToggle();

        mergedToggle.Toggled += (object o, ToggledArgs args) =>
        {
            VectorFile vf = (VectorFile)(NodeFileList.NodeStore.GetNode(new TreePath(args.Path)));
            vf.ExportMerged = !vf.ExportMerged;
        };

        CellRendererText optionsRenderer = new CellRendererText();

        optionsRenderer.Editable = true;
        optionsRenderer.Edited  += (object o, EditedArgs args) =>
        {
            VectorFile vf = (VectorFile)(NodeFileList.NodeStore.GetNode(new TreePath(args.Path)));
            vf.Options = args.NewText;
        };

        CellRendererText nameRenderer = new CellRendererText();

        nameRenderer.Editable = true;
        nameRenderer.Edited  += (object o, EditedArgs args) =>
        {
            VectorFile vf = (VectorFile)(NodeFileList.NodeStore.GetNode(new TreePath(args.Path)));
            vf.Name = args.NewText;
        };

        TreeViewColumn nameCol = NodeFileList.AppendColumn("Name", nameRenderer, "text", 5);

        nameCol.Resizable = true;

        NodeFileList.AppendColumn("Color", colorToggle, "active", 3);
        NodeFileList.AppendColumn("Line", lineToggle, "active", 2);
        NodeFileList.AppendColumn("Merged", mergedToggle, "active", 1);

        TreeViewColumn optionsCol = NodeFileList.AppendColumn("Options", optionsRenderer, "text", 4);

        optionsCol.Resizable = true;

        NodeFileList.AppendColumn("Path", new Gtk.CellRendererText(), "text", 0);


        NodeFileList.NodeStore = exportSettingsController.GetListStore();

        NodeFileList.CursorChanged += RowSelected;
    }
        public void Initialize(IPadWindow window)
        {
            // Toolbar and menu definitions

            ActionCommand gotoCmd       = new ActionCommand(LocalCommands.GoToFile, GettextCatalog.GetString("Go to File"));
            ActionCommand propertiesCmd = new ActionCommand(LocalCommands.Properties, GettextCatalog.GetString("Properties"), Gtk.Stock.Properties);

            menuSet = new CommandEntrySet();
            menuSet.Add(gotoCmd);
            menuSet.AddSeparator();
            menuSet.AddItem(DebugCommands.EnableDisableBreakpoint);
            menuSet.AddItem(DebugCommands.ClearAllBreakpoints);
            menuSet.AddItem(DebugCommands.DisableAllBreakpoints);
            menuSet.AddItem(EditCommands.DeleteKey);
            menuSet.AddSeparator();
            menuSet.Add(propertiesCmd);

            CommandEntrySet toolbarSet = new CommandEntrySet();

            toolbarSet.AddItem(DebugCommands.EnableDisableBreakpoint);
            toolbarSet.AddItem(DebugCommands.ClearAllBreakpoints);
            toolbarSet.AddItem(DebugCommands.DisableAllBreakpoints);
            toolbarSet.AddItem(EditCommands.Delete);
            toolbarSet.AddSeparator();
            toolbarSet.Add(propertiesCmd);

            // The breakpoint list

            store = new TreeStore(typeof(string), typeof(bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));

            tree                = new PadTreeView();
            tree.Model          = store;
            tree.RulesHint      = true;
            tree.HeadersVisible = true;
            tree.DoPopupMenu    = ShowPopup;
            tree.KeyPressEvent += OnKeyPressEvent;

            treeState = new TreeViewState(tree, (int)Columns.Breakpoint);

            TreeViewColumn col = new TreeViewColumn();
            CellRenderer   crp = new CellRendererIcon();

            col.PackStart(crp, false);
            col.AddAttribute(crp, "stock_id", (int)Columns.Icon);
            tree.AppendColumn(col);

            Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle();
            toggleRender.Toggled += new ToggledHandler(ItemToggled);
            col = new TreeViewColumn();
            col.PackStart(toggleRender, false);
            col.AddAttribute(toggleRender, "active", (int)Columns.Selected);
            tree.AppendColumn(col);

            TreeViewColumn FrameCol = new TreeViewColumn();
            CellRenderer   crt      = tree.TextRenderer;

            FrameCol.Title = GettextCatalog.GetString("Name");
            FrameCol.PackStart(crt, true);
            FrameCol.AddAttribute(crt, "text", (int)Columns.FileName);
            FrameCol.Resizable = true;
            FrameCol.Alignment = 0.0f;
            tree.AppendColumn(FrameCol);

            col           = tree.AppendColumn(GettextCatalog.GetString("Condition"), crt, "text", (int)Columns.Condition);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Trace Expression"), crt, "text", (int)Columns.TraceExp);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Hit Count"), crt, "text", (int)Columns.HitCount);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Last Trace"), crt, "text", (int)Columns.LastTrace);
            col.Resizable = true;

            sw            = new Gtk.ScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(tree);

            control = sw;

            control.ShowAll();

            bps = DebuggingService.Breakpoints;

            UpdateDisplay();

            breakpointUpdatedHandler = DispatchService.GuiDispatch <EventHandler <BreakpointEventArgs> > (OnBreakpointUpdated);
            breakpointRemovedHandler = DispatchService.GuiDispatch <EventHandler <BreakpointEventArgs> > (OnBreakpointRemoved);
            breakpointAddedHandler   = DispatchService.GuiDispatch <EventHandler <BreakpointEventArgs> > (OnBreakpointAdded);
            breakpointChangedHandler = DispatchService.GuiDispatch <EventHandler> (OnBreakpointChanged);

            DebuggingService.Breakpoints.BreakpointAdded   += breakpointAddedHandler;
            DebuggingService.Breakpoints.BreakpointRemoved += breakpointRemovedHandler;
            DebuggingService.Breakpoints.Changed           += breakpointChangedHandler;
            DebuggingService.Breakpoints.BreakpointUpdated += breakpointUpdatedHandler;

            DebuggingService.PausedEvent  += OnDebuggerStatusCheck;
            DebuggingService.ResumedEvent += OnDebuggerStatusCheck;
            DebuggingService.StoppedEvent += OnDebuggerStatusCheck;

            tree.RowActivated += OnRowActivated;

            DockItemToolbar toolbar = window.GetToolbar(PositionType.Top);

            toolbar.Add(toolbarSet, sw);
            toolbar.ShowAll();
        }
 public CustomCellRendererToggle()
 {
     CellRenderer      = renderer = new Gtk.CellRendererToggle();
     renderer.Toggled += HandleToggled;
 }
Example #51
0
    Gtk.ListStore listStoreAll;     //stores the chronopics that have assigned a serial port: They are plugged in.

    //based on: ~/informatica/progs_meus/mono/treemodel.cs
    private void createContent(List <ChronopicRegisterPort> list)
    {
        treeview = new Gtk.TreeView();

        // Create column , cell renderer and add the cell to the serialN column
        Gtk.TreeViewColumn serialNCol = new Gtk.TreeViewColumn();
        serialNCol.Title = " " + Catalog.GetString("Serial Number") + " ";
        Gtk.CellRendererText serialNCell = new Gtk.CellRendererText();
        serialNCol.PackStart(serialNCell, true);

        // Create column , cell renderer and add the cell to the port column
        Gtk.TreeViewColumn portCol = new Gtk.TreeViewColumn();
        portCol.Title = " Port ";
        Gtk.CellRendererText portCell = new Gtk.CellRendererText();
        portCol.PackStart(portCell, true);


        //-- cell renderer toggles

        Gtk.TreeViewColumn unknownCol = new Gtk.TreeViewColumn();
        unknownCol.Title = " " + Catalog.GetString("Not configured") + " ";
        Gtk.CellRendererToggle unknownCell = new Gtk.CellRendererToggle();
        unknownCell.Activatable = true;
        unknownCell.Radio       = true;         //draw as radiobutton
        unknownCell.Toggled    += new Gtk.ToggledHandler(unknownToggled);
        unknownCol.PackStart(unknownCell, true);

        Gtk.TreeViewColumn contactsCol = new Gtk.TreeViewColumn();
        contactsCol.Title = " " + Catalog.GetString("Jumps/Races") + " ";
        Gtk.CellRendererToggle contactsCell = new Gtk.CellRendererToggle();
        contactsCell.Activatable = true;
        contactsCell.Radio       = true;        //draw as radiobutton
        contactsCell.Toggled    += new Gtk.ToggledHandler(contactsToggled);
        contactsCol.PackStart(contactsCell, true);

        Gtk.TreeViewColumn encoderCol = new Gtk.TreeViewColumn();
        encoderCol.Title = " " + Catalog.GetString("Encoder") + " ";
        Gtk.CellRendererToggle encoderCell = new Gtk.CellRendererToggle();
        encoderCell.Activatable = true;
        encoderCell.Radio       = true;         //draw as radiobutton
        encoderCell.Toggled    += new Gtk.ToggledHandler(encoderToggled);
        encoderCol.PackStart(encoderCell, true);

        //-- end of cell renderer toggles


        listStoreAll = new Gtk.ListStore(typeof(ChronopicRegisterWindowTypes));

        int connectedCount = 0;
        int unknownCount   = 0;

        foreach (ChronopicRegisterPort crp in list)
        {
            if (crp.Port != "")
            {
                listStoreAll.AppendValues(new ChronopicRegisterWindowTypes(crp));
                connectedCount++;

                if (crp.Type == ChronopicRegisterPort.Types.UNKNOWN)
                {
                    unknownCount++;
                }
            }
        }

        serialNCol.SetCellDataFunc(serialNCell, new Gtk.TreeCellDataFunc(RenderSerialN));
        portCol.SetCellDataFunc(portCell, new Gtk.TreeCellDataFunc(RenderPort));
        unknownCol.SetCellDataFunc(unknownCell, new Gtk.TreeCellDataFunc(RenderUnknown));
        contactsCol.SetCellDataFunc(contactsCell, new Gtk.TreeCellDataFunc(RenderContacts));
        encoderCol.SetCellDataFunc(encoderCell, new Gtk.TreeCellDataFunc(RenderEncoder));

        treeview.Model = listStoreAll;

        // Add the columns to the TreeView
        treeview.AppendColumn(serialNCol);
        treeview.AppendColumn(portCol);
        treeview.AppendColumn(unknownCol);
        treeview.AppendColumn(contactsCol);
        treeview.AppendColumn(encoderCol);

        Gtk.HBox hbox = new Gtk.HBox(false, 12);

        //create image
        Pixbuf pixbuf = new Pixbuf(null, Util.GetImagePath(false) + Constants.FileNameChronopic);

        Gtk.Image image = new Gtk.Image();
        image.Pixbuf = pixbuf;
        hbox.Add(image);

        //create label
        Gtk.Label label = new Gtk.Label();
        label.Text = writeLabel(connectedCount, unknownCount);
        hbox.Add(label);

        Gtk.VBox vboxTV = new Gtk.VBox(false, 12);
        vboxTV.Add(hbox);

        if (connectedCount > 0)
        {
            vboxTV.Add(treeview);
        }

        vbox_main.Add(vboxTV);
    }
Example #52
0
        void LoadColumns()
        {
            bool pref_val;

            Gtk.CellRenderer renderer;

            ///
            /// Completion Status
            ///
            Gtk.TreeViewColumn status = new Gtk.TreeViewColumn();
            status.Title         = string.Empty;
            status.Sizing        = Gtk.TreeViewColumnSizing.Autosize;
            status.Resizable     = false;
            status.Clickable     = true;
            status.Clicked      += OnCompletionColumnClicked;
            status.Reorderable   = true;
            status.SortIndicator = true;

            renderer = new Gtk.CellRendererToggle();
            (renderer as Gtk.CellRendererToggle).Toggled += OnTaskToggled;
            status.PackStart(renderer, false);
            status.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(ToggleCellDataFunc));
            tree.AppendColumn(status);

            ///
            /// Summary
            ///
            summary_column               = new Gtk.TreeViewColumn();
            summary_column.Title         = Catalog.GetString("Summary");
            summary_column.MinWidth      = 200;
            summary_column.FixedWidth    = 200;
            summary_column.Sizing        = Gtk.TreeViewColumnSizing.Autosize;
            summary_column.Resizable     = true;
            summary_column.Clickable     = true;
            summary_column.Clicked      += OnSummaryColumnClicked;
            summary_column.Reorderable   = true;
            summary_column.SortIndicator = true;

            renderer = new Gtk.CellRendererText();
            (renderer as CellRendererText).Editable  = true;
            (renderer as CellRendererText).Ellipsize = Pango.EllipsizeMode.End;
            (renderer as CellRendererText).Edited   += OnTaskSummaryEdited;
            renderer.Xalign = 0.0f;
            summary_column.PackStart(renderer, true);
            summary_column.SetCellDataFunc(renderer,
                                           new Gtk.TreeCellDataFunc(SummaryCellDataFunc));
            tree.AppendColumn(summary_column);

            // Due Date Column
            pref_val = GetPref(TaskListWindow.ShowDueDateColumnPreference);
            if (pref_val == true)
            {
                // Show the Due Date Column
                due_date_column               = new Gtk.TreeViewColumn();
                due_date_column.Title         = Catalog.GetString("Due Date");
                due_date_column.Sizing        = Gtk.TreeViewColumnSizing.Autosize;
                due_date_column.Resizable     = false;
                due_date_column.Clickable     = true;
                due_date_column.Clicked      += OnDueDateColumnClicked;
                due_date_column.Reorderable   = true;
                due_date_column.SortIndicator = true;

                renderer = new Gtk.Extras.CellRendererDate();
                (renderer as Gtk.Extras.CellRendererDate).Editable = true;
                (renderer as Gtk.Extras.CellRendererDate).Edited  += OnDueDateEdited;
                (renderer as Gtk.Extras.CellRendererDate).ShowTime = false;
                renderer.Xalign = 0.0f;
                due_date_column.PackStart(renderer, true);
                due_date_column.SetCellDataFunc(renderer,
                                                new Gtk.TreeCellDataFunc(DueDateCellDataFunc));
                tree.AppendColumn(due_date_column);
            }

            // Priority Column
            pref_val = GetPref(TaskListWindow.ShowPriorityColumnPreference);
            if (pref_val == true)
            {
                // Show the Priority Column
                priority_column               = new Gtk.TreeViewColumn();
                priority_column.Title         = Catalog.GetString("Priority");
                priority_column.Sizing        = Gtk.TreeViewColumnSizing.Autosize;
                priority_column.Resizable     = false;
                priority_column.Clickable     = true;
                priority_column.Clicked      += OnPriorityColumnClicked;
                priority_column.Reorderable   = true;
                priority_column.SortIndicator = true;

                renderer = new Gtk.CellRendererCombo();
                (renderer as Gtk.CellRendererCombo).Editable = true;
                (renderer as Gtk.CellRendererCombo).HasEntry = false;
                (renderer as Gtk.CellRendererCombo).Edited  += OnTaskPriorityEdited;
                Gtk.ListStore priority_store = new Gtk.ListStore(typeof(string));
                priority_store.AppendValues(Catalog.GetString("None"));
                priority_store.AppendValues(Catalog.GetString("Low"));
                priority_store.AppendValues(Catalog.GetString("Normal"));
                priority_store.AppendValues(Catalog.GetString("High"));
                (renderer as Gtk.CellRendererCombo).Model      = priority_store;
                (renderer as Gtk.CellRendererCombo).TextColumn = 0;
                renderer.Xalign = 0.0f;
                priority_column.PackStart(renderer, true);
                priority_column.SetCellDataFunc(renderer,
                                                new Gtk.TreeCellDataFunc(PriorityCellDataFunc));
                tree.AppendColumn(priority_column);
            }
        }
Example #53
0
        protected override void Initialize(IPadWindow window)
        {
            Id = "MonoDevelop.Debugger.BreakpointPad";
            // Toolbar and menu definitions

            ActionCommand gotoCmd       = new ActionCommand(LocalCommands.GoToFile, GettextCatalog.GetString("Go to File"));
            ActionCommand propertiesCmd = new ActionCommand(LocalCommands.Properties, GettextCatalog.GetString("Edit Breakpoint…"), Stock.Properties);

            menuSet = new CommandEntrySet();
            menuSet.Add(propertiesCmd);
            menuSet.Add(gotoCmd);
            menuSet.AddSeparator();
            menuSet.AddItem(DebugCommands.EnableDisableBreakpoint);
            menuSet.AddItem(DebugCommands.DisableAllBreakpoints);
            menuSet.AddSeparator();
            menuSet.AddItem(EditCommands.DeleteKey);
            menuSet.AddItem(DebugCommands.ClearAllBreakpoints);

            CommandEntrySet toolbarSet = new CommandEntrySet();

            toolbarSet.AddItem(DebugCommands.EnableDisableBreakpoint);
            toolbarSet.AddItem(DebugCommands.ClearAllBreakpoints);
            toolbarSet.AddItem(DebugCommands.DisableAllBreakpoints);
            toolbarSet.AddItem(EditCommands.Delete);
            toolbarSet.AddSeparator();
            toolbarSet.Add(propertiesCmd);
            toolbarSet.AddSeparator();
            toolbarSet.Add(new CommandEntry(DebugCommands.NewFunctionBreakpoint)
            {
                DisplayType = CommandEntryDisplayType.IconAndText
            });
            toolbarSet.Add(new CommandEntry(DebugCommands.NewCatchpoint)
            {
                DisplayType = CommandEntryDisplayType.IconAndText
            });

            // The breakpoint list

            store = new TreeStore(typeof(string), typeof(bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__Icon", "store__Selected", "store_FileName",
                                                                          "store_Breakpoint", "store_Condition", "store_TraceExp", "store_HitCount", "store_LastTrace");

            TypeDescriptor.AddAttributes(store, modelAttr);

            tree                = new PadTreeView();
            tree.Model          = store;
            tree.RulesHint      = true;
            tree.HeadersVisible = true;
            tree.DoPopupMenu    = ShowPopup;
            tree.KeyPressEvent += OnKeyPressEvent;
            tree.Selection.Mode = SelectionMode.Multiple;

            treeState = new TreeViewState(tree, (int)Columns.Breakpoint);

            TreeViewColumn col = new TreeViewColumn();
            CellRenderer   crp = new CellRendererImage();

            col.PackStart(crp, false);
            col.AddAttribute(crp, "stock_id", (int)Columns.Icon);
            tree.AppendColumn(col);

            Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle();
            toggleRender.Toggled += new ToggledHandler(ItemToggled);
            col = new TreeViewColumn();
            col.PackStart(toggleRender, false);
            col.AddAttribute(toggleRender, "active", (int)Columns.Selected);
            tree.AppendColumn(col);

            TreeViewColumn FrameCol = new TreeViewColumn();
            CellRenderer   crt      = tree.TextRenderer;

            FrameCol.Title = GettextCatalog.GetString("Name");
            FrameCol.PackStart(crt, true);
            FrameCol.AddAttribute(crt, "text", (int)Columns.FileName);
            FrameCol.Resizable = true;
            FrameCol.Alignment = 0.0f;
            tree.AppendColumn(FrameCol);

            col           = tree.AppendColumn(GettextCatalog.GetString("Condition"), crt, "text", (int)Columns.Condition);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Trace Expression"), crt, "text", (int)Columns.TraceExp);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Hit Count"), crt, "text", (int)Columns.HitCount);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Last Trace"), crt, "text", (int)Columns.LastTrace);
            col.Resizable = true;

            sw            = new Gtk.ScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(tree);

            control = sw;

            control.ShowAll();

            breakpoints = DebuggingService.Breakpoints;

            UpdateDisplay();

            breakpoints.BreakpointAdded   += OnBreakpointAdded;
            breakpoints.BreakpointRemoved += OnBreakpointRemoved;
            breakpoints.Changed           += OnBreakpointChanged;
            breakpoints.BreakpointUpdated += OnBreakpointUpdated;

            DebuggingService.PausedEvent  += OnDebuggerStatusCheck;
            DebuggingService.ResumedEvent += OnDebuggerStatusCheck;
            DebuggingService.StoppedEvent += OnDebuggerStatusCheck;

            tree.RowActivated += OnRowActivated;

            DockItemToolbar toolbar = window.GetToolbar(DockPositionType.Top);

            toolbar.Add(toolbarSet, sw);
            toolbar.ShowAll();
        }
Example #54
0
        public SampleAssistant()
        {
            SetSizeRequest(450, 300);
            Title = "Gtk.Assistant Sample";

            // ANA SAYFA

            Label lbl = new Label("HELLO PEOPLE OF EKINOKS");

            AppendPage(lbl);
            SetPageTitle(lbl, "Introduction");
            SetPageType(lbl, AssistantPageType.Intro);
            SetPageComplete(lbl, true);

            // ZIP SECME SAYFASI


            FileChooserButton fileChooserButton = new FileChooserButton("Choose the instalation zip", 0);
            HBox box = new HBox(true, 1);

            box.PackStart(fileChooserButton);
            fileChooserButton.CurrentFolderChanged += new EventHandler(Deneme);
            AppendPage(box);
            SetPageTitle(box, "Choose zip, people of Ekinoks");
            SetPageType(box, AssistantPageType.Content);


            // MODULE CHOOSER

            //HBox moduleBox = new HBox(true, 1);

            Gtk.TreeView tree = new Gtk.TreeView();

            //moduleBox.PackStart(tree);

            Gtk.TreeViewColumn moduleColumn = new Gtk.TreeViewColumn();
            moduleColumn.Title = "Module";
            Gtk.CellRendererText moduleColumnCell = new Gtk.CellRendererText();
            moduleColumn.PackStart(moduleColumnCell, true);

            Gtk.TreeViewColumn includeColumn = new Gtk.TreeViewColumn();
            includeColumn.Title = "Include";
            Gtk.CellRendererToggle includeColumnCell = new Gtk.CellRendererToggle();
            includeColumn.PackStart(includeColumnCell, true);


            // Add the columns to the TreeView
            tree.AppendColumn(moduleColumn);
            tree.AppendColumn(includeColumn);

            Gtk.ListStore moduleList = new Gtk.ListStore(typeof(string), typeof(bool));

            tree.Model = moduleList;



            AppendPage(tree);

            moduleList.AppendValues("Garbage", "DEDELER");
            moduleColumn.AddAttribute(moduleColumnCell, "text", 0);
            includeColumn.AddAttribute(includeColumnCell, "text", 1);


            // Done Done Tum dosyaları ekle



            //SetPageTitle(moduleBox, "Choose The Modules");
            //SetPageType(moduleBox, AssistantPageType.Content);

            //ESKI YAZI SEC SAYFASI
            //HBox box = new HBox(false, 6);
            //box.PackStart(new Label("Enter some text: "), false, false, 6);
            //Entry entry = new Entry();
            //entry.Changed += new EventHandler(EntryChanged);
            //box.PackStart(entry, false, false, 6);
            //Entry entry2 = new Entry();
            //entry2.Changed += new EventHandler(EntryChanged);
            //box.PackStart(entry2, false, false, 6);
            //AppendPage(box);
            //SetPageTitle(box, "Getting Some Input");
            //SetPageType(box, AssistantPageType.Content);

            //CHECKBOXLI EKRAN
            //CheckButton chk = new CheckButton("I think Gtk# is awesome.");
            //chk.Toggled += new EventHandler(ButtonToggled);
            //AppendPage(chk);
            //SetPageTitle(chk, "Provide Feedback");
            //SetPageType(chk, AssistantPageType.Content);

            Alignment al = new Alignment(0.5f, 0.5f, 0.0f, 0.0f);

            box          = new HBox(false, 6);
            progress_bar = new ProgressBar();
            box.PackStart(progress_bar, true, true, 6);
            Button btn = new Button("Make progress");

            btn.Clicked += new EventHandler(ButtonClicked);
            box.PackStart(btn, false, false, 6);
            al.Add(box);
            AppendPage(al);
            SetPageTitle(al, "Show Some Progress");
            SetPageType(al, AssistantPageType.Progress);

            lbl = new Label("In addition to being able to type,\nYou obviously have great taste in software.");
            AppendPage(lbl);
            SetPageTitle(lbl, "Congratulations");
            SetPageType(lbl, AssistantPageType.Confirm);
            SetPageComplete(lbl, true);

            Cancel += new EventHandler(AssistantCancel);
            Close  += new EventHandler(AssistantClose);
        }
Example #55
0
        private void Build()
        {
            SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            ShadowType = ShadowType.EtchedIn;

            d_treeview = new TreeView <Node>();
            d_treeview.Show();

            d_treeview.EnableSearch = false;

            d_treeview.RulesHint      = true;
            d_treeview.Selection.Mode = SelectionMode.Multiple;
            d_treeview.ShowExpanders  = false;

            d_treeview.ButtonPressEvent += OnTreeViewButtonPressEvent;
            d_treeview.KeyPressEvent    += OnTreeViewKeyPressEvent;

            d_treeview.TooltipColumn = (int)Node.Columns.Tooltip;

            CellRendererText renderer;
            TreeViewColumn   column;

            // Setup renderer for the name of the property
            renderer          = new CellRendererText();
            renderer.Editable = true;

            column           = d_treeview.AppendColumn("Name", renderer, "text", Node.Columns.Name);
            column.Resizable = true;
            column.MinWidth  = 75;

            column.SetCellDataFunc(renderer, VisualizeProperties);

            CellRenderer rname = renderer;

            renderer.EditingStarted += delegate(object o, EditingStartedArgs args) {
                d_editingEntry = args.Editable as Entry;
                d_editingPath  = args.Path;

                Node node = d_treeview.NodeStore.FindPath(new TreePath(args.Path));

                if (node.Variable == null && !(node is InterfaceNode))
                {
                    d_editingEntry.Text = "";
                }

                d_editingEntry.KeyPressEvent += delegate(object source, KeyPressEventArgs a)
                {
                    OnEntryKeyPressed(a, rname, NameEdited);
                };
            };

            renderer.EditingCanceled += delegate(object sender, EventArgs e) {
                if (d_editingEntry != null && Utils.GetCurrentEvent() is Gdk.EventButton)
                {
                    // Still do it actually
                    NameEdited(d_editingEntry.Text, d_editingPath);
                }
            };

            renderer.Edited += DoNameEdited;

            // Setup renderer for expression of the property
            renderer = new Gtk.CellRendererText();
            column   = d_treeview.AppendColumn("Expression", renderer,
                                               "text", Node.Columns.Expression,
                                               "editable", Node.Columns.Editable);

            column.Resizable = true;
            column.Expand    = true;

            column.SetCellDataFunc(renderer, VisualizeProperties);

            CellRenderer rexpr = renderer;

            renderer.EditingStarted += delegate(object o, EditingStartedArgs args) {
                d_editingEntry = args.Editable as Entry;
                d_editingPath  = args.Path;

                d_editingEntry.KeyPressEvent += delegate(object source, KeyPressEventArgs a)
                {
                    OnEntryKeyPressed(a, rexpr, ExpressionEdited);
                };
            };

            renderer.EditingCanceled += delegate(object sender, EventArgs e) {
                if (d_editingEntry != null && Utils.GetCurrentEvent() is Gdk.EventButton)
                {
                    // Still do it actually
                    ExpressionEdited(d_editingEntry.Text, d_editingPath);
                }
            };

            renderer.Edited += DoExpressionEdited;

            // Setup renderer for integrated toggle
            CellRendererToggle toggle;

            toggle = new Gtk.CellRendererToggle();
            column = d_treeview.AppendColumn(" ∫", toggle,
                                             "active", Node.Columns.Integrated,
                                             "activatable", Node.Columns.Editable);
            column.Resizable = false;

            toggle.Toggled += DoIntegratedToggled;

            // Setup renderer for flags
            CellRendererCombo combo;

            combo = new Gtk.CellRendererCombo();

            column = d_treeview.AppendColumn("Flags", combo,
                                             "text", Node.Columns.Flags,
                                             "editable", Node.Columns.Editable);
            column.Resizable = true;
            column.Expand    = false;

            combo.EditingStarted += DoEditingStarted;
            combo.Edited         += DoFlagsEdited;

            combo.HasEntry = false;

            d_flagsStore     = new ListStore(typeof(string));
            combo.Model      = d_flagsStore;
            combo.TextColumn = 0;

            column.MinWidth = 50;

            if (d_wrapper != null && d_wrapper is Wrappers.Node)
            {
                renderer = new Gtk.CellRendererText();

                column = d_treeview.AppendColumn("Interface", renderer,
                                                 "text", Node.Columns.Target);

                renderer.Editable = true;

                column.SetCellDataFunc(renderer, VisualizeProperties);

                CellRenderer riface = renderer;

                renderer.EditingStarted += delegate(object o, EditingStartedArgs args) {
                    d_editingEntry = args.Editable as Entry;
                    d_editingPath  = args.Path;

                    d_editingEntry.KeyPressEvent += delegate(object source, KeyPressEventArgs a)
                    {
                        OnEntryKeyPressed(a, riface, InterfaceEdited);
                    };
                };

                renderer.EditingCanceled += delegate(object sender, EventArgs e) {
                    if (d_editingEntry != null && Utils.GetCurrentEvent() is Gdk.EventButton)
                    {
                        // Still do it actually
                        InterfaceEdited(d_editingEntry.Text, d_editingPath);
                    }
                };

                renderer.Edited += DoInterfaceEdited;
            }

            Populate();
            InitializeFlagsList();

            Add(d_treeview);
        }
Example #56
0
        public FolderSyncView()
        {
            vbox_main.PackStart(main_hpane, true, true, 1);
            vbox_main.PackStart(Progress, false, false, 1);
            var frame = new Hyena.Widgets.ScrolledWindow();

            frame.AddWithFrame(playlist_tree);
            main_hpane.Pack1(frame, true, true);
            // right hand side is folder select and options
            //hbox_main.PackStart (vbox_folder_and_option, true, true, 0);
            main_hpane.Pack2(vbox_folder_and_option, true, true);
            hbox_chooser.PackStart(
                new Gtk.Label(AddinManager.CurrentLocalizer.GetString("Sync to folder:")),
                false, false, 1);
            hbox_chooser.PackStart(target_chooser, true, true, 1);
            vbox_folder_and_option.PackStart(hbox_chooser, false, false, 1);
            vbox_folder_and_option.PackStart(options_frame, false, false, 1);

            options_frame.Add(frame_alignment);

            frame_alignment.Add(vbox_checkbox);
            vbox_checkbox.PackStart(create_m3u, true, true, 1);
            vbox_checkbox.PackStart(overwrite_existing, true, true, 1);
            vbox_checkbox.PackStart(create_symlinks, true, true, 1);
            vbox_checkbox.PackStart(hbox_subfolder, true, true, 1);
            hbox_subfolder.PackStart(create_subfolders, true, true, 1);
            hbox_subfolder.PackStart(
                new Gtk.Label(AddinManager.CurrentLocalizer.GetString("Subfolder depth") + ":"), true, true, 1);
            hbox_subfolder.PackStart(subfolder_depth, true, true, 1);

            subfolder_depth.Value      = 1;
            create_subfolders.Clicked += delegate(object sender, EventArgs e) {
                subfolder_depth.Sensitive = create_subfolders.Active;
            };

            startbutton_alignment.Add(StartSyncButton);
            vbox_folder_and_option.PackStart(startbutton_alignment, false, false, 0);

            Add(vbox_main);

            // PLAYLIST TREEVIEW stuff
            // connect data model to the TreeView
            playlist_tree.Model          = PlaylistStore;
            playlist_tree.Selection.Mode = Gtk.SelectionMode.Multiple;

            // new column & renderer for the playlists
            var playlist_column        = new TreeViewColumn();
            var playlist_cell_renderer = new Gtk.CellRendererText();

            playlist_column.Title = "Playlists";
            // the the cell renderer, set to type text, and choose 1st position
            // from the model (counting starts on 0)
            playlist_column.PackStart(playlist_cell_renderer, true);
            playlist_column.AddAttribute(playlist_cell_renderer, "text", 1);
            var select_column        = new TreeViewColumn();
            var select_cell_renderer = new Gtk.CellRendererToggle();

            select_column.Title = "Sync";
            select_column.PackStart(select_cell_renderer, false);
            select_column.AddAttribute(select_cell_renderer, "active", 0);

            //TODO enable checkbox in the selection window
            //playlist_tree.AppendColumn (select_column);
            // order of Append matters, so first add select, then the playlist
            playlist_tree.AppendColumn(playlist_column);

            // show all the widgets in this window
            ShowAll();
        }
Example #57
0
        /// <summary>
        ///  the main function for the open game dialog
        /// also set up the treeview and its elements
        /// </summary>
        public dlgOpen()
        {
            Build();
            #region "Tree Layout"
            //
            // Open TreeView
            //


            // Create a column for the game ID title
            Gtk.TreeViewColumn colGameID = new Gtk.TreeViewColumn();
            colGameID.Alignment = 0.5f;
            colGameID.Title     = "ID";

            // Create a column for the player name title
            Gtk.TreeViewColumn colPlayerName = new Gtk.TreeViewColumn();
            colPlayerName.Title = "Player Name";

            Gtk.TreeViewColumn colScore = new Gtk.TreeViewColumn();
            colScore.Alignment = 0.5f;
            colScore.Title     = "Score";

            // Create a column for the date title
            Gtk.TreeViewColumn colDate = new Gtk.TreeViewColumn();
            colDate.Alignment = 0.5f;
            colDate.Title     = "Date";

            // Create a column for the date title
            Gtk.TreeViewColumn colComplete = new Gtk.TreeViewColumn();
            colComplete.Alignment = 0.5f;
            colComplete.Visible   = false;
            colComplete.Title     = "Finished";


            // Add the columns to the TreeView
            gvOpen.AppendColumn(colGameID);
            gvOpen.AppendColumn(colPlayerName);
            colPlayerName.Expand = true;
            gvOpen.AppendColumn(colScore);
            gvOpen.AppendColumn(colDate);
            gvOpen.AppendColumn(colComplete);

            // set up the columns
            Gtk.CellRendererText cellGameID = new Gtk.CellRendererText();
            cellGameID.Width  = 25;
            cellGameID.Xalign = 0.5f;
            colGameID.PackStart(cellGameID, true);

            Gtk.CellRendererText cellPlayerName = new Gtk.CellRendererText();
            cellPlayerName.Width = 150;
            colPlayerName.PackStart(cellPlayerName, true);

            Gtk.CellRendererText cellScore = new Gtk.CellRendererText();
            cellScore.Width  = 65;
            cellScore.Xalign = 1.0f;
            colScore.PackStart(cellScore, true);

            Gtk.CellRendererText cellDate = new Gtk.CellRendererText();
            cellDate.Width  = 75;
            cellDate.Xalign = 1.0f;
            colDate.PackStart(cellDate, true);

            Gtk.CellRendererToggle cellComplete = new Gtk.CellRendererToggle();
            cellComplete.Xalign    = 0.5f;
            cellComplete.Sensitive = true;
            colComplete.PackStart(cellComplete, true);

            // Tell the Cell Renderers which item(frmMain)s in the model to display
            colGameID.AddAttribute(cellGameID, "text", 0);
            colPlayerName.AddAttribute(cellPlayerName, "text", 1);
            colScore.AddAttribute(cellScore, "text", 2);
            colDate.AddAttribute(cellDate, "text", 3);
            colComplete.AddAttribute(cellComplete, "active", 4);

            #endregion

            gvOpen.Model = LoadTree();
        }
Example #58
0
        public TaskTreeView(Gtk.TreeModel model)
            : base()
        {
                        #if GTK_2_12
            // set up the timing for the tooltips
            this.Settings.SetLongProperty("gtk-tooltip-browse-mode-timeout", 0, "Tasque:TaskTreeView");
            this.Settings.SetLongProperty("gtk-tooltip-browse-timeout", 750, "Tasque:TaskTreeView");
            this.Settings.SetLongProperty("gtk-tooltip-timeout", 750, "Tasque:TaskTreeView");

            ConnectEvents();
                        #endif

            // TODO: Modify the behavior of the TreeView so that it doesn't show
            // the highlighted row.  Then, also tie in with the mouse hovering
            // so that as you hover the mouse around, it will automatically
            // select the row that the mouse is hovered over.  By doing this,
            // we should be able to not require the user to click on a task
            // to select it and THEN have to click on the column item they want
            // to modify.

            filterCategory = null;

            modelFilter             = new Gtk.TreeModelFilter(model, null);
            modelFilter.VisibleFunc = FilterFunc;

            modelFilter.RowInserted += OnRowInsertedHandler;
            modelFilter.RowDeleted  += OnRowDeletedHandler;

            //Model = modelFilter

            Selection.Mode = Gtk.SelectionMode.Single;
            RulesHint      = false;
            HeadersVisible = false;
            HoverSelection = true;

            // TODO: Figure out how to turn off selection highlight

            Gtk.CellRenderer renderer;

            //
            // Checkbox Column
            //
            Gtk.TreeViewColumn column = new Gtk.TreeViewColumn();
            // Title for Completed/Checkbox Column
            column.Title     = Catalog.GetString("Completed");
            column.Sizing    = Gtk.TreeViewColumnSizing.Autosize;
            column.Resizable = false;
            column.Clickable = true;

            renderer = new Gtk.CellRendererToggle();
            (renderer as Gtk.CellRendererToggle).Toggled += OnTaskToggled;
            column.PackStart(renderer, false);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(TaskToggleCellDataFunc));
            AppendColumn(column);

            //
            // Priority Column
            //
            column = new Gtk.TreeViewColumn();
            // Title for Priority Column
            column.Title = Catalog.GetString("Priority");
            //column.Sizing = Gtk.TreeViewColumnSizing.Autosize;
            column.Sizing     = Gtk.TreeViewColumnSizing.Fixed;
            column.Alignment  = 0.5f;
            column.FixedWidth = 30;
            column.Resizable  = false;
            column.Clickable  = true;

            renderer = new Gtk.CellRendererCombo();
            (renderer as Gtk.CellRendererCombo).Editable = true;
            (renderer as Gtk.CellRendererCombo).HasEntry = false;
            SetCellRendererCallbacks((CellRendererCombo)renderer, OnTaskPriorityEdited);
            Gtk.ListStore priorityStore = new Gtk.ListStore(typeof(string));
            priorityStore.AppendValues(Catalog.GetString("1"));               // High
            priorityStore.AppendValues(Catalog.GetString("2"));               // Medium
            priorityStore.AppendValues(Catalog.GetString("3"));               // Low
            priorityStore.AppendValues(Catalog.GetString("-"));               // None
            (renderer as Gtk.CellRendererCombo).Model      = priorityStore;
            (renderer as Gtk.CellRendererCombo).TextColumn = 0;
            renderer.Xalign = 0.5f;
            column.PackStart(renderer, true);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(TaskPriorityCellDataFunc));
            AppendColumn(column);

            //
            // Task Name Column
            //
            column = new Gtk.TreeViewColumn();
            // Title for Task Name Column
            column.Title = Catalog.GetString("Task Name");
//			column.Sizing = Gtk.TreeViewColumnSizing.Fixed;
            column.Sizing    = Gtk.TreeViewColumnSizing.Autosize;
            column.Expand    = true;
            column.Resizable = true;

            // TODO: Add in code to determine how wide we should make the name
            // column.
            // TODO: Add in code to readjust the size of the name column if the
            // user resizes the Task Window.
            //column.FixedWidth = 250;

            renderer = new Gtk.CellRendererText();
            column.PackStart(renderer, true);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(TaskNameTextCellDataFunc));
            ((Gtk.CellRendererText)renderer).Editable = true;
            SetCellRendererCallbacks((CellRendererText)renderer, OnTaskNameEdited);

            AppendColumn(column);


            //
            // Due Date Column
            //

            //  2/11 - Today
            //  2/12 - Tomorrow
            //  2/13 - Wed
            //  2/14 - Thu
            //  2/15 - Fri
            //  2/16 - Sat
            //  2/17 - Sun
            // --------------
            //  2/18 - In 1 Week
            // --------------
            //  No Date
            // ---------------
            //  Choose Date...

            column = new Gtk.TreeViewColumn();
            // Title for Due Date Column
            column.Title      = Catalog.GetString("Due Date");
            column.Sizing     = Gtk.TreeViewColumnSizing.Fixed;
            column.Alignment  = 0f;
            column.FixedWidth = 90;
            column.Resizable  = false;
            column.Clickable  = true;

            renderer = new Gtk.CellRendererCombo();
            (renderer as Gtk.CellRendererCombo).Editable = true;
            (renderer as Gtk.CellRendererCombo).HasEntry = false;
            SetCellRendererCallbacks((CellRendererCombo)renderer, OnDateEdited);
            Gtk.ListStore dueDateStore = new Gtk.ListStore(typeof(string));
            DateTime      today        = DateTime.Now;
            dueDateStore.AppendValues(
                today.ToString(Catalog.GetString("M/d - ")) + Catalog.GetString("Today"));
            dueDateStore.AppendValues(
                today.AddDays(1).ToString(Catalog.GetString("M/d - ")) + Catalog.GetString("Tomorrow"));
            dueDateStore.AppendValues(
                today.AddDays(2).ToString(Catalog.GetString("M/d - ddd")));
            dueDateStore.AppendValues(
                today.AddDays(3).ToString(Catalog.GetString("M/d - ddd")));
            dueDateStore.AppendValues(
                today.AddDays(4).ToString(Catalog.GetString("M/d - ddd")));
            dueDateStore.AppendValues(
                today.AddDays(5).ToString(Catalog.GetString("M/d - ddd")));
            dueDateStore.AppendValues(
                today.AddDays(6).ToString(Catalog.GetString("M/d - ddd")));
            dueDateStore.AppendValues(
                today.AddDays(7).ToString(Catalog.GetString("M/d - ")) + Catalog.GetString("In 1 Week"));
            dueDateStore.AppendValues(Catalog.GetString("No Date"));
            dueDateStore.AppendValues(Catalog.GetString("Choose Date..."));
            (renderer as Gtk.CellRendererCombo).Model      = dueDateStore;
            (renderer as Gtk.CellRendererCombo).TextColumn = 0;
            renderer.Xalign = 0.0f;
            column.PackStart(renderer, true);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(DueDateCellDataFunc));
            AppendColumn(column);



            //
            // Notes Column
            //
            column = new Gtk.TreeViewColumn();
            // Title for Notes Column
            column.Title      = Catalog.GetString("Notes");
            column.Sizing     = Gtk.TreeViewColumnSizing.Fixed;
            column.FixedWidth = 20;
            column.Resizable  = false;

            renderer = new Gtk.CellRendererPixbuf();
            column.PackStart(renderer, false);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(TaskNotesCellDataFunc));

            AppendColumn(column);

            //
            // Timer Column
            //
            column = new Gtk.TreeViewColumn();
            // Title for Timer Column
            column.Title      = Catalog.GetString("Timer");
            column.Sizing     = Gtk.TreeViewColumnSizing.Fixed;
            column.FixedWidth = 20;
            column.Resizable  = false;

            renderer        = new Gtk.CellRendererPixbuf();
            renderer.Xalign = 0.5f;
            column.PackStart(renderer, false);
            column.SetCellDataFunc(renderer,
                                   new Gtk.TreeCellDataFunc(TaskTimerCellDataFunc));

            AppendColumn(column);
        }
Example #59
0
    private void treeView_lines_setup()
    {
        treeview_lines_store = new Gtk.ListStore(typeof(userLine));

        Gtk.CellRendererText   nameCell   = new Gtk.CellRendererText();
        Gtk.CellRendererText   lineCell   = new Gtk.CellRendererText();
        Gtk.CellRendererText   rssCell    = new Gtk.CellRendererText();
        Gtk.CellRendererToggle activeCell = new Gtk.CellRendererToggle();
        Gtk.CellRendererToggle loopCell   = new Gtk.CellRendererToggle();
        Gtk.CellRendererText   numCell    = new Gtk.CellRendererText();
        Gtk.CellRendererText   timeCell   = new Gtk.CellRendererText();

        Gtk.TreeViewColumn nameColumn   = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn activeColumn = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn lineColumn   = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn rssColumn    = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn loopColumn   = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn numColumn    = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn timeColumn   = new Gtk.TreeViewColumn();

        nameColumn.Title   = "Name";
        activeColumn.Title = "Aktiv";
        lineColumn.Title   = "Code";
        rssColumn.Title    = "RSS Feed / XML Datei";
        loopColumn.Title   = "Loop";
        numColumn.Title    = "";
        timeColumn.Title   = "Dauer";

        nameColumn.PackStart(nameCell, true);
        activeColumn.PackStart(activeCell, true);
        lineColumn.PackStart(lineCell, true);
        rssColumn.PackStart(rssCell, true);
        loopColumn.PackStart(loopCell, true);
        numColumn.PackStart(numCell, true);
        timeColumn.PackStart(timeCell, true);

        nameCell.Editable      = true;
        nameCell.Edited       += nameCellEdited;
        lineCell.Editable      = true;
        lineCell.Edited       += codeCellEdited;
        rssCell.Editable       = true;
        rssCell.Edited        += rssCellEdited;
        activeCell.Activatable = true;
        activeCell.Toggled    += HandleActiveCellToggled;
        loopCell.Activatable   = true;
        loopCell.Toggled      += HandleLoopCellToggled;
        timeCell.Editable      = true;
        timeCell.Edited       += timeCellEdited;

        treeview2.KeyPressEvent += HandleTreeview2KeyPressEvent;

        //nameColumn.AddAttribute(nameCell,"text",0);
        //activeColumn.AddAttribute(activeCell,"radio",1);
        //lineColumn.AddAttribute(lineCell,"text",2);
        //rssColumn.AddAttribute(rssCell,"text",3);

        activeCell.Radio = true;

        foreach (userLine line in user_lines)
        {
            treeview_lines_store.AppendValues(line);
            if (line.m_active)
            {
                led_matrix.led_matrix_string = line.m_code;
                led_matrix.rss.url           = line.m_rss_url;
            }
        }

        nameColumn.SetCellDataFunc(nameCell, new Gtk.TreeCellDataFunc(RenderUserLinesName));
        activeColumn.SetCellDataFunc(activeCell, new Gtk.TreeCellDataFunc(RenderUserLinesActive));
        lineColumn.SetCellDataFunc(lineCell, new Gtk.TreeCellDataFunc(RenderUserLinesCode));
        rssColumn.SetCellDataFunc(rssCell, new Gtk.TreeCellDataFunc(RenderUserLinesRss));
        loopColumn.SetCellDataFunc(loopCell, new Gtk.TreeCellDataFunc(RenderUserLinesLoop));
        timeColumn.SetCellDataFunc(timeCell, new Gtk.TreeCellDataFunc(RenderUserLinesTime));
        numColumn.SetCellDataFunc(numCell, new Gtk.TreeCellDataFunc(RenderUserLinesNum));

        treeview2.Model = treeview_lines_store;

        treeview2.AppendColumn(numColumn);
        treeview2.AppendColumn(nameColumn);
        treeview2.AppendColumn(activeColumn);
        treeview2.AppendColumn(loopColumn);
        treeview2.AppendColumn(timeColumn);
        treeview2.AppendColumn(lineColumn);
        treeview2.AppendColumn(rssColumn);
    }