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 ();
        }
Esempio n. 2
0
        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 ();
        }
		public ProjectFileSelectorDialog (Project project, string defaultFilterName, string defaultFilterPattern, string [] buildActions)
		{
			this.project = project;
			this.defaultFilter = new SelectFileDialogFilter (defaultFilterName, defaultFilterPattern ?? "*");
			this.buildActions = buildActions;
			
			this.Build();
			
			projBuf = ImageService.GetIcon (project.StockIcon, IconSize.Menu);
			dirClosedBuf = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.ClosedFolder, IconSize.Menu);
			dirOpenBuf = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.OpenFolder, IconSize.Menu);
			
			TreeViewColumn projectCol = new TreeViewColumn ();
			projectCol.Title = GettextCatalog.GetString ("Project Folders");
			var pixRenderer = new CellRendererImage ();
			CellRendererText txtRenderer = new CellRendererText ();
			projectCol.PackStart (pixRenderer, false);
			projectCol.PackStart (txtRenderer, true);
			projectCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (PixDataFunc));
			projectCol.SetCellDataFunc (txtRenderer, new TreeCellDataFunc (TxtDataFunc));
			projectTree.Model = dirStore;
			projectTree.AppendColumn (projectCol);
			TreeIter projectIter = dirStore.AppendValues ("", FilePath.Empty);
			InitDirs (projectIter);
			projectTree.ExpandAll ();
			projectTree.RowActivated += delegate {
				fileList.GrabFocus ();
			};
			projectTree.KeyPressEvent += ProjectListKeyPressEvent;
			
			TreeViewColumn fileCol = new TreeViewColumn ();
			var filePixRenderer = new CellRendererImage ();
			fileCol.Title = GettextCatalog.GetString ("Files");
			fileCol.PackStart (filePixRenderer, false);
			fileCol.PackStart (txtRenderer, true);
			fileCol.AddAttribute (filePixRenderer, "image", 1);
			fileCol.SetCellDataFunc (txtRenderer, new TreeCellDataFunc (TxtFileDataFunc));
			fileList.Model = fileStore;
			fileList.AppendColumn (fileCol);
			fileList.RowActivated += delegate {
				TreeIter iter;
				if (fileList.Selection.GetSelected (out iter))
					Respond (ResponseType.Ok);
			};
			fileList.KeyPressEvent += FileListKeyPressEvent;
			fileList.KeyReleaseEvent += FileListKeyReleaseEvent;
			
			TreeIter root;
			if (dirStore.GetIterFirst (out root))
				projectTree.Selection.SelectIter (root);
			
			UpdateFileList (null, null);
			
			projectTree.Selection.Changed += UpdateFileList;
			fileList.Selection.Changed += UpdateSensitivity;
			
			
			this.DefaultResponse = ResponseType.Cancel;
			this.Modal = true;
		}
		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);
		}
Esempio n. 5
0
        public PeopleTreeView()
        {
            Selection.Mode = SelectionMode.Single;
            HeadersVisible = false;

            peopleTreeStore = new TreeStore(typeof(uint),typeof(string),typeof(Tag));
            this.Model = peopleTreeStore;

            TagStore.ItemsAdded += TagStoreItemsAdded;
            TagStore.ItemsChanged += TagStoreItemsChanged;
            TagStore.ItemsRemoved += TagStoreItemsRemoved;

            complete_column = new TreeViewColumn();

            pix_render = new CellRendererPixbuf();
            complete_column.PackStart(pix_render,false);
            complete_column.SetCellDataFunc(pix_render, new TreeCellDataFunc(IconDataFunc));

            text_render = new CellRendererText();
            complete_column.PackStart( text_render, true);
            complete_column.SetCellDataFunc( text_render, new TreeCellDataFunc( NameDataFunc));

            AppendColumn(complete_column);

            RefreshPeopleTreeStore ();

            //TODO If have time - add people search.
        }
Esempio n. 6
0
        // Constructor.
        public TagSelectionWidget(TagStore tag_store)
            : base(new TreeStore (typeof(uint), typeof(string)))
        {
            database = MainWindow.Toplevel.Database;

            HeadersVisible = false;

            complete_column = new TreeViewColumn ();

            pix_render = new CellRendererPixbuf ();
            complete_column.PackStart (pix_render, false);
            complete_column.SetCellDataFunc (pix_render, new TreeCellDataFunc (IconDataFunc));
            //complete_column.AddAttribute (pix_render, "pixbuf", OpenIconColumn);

            //icon_column = AppendColumn ("icon",
            //, new TreeCellDataFunc (IconDataFunc));
            //icon_column = AppendColumn ("icon", new CellRendererPixbuf (), new TreeCellDataFunc (IconDataFunc));

            text_render = new CellRendererText ();
            complete_column.PackStart (text_render, true);
            complete_column.SetCellDataFunc (text_render, new TreeCellDataFunc (NameDataFunc));

            AppendColumn (complete_column);

            this.tag_store = tag_store;

            Update ();

            ExpandDefaults ();

            tag_store.ItemsAdded += HandleTagsAdded;
            tag_store.ItemsRemoved += HandleTagsRemoved;
            tag_store.ItemsChanged += HandleTagsChanged;

            // TODO make the search find tags that are not currently expanded
            EnableSearch = true;
            SearchColumn = NameColumn;

            // Transparent white
            empty_pixbuf.Fill(0xffffff00);

            /* set up drag and drop */
            DragDataGet += HandleDragDataGet;
            DragDrop += HandleDragDrop;
            DragBegin += HandleDragBegin;

            Gtk.Drag.SourceSet (this,
                       Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button3Mask,
                       tag_source_target_table,
                       DragAction.Copy | DragAction.Move);

            DragDataReceived += HandleDragDataReceived;
            DragMotion += HandleDragMotion;

            Gtk.Drag.DestSet (this,
                              DestDefaults.All,
                              tag_dest_target_table,
                              DragAction.Copy | DragAction.Move);
        }
        public Gtk.Widget GetOutlineWidget()
        {
            if (TreeView != null)
                return TreeView;

            TreeStore = new TreeStore(typeof(object));
            /*
            settings = ClassOutlineSettings.Load();
            comparer = new ClassOutlineNodeComparer(GetAmbience(), settings, outlineTreeModelSort);

            outlineTreeModelSort.SetSortFunc(0, comparer.CompareNodes);
            outlineTreeModelSort.SetSortColumnId(0, SortType.Ascending);
            */
            TreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView(TreeStore);

            var pixRenderer = new CellRendererPixbuf();
            pixRenderer.Xpad = 0;
            pixRenderer.Ypad = 0;

            TreeView.TextRenderer.Xpad = 0;
            TreeView.TextRenderer.Ypad = 0;

            TreeViewColumn treeCol = new TreeViewColumn();
            treeCol.PackStart(pixRenderer, false);

            treeCol.SetCellDataFunc(pixRenderer, new TreeCellDataFunc(OutlineTreeIconFunc));
            treeCol.PackStart(TreeView.TextRenderer, true);

            treeCol.SetCellDataFunc(TreeView.TextRenderer, new TreeCellDataFunc(OutlineTreeTextFunc));

            TreeView.AppendColumn(treeCol);

            TreeView.TextRenderer.Editable = true;
            TreeView.TextRenderer.Edited += new EditedHandler(nameCell_Edited);

            TreeView.HeadersVisible = false;

            TreeView.Selection.Changed += delegate
            {
                if (dontJumpToDeclaration || !outlineReady)
                    return;

                clickedOnOutlineItem = true;
                JumpToDeclaration(true);
                clickedOnOutlineItem = false;
            };

            TreeView.Realized += delegate { RefillOutlineStore(); };
            //UpdateSorting();

            var sw = new CompactScrolledWindow();
            sw.Add(TreeView);
            sw.ShowAll();
            return sw;
        }
Esempio n. 8
0
 private void InitializeTreeView()
 {
     _storeItems = new Gtk.TreeStore(typeof(SyncMenuItemEntity));
     treeView.HeadersVisible = false;
     treeView.Selection.Mode = SelectionMode.Multiple;
     Gtk.TreeViewColumn colTitle = new Gtk.TreeViewColumn();
     Gtk.CellRendererText cellTitle = new Gtk.CellRendererText();    
     Gtk.CellRendererPixbuf cellPixbuf = new Gtk.CellRendererPixbuf();
     colTitle.PackStart(cellPixbuf, false);
     colTitle.PackStart(cellTitle, true);
     colTitle.SetCellDataFunc(cellPixbuf, new Gtk.TreeCellDataFunc(RenderCell));
     colTitle.SetCellDataFunc(cellTitle, new Gtk.TreeCellDataFunc(RenderCell));
     treeView.AppendColumn(colTitle);
 }
Esempio n. 9
0
        private void InitializeDeviceTreeView()
        {
            _storeDevices = new Gtk.TreeStore(typeof(SyncDevice));
            treeViewDevices.ShowExpanders = false;
            treeViewDevices.HeadersVisible = false;

            // Create title column
            Gtk.TreeViewColumn colTitle = new Gtk.TreeViewColumn();
            Gtk.CellRendererPixbuf cellPixbuf = new Gtk.CellRendererPixbuf();
            Gtk.CellRendererText cellTitle = new Gtk.CellRendererText();
            colTitle.PackStart(cellPixbuf, false);
            colTitle.PackStart(cellTitle, true);
            colTitle.SetCellDataFunc(cellPixbuf, new Gtk.TreeCellDataFunc(RenderDeviceCell));
            colTitle.SetCellDataFunc(cellTitle, new Gtk.TreeCellDataFunc(RenderDeviceCell));
            treeViewDevices.AppendColumn(colTitle);
        }
		public void PopulateForm ()
		{
			Gtk.TreeViewColumn serialColumn = new Gtk.TreeViewColumn ();
			serialColumn.Title = "Serial";
			Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn ();
			nameColumn.Title = "Name";

			Gtk.CellRendererText serialCell = new Gtk.CellRendererText ();
			Gtk.CellRendererText nameCell = new Gtk.CellRendererText ();

			serialColumn.PackStart (serialCell, false);
			serialColumn.SetCellDataFunc (serialCell, new Gtk.TreeCellDataFunc (RenderSerial));

			nameColumn.PackEnd (nameCell, true);
			nameColumn.SetCellDataFunc (nameCell, new Gtk.TreeCellDataFunc (RenderName));

			treeviewDevices.Model = DeviceListStore;

			treeviewDevices.AppendColumn (serialColumn);
			treeviewDevices.AppendColumn (nameColumn);

			List<String> deviceNames = new List<string> ();
			foreach (LedController controller in Manager.Controllers) {
				deviceNames.Add (controller.DeviceVisibleName);
			}
			deviceNames.Sort ();

			foreach (String name in deviceNames) {
				DeviceListStore.AppendValues(Manager.FindControllerBySerialNumber(name));
			}

			UpdateFormComponents();
		}
Esempio n. 11
0
    public LayerListWidget(Application application)
    {
        this.application = application;
        RowSeparatorFunc = OurRowSeparatorFunc;
        ButtonPressEvent += OnButtonPressed;

        VisibilityRenderer visibilityRenderer = new VisibilityRenderer();
        visibilityRenderer.VisibilityChanged += OnVisibilityChange;
        TreeViewColumn visibilityColumn = new TreeViewColumn("Visibility",
                                                             visibilityRenderer);
        visibilityColumn.SetCellDataFunc(visibilityRenderer, (TreeCellDataFunc)VisibilityDataFunc);
        AppendColumn(visibilityColumn);

        CellRendererText TextRenderer = new CellRendererText();
        TreeViewColumn TypeColumn = new TreeViewColumn();
        TypeColumn.PackStart(TextRenderer, true);
        TypeColumn.SetCellDataFunc(TextRenderer, (TreeCellDataFunc)TextDataFunc);
        TypeColumn.Title = "Type";
        AppendColumn(TypeColumn);

        HeadersVisible = false;

        application.SectorChanged += OnSectorChanged;
        application.TilemapChanged += OnTilemapChanged;
        application.LevelChanged += OnLevelChanged;

        FieldOrProperty.AnyFieldChanged += OnFieldModified;
    }
Esempio n. 12
0
        public ContentDirectoryInfo (RemoteContentDirectory contentDirectory)
        {
            if (contentDirectory == null) {
                throw new ArgumentNullException ("contentDirectory");
            }

            this.content_directry = contentDirectory;
            this.store = new TreeStore (typeof (ObjectRow));
            var objects = new TreeView ();
            var column = new TreeViewColumn ();
            var cell = new CellRendererText ();
            column.PackStart (cell, true);
            column.SetCellDataFunc (cell, RenderObject);
            column.Title = "Objects";
            objects.AppendColumn (column);
            objects.Selection.Changed += HandleObjectsSelectionChanged;
            objects.RowExpanded += HandleObjectsRowExpanded;
            objects.Model = store;

            var root = contentDirectory.GetRootObject ();
            store.AppendValues (new ObjectRow (root));
            TreeIter iter;
            store.GetIterFirst (out iter);
            store.AppendValues (iter, loading);

            Add (objects);
        }
Esempio n. 13
0
        /// <summary>
        /// Initializes a new instance of class.
        /// </summary>
        /// <param name="plugin">Plugin.</param>
        /// <param name="list">List of actions.</param>
        public ActionsPreferencesPage(Actions plugin, ListStore list)
        {
            this.Build();
            this.plugin = plugin;
            this.list = list;
            this.enable.Active = Core.Settings.Instance[SettingsKeys.Enable].AsBoolean();

            TreeViewColumn column = new TreeViewColumn();
            column.Title = Catalog.GetString("Label");
            CellRendererText cell = new CellRendererText();
            column.PackStart(cell, true);
            column.SetCellDataFunc(cell, delegate (TreeViewColumn col, CellRenderer c, TreeModel m, TreeIter i)
            {
                Action a = (Action)m.GetValue(i, 0);
                ((CellRendererText)c).Text = a.Label;
            });
            this.actions.AppendColumn(column);

            column = new TreeViewColumn();
            column.Title = Catalog.GetString("Content");
            cell = new CellRendererText();
            column.PackStart(cell, true);
            column.SetCellDataFunc(cell, delegate (TreeViewColumn col, CellRenderer c, TreeModel m, TreeIter i)
            {
                Action a = (Action)m.GetValue(i, 0);
                ((CellRendererText)c).Text = a.Content;
            });
            this.actions.AppendColumn(column);

            this.actions.Model = list;
            this.actions.ShowAll();

            this.SetActionsSensitivity();
            this.handleEvents = true;
        }
Esempio n. 14
0
	public ItemList(ItemView itemView, ChannelList channelList)
	{
	    this.itemView = itemView;
			channelList.ChannelSelectedEvent += channel => CurrentChannel = channel;

        CellRendererPixbuf cell2 = new CellRendererPixbuf();
        iconColumn = new TreeViewColumn();
        iconColumn.PackStart(cell2, true);
        iconColumn.Sizing = TreeViewColumnSizing.GrowOnly;
        iconColumn.Expand = false;
        iconColumn.SetCellDataFunc(cell2,
                   new TreeCellDataFunc(IconCellDataFunc));

        AppendColumn(iconColumn);

	    titleColumn = new TreeViewColumn();
	    CellRendererText cell = new CellRendererText();

	    titleColumn.PackStart(cell, true);
	    titleColumn.SetCellDataFunc(cell, 
					new TreeCellDataFunc(NameCellDataFunc));

	    AppendColumn(titleColumn);

	    this.Selection.Changed += new EventHandler(SelectionChanged);
	    this.Model = new ListStore (typeof(Imendio.Blam.Item));
	    this.HeadersVisible = false;

        (Model as ListStore).DefaultSortFunc = CompareFunc;
        SetSortOrder(Conf.Get(Preference.REVERSE_ENTRIES, false));

	    Conf.AddNotify (Conf.GetFullKey(Preference.REVERSE_ENTRIES), new NotifyEventHandler (ConfNotifyHandler));

	}
Esempio n. 15
0
        public HistoryTreeView()
        {
            CanFocus = true;

            Model = PintaCore.History.ListStore;
            HeadersVisible = false;
            Selection.Mode = SelectionMode.Single;
            Selection.SelectFunction = HistoryItemSelected;

            Gtk.TreeViewColumn icon_column = new Gtk.TreeViewColumn ();
            Gtk.CellRendererPixbuf icon_cell = new Gtk.CellRendererPixbuf ();
            icon_column.PackStart (icon_cell, true);

            Gtk.TreeViewColumn text_column = new Gtk.TreeViewColumn ();
            Gtk.CellRendererText text_cell = new Gtk.CellRendererText ();
            text_column.PackStart (text_cell, true);

            text_column.SetCellDataFunc (text_cell, new Gtk.TreeCellDataFunc (HistoryRenderText));
            icon_column.SetCellDataFunc (icon_cell, new Gtk.TreeCellDataFunc (HistoryRenderIcon));

            AppendColumn (icon_column);
            AppendColumn (text_column);

            PintaCore.History.HistoryItemAdded += new EventHandler<HistoryItemAddedEventArgs> (OnHistoryItemsChanged);
            PintaCore.History.ActionUndone += new EventHandler (OnHistoryItemsChanged);
            PintaCore.History.ActionRedone += new EventHandler (OnHistoryItemsChanged);
        }
Esempio n. 16
0
        public PlayListTreeView()
        {
            this.HeadersVisible = false;

            ls = new ListStore(typeof(PlayListPlay));
            this.Model = ls;

            menu = new Menu();
            MenuItem title = new MenuItem(Catalog.GetString("Edit Title"));
            title.Activated += new EventHandler(OnTitle);
            title.Show();
            MenuItem delete = new MenuItem(Catalog.GetString("Delete"));
            delete.Activated += new EventHandler(OnDelete);
            delete.Show();
            setRate = new MenuItem(Catalog.GetString("Apply current play rate"));
            setRate.Activated += new EventHandler(OnApplyRate);
            setRate.Show();
            menu.Append(title);
            menu.Append(setRate);
            menu.Append(delete);

            Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn();
            nameColumn.Title = Catalog.GetString("Name");
            Gtk.CellRendererText nameCell = new Gtk.CellRendererText();
            nameColumn.PackStart(nameCell, true);
            nameColumn.SetCellDataFunc(nameCell, new Gtk.TreeCellDataFunc(RenderName));
            this.AppendColumn(nameColumn);
        }
Esempio n. 17
0
        public Groups()
        {
            this.Build();
            store= new Gtk.ListStore (typeof(string),typeof(Group),typeof(bool));
            //treeview1.AppendColumn("Group",new CellRendererText(),"text",0);

            Gtk.TreeViewColumn groupColumn = new Gtk.TreeViewColumn();
            groupColumn.Title = "Group";
            Gtk.CellRendererText groupNameCell = new Gtk.CellRendererText();
            groupColumn.PackStart(groupNameCell, true);

            groupColumn.SetCellDataFunc(groupNameCell, new Gtk.TreeCellDataFunc(RenderGroupName));
            treeview1.AppendColumn(groupColumn);

            treeview1.Model=store;

            MainClass.onRegister += new MainClass.register(MainClass_onRegister);
            MainClass.onDeregister += new MainClass.deregister(MainClass_onDeregister);
            if(MainClass.client != null ) { MainClass_onRegister(); }

            if (MainClass.client != null)
            {
                if (MainClass.client.Network.LoginStatusCode == OpenMetaverse.LoginStatus.Success)
                {
                    MainClass.client.Groups.RequestCurrentGroups();
               }
            }
        }
Esempio n. 18
0
		private void BuildColumns ()
		{
			priorityColumn = new TreeViewColumn ();
			filenameColumn = new TreeViewColumn ();
			progressColumn = new TreeViewColumn ();
			
			filenameColumn.Resizable = true;
			
			priorityColumn.Title = "";
			filenameColumn.Title = "Filename";
			progressColumn.Title = "Progress";
			
			Gtk.CellRendererPixbuf priorityCell = new CellRendererPixbuf ();
			Gtk.CellRendererText filenameCell = new CellRendererText ();
			Gtk.CellRendererProgress progressCell = new CellRendererProgress ();
			
			priorityColumn.PackStart (priorityCell, true);
			filenameColumn.PackStart (filenameCell, true);
			progressColumn.PackStart(progressCell, true);
			
			priorityColumn.SetCellDataFunc (priorityCell, new Gtk.TreeCellDataFunc (RenderPriority)); 
			filenameColumn.SetCellDataFunc (filenameCell, new Gtk.TreeCellDataFunc (RenderFilename));
			progressColumn.SetCellDataFunc (progressCell, new Gtk.TreeCellDataFunc (RenderProgress));
			
			AppendColumn (priorityColumn);
			AppendColumn (filenameColumn);
			AppendColumn (progressColumn);
		}
Esempio n. 19
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);
		}
Esempio n. 20
0
		public ViewOrderDetails() : base()
		{
			CellRenderer productrenderer = new CellRendererText();
			CellRenderer taxrenderer = new CellRendererText();
			taxrenderer.Xalign = 1;
			CellRenderer pricerenderer = new CellRendererText();
			pricerenderer.Xalign = 1;
			CellRenderer quantrenderer = new CellRendererText();
			quantrenderer.Xalign = 1;
			CellRenderer totpricerenderer = new CellRendererText();
			totpricerenderer.Xalign = 1;
			CellRenderer tottaxrenderer = new CellRendererText();
			tottaxrenderer.Xalign = 1;
			CellRenderer totpricettcrenderer = new CellRendererText();
			totpricettcrenderer.Xalign = 1;
			
			TreeViewColumn prodcol = new TreeViewColumn();
			prodcol.Title = "Product";
			prodcol.PackStart( productrenderer,true);
			prodcol.SetCellDataFunc(productrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailProduct);
			prodcol.Expand = true;
			treeview.AppendColumn(prodcol);
			treeview.AppendColumn("Unit Price", pricerenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailPrice);
			treeview.AppendColumn("Unit Tax", taxrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailTax);			
			treeview.AppendColumn("Unit Price TTC", taxrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailPriceTaxInc);
			treeview.AppendColumn("Quantity", quantrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailQuantity);
			treeview.AppendColumn("Price", totpricerenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailTotalPrice);
			treeview.AppendColumn("Tax", tottaxrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailTotalTax);
			treeview.AppendColumn("Price TTC", totpricettcrenderer, (TreeCellDataFunc)CellRenderFunctions.RenderOrderDetailTotalPriceTaxInc);
		
			this.DataMember="OrderDetails";
			this.Show();
		}
		public RefactoringPreviewDialog (ProjectDom ctx, List<Change> changes)
		{
			this.Build ();
			this.changes = changes;
			treeviewPreview.Model = store;

			TreeViewColumn column = new TreeViewColumn ();

			// pixbuf column
			var pixbufCellRenderer = new CellRendererPixbuf ();
			column.PackStart (pixbufCellRenderer, false);
			column.SetAttributes (pixbufCellRenderer, "pixbuf", pixbufColumn);
			column.AddAttribute (pixbufCellRenderer, "visible", statusVisibleColumn);
			
			// text column
			CellRendererText cellRendererText = new CellRendererText ();
			column.PackStart (cellRendererText, false);
			column.SetAttributes (cellRendererText, "text", textColumn);
			column.AddAttribute (cellRendererText, "visible", statusVisibleColumn);
			
			// location column
			CellRendererText cellRendererText2 = new CellRendererText ();
			column.PackStart (cellRendererText2, false);
			column.SetCellDataFunc (cellRendererText2, new TreeCellDataFunc (SetLocationTextData));
			
			CellRendererDiff cellRendererDiff = new CellRendererDiff ();
			column.PackStart (cellRendererDiff, true);
			column.SetCellDataFunc (cellRendererDiff, new TreeCellDataFunc (SetDiffCellData));

			treeviewPreview.AppendColumn (column);
			treeviewPreview.HeadersVisible = false;
			
			buttonCancel.Clicked += delegate {
				Destroy ();
			};
			
			buttonOk.Clicked += delegate {
				IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor (this.Title, null);
				RefactoringService.AcceptChanges (monitor, ctx, changes);
				
				Destroy ();
			};
			
			FillChanges ();
			Resize (IdeApp.Workbench.ActiveDocument.ActiveView.Control.Allocation.Width,
			        IdeApp.Workbench.ActiveDocument.ActiveView.Control.Allocation.Height);
		}
		public CodeTemplatePanelWidget (OptionsDialog parent)
		{
			this.parent = parent;
			this.Build();
			scrolledwindow1.Child = textEditor;
			textEditor.ShowAll ();
			
			templateStore = new TreeStore (typeof (CodeTemplate), typeof (string), typeof (string));
			
			
			TreeViewColumn column = new TreeViewColumn ();
			column.Title = GettextCatalog.GetString ("Key");
			
			pixbufCellRenderer = new CellRendererPixbuf ();
			column.PackStart (pixbufCellRenderer, false);
			column.SetCellDataFunc (pixbufCellRenderer, new Gtk.TreeCellDataFunc (RenderIcon));
			
			templateCellRenderer = new CellRendererText ();
			column.PackStart (templateCellRenderer, true);
			column.SetCellDataFunc (templateCellRenderer, new Gtk.TreeCellDataFunc (RenderTemplateName));
			
			
			treeviewCodeTemplates.AppendColumn (column);
			
			treeviewCodeTemplates.Model = templateStore;
			templates = new List<CodeTemplate> (CodeTemplateService.Templates);
			templates.ForEach (t => InsertTemplate (t));
			
			treeviewCodeTemplates.ExpandAll ();
			treeviewCodeTemplates.Selection.Changed += HandleChanged;
			
			options = new Mono.TextEditor.TextEditorOptions ();
			options.ShowLineNumberMargin = false;
			options.ShowFoldMargin = false;
			options.ShowIconMargin = false;
			options.ShowInvalidLines = false;
			options.ShowSpaces = options.ShowTabs = options.ShowEolMarkers = false;
			options.ColorScheme = PropertyService.Get ("ColorScheme", "Default");
			textEditor.Options = options;
			textEditor.Document.ReadOnly = true;
			this.buttonAdd.Clicked += ButtonAddClicked;
			this.buttonEdit.Clicked += ButtonEditClicked;
			this.buttonRemove.Clicked += ButtonRemoveClicked;
			checkbuttonWhiteSpaces.Toggled += CheckbuttonWhiteSpacesToggled;
			this.treeviewCodeTemplates.Selection.Changed += SelectionChanged;
			SelectionChanged (null, null);
		}
		public RefactoringPreviewDialog (IList<Change> changes)
		{
			this.Build ();
			this.changes = changes;
			treeviewPreview.Model = store;
			treeviewPreview.SearchColumn = -1; // disable the interactive search

			TreeViewColumn column = new TreeViewColumn ();

			// pixbuf column
			var pixbufCellRenderer = new CellRendererImage ();
			column.PackStart (pixbufCellRenderer, false);
			column.SetAttributes (pixbufCellRenderer, "image", pixbufColumn);
			column.AddAttribute (pixbufCellRenderer, "visible", statusVisibleColumn);
			
			// text column
			CellRendererText cellRendererText = new CellRendererText ();
			column.PackStart (cellRendererText, false);
			column.SetAttributes (cellRendererText, "text", textColumn);
			column.AddAttribute (cellRendererText, "visible", statusVisibleColumn);
			
			// location column
			CellRendererText cellRendererText2 = new CellRendererText ();
			column.PackStart (cellRendererText2, false);
			column.SetCellDataFunc (cellRendererText2, new TreeCellDataFunc (SetLocationTextData));
			
			CellRendererDiff cellRendererDiff = new CellRendererDiff ();
			column.PackStart (cellRendererDiff, true);
			column.SetCellDataFunc (cellRendererDiff, new TreeCellDataFunc (SetDiffCellData));

			treeviewPreview.AppendColumn (column);
			treeviewPreview.HeadersVisible = false;
			
			buttonCancel.Clicked += delegate {
				Destroy ();
			};
			
			buttonOk.Clicked += delegate {
				ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor (this.Title, null);
				RefactoringService.AcceptChanges (monitor, changes);
				
				Destroy ();
			};
			
			FillChanges ();
		}
        public void Create(ArrayList columns)
        {
            try
            {

                System.Type[] columnsTypes = new Type[columns.Count];
                int i = 0;

                foreach (SimpleColumn column in columns)
                {
                    columnsTypes[i++] = column.Type;
                }
                store = new TreeStore(columnsTypes);
                treeview.Model = store;
                Console.WriteLine("create3");
                i = 0;
                Console.WriteLine("create4");
                foreach (SimpleColumn column in columns)
                {
                    Console.WriteLine("COLUMN TYPE=" + column.Type.ToString());
                    if (column.Type == typeof(Gdk.Pixbuf))
                    {
                        Console.WriteLine("create5 loop");
                        TreeViewColumn tc = treeview.AppendColumn ("", new CellRendererPixbuf (), "pixbuf", i++);
                        Console.WriteLine("create6 loop");
                        if (tc != null)
                            tc.Visible = column.Visible;
                    }
                    else if (column.Type == typeof(System.Object))
                    {
                        Gtk.TreeViewColumn objColumn = new Gtk.TreeViewColumn ();
                        objColumn.Title = column.Name;
                        Gtk.CellRendererText objCell = new Gtk.CellRendererText ();
                        objColumn.PackStart (objCell, true);
                        objColumn.SetCellDataFunc (objCell, new Gtk.TreeCellDataFunc (RenderObject));

                        treeview.AppendColumn(objColumn);
                        //TreeViewColumn tc = treeview.AppendColumn ("", new CellRendererPixbuf (), "object", i++);
                        //tc.Visible = column.Visible;
                    }
                    else
                    {

                        Console.WriteLine("create 7 loop:" + column.Name);
                        if (treeview == null)
                            treeview = new Gtk.TreeView();
                        TreeViewColumn tc = treeview.AppendColumn (column.Name, new CellRendererText (), "text", i++);
                        Console.WriteLine("create8 loop");
                        if (tc != null)
                            tc.Visible = column.Visible;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Create exception:" + ex.Message + ex.StackTrace);
            }
        }
        Widget IOutlinedDocument.GetOutlineWidget()
        {
            if (outlineTreeView != null)
                return outlineTreeView;

            outlineTreeStore = new TreeStore (typeof(object));

            outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);

            var pixRenderer = new CellRendererImage ();
            pixRenderer.Xpad = 0;
            pixRenderer.Ypad = 0;

            outlineTreeView.TextRenderer.Xpad = 0;
            outlineTreeView.TextRenderer.Ypad = 0;

            TreeViewColumn treeCol = new TreeViewColumn ();
            treeCol.PackStart (pixRenderer, false);

            treeCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (OutlineTreeIconFunc));
            treeCol.PackStart (outlineTreeView.TextRenderer, true);

            treeCol.SetCellDataFunc (outlineTreeView.TextRenderer, new TreeCellDataFunc (OutlineTreeTextFunc));
            outlineTreeView.AppendColumn (treeCol);

            outlineTreeView.HeadersVisible = false;

            outlineTreeView.Selection.Changed += delegate {
                JumpToDeclaration (false);
            };

            outlineTreeView.RowActivated += delegate {
                JumpToDeclaration (true);
            };

            this.lastCU = Document.ParsedDocument;

            outlineTreeView.Realized += delegate { RefillOutlineStore (); };
            UpdateSorting ();

            var sw = new CompactScrolledWindow ();
            sw.Add (outlineTreeView);
            sw.ShowAll ();
            return sw;
        }
		public AddAddinReferenceDialog (Addin[] allAddins)
		{
			if (allAddins == null || allAddins.Length == 0)
				throw new ArgumentException ();

			Title = GettextCatalog.GetString ("Add Addin Reference");
			DestroyWithParent = true;
			Modal = true;
			HasSeparator = false;
			WidthRequest = 400;
			HeightRequest = 400;
			AllowShrink = false;
			Resizable = true;

			AddActionWidget (new Button (Stock.Cancel), ResponseType.Cancel);
			AddActionWidget (addButton, ResponseType.Ok);

			treeView.HeadersVisible = false;
			treeView.Model = store;

			var column = new TreeViewColumn ();
			var toggleRenderer = new CellRendererToggle ();
			column.PackStart (toggleRenderer, false);
			column.SetCellDataFunc (toggleRenderer, ToggleCellDataFunc);

			toggleRenderer.Toggled += HandleToggled;

			var textRenderer = new CellRendererText ();
			column.PackStart (textRenderer, true);
			column.SetCellDataFunc (textRenderer, TextCellDataFunc);

			treeView.AppendColumn (column);
			var sw = new CompactScrolledWindow {
				Child = treeView
			};
			VBox.PackStart (sw);

			foreach (var addin in allAddins.OrderBy (a => a.Id)) {
				store.AppendValues (addin, false);
			}

			addButton.Sensitive = false;

			ShowAll ();
		}
Esempio n. 27
0
        public TvShowGui()
        {
            this.Build ();

            store = new TreeStore(typeof(object));
            treeview.Model = store;
            treeview.BorderWidth = 0;

            string[] titles = new string[] { "Episodes", "Title", "Rating", "Filename"};
            for(int i=0; i <titles.Length ; i++)
            {
                if( i == 0)
                {
                    TreeViewColumn col = new Gtk.TreeViewColumn ();
                    TreeItemCellRenderer cell = new TreeItemCellRenderer();
                    col.PackStart(cell, true);
                    col.SortColumnId = i;
                    col.Title = titles[i];
                    col.MinWidth = 85;
                    col.MaxWidth = 85;
                    col.SetCellDataFunc(cell, new Gtk.TreeCellDataFunc(RenderTreeCell));
                    treeview.AppendColumn(col);
                }
                else if(i == 2)
                {
                    TreeViewColumn col = new TreeViewColumn();
                    CellRendererPixbuf cell = new CellRendererPixbuf();
                    col.PackStart(cell, true);
                    col.SortColumnId = i;
                    col.Title = titles[i];
                    col.SetCellDataFunc(cell, new TreeCellDataFunc(RenderTreeCell));
                    treeview.AppendColumn(col);
                }
                else
                {
                    TreeViewColumn col = new Gtk.TreeViewColumn ();
                    CellRendererText cell = new Gtk.CellRendererText();
                    col.PackStart(cell, true);
                    col.SortColumnId = i;
                    /*
                    if(i == 1)
                        col.MinWidth = 80;
                    else if(i == 2)
                        col.MinWidth = 200;
                        */
                    col.Title = titles[i];
                    col.SetCellDataFunc(cell, new Gtk.TreeCellDataFunc(RenderTreeCell));
                    treeview.AppendColumn(col);
                }
            }

            treeview.RowActivated += HandleNodeview1RowActivated;

            this.ExposeEvent += delegate(object o, ExposeEventArgs args) {
                //ExposeIt();
            };
        }
Esempio n. 28
0
        public int InsertColumn(int pos, string title, CellRenderer cell, CellLayoutDataFunc cell_data)
        {
            TreeViewColumn col = new TreeViewColumn();

            col.Title = title;
            col.PackStart(cell, true);
            col.SetCellDataFunc(cell, cell_data);
            return(InsertColumn(col, pos));
        }
Esempio n. 29
0
        public ApacheSitesList()
        {
            this.Build ();

            /*model = new TreeStore(typeof (string), typeof (string), typeof (string));
            treeView.Model = model;
            treeView.HeadersVisible = true;

            treeView.AppendColumn("Sites", new CellRendererText (), "text", 0);
            treeView.AppendColumn("Status", new CellRendererText (), "text", 1);
            treeView.AppendColumn("Config File", new CellRendererText (), "text", 2);*/

            // TreeView

            model = new TreeStore(typeof (ApacheSite));
            treeView.Model = model;
            treeView.HeadersVisible = true;

            // Name Column
            TreeViewColumn nameColumn = new TreeViewColumn ();
            nameColumn.Title = "Sites";
            CellRendererText nameCell = new CellRendererText();
            nameColumn.PackStart (nameCell, true);
            // Status Column
            TreeViewColumn statusColumn = new TreeViewColumn ();
            statusColumn.Title = "Status";
            CellRendererText statusCell = new CellRendererText();
            statusColumn.PackStart (statusCell, true);
            // Config Column
            TreeViewColumn configColumn = new TreeViewColumn ();
            configColumn.Title = "Config File";
            CellRendererText configCell = new CellRendererText();
            configColumn.PackStart (configCell, true);

            treeView.AppendColumn (nameColumn);
            treeView.AppendColumn (statusColumn);
            treeView.AppendColumn (configColumn);

            nameColumn.SetCellDataFunc (nameCell, new TreeCellDataFunc (RenderName));
            statusColumn.SetCellDataFunc (statusCell, new TreeCellDataFunc (RenderStatus));
            configColumn.SetCellDataFunc (configCell, new TreeCellDataFunc (RenderConfig));

            treeView.Selection.Changed += OnSelectionChanged;

            // Buttons

            iconLabelStatusButton = new JLWidgets.IconLabel();
            iconLabelStatusButton.SetImageFromIcon("gtk-ok");
            iconLabelStatusButton.SetText("Activate");

            statusButton.Remove(statusButton.Child);
            statusButton.Add(iconLabelStatusButton);

            statusButton.Sensitive = false;
            editButton.Sensitive = false;
        }
Esempio n. 30
0
		public CodeTemplatePanelWidget (OptionsDialog parent)
		{
			this.Build();
			scrolledwindow1.Add (textEditor);
			textEditor.ShowAll ();
			
			templateStore = new TreeStore (typeof (CodeTemplate), typeof (string), typeof (string));
			
			
			TreeViewColumn column = new TreeViewColumn ();
			column.Title = GettextCatalog.GetString ("Key");
			
			pixbufCellRenderer = new CellRendererImage ();
			column.PackStart (pixbufCellRenderer, false);
			column.SetCellDataFunc (pixbufCellRenderer, new Gtk.TreeCellDataFunc (RenderIcon));
			
			templateCellRenderer = new CellRendererText ();
			column.PackStart (templateCellRenderer, true);
			column.SetCellDataFunc (templateCellRenderer, new Gtk.TreeCellDataFunc (RenderTemplateName));
			
			
			treeviewCodeTemplates.AppendColumn (column);
			
			treeviewCodeTemplates.Model = templateStore;
			templates = new List<CodeTemplate> (CodeTemplateService.Templates);
			templates.ForEach (t => InsertTemplate (t));
			
			treeviewCodeTemplates.ExpandAll ();
			treeviewCodeTemplates.Selection.Changed += HandleChanged;
			
			options = new MonoDevelop.Ide.Gui.CommonTextEditorOptions ();
			options.ShowLineNumberMargin = false;
			options.ShowFoldMargin = false;
			options.ShowIconMargin = false;
			textEditor.Options = options;
			textEditor.Document.ReadOnly = true;
			this.buttonAdd.Clicked += ButtonAddClicked;
			this.buttonEdit.Clicked += ButtonEditClicked;
			this.buttonRemove.Clicked += ButtonRemoveClicked;
			this.treeviewCodeTemplates.Selection.Changed += SelectionChanged;
			SelectionChanged (null, null);
			checkbuttonWhiteSpaces.Hide ();
		}
Esempio n. 31
0
        public PayAccrual()
        {
            this.Build ();

            ComboBox IncomeCombo = new ComboBox();
            ComboWorks.ComboFillReference(IncomeCombo,"income_items", ComboWorks.ListMode.OnlyItems);
            IncomeNameList = IncomeCombo.Model;
            IncomeCombo.Destroy ();

            //Создаем таблицу "Услуги"
            ServiceListStore = new Gtk.ListStore (typeof (bool),
                                                  typeof (int),
                                                  typeof (string),
                                                  typeof (int),
                                                  typeof (string),
                                                  typeof (int),
                                                  typeof (string),
                                                  typeof (decimal),
                                                  typeof(long));

            CellRendererToggle CellPay = new CellRendererToggle();
            CellPay.Activatable = true;
            CellPay.Toggled += onCellPayToggled;

            Gtk.TreeViewColumn IncomeItemsColumn = new Gtk.TreeViewColumn ();
            IncomeItemsColumn.Title = "Статья дохода";
            IncomeItemsColumn.MinWidth = 130;
            Gtk.CellRendererCombo CellIncomeItems = new CellRendererCombo();
            CellIncomeItems.TextColumn = 0;
            CellIncomeItems.Editable = true;
            CellIncomeItems.Model = IncomeNameList;
            CellIncomeItems.HasEntry = false;
            CellIncomeItems.Edited += OnIncomeItemComboEdited;
            IncomeItemsColumn.PackStart (CellIncomeItems, true);

            Gtk.TreeViewColumn SumColumn = new Gtk.TreeViewColumn ();
            SumColumn.Title = "Сумма";
            SumColumn.MinWidth = 90;
            Gtk.CellRendererText CellSum = new CellRendererText();
            CellSum.Editable = true;
            CellSum.Edited += OnSumTextEdited;
            SumColumn.PackStart (CellSum, true);

            treeviewServices.AppendColumn("Оплатить", CellPay, "active", (int)ServiceCol.pay);
            treeviewServices.AppendColumn ("Услуга", new Gtk.CellRendererText (), "text", (int)ServiceCol.service);
            treeviewServices.AppendColumn ("Касса", new Gtk.CellRendererText (), "text", (int)ServiceCol.cash);
            treeviewServices.AppendColumn (IncomeItemsColumn);
            IncomeItemsColumn.AddAttribute (CellIncomeItems, "text", (int)ServiceCol.income);
            treeviewServices.AppendColumn (SumColumn);
            SumColumn.SetCellDataFunc (CellSum, RenderSumColumn);

            treeviewServices.Model = ServiceListStore;
            treeviewServices.ShowAll();
        }
Esempio n. 32
0
        public HSimpleList()
        {
            this.HeadersVisible = false;
            TreeViewColumn     firstColumn = new Gtk.TreeViewColumn();
            CellRendererCustom cell        = new CellRendererCustom(this);

            this.Reorderable = true;
            firstColumn.PackStart(cell, true);

            firstColumn.SetCellDataFunc(cell, new Gtk.TreeCellDataFunc(RenderListItem));

            this.Model = store;
            this.AppendColumn(firstColumn);

            this.Items.OnItemAdded   += new ListAddEventHandler(this.on_item_added);
            this.items.OnItemRemoved += new ListRemoveEventHandler(this.on_item_removed);
            this.items.OnItemUpdated += new ListUpdateEventHandler(this.on_item_updated);
        }
Esempio n. 33
0
        public void AddColumnDateTime(string title, string format, int sortid, int col)
        {
            store.SetSortFunc(col, new TreeIterCompareFunc(DateTimeTreeIterCompareFunc));

            column                  = new TreeViewColumn();
            datetimerenderer        = new CellRendererDateTime();
            datetimerenderer.Format = format == null ? "G" : format;
            column.Title            = title;
            column.SortColumnId     = sortid;
            column.Sizing           = TreeViewColumnSizing.Autosize;
            column.Reorderable      = true;
            column.Resizable        = true;
            column.Expand           = false;
            column.Alignment        = 0.0f;
            column.PackStart(datetimerenderer, true);
            column.SetCellDataFunc(datetimerenderer, new TreeCellDataFunc(DateTimeColumnDataHandler));
            tree.AppendColumn(column);
        }
Esempio n. 34
0
        public MainWindow() : base(Gtk.WindowType.Toplevel)
        {
            this.SetSizeRequest(this.Screen.Width / 2, this.Screen.Height - 100);
            this.Build();
            this.SetIconFromFile(Functions.logoFile);

            scrolledwindow1.Add(tree);

            Gtk.TreeViewColumn   arrowColumn = new Gtk.TreeViewColumn();
            Gtk.CellRendererText arrowCell   = new Gtk.CellRendererText();
            arrowColumn.PackStart(arrowCell, true);

            Gtk.TreeViewColumn inputColumn = new Gtk.TreeViewColumn();
            inputColumn.Title = "";
            Gtk.CellRendererText inputCell = new Gtk.CellRendererText();
            inputColumn.PackStart(inputCell, true);

            Gtk.TreeViewColumn   analysis1Column = new Gtk.TreeViewColumn();
            Gtk.CellRendererText analysis1Cell   = new Gtk.CellRendererText();
            analysis1Column.PackStart(analysis1Cell, true);

            Gtk.TreeViewColumn   analysis2Column = new Gtk.TreeViewColumn();
            Gtk.CellRendererText analysis2Cell   = new Gtk.CellRendererText();
            analysis2Column.PackStart(analysis2Cell, true);

            arrowColumn.SetCellDataFunc(arrowCell, new Gtk.TreeCellDataFunc(RenderArrowCell));
            inputColumn.SetCellDataFunc(inputCell, new Gtk.TreeCellDataFunc(RenderInputCell));
            analysis1Column.SetCellDataFunc(analysis1Cell, new Gtk.TreeCellDataFunc(RenderAnalysis1Cell));
            analysis2Column.SetCellDataFunc(analysis2Cell, new Gtk.TreeCellDataFunc(RenderAnalysis2Cell));

            tree.Model = treeStore;

            tree.AppendColumn(arrowColumn);
            tree.AppendColumn(inputColumn);
            tree.AppendColumn(analysis1Column);
            tree.AppendColumn(analysis2Column);

            tree.ExpanderColumn = analysis1Column;

            scrolledwindow1.ShowAll();

            Start.Clicked    += OnGo;
            entry1.Activated += OnGo;
        }
        public PatternEditorWidget()
        {
            this.Build();

            Gtk.TreeViewColumn patternNameColumn = new Gtk.TreeViewColumn();
            patternNameColumn.Title = "Name";
            Gtk.CellRendererText patternNameCell = new Gtk.CellRendererText();
            patternNameColumn.PackStart(patternNameCell, true);
            patternNameColumn.SetCellDataFunc(patternNameCell, new Gtk.TreeCellDataFunc(RenderPatternName));

            treeviewPatterns.AppendColumn("Play", new Gtk.CellRendererPixbuf(), "stock_id", 0);
            treeviewPatterns.AppendColumn(patternNameColumn);
            treeviewPatterns.AppendColumn("Edit", new Gtk.CellRendererPixbuf(), "stock_id", 2);
            treeviewPatterns.AppendColumn("Copy", new Gtk.CellRendererPixbuf(), "stock_id", 3);
            treeviewPatterns.AppendColumn("Delete", new Gtk.CellRendererPixbuf(), "stock_id", 4);

            treeviewPatterns.Columns[3].Expand = false;
            treeviewPatterns.Columns[2].Expand = false;
            treeviewPatterns.Columns[4].Expand = false;
            treeviewPatterns.Columns[1].Expand = true;

            PatternListStore.SetSortFunc(0, delegate(TreeModel model, TreeIter a, TreeIter b) {
                Pattern p1 = (Pattern)model.GetValue(a, PatternColumn);
                Pattern p2 = (Pattern)model.GetValue(b, PatternColumn);
                if (p1 == null || p2 == null)
                {
                    return(0);
                }
                return(String.Compare(p1.Name, p2.Name));
            });

            PatternListStore.SetSortColumnId(0, SortType.Ascending);

            treeviewPatterns.Model = PatternListStore;

            //These events get lost in the designer
            treeviewPatterns.RowActivated  += OnTreeviewPatternsRowActivated;
            treeviewPatterns.CursorChanged += OnTreeviewPatternsCursorChanged;

            blinkstickemulatorwidget1.EmulatedDevice = BlinkStickDeviceEnum.BlinkStick;

            UpdateButtons();
        }
Esempio n. 36
0
        public EventsWidget()
        {
            this.Build();

            Gtk.TreeViewColumn timeColumn = new Gtk.TreeViewColumn();
            timeColumn.Title     = "Time";
            timeColumn.Resizable = true;

            Gtk.TreeViewColumn notificationColumn = new Gtk.TreeViewColumn();
            notificationColumn.Title     = "Notification";
            notificationColumn.Resizable = true;

            Gtk.TreeViewColumn messageColumn = new Gtk.TreeViewColumn();
            messageColumn.Title = "Message";

            Gtk.CellRendererText timeCell         = new Gtk.CellRendererText();
            Gtk.CellRendererText notificationCell = new Gtk.CellRendererText();
            Gtk.CellRendererText messageCell      = new Gtk.CellRendererText();

            timeColumn.PackEnd(timeCell, false);
            notificationColumn.PackEnd(notificationCell, false);
            messageColumn.PackEnd(messageCell, false);

            timeColumn.SetCellDataFunc(timeCell, new Gtk.TreeCellDataFunc(RenderTimeCell));
            notificationColumn.SetCellDataFunc(notificationCell, new Gtk.TreeCellDataFunc(RenderNotificationCell));
            messageColumn.SetCellDataFunc(messageCell, new Gtk.TreeCellDataFunc(RenderMessageCell));

            treeviewEvents.AppendColumn(timeColumn);
            treeviewEvents.AppendColumn(notificationColumn);
            treeviewEvents.AppendColumn(messageColumn);

            EventListStore.SetSortFunc(0, delegate(TreeModel model, TreeIter a, TreeIter b) {
                TriggeredEvent s1 = (TriggeredEvent)model.GetValue(a, 0);
                TriggeredEvent s2 = (TriggeredEvent)model.GetValue(b, 0);
                return(DateTime.Compare(s1.TimeStamp, s2.TimeStamp));
            });
            EventListStore.SetSortColumnId(0, SortType.Descending);

            treeviewEvents.Model = EventListStore;

            RefreshTimer = GLib.Timeout.Add(5000, new GLib.TimeoutHandler(UpdateRows));
        }
Esempio n. 37
0
        private void CreateList()
        {
            list = new TreeView(listStore);

            list.RulesHint          = true;    //alternating colors
            list.Selection.Mode     = SelectionMode.Single;
            list.Selection.Changed += OnSelectionChanged;
            list.BorderWidth        = 0;
            list.HeadersVisible     = false;
            list.ModifyBase(Gtk.StateType.Active, Constants.Colors.Base.Gdk);
            list.ModifyBase(Gtk.StateType.Selected, Constants.Colors.Base.Gdk);
            list.ModifyBase(Gtk.StateType.Normal, Constants.Colors.Base.Gdk);

            Gtk.TreeViewColumn    col      = new Gtk.TreeViewColumn();
            ExpandingCellRenderer renderer = new ExpandingCellRenderer();

            col.PackStart(renderer, true);
            col.SetCellDataFunc(renderer, new Gtk.TreeCellDataFunc(RenderCell));
            col.MinWidth = 130;
            list.AppendColumn(col);
        }
Esempio n. 38
0
        private void ConfigureList()
        {
            treeview1.Model = listStore;

            treeview1.RulesHint      = true; //alternating colors
            treeview1.Selection.Mode = SelectionMode.Single;
            //treeview1.Selection.Changed += OnSelectionChanged;
            treeview1.BorderWidth    = 0;
            treeview1.HeadersVisible = false;
            treeview1.ModifyBase(Gtk.StateType.Active, Constants.Colors.Base.Gdk);
            treeview1.ModifyBase(Gtk.StateType.Selected, Constants.Colors.Base.Gdk);
            treeview1.ModifyBase(Gtk.StateType.Normal, Constants.Colors.ButtonSelected.Gdk);

            var col         = new Gtk.TreeViewColumn();
            var rowRenderer = new RowRenderer();

            col.PackStart(rowRenderer, true);
            col.SetCellDataFunc(rowRenderer, new Gtk.TreeCellDataFunc(RenderCell));
            col.MinWidth = 130;
            treeview1.AppendColumn(col);
        }
    public TreeViewExample()
    {
        songs = new ArrayList();

        songs.Add(new Song("Dancing DJs vs. Roxette", "Fading Like a Flower"));
        songs.Add(new Song("Xaiver", "Give me the night"));
        songs.Add(new Song("Daft Punk", "Technologic"));

        Gtk.Window window = new Gtk.Window("TreeView Example");
        window.SetSizeRequest(500, 200);

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

        Gtk.TreeViewColumn artistColumn = new Gtk.TreeViewColumn();
        artistColumn.Title = "Artist";
        Gtk.CellRendererText artistNameCell = new Gtk.CellRendererText();
        artistColumn.PackStart(artistNameCell, true);

        Gtk.TreeViewColumn songColumn = new Gtk.TreeViewColumn();
        songColumn.Title = "Song Title";
        Gtk.CellRendererText songTitleCell = new Gtk.CellRendererText();
        songColumn.PackStart(songTitleCell, true);

        Gtk.ListStore musicListStore = new Gtk.ListStore(typeof(Song));
        foreach (Song song in songs)
        {
            musicListStore.AppendValues(song);
        }

        artistColumn.SetCellDataFunc(artistNameCell, new Gtk.TreeCellDataFunc(RenderArtistName));
        songColumn.SetCellDataFunc(songTitleCell, new Gtk.TreeCellDataFunc(RenderSongTitle));

        tree.Model = musicListStore;

        tree.AppendColumn(artistColumn);
        tree.AppendColumn(songColumn);

        window.ShowAll();
    }
Esempio n. 40
0
        public HistoryTreeView()
        {
            CanFocus = false;
            SetSizeRequest(200, 200);

            SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            tree          = new TreeView();
            tree.CanFocus = false;

            tree.HeadersVisible           = false;
            tree.EnableGridLines          = TreeViewGridLines.None;
            tree.EnableTreeLines          = false;
            tree.Selection.Mode           = SelectionMode.Single;
            tree.Selection.SelectFunction = HistoryItemSelected;

            Gtk.TreeViewColumn     icon_column = new Gtk.TreeViewColumn();
            Gtk.CellRendererPixbuf icon_cell   = new Gtk.CellRendererPixbuf();
            icon_column.PackStart(icon_cell, true);

            Gtk.TreeViewColumn   text_column = new Gtk.TreeViewColumn();
            Gtk.CellRendererText text_cell   = new Gtk.CellRendererText();
            text_column.PackStart(text_cell, true);

            text_column.SetCellDataFunc(text_cell, new Gtk.TreeCellDataFunc(HistoryRenderText));
            icon_column.SetCellDataFunc(icon_cell, new Gtk.TreeCellDataFunc(HistoryRenderIcon));

            tree.AppendColumn(icon_column);
            tree.AppendColumn(text_column);

            PintaCore.Workspace.ActiveDocumentChanged += Workspace_ActiveDocumentChanged;

            PintaCore.History.HistoryItemAdded += new EventHandler <HistoryItemAddedEventArgs> (OnHistoryItemsChanged);
            PintaCore.History.ActionUndone     += new EventHandler(OnHistoryItemsChanged);
            PintaCore.History.ActionRedone     += new EventHandler(OnHistoryItemsChanged);

            Add(tree);
            ShowAll();
        }
Esempio n. 41
0
        private void setupTree()
        {
            Gtk.TreeViewColumn checkCol = new Gtk.TreeViewColumn();
            checkCol.Title = "Active";
            pluginTree.AppendColumn(checkCol);

            Gtk.CellRendererToggle checkCell = new CellRendererToggle();
            checkCol.PackStart(checkCell, true);
            checkCol.AddAttribute(checkCell, "active", 0);

            //checkCol.SetCellDataFunc (checkCell, new TreeCellDataFunc (renderCheckCol));
            checkCell.Toggled += OnToggle;

            Gtk.TreeViewColumn pluginCol = new Gtk.TreeViewColumn();
            pluginCol.Title = "Plugin Name";
            pluginTree.AppendColumn(pluginCol);

            Gtk.CellRendererText pluginCell = new Gtk.CellRendererText();
            pluginCol.PackStart(pluginCell, true);
            //pluginCol.AddAttribute (pluginCell, "text", 1);
            pluginCol.SetCellDataFunc(pluginCell, new TreeCellDataFunc(renderPluginCol));
        }
Esempio n. 42
0
        private void ConfigureList()
        {
            listPortfolio.Model = listStore;

            listPortfolio.Selection.Mode = SelectionMode.None;
            listPortfolio.BorderWidth    = 0;
            listPortfolio.HeadersVisible = false;
            listPortfolio.ModifyBase(Gtk.StateType.Active, Constants.Colors.Base.Gdk);
            listPortfolio.ModifyBase(Gtk.StateType.Selected, Constants.Colors.Base.Gdk);
            listPortfolio.ModifyBase(Gtk.StateType.Normal, Constants.Colors.ButtonSelected.Gdk);

            var col         = new Gtk.TreeViewColumn();
            var rowRenderer = new PortfolioEntryRenderer();

            col.PackStart(rowRenderer, true);
            col.SetCellDataFunc(rowRenderer, new Gtk.TreeCellDataFunc(RenderCell));
            listPortfolio.AppendColumn(col);

            var headersStore = new Gtk.ListStore(typeof(object));

            headersStore.AppendValues(new object());
            listHeaders.Selection.Mode = SelectionMode.None;
            listHeaders.Model          = headersStore;
            listHeaders.RulesHint      = true;        //alternating colors
            listHeaders.BorderWidth    = 0;
            listHeaders.HeadersVisible = false;
            listHeaders.ModifyBase(Gtk.StateType.Active, Constants.Colors.Base.Gdk);
            listHeaders.ModifyBase(Gtk.StateType.Selected, Constants.Colors.Base.Gdk);
            listHeaders.ModifyBase(Gtk.StateType.Normal, Constants.Colors.ButtonSelected.Gdk);

            var colHeaders         = new Gtk.TreeViewColumn();
            var rowRendererHeaders = new PortfolioHeaderRenderer();

            colHeaders.PackStart(rowRendererHeaders, true);
            listHeaders.AppendColumn(colHeaders);
        }
Esempio n. 43
0
        private void InitList(TreeView list, ListStore store, LogRendererBase renderer)
        {
            list.Model = store;

            list.Selection.Mode = SelectionMode.None;
            list.ModifyBase(Gtk.StateType.Normal, Colors.Base.Gdk);

            Gtk.TreeViewColumn col = new Gtk.TreeViewColumn();

            col.PackStart(renderer, true);
            col.SetCellDataFunc(renderer, new Gtk.TreeCellDataFunc(
                                    (Gtk.TreeViewColumn column, Gtk.CellRenderer cellRenderer, Gtk.TreeModel model, Gtk.TreeIter iter) =>
            {
                if (cellRenderer is LogEntryRenderer)
                {
                    var logEntryRenderer = (LogEntryRenderer)cellRenderer;

                    logEntryRenderer.LogEntryItem = (LogEntryItem)model.GetValue(iter, 0);
                }
            })
                                );

            list.AppendColumn(col);
        }
Esempio n. 44
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);
    }
        public void Initialize()
        {
            log.Debug("Setting up treeview");

            Gtk.TreeViewColumn enabledColumn = new Gtk.TreeViewColumn();
            enabledColumn.Title = "";

            Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn();
            nameColumn.Title = "Name";

            Gtk.TreeViewColumn blinkStickColumn = new Gtk.TreeViewColumn();
            blinkStickColumn.Title = "BlinkStick";

            Gtk.TreeViewColumn patternColumn = new Gtk.TreeViewColumn();
            patternColumn.Title = "Pattern";

            Gtk.CellRendererPixbuf enabledCell    = new Gtk.CellRendererPixbuf();
            Gtk.CellRendererText   nameCell       = new Gtk.CellRendererText();
            Gtk.CellRendererText   typeCell       = new Gtk.CellRendererText();
            Gtk.CellRendererText   blinkStickCell = new Gtk.CellRendererText();
            Gtk.CellRendererText   patternCell    = new Gtk.CellRendererText();

            CellRendererPixbuf iconCell = new CellRendererPixbuf();

            nameColumn.PackStart(iconCell, false);
            nameColumn.AddAttribute(iconCell, "pixbuf", 4);

            enabledColumn.PackEnd(enabledCell, false);
            blinkStickColumn.PackEnd(blinkStickCell, false);
            nameColumn.PackEnd(nameCell, true);
            patternColumn.PackEnd(patternCell, false);

            enabledColumn.SetCellDataFunc(enabledCell, new Gtk.TreeCellDataFunc(RenderEnabledCell));
            nameColumn.SetCellDataFunc(nameCell, new Gtk.TreeCellDataFunc(RenderNameCell));
            blinkStickColumn.SetCellDataFunc(blinkStickCell, new Gtk.TreeCellDataFunc(RenderBlinkStickCell));
            patternColumn.SetCellDataFunc(patternCell, new Gtk.TreeCellDataFunc(RenderPatternCell));

            treeviewEvents.AppendColumn(enabledColumn);

            treeviewEvents.AppendColumn(nameColumn);
            treeviewEvents.Columns[1].Expand = true;
            treeviewEvents.AppendColumn(patternColumn);

            if (this.ApplicationSettings.SingleBlinkStickMode)
            {
                DeleteColumnIndex = 5;
            }
            else
            {
                treeviewEvents.AppendColumn(blinkStickColumn);
                DeleteColumnIndex = 6;
            }

            treeviewEvents.AppendColumn("", new Gtk.CellRendererPixbuf(), "stock_id", 1);
            treeviewEvents.AppendColumn("", new Gtk.CellRendererPixbuf(), "stock_id", 2);
            treeviewEvents.AppendColumn("", new Gtk.CellRendererPixbuf(), "stock_id", 3);
            NotificationListStore.SetSortFunc(0, delegate(TreeModel model, TreeIter a, TreeIter b)
            {
                CustomNotification n1 = (CustomNotification)model.GetValue(a, 0);
                CustomNotification n2 = (CustomNotification)model.GetValue(b, 0);
                if (n1 == null || n2 == null)
                {
                    return(0);
                }
                return(String.Compare(n1.Name, n2.Name));
            });

            NotificationListStore.SetSortColumnId(1, SortType.Ascending);
            treeviewEvents.Model = NotificationListStore;

            log.Debug("Adding notifications to the tree");
            foreach (CustomNotification e in DataModel.Notifications)
            {
                NotificationListStore.AppendValues(e, "icon-dark-pencil-square-o", "icon-dark-clone", "icon-dark-trash", NotificationRegistry.FindIcon(e.GetType()));
            }
        }
Esempio n. 46
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);
    }
Esempio n. 47
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);
        }
Esempio n. 48
0
        public HeapSnapshotExplorer()
        {
            Build();
            MenuItem menuItem;

            OnClearMark();

            loadHeapSnapshotBlock = new Menu();
            menuItem            = new MenuItem("Load block data");
            menuItem.Activated += delegate {
                OnLoadHeapSnapshotData();
            };
            loadHeapSnapshotBlock.Append(menuItem);

            loadAllocationsBlocks = new Menu();
            menuItem            = new MenuItem("Load block data");
            menuItem.Activated += delegate {
                OnLoadAllocationsEventData();
            };
            loadAllocationsBlocks.Append(menuItem);

            filterObjectSet     = new Menu();
            menuItem            = new MenuItem("Filter by object class");
            menuItem.Activated += delegate {
                OnFilterByClass <HeapObject> ();
            };
            filterObjectSet.Append(menuItem);
            menuItem            = new MenuItem("Filter by \"references object of class\"");
            menuItem.Activated += delegate {
                OnFilterByReferencesObjectOfClass();
            };
            filterObjectSet.Append(menuItem);
            menuItem            = new MenuItem("Filter by \"is referenced by object of class\"");
            menuItem.Activated += delegate {
                OnFilterByIsReferencedByObjectOfClass();
            };
            filterObjectSet.Append(menuItem);
            menuItem            = new MenuItem("Mark set for comparison");
            menuItem.Activated += delegate {
                OnMarkObjectSetForComparison();
            };
            filterObjectSet.Append(menuItem);
            menuItem            = new MenuItem("Mark set for \"set reference\" filtering");
            menuItem.Activated += delegate {
                OnMarkObjectSetForFiltering();
            };
            filterObjectSet.Append(menuItem);

            filterAllocationSet = new Menu();
            menuItem            = new MenuItem("Filter by object class");
            menuItem.Activated += delegate {
                OnFilterByClass <AllocatedObject> ();
            };
            filterAllocationSet.Append(menuItem);
            menuItem            = new MenuItem("Mark set for comparison");
            menuItem.Activated += delegate {
                OnMarkAllocationSetForComparison();
            };
            filterAllocationSet.Append(menuItem);
            // For now no set based filtering for allocations...
            //menuItem = new MenuItem ("Mark set for filtering");
            //menuItem.Activated += delegate {
            //	OnMarkAllocationSetForFiltering ();
            //};
            //filterAllocationSet.Append (menuItem);

            compareObjectSet    = new Menu();
            menuItem            = new MenuItem("Perform comparison with this set");
            menuItem.Activated += delegate {
                OnCompareWithSet <HeapObject> ();
            };
            compareObjectSet.Append(menuItem);
            menuItem            = new MenuItem("Perform intersection with this set");
            menuItem.Activated += delegate {
                OnIntersectWithSet <HeapObject> ();
            };
            compareObjectSet.Append(menuItem);
            menuItem            = new MenuItem("Clear selection");
            menuItem.Activated += delegate {
                OnClearMark();
            };
            compareObjectSet.Append(menuItem);

            compareAllocationSet = new Menu();
            menuItem             = new MenuItem("Perform comparison with this set");
            menuItem.Activated  += delegate {
                OnCompareWithSet <AllocatedObject> ();
            };
            compareAllocationSet.Append(menuItem);
            menuItem            = new MenuItem("Perform intersection with this set");
            menuItem.Activated += delegate {
                OnIntersectWithSet <AllocatedObject> ();
            };
            compareAllocationSet.Append(menuItem);
            menuItem            = new MenuItem("Clear selection");
            menuItem.Activated += delegate {
                OnClearMark();
            };
            compareAllocationSet.Append(menuItem);

            filterObjectSetUsingSelection = new Menu();
            menuItem            = new MenuItem("Select objects referencing objects in this set");
            menuItem.Activated += delegate {
                OnFilterByReferencesObjectInSet <HeapObject> ();
            };
            filterObjectSetUsingSelection.Append(menuItem);
            menuItem            = new MenuItem("Select objects referenced by objects in this set");
            menuItem.Activated += delegate {
                OnFilterByIsReferencedByObjectInSet <HeapObject> ();
            };
            filterObjectSetUsingSelection.Append(menuItem);
            menuItem            = new MenuItem("Clear selection");
            menuItem.Activated += delegate {
                OnClearMark();
            };
            filterObjectSetUsingSelection.Append(menuItem);

            filterAllocationSetUsingSelection = new Menu();
            menuItem            = new MenuItem("Select objects referencing objects in this set");
            menuItem.Activated += delegate {
                OnFilterByReferencesObjectInSet <AllocatedObject> ();
            };
            filterAllocationSetUsingSelection.Append(menuItem);
            menuItem            = new MenuItem("Select objects referenced by objects in this set");
            menuItem.Activated += delegate {
                OnFilterByIsReferencedByObjectInSet <AllocatedObject> ();
            };
            filterAllocationSetUsingSelection.Append(menuItem);
            menuItem            = new MenuItem("Clear selection");
            menuItem.Activated += delegate {
                OnClearMark();
            };
            filterAllocationSetUsingSelection.Append(menuItem);

            PrepareTreeViewForStatisticsDisplay(PerClassStatistics);
            PerClassStatistics.NodeSelection.Changed += delegate(object o, EventArgs args) {
                currentListSelection = (StatisticsNode)PerClassStatistics.NodeSelection.SelectedNode;
            };
            listMenuHandlerForClasses    = new StatisticsNodeMenuHandlerForClasses(this);
            listMenuHandlerForMethods    = new StatisticsNodeMenuHandlerForMethods(this);
            listMenuHandlerForCallStacks = new StatisticsNodeMenuHandlerForCallStacks(this);

            Tree.Selection.Changed += delegate(object o, EventArgs args) {
                TreeSelection selection = (TreeSelection)o;
                TreeIter      iter;
                if (selection.GetSelected(out iter))
                {
                    currentSelection = (HeapExplorerTreeModel.INode)Tree.Model.GetValue(iter, 0);
                    FillStatisticsListWithClassData();
                }
            };

            Gtk.TreeViewColumn setColumn   = new Gtk.TreeViewColumn();
            Gtk.TreeViewColumn countColumn = new Gtk.TreeViewColumn();
            Gtk.TreeViewColumn bytesColumn = new Gtk.TreeViewColumn();
            setColumn.Title   = "Object set";
            countColumn.Title = "Object count";
            bytesColumn.Title = "Bytes";
            Gtk.CellRendererText setCell   = new Gtk.CellRendererText();
            Gtk.CellRendererText countCell = new Gtk.CellRendererText();
            Gtk.CellRendererText bytesCell = new Gtk.CellRendererText();
            setColumn.PackStart(setCell, true);
            countColumn.PackStart(countCell, true);
            bytesColumn.PackStart(bytesCell, true);

            setColumn.SetCellDataFunc(setCell, delegate(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) {
                HeapExplorerTreeModel.INode node = (HeapExplorerTreeModel.INode)model.GetValue(iter, 0);
                CellRendererText textCell        = (CellRendererText)cell;
                textCell.Text = node.Description;
                if (node != MarkedNode)
                {
                    textCell.Style = Pango.Style.Normal;
                }
                else
                {
                    textCell.Style = Pango.Style.Italic;
                }
            });
            countColumn.SetCellDataFunc(countCell, delegate(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) {
                HeapExplorerTreeModel.INode node = (HeapExplorerTreeModel.INode)model.GetValue(iter, 0);
                CellRendererText textCell        = (CellRendererText)cell;
                textCell.Text = node.Count;
                if (node != MarkedNode)
                {
                    textCell.Style = Pango.Style.Normal;
                }
                else
                {
                    textCell.Style = Pango.Style.Italic;
                }
            });
            bytesColumn.SetCellDataFunc(bytesCell, delegate(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) {
                HeapExplorerTreeModel.INode node = (HeapExplorerTreeModel.INode)model.GetValue(iter, 0);
                CellRendererText textCell        = (CellRendererText)cell;
                textCell.Text = node.AllocatedBytes;
                if (node != MarkedNode)
                {
                    textCell.Style = Pango.Style.Normal;
                }
                else
                {
                    textCell.Style = Pango.Style.Italic;
                }
            });

            setColumn.AddAttribute(setCell, "text", 0);
            countColumn.AddAttribute(countCell, "text", 1);
            bytesColumn.AddAttribute(bytesCell, "text", 2);

            Tree.AppendColumn(setColumn);
            Tree.AppendColumn(countColumn);
            Tree.AppendColumn(bytesColumn);

            loadHeapSnapshotBlock.ShowAll();
            loadAllocationsBlocks.ShowAll();
            filterObjectSet.ShowAll();
            filterAllocationSet.ShowAll();
            compareObjectSet.ShowAll();
            compareAllocationSet.ShowAll();
            filterObjectSetUsingSelection.ShowAll();
            filterAllocationSetUsingSelection.ShowAll();
        }
Esempio n. 49
0
    public TxtEdit() :  base("Stronghold .tex editor v.0.2")
    {
        offsets  = new UInt32[250];
        sections = new List <TexString>();
        file_dialog();

        SetDefaultSize(800, 600);
        SetPosition(WindowPosition.Center);

        DeleteEvent += delegate {
            Application.Quit();
        };

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

        // menu bar
        MenuBar mb       = new MenuBar();
        Menu    filemenu = new Menu();
        Menu    helpmenu = new Menu();

        MenuItem file = new MenuItem("File");

        file.Submenu = filemenu;

        MenuItem open = new MenuItem("Open");

        open.Activated += delegate {
            file_dialog();
        };
        filemenu.Append(open);

        MenuItem reload = new MenuItem("Reload");

        reload.Activated += delegate {
            MessageDialog md = new MessageDialog(this,
                                                 DialogFlags.DestroyWithParent, MessageType.Question,
                                                 ButtonsType.OkCancel, "This will undo all changes. Continue?");
            ResponseType result = (ResponseType)md.Run();
            if (result == ResponseType.Ok)
            {
                sections = new List <TexString>();

                load_file();

                store = new Gtk.TreeStore(typeof(TexString));
                foreach (var sec in sections)
                {
                    store.AppendValues(sec);
                }
                tree.Model = store;
            }

            md.Destroy();
        };
        filemenu.Append(reload);

        MenuItem save = new MenuItem("Save");

        save.Activated += delegate {
            save_backup();
            save_tex();
        };
        filemenu.Append(save);

        MenuItem exit = new MenuItem("Exit");

        exit.Activated += delegate {
            Application.Quit();
        };
        filemenu.Append(exit);

        MenuItem help = new MenuItem("Help");

        help.Submenu = helpmenu;

        MenuItem about = new MenuItem("About");

        about.Activated += about_event;
        helpmenu.Append(about);

        mb.Append(file);
        mb.Append(help);

        VBox vbox = new VBox(false, 2);

        vbox.PackStart(mb, false, false, 0);

        // scrolling area
        ScrolledWindow scroller = new ScrolledWindow();

        scroller.BorderWidth = 5;
        scroller.ShadowType  = ShadowType.In;
        vbox.Add(scroller);

        // tree view
        Gtk.TreeViewColumn sectionColumn = new Gtk.TreeViewColumn();
        sectionColumn.Title = "Text";

        Gtk.CellRendererText sectionCell = new Gtk.CellRendererText();
        sectionCell.Editable = true;
        sectionCell.Edited  += sectionCell_edit;
        sectionColumn.PackStart(sectionCell, true);

        store = new Gtk.TreeStore(typeof(TexString));
        foreach (var sec in sections)
        {
            store.AppendValues(sec);
        }

        sectionColumn.SetCellDataFunc(sectionCell, new Gtk.TreeCellDataFunc(RenderSection));

        tree.AppendColumn(sectionColumn);
        tree.Model = store;
        scroller.Add(tree);

        Add(vbox);

        ShowAll();
    }
Esempio n. 50
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);
            }
        }
        public PlayerPropertiesTreeView()
        {
            RowActivated      += OnTreeviewRowActivated;
            Selection.Changed += OnSelectionChanged;
            Selection.Mode     = SelectionMode.Multiple;

            Gtk.TreeViewColumn photoColumn = new Gtk.TreeViewColumn();
            photoColumn.Title = Catalog.GetString("Photo");
            Gtk.CellRendererPixbuf photoCell = new Gtk.CellRendererPixbuf();
            photoColumn.PackStart(photoCell, true);

            Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn();
            nameColumn.Title = Catalog.GetString("Name");
            Gtk.CellRendererText nameCell = new Gtk.CellRendererText();
            nameColumn.PackStart(nameCell, true);

            Gtk.TreeViewColumn playsColumn = new Gtk.TreeViewColumn();
            playsColumn.Title = Catalog.GetString("Play this match");
            Gtk.CellRendererText playCell = new Gtk.CellRendererText();
            playsColumn.PackStart(playCell, true);

            Gtk.TreeViewColumn birthdayColumn = new Gtk.TreeViewColumn();
            birthdayColumn.Title = Catalog.GetString("Date of Birth");
            Gtk.CellRendererText birthdayCell = new Gtk.CellRendererText();
            birthdayColumn.PackStart(birthdayCell, true);

            Gtk.TreeViewColumn nationColumn = new Gtk.TreeViewColumn();
            nationColumn.Title = Catalog.GetString("Nationality");
            Gtk.CellRendererText nationCell = new Gtk.CellRendererText();
            nationColumn.PackStart(nationCell, true);

            Gtk.TreeViewColumn heightColumn = new Gtk.TreeViewColumn();
            heightColumn.Title = Catalog.GetString("Height");
            Gtk.CellRendererText heightCell = new Gtk.CellRendererText();
            heightColumn.PackStart(heightCell, true);

            Gtk.TreeViewColumn weightColumn = new Gtk.TreeViewColumn();
            weightColumn.Title = Catalog.GetString("Weight");
            Gtk.CellRendererText weightCell = new Gtk.CellRendererText();
            weightColumn.PackStart(weightCell, true);

            Gtk.TreeViewColumn positionColumn = new Gtk.TreeViewColumn();
            positionColumn.Title = Catalog.GetString("Position");
            Gtk.CellRendererText positionCell = new Gtk.CellRendererText();
            positionColumn.PackStart(positionCell, true);

            Gtk.TreeViewColumn numberColumn = new Gtk.TreeViewColumn();
            numberColumn.Title = Catalog.GetString("Number");
            Gtk.CellRendererText numberCell = new Gtk.CellRendererText();
            numberColumn.PackStart(numberCell, true);

            photoColumn.SetCellDataFunc(photoCell, new Gtk.TreeCellDataFunc(RenderPhoto));
            nameColumn.SetCellDataFunc(nameCell, new Gtk.TreeCellDataFunc(RenderName));
            playsColumn.SetCellDataFunc(playCell, new Gtk.TreeCellDataFunc(RenderPlay));
            nationColumn.SetCellDataFunc(nationCell, new Gtk.TreeCellDataFunc(RenderNationality));
            positionColumn.SetCellDataFunc(positionCell, new Gtk.TreeCellDataFunc(RenderPosition));
            numberColumn.SetCellDataFunc(numberCell, new Gtk.TreeCellDataFunc(RenderNumber));
            heightColumn.SetCellDataFunc(heightCell, new Gtk.TreeCellDataFunc(RenderHeight));
            weightColumn.SetCellDataFunc(weightCell, new Gtk.TreeCellDataFunc(RenderWeight));
            birthdayColumn.SetCellDataFunc(birthdayCell, new Gtk.TreeCellDataFunc(RenderBirthday));

            AppendColumn(photoColumn);
            AppendColumn(nameColumn);
            AppendColumn(playsColumn);
            AppendColumn(numberColumn);
            AppendColumn(positionColumn);
            AppendColumn(heightColumn);
            AppendColumn(weightColumn);
            AppendColumn(birthdayColumn);
            AppendColumn(nationColumn);
        }
Esempio n. 52
0
        void CreateTreeView()
        {
            //LOCATIONS
            Gtk.TreeViewColumn LocationsColumn = new Gtk.TreeViewColumn();
            LocationsColumn.Title = "Locations";
            Gtk.CellRendererText LocationsColumnCell = new Gtk.CellRendererText();
            LocationsColumn.PackStart(LocationsColumnCell, true);

            //creo la lista perchè nella treeview faccio vedere SOLO il nome e non la data
            //ListStore Lista_Locations = new ListStore (typeof(string));

            //foreach( Location actLocation in DataAccess.Instance.ListaLocations)
            //	Lista_Locations.AppendValues(actLocation.LocationName);

            //qui collego il nome con l'oggetto, la funzione è sotto
            LocationsColumn.SetCellDataFunc(LocationsColumnCell, new Gtk.TreeCellDataFunc(RenderLocation));

            LocationsGrid.AppendColumn(LocationsColumn);

            LocationsColumn.AddAttribute(LocationsColumnCell, "text", 0);

            //riempio la griglia
            LocationsGrid.Model = DataAccess.Instance.ListaLocations;
            //m_Lista_Locations;
            //CONTAINERS
            Gtk.TreeViewColumn ContainersColum = new Gtk.TreeViewColumn();
            ContainersColum.Title = "Containers";
            Gtk.CellRendererText ContainersColumCell = new Gtk.CellRendererText();
            ContainersColum.PackStart(ContainersColumCell, true);

            //creo la lista perchè nella treeview faccio vedere SOLO il nome e non la data
            //ListStore Lista_Containers = new ListStore (typeof(string));

            //foreach( Container actContainer in DataAccess.Instance.ListaContainers)
            //	Lista_Containers.AppendValues(actContainer.ContainerName);

            //qui collego il nome con l'oggetto, la funzione è sotto
            ContainersColum.SetCellDataFunc(ContainersColumCell, new Gtk.TreeCellDataFunc(RenderContainer));

            ContainersGrid.AppendColumn(ContainersColum);
            ContainersColum.AddAttribute(ContainersColumCell, "text", 0);

            //riempio la griglia
            ContainersGrid.Model = DataAccess.Instance.ListaContainers;

            //ITEMS
            Gtk.TreeViewColumn ItemsColum = new Gtk.TreeViewColumn();
            ItemsColum.Title = "Items";
            Gtk.CellRendererText ItemsColumCell = new Gtk.CellRendererText();
            ItemsColum.PackStart(ItemsColumCell, true);

            //creo la lista perchè nella treeview faccio vedere SOLO il nome e non la data
            //ListStore Lista_Item = new ListStore (typeof(string));

            //foreach( Item actItem in DataAccess.Instance.ListaItems)
            //	Lista_Item.AppendValues(actItem.ItemName);

            //qui collego il nome con l'oggetto, la funzione è sotto
            ItemsColum.SetCellDataFunc(ItemsColumCell, new Gtk.TreeCellDataFunc(RenderItem));


            ItemsGrid.AppendColumn(ItemsColum);
            ItemsColum.AddAttribute(ItemsColumCell, "text", 0);

            //riempio la griglia
            ItemsGrid.Model = DataAccess.Instance.ListaItems;



            this.ShowAll();
        }
Esempio n. 53
0
        private Gtk.Widget MakeGeneralPage()
        {
            VBox vbox = new VBox(false, 6);

            vbox.BorderWidth = 10;

            //
            // ITask Management System
            //
            VBox  sectionVBox = new VBox(false, 4);
            Label l           = new Label();

            l.Markup = string.Format("<span size=\"large\" weight=\"bold\">{0}</span>",
                                     Catalog.GetString("Task Management System"));
            l.UseUnderline = false;
            l.UseMarkup    = true;
            l.Wrap         = false;
            l.Xalign       = 0;

            l.Show();
            sectionVBox.PackStart(l, false, false, 0);

            backendComboBox = ComboBox.NewText();
            backendComboMap = new Dictionary <int, string> ();
            // Fill out the ComboBox
            int i = 0;

            selectedBackend = -1;
            foreach (var backend in application.BackendManager.AvailableBackends)
            {
                backendComboBox.AppendText(backend.Value);
                backendComboMap [i] = backend.Key;
                if (backend.Key == application.BackendManager.CurrentBackend)
                {
                    selectedBackend = i;
                }
                i++;
            }
            if (selectedBackend >= 0)
            {
                backendComboBox.Active = selectedBackend;
            }
            backendComboBox.Changed += OnBackendComboBoxChanged;
            backendComboBox.Show();

            HBox hbox = new HBox(false, 6);

            l = new Label(string.Empty);              // spacer
            l.Show();
            hbox.PackStart(l, false, false, 0);
            hbox.PackStart(backendComboBox, false, false, 0);
            hbox.Show();
            sectionVBox.PackStart(hbox, false, false, 0);
            sectionVBox.Show();
            vbox.PackStart(sectionVBox, false, false, 0);

            //
            // ITask Filtering
            //
            sectionVBox = new VBox(false, 4);
            l           = new Label();
            l.Markup    = string.Format("<span size=\"large\" weight=\"bold\">{0}</span>",
                                        Catalog.GetString("Task Filtering"));
            l.UseUnderline = false;
            l.UseMarkup    = true;
            l.Wrap         = false;
            l.Xalign       = 0;

            l.Show();
            sectionVBox.PackStart(l, false, false, 0);

            HBox sectionHBox = new HBox(false, 6);

            l = new Label(string.Empty);              // spacer
            l.Show();
            sectionHBox.PackStart(l, false, false, 0);
            VBox innerSectionVBox = new VBox(false, 6);

            hbox = new HBox(false, 6);

            bool showCompletedTasks = application.Preferences.GetBool(
                PreferencesKeys.ShowCompletedTasksKey);

            showCompletedTasksCheckButton =
                new CheckButton(Catalog.GetString("Sh_ow completed tasks"));
            showCompletedTasksCheckButton.UseUnderline = true;
            showCompletedTasksCheckButton.Active       = showCompletedTasks;
            showCompletedTasksCheckButton.Show();
            hbox.PackStart(showCompletedTasksCheckButton, true, true, 0);
            hbox.Show();
            innerSectionVBox.PackStart(hbox, false, false, 0);

            // TaskLists TreeView
            l = new Label(Catalog.GetString("Only _show these lists when \"All\" is selected:"));
            l.UseUnderline = true;
            l.Xalign       = 0;
            l.Show();
            innerSectionVBox.PackStart(l, false, false, 0);

            ScrolledWindow sw = new ScrolledWindow();

            sw.HscrollbarPolicy = PolicyType.Automatic;
            sw.VscrollbarPolicy = PolicyType.Automatic;
            sw.ShadowType       = ShadowType.EtchedIn;

            taskListsTree = new TreeView();
            taskListsTree.Selection.Mode = SelectionMode.None;
            taskListsTree.RulesHint      = false;
            taskListsTree.HeadersVisible = false;
            l.MnemonicWidget             = taskListsTree;

            Gtk.TreeViewColumn column = new Gtk.TreeViewColumn();
            column.Title     = Catalog.GetString("Task List");
            column.Sizing    = Gtk.TreeViewColumnSizing.Autosize;
            column.Resizable = false;

            Gtk.CellRendererToggle toggleCr = new CellRendererToggle();
            toggleCr.Toggled += OnTaskListToggled;
            column.PackStart(toggleCr, false);
            column.SetCellDataFunc(toggleCr,
                                   new Gtk.TreeCellDataFunc(ToggleCellDataFunc));

            Gtk.CellRendererText textCr = new CellRendererText();
            column.PackStart(textCr, true);
            column.SetCellDataFunc(textCr,
                                   new Gtk.TreeCellDataFunc(TextCellDataFunc));

            taskListsTree.AppendColumn(column);

            taskListsTree.Show();
            sw.Add(taskListsTree);
            sw.Show();
            innerSectionVBox.PackStart(sw, true, true, 0);
            innerSectionVBox.Show();

            sectionHBox.PackStart(innerSectionVBox, true, true, 0);
            sectionHBox.Show();
            sectionVBox.PackStart(sectionHBox, true, true, 0);
            sectionVBox.Show();
            vbox.PackStart(sectionVBox, true, true, 0);

            return(vbox);
        }