예제 #1
0
		public PythonOptionsWidget ()
		{
			this.Build();
			
			// Python paths
			m_PathsListStore = new ListStore (typeof (string));
			m_PathsTreeView.Model = this.m_PathsListStore;
			m_PathsTreeView.HeadersVisible = false;
			TreeViewColumn column = new TreeViewColumn ();
			CellRendererText ctext = new CellRendererText ();
			column.PackStart (ctext, true);
			column.AddAttribute (ctext, "text", 0);
			m_PathsTreeView.AppendColumn (column);
			m_PathsTreeView.Selection.Changed += delegate {
				this.m_RemovePathButton.Sensitive = m_PathsTreeView.Selection.CountSelectedRows () == 1;
			};
			
			// Setup Python Runtime Version
			m_RuntimeListStore = new ListStore (typeof (string), typeof (Type));
			m_RuntimeCombo.Model = this.m_RuntimeListStore;
			m_RuntimeListStore.AppendValues ("Python 2.5", typeof (Python25Runtime));
			m_RuntimeListStore.AppendValues ("Python 2.6", typeof (Python26Runtime));
			m_RuntimeListStore.AppendValues ("Python 2.7", typeof (Python27Runtime));
			m_RuntimeListStore.AppendValues ("IronPython", typeof (IronPythonRuntime));
			
			m_RuntimeCombo.Changed += delegate {
				m_RuntimeFileEntry.Path = String.Empty;
			};
		}
        public MergeDialog(MercurialRepository repo, bool rebasing)
        {
            this.Build ();

            this.repo = repo;
            this.rebasing = rebasing;

            store = new TreeStore (typeof(string), typeof(Gdk.Pixbuf), typeof (string), typeof(string));
            tree.Model = store;

            CellRendererPixbuf crp = new CellRendererPixbuf ();
            TreeViewColumn col = new TreeViewColumn ();
            col.PackStart (crp, false);
            col.AddAttribute (crp, "pixbuf", 1);
            CellRendererText crt = new CellRendererText ();
            col.PackStart (crt, true);
            col.AddAttribute (crt, "text", 2);
            tree.AppendColumn (col);

            tree.Selection.Changed += HandleTreeSelectionChanged;

            if (rebasing) {
                labelHeader.Text = GettextCatalog.GetString ("Select the branch to which to rebase:");
                checkStage.Label = GettextCatalog.GetString ("Stash/unstash local changes before/after rebasing");
            }

            checkStage.Active = true;

            Fill ();
        }
예제 #3
0
	public CollectionsTreeView ()
		: base ()
	{
		Gtk.TreeViewColumn NameCol = new Gtk.TreeViewColumn ();
		Gtk.CellRendererText NameRenderer = new Gtk.CellRendererText ();
		NameRenderer.Editable = true;
		NameRenderer.Edited += new Gtk.EditedHandler (CollectionNameEditedHandler);
		NameCol.Title = "Name";
		NameCol.PackStart (NameRenderer, true);
		NameCol.AddAttribute (NameRenderer, "markup", 0);
		NameCol.SortColumnId = 0;
		NameCol.Resizable = true;
		NameCol.FixedWidth = 150;
		NameCol.Sizing = Gtk.TreeViewColumnSizing.Autosize;
		this.AppendColumn (NameCol);

		Gtk.TreeViewColumn CountCol = new Gtk.TreeViewColumn ();
		Gtk.CellRendererText CountRenderer = new Gtk.CellRendererText ();
		CountCol.Title = "Images";
		CountCol.PackStart (CountRenderer, true);
		CountCol.AddAttribute (CountRenderer, "text", 1);
		CountCol.SortColumnId = 1;
		CountCol.Resizable = true;
		CountCol.Sizing = Gtk.TreeViewColumnSizing.Autosize;
		this.AppendColumn (CountCol);

		store = new CollectionsTreeStore ();
		this.Model = store;
	}
예제 #4
0
    private void SetupTreeView()
    {
        {
            var column = new TreeViewColumn();
            var cell = new CellRendererText();
            column.Title = "Customer ID";
            column.PackStart(cell, true);
            column.AddAttribute(cell, "text", (int)Column.CustomerID);
            this.treeview1.AppendColumn(column);
        }

        {
            var column = new TreeViewColumn();
            var cell = new CellRendererText();
            column.Title = "First Name";
            column.PackStart(cell, true);
            column.AddAttribute(cell, "text", (int)Column.FirstName);
            this.treeview1.AppendColumn(column);
        }

        {
            var column = new TreeViewColumn();
            var cell = new CellRendererText();
            column.Title = "Last Name";
            column.PackStart(cell, true);
            column.AddAttribute(cell, "text", (int)Column.LastName);
            this.treeview1.AppendColumn(column);
        }

        this.treeStore1 = (TreeStore)this.SetupTreeViewModel();

        this.treeview1.Model = this.treeStore1;
        this.treeview1.ExpandAll();
    }
예제 #5
0
        public MultiChooserDialog(IList options, IList banned)
        {
            base.Modal = true;
            base.HeightRequest = 400;
            base.WidthRequest = 250;
            //TODO: i18n
            base.Title = GettextCatalog.GetString ("Choose elements");
            base.AddButton(GettextCatalog.GetString ("_Cancel"), Gtk.ResponseType.Cancel);
            base.AddButton(GettextCatalog.GetString ("_Accept"), Gtk.ResponseType.Accept);
            base.Response += new Gtk.ResponseHandler(OnResponse);

            TreeView treeView = new TreeView();
            treeView.HeadersVisible = false;
            _store = new ListStore(typeof(bool), typeof(string));
            treeView.Model = _store;
            CellRendererToggle crtgl = new CellRendererToggle();
            crtgl.Activatable = true;
            crtgl.Toggled += new ToggledHandler(CheckboxToggledHandler);
            TreeViewColumn column = new TreeViewColumn ();
            column.PackStart(crtgl, false);
            column.AddAttribute(crtgl, "active", 0);
            treeView.AppendColumn(column);
            CellRendererText crtxt = new CellRendererText ();
            column = new TreeViewColumn ();
            column.PackStart(crtxt, false);
            column.AddAttribute(crtxt, "text", 1);
            treeView.AppendColumn(column);
            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Add(treeView);
            treeView.Show();
            base.VBox.Add(sw);
            ShowList(options, banned);
            sw.Show();
        }
예제 #6
0
파일: LegendView.cs 프로젝트: hol353/ApsimX
        /// <summary>
        /// Construtor
        /// </summary>
        public LegendView(ViewBase owner)
            : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.LegendView.glade", "hbox1");
            gxml.Autoconnect(this);
            _mainWidget = hbox1;
            combobox1.Model = comboModel;
            combobox1.PackStart(comboRender, false);
            combobox1.AddAttribute(comboRender, "text", 0);
            combobox1.Changed += OnPositionComboChanged;
            combobox1.Focused += OnTitleTextBoxEnter;

            listview.Model = listModel;
            TreeViewColumn column = new TreeViewColumn();
            column.Title = "Series name";
            column.PackStart(listToggle, false);
            listRender.Editable = false;
            column.PackStart(listRender, true);
            column.SetAttributes(listToggle, "active", 0);
            column.SetAttributes(listRender, "text", 1);
            listview.AppendColumn(column);
            listToggle.Activatable = true;
            listToggle.Toggled += OnItemChecked;
            _mainWidget.Destroyed += _mainWidget_Destroyed;
        }
예제 #7
0
    private void SetupTreeView()
    {
        {
            var cell = new CellRendererText();
            var column = new TreeViewColumn("Customer ID", cell, "text", (int)Column.CustomerID);
            column.SortColumnId = (int)Column.CustomerID;
            this.treeview1.AppendColumn(column);
        }

        {
            var cell = new CellRendererText();
            var column = new TreeViewColumn("First Name", cell, "text", (int)Column.FirstName);
            column.SortColumnId = (int)Column.FirstName;
            this.treeview1.AppendColumn(column);
        }

        {
            var cell = new CellRendererText();
            var column = new TreeViewColumn("Last Name", cell, "text", (int)Column.LastName);
            column.SortColumnId = (int)Column.LastName;
            this.treeview1.AppendColumn(column);
        }

        this.store = this.SetupTreeViewModel();
        this.treeview1.Model = this.store;
        this.treeview1.RulesHint = true;
    }
예제 #8
0
		public WebDeployLaunchDialog (AspNetAppProject project)
		{
			this.Build();
			
			this.project = project;
			
			//set up the sort order 
			targetStore.SetSortFunc (LISTCOL_Text, delegate (TreeModel m, TreeIter a, TreeIter b) {
				return string.Compare ((string) m.GetValue (a, LISTCOL_Text), (string) m.GetValue (b, LISTCOL_Text));
			});
			targetStore.SetSortColumnId (LISTCOL_Text, SortType.Ascending);
			
			//set up the view
			targetView.Model = targetStore;
			targetView.HeadersVisible = false;
			
			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Activatable = true;
			toggleRenderer.Xpad = 6;
			TreeViewColumn checkCol = new TreeViewColumn ("", toggleRenderer, "active", LISTCOL_Checked);
			checkCol.Expand = false;
			targetView.AppendColumn (checkCol);
			toggleRenderer.Toggled += HandleToggle;
			
			CellRendererText textRenderer = new CellRendererText ();
			textRenderer.WrapMode = Pango.WrapMode.WordChar;
			targetView.AppendColumn ("", textRenderer, "markup", LISTCOL_Text);
			
			fillStore ();
		}
예제 #9
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.
        }
예제 #10
0
		public MainWindow () : 
				base(Gtk.WindowType.Toplevel)
		{
			this.Build ();
			this.BorderWidth = 12;
			this.treeviewNodes.Model = store;
			var col =new TreeViewColumn ();
			col.Title ="Node";
			var pb = new CellRendererPixbuf ();
			col.PackStart (pb, false);
			col.AddAttribute (pb, "pixbuf", 3);
			
			var text = new CellRendererText ();
			col.PackStart (text, true);
			col.AddAttribute (text, "text", 0);
			
			this.treeviewNodes.AppendColumn (col);
			this.treeviewNodes.AppendColumn ("ResolveResult", new CellRendererText (), "text", 1);
			this.treeviewNodes.Selection.Changed += SelectionChanged;
//			this.treeviewNodes.HeadersVisible = false;
			this.textview1.ModifyFont (Pango.FontDescription.FromString ("Mono 14"));
			this.textview1.MoveCursor += HandleMoveCursor;
			string path = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "CSharpDemo.cs");
			this.textview1.Buffer.Text = File.ReadAllText (path);
			buttonParse.Clicked += HandleClicked;
			buttonGenerate.Clicked += CSharpGenerateCodeButtonClick;
			HandleClicked (this, EventArgs.Empty);
		}
		public UniqueConstraintEditorWidget (ISchemaProvider schemaProvider, SchemaActions action)
		{
			if (schemaProvider == null)
				throw new ArgumentNullException ("schemaProvider");
			
			this.schemaProvider = schemaProvider;
			this.action = action;
			
			this.Build();
			
			store = new ListStore (typeof (string), typeof (bool), typeof (string), typeof (object));
			listUnique.Model = store;
			listUnique.Selection.Changed += new EventHandler (SelectionChanged);
			columnSelecter.ColumnToggled += new EventHandler (ColumnToggled);
			
			TreeViewColumn colName = new TreeViewColumn ();

			colName.Title = AddinCatalog.GetString ("Name");
			
			CellRendererText nameRenderer = new CellRendererText ();
			
			nameRenderer.Editable = true;
			nameRenderer.Edited += new EditedHandler (NameEdited);
			
			colName.PackStart (nameRenderer, true);
			colName.AddAttribute (nameRenderer, "text", colNameIndex);
			
			listUnique.AppendColumn (colName);
			
			ShowAll ();
		}
        public StackTracePad()
        {
            this.ShadowType = ShadowType.In;

            store = new TreeStore (typeof (string));

            tree = new TreeView (store);
            tree.RulesHint = true;
            tree.HeadersVisible = true;

            TreeViewColumn FrameCol = new TreeViewColumn ();
            CellRenderer FrameRenderer = new CellRendererText ();
            FrameCol.Title = "Frame";
            FrameCol.PackStart (FrameRenderer, true);
            FrameCol.AddAttribute (FrameRenderer, "text", 0);
            FrameCol.Resizable = true;
            FrameCol.Alignment = 0.0f;
            tree.AppendColumn (FrameCol);

            Add (tree);
            ShowAll ();

            Runtime.DebuggingService.PausedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnPausedEvent));
            Runtime.DebuggingService.ResumedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnResumedEvent));
            Runtime.DebuggingService.StoppedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnStoppedEvent));
        }
예제 #13
0
		public MergeDialog (GitRepository repo, bool rebasing)
		{
			this.Build ();

			this.UseNativeContextMenus ();

			this.repo = repo;
			this.rebasing = rebasing;

			store = new TreeStore (typeof(string), typeof(Xwt.Drawing.Image), typeof (string), typeof(string));
			tree.Model = store;

			var crp = new CellRendererImage ();
			var col = new TreeViewColumn ();
			col.PackStart (crp, false);
			col.AddAttribute (crp, "image", 1);
			var crt = new CellRendererText ();
			col.PackStart (crt, true);
			col.AddAttribute (crt, "text", 2);
			tree.AppendColumn (col);

			tree.Selection.Changed += HandleTreeSelectionChanged;

			if (rebasing) {
				labelHeader.Text = GettextCatalog.GetString ("Select the branch to which to rebase:");
				checkStage.Label = GettextCatalog.GetString ("Stash/unstash local changes before/after rebasing");
				buttonOk.Label = GettextCatalog.GetString ("Rebase");
			}

			checkStage.Active = true;

			Fill ();
		}
예제 #14
0
        public SessionDisplayWidget()
        {
            this.Build ();

            TreeViewColumn startColumn = new TreeViewColumn ();
            CellRendererText startRenderer = new CellRendererText ();
            startColumn.Title = "Start";
            startColumn.PackStart (startRenderer, true);

            TreeViewColumn stopColumn = new TreeViewColumn ();
            CellRendererText stopRenderer = new CellRendererText ();
            stopColumn.Title = "Stop";
            stopColumn.PackStart (stopRenderer, true);

            TreeViewColumn durationColumn = new TreeViewColumn ();
            CellRenderer durationRenderer = new CellRendererText ();
            durationColumn.Title = "Duration";
            durationColumn.PackStart (durationRenderer, true);

            this.sessionView1.AppendColumn (startColumn);
            this.sessionView1.AppendColumn (stopColumn);
            this.sessionView1.AppendColumn (durationColumn);

            startColumn.AddAttribute (startRenderer, "text", 0);
            stopColumn.AddAttribute (stopRenderer, "text", 1);
            durationColumn.AddAttribute (durationRenderer, "text", 2);

            sessionStore = new Gtk.ListStore (typeof(string), typeof(string), typeof(string));
            sessionView1.Model = sessionStore;
        }
예제 #15
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);
        }
		public void Initialize (TreeView treeView)
		{
			var column = new TreeViewColumn ();

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

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

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

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

				var tuple = obj as Tuple<ISymbol, bool>;
				if (tuple != null) {
					Store.AppendValues (false, ImageService.GetIcon (tuple.Item1.GetStockIcon (), IconSize.Menu), tuple.Item1.ToDisplayString (Ambience.LabelFormat), tuple);
					continue;
				}
			}
			
			treeView.Model = store;
		}
예제 #17
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;
    }
		public CombineEntryConfigurationsPanelWidget (MultiConfigItemOptionsDialog dlg)
		{
			Build ();
			
			configData = dlg.ConfigurationData;
			
			store = new TreeStore (typeof(object), typeof(string));
			configsList.Model = store;
			configsList.HeadersVisible = true;
			store.SetSortColumnId (1, SortType.Ascending);
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererText sr = new CellRendererText ();
			col.PackStart (sr, true);
			col.AddAttribute (sr, "text", 1);
			col.Title = GettextCatalog.GetString ("Configuration");
			col.SortColumnId = 1;
			configsList.AppendColumn (col);

			foreach (ItemConfiguration cc in configData.Configurations)
				store.AppendValues (cc, cc.Id);

			addButton.Clicked += new EventHandler (OnAddConfiguration);
			removeButton.Clicked += new EventHandler (OnRemoveConfiguration);
			renameButton.Clicked += new EventHandler (OnRenameConfiguration);
			copyButton.Clicked += new EventHandler (OnCopyConfiguration);
		}
예제 #19
0
        public ImportSymbolSelectionDlg(INode[] nodes)
        {
            this.Build ();

            SetResponseSensitive(ResponseType.Ok, true);
            SetResponseSensitive(ResponseType.Cancel, true);

            buttonOk.GrabFocus();
            Modal = true;
            WindowPosition = Gtk.WindowPosition.CenterOnParent;

            // Init name column
            var nameCol = new TreeViewColumn();
            var textRenderer = new CellRendererText();
            nameCol.PackStart(textRenderer, true);
            nameCol.AddAttribute(textRenderer, "text", 0);
            list.AppendColumn(nameCol);

            // Init list model
            var nodeStore = new ListStore(typeof(string),typeof(INode));
            list.Model = nodeStore;

            // Fill list
            foreach (var n in nodes)
                if(n!=null)
                    nodeStore.AppendValues(n.ToString(), n);

            // Select first result
            TreeIter iter;
            if(nodeStore.GetIterFirst(out iter))
                list.Selection.SelectIter(iter);
        }
		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;
		}
예제 #21
0
파일: Results.cs 프로젝트: tmassey/mtos
        void SetupColumns()
        {
            _id = new TreeViewColumn ();
            _average = new TreeViewColumn ();
            _total = new TreeViewColumn ();
            _id.Title = "Task Id";
            _average.Title = "Average Time";
            _total.Title = "Total Time";

            Gtk.CellRendererText idcell = new Gtk.CellRendererText ();
            Gtk.CellRendererText avgcell = new Gtk.CellRendererText ();
            Gtk.CellRendererText totalcell = new Gtk.CellRendererText ();

            _id.PackStart (idcell, true);
            _average.PackStart (avgcell, true);
            _total.PackStart (totalcell, true);
            // Add the columns to the TreeView
            treeview1.AppendColumn (_id);
            treeview1.AppendColumn (_average);
            treeview1.AppendColumn (_total);

            _id.AddAttribute (idcell, "text", 0);
            _average.AddAttribute (avgcell, "text", 1);
            _total.AddAttribute (totalcell, "text", 2);

            // Create a model that will hold two strings - Artist Name and Song Title
            _liststore = new Gtk.ListStore (typeof(string), typeof(string), typeof(string));
            treeview1.Model = _liststore;
        }
		public ContextActionPanelWidget (string mimeType)
		{
			this.mimeType = mimeType;
			this.Build ();
			
			var col = new TreeViewColumn ();
			
			var togRender = new CellRendererToggle ();
			togRender.Toggled += delegate(object o, ToggledArgs args) {
				TreeIter iter;
				if (!treeStore.GetIterFromString (out iter, args.Path)) 
					return;
				bool enabled = (bool)treeStore.GetValue (iter, 1);
				treeStore.SetValue (iter, 1, !enabled);
			};
			col.PackStart (togRender, false);
			col.AddAttribute (togRender, "active", 1);
			
			var textRender = new CellRendererText ();
			col.PackStart (textRender, true);
			col.AddAttribute (textRender, "text", 0);
			
			treeviewContextActions.AppendColumn (col);
			treeviewContextActions.HeadersVisible = false;
			treeviewContextActions.Model = treeStore;
			
			FillTreeStore ();
			treeviewContextActions.Selection.Changed += HandleTreeviewContextActionsSelectionChanged;
		}
예제 #23
0
		public IncludeNewFilesDialog (string title, FilePath baseDirectory)
		{
			this.Build ();
			this.Title = title;
			this.baseDirectory = baseDirectory;
			
			treeviewFiles.Model = store;
			
			treeviewFiles.HeadersVisible = false; // Headers are untranslated because they're hidden as default
			
			TreeViewColumn textColumn = new TreeViewColumn ();
			
			CellRendererToggle toggleRender = new CellRendererToggle ();
			toggleRender.Toggled += ToggleRenderToggled;
			textColumn.PackStart (toggleRender, false);
			textColumn.AddAttribute (toggleRender, "active", Columns.IsToggled);
			
			textColumn.Title = "Name";
			var pixbufRenderer = new CellRendererImage ();
			textColumn.PackStart (pixbufRenderer, false);
			textColumn.AddAttribute (pixbufRenderer, "image", Columns.IconOpened);
			textColumn.AddAttribute (pixbufRenderer, "image-expander-open", Columns.IconOpened);
			textColumn.AddAttribute (pixbufRenderer, "image-expander-closed", Columns.IconClosed);
			
			CellRendererText textRenderer = new CellRendererText ();
			textColumn.PackStart (textRenderer, false);
			textColumn.AddAttribute (textRenderer, "text", Columns.Text);
			treeviewFiles.AppendColumn (textColumn);
			buttonExcludeAll.Clicked += ButtonExcludeAllClicked;
			buttonIncludeAll.Clicked += ButtonIncludeAllClicked;
			buttonOk.Clicked += ButtonOkClicked;
		}
		public void Initialize (Gtk.TreeView treeView)
		{
			TreeViewColumn column = new TreeViewColumn ();

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

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

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

			treeView.AppendColumn (column);
			Ambience ambience = AmbienceService.GetAmbienceForFile (options.Document.FileName);
			foreach (IBaseMember member in GetValidMembers ()) {
				Store.AppendValues (false, ImageService.GetPixbuf (member.StockIcon, IconSize.Menu), ambience.GetString (member, member.MemberType == MonoDevelop.Projects.Dom.MemberType.Parameter ? OutputFlags.IncludeParameterName : OutputFlags.ClassBrowserEntries), member);
			}
			
			treeView.Model = store;
		}
예제 #25
0
        public ProjectSelectorWidget()
        {
            this.Build();

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

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

            tree.Selection.Changed += HandleTreeSelectionChanged;
        }
예제 #26
0
        public DirectoryView(ExploreView exploreView)
        {
            this.exploreView = exploreView;
                menu = new DirectoryMenu(exploreView);

                store = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(ItemType));
                Model = store;

                sortableColumns = new SortableColumns(this, store);

            #if HAVE_ATLEAST_GTK_210
                EnableGridLines = TreeViewGridLines.Vertical;
            #endif
                // setup main column with image/text data
                TreeViewColumn column = new TreeViewColumn ();
                CellRendererText crt = new CellRendererText();
                CellRendererPixbuf crp = new CellRendererPixbuf();
                column.Title = "Name";
                column.PackStart(crp, false);
                column.PackStart(crt, true);
                column.AddAttribute(crp, "pixbuf", 0);
                column.AddAttribute(crt, "text", 1);
                AppendColumn(column);
                AppendColumn("Status", ColumnIndex.Status);
                AppendColumn("Owner", ColumnIndex.Owner);
                AppendColumn("Latest", ColumnIndex.Latest);

                Selection.Mode = SelectionMode.Multiple;
                KeyReleaseEvent += MyKeyReleaseEventHandler;
                ButtonPressEvent += MyButtonPressEventHandler;
        }
예제 #27
0
		public void Initialize (Gtk.TreeView treeView)
		{
			TreeViewColumn column = new TreeViewColumn ();

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

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

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

			treeView.AppendColumn (column);
			Ambience ambience = AmbienceService.GetAmbienceForFile (options.Document.FileName);
			foreach (object obj in GetValidMembers ()) {
				var member = obj as IEntity;
				if (member != null) {
					Store.AppendValues (false, ImageService.GetPixbuf (member.GetStockIcon (), IconSize.Menu), ambience.GetString (member, OutputFlags.ClassBrowserEntries), member);
					continue;
				}
				
				var variable = obj as IVariable;
				if (variable != null)
					Store.AppendValues (false, ImageService.GetPixbuf (variable.GetStockIcon (), IconSize.Menu), variable.Name, variable);
				
			}
			
			treeView.Model = store;
		}
예제 #28
0
파일: Uploads.cs 프로젝트: elnomade/hathi
 public TUploads(Gtk.TreeView tvUploads, CInterfaceGateway in_krnGateway)
 {
     krnGateway = in_krnGateway;
     Gtk.TreeViewColumn tvc = new TreeViewColumn ("Name",new CellRendererText(),"text",0);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 0;
     tvc = new TreeViewColumn ("File name",new CellRendererText(),"text",1);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 1;
     tvc = new TreeViewColumn ("Speed",new CellRendererText(),"text",2);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 2;
     tvc = new TreeViewColumn ("Position",new CellRendererText(),"text",3);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 3;
     tvc = new TreeViewColumn ("Downloaded",new CellRendererText(),"text",4);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 4;
     tvc = new TreeViewColumn ("Uploaded",new CellRendererText(),"text",5);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 5;
     tvc = new TreeViewColumn ("Progress",new CellRendererText(),"text",6);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 6;
     tvc = new TreeViewColumn ("Software",new CellRendererText(),"text",7);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 7;
     tvc = new TreeViewColumn ("Version",new CellRendererText(),"text",8);
     tvUploads.AppendColumn (tvc);
     tvc.SortColumnId = 8;
 }
            public CombineConfigurationPanelWidget(IProperties CustomizationObject)
                : base("Base.glade", "CombineConfigurationsPanel")
            {
                configuration = (CombineConfiguration)((IProperties)CustomizationObject).GetProperty("Config");

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

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

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

                foreach (CombineConfigurationEntry ce in configuration.Entries)
                    store.AppendValues (ce, ce.Entry.Name, ce.Build, ce.ConfigurationName);
            }
		public CombineConfigurationPanelWidget (MultiConfigItemOptionsDialog parentDialog)
		{
			Build ();
			
			this.parentDialog = parentDialog;
			store = new ListStore (typeof(object), typeof(string), typeof(bool));
			configsList.Model = store;
			configsList.HeadersVisible = true;
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererText sr = new CellRendererText ();
			col.PackStart (sr, true);
			col.Expand = true;
			col.AddAttribute (sr, "text", 1);
			col.Title = GettextCatalog.GetString ("Solution Item");
			configsList.AppendColumn (col);
			col.SortColumnId = 1;
			
			CellRendererToggle tt = new CellRendererToggle ();
			tt.Activatable = true;
			tt.Toggled += new ToggledHandler (OnBuildToggled);
			configsList.AppendColumn (GettextCatalog.GetString ("Build"), tt, "active", 2);
			
			CellRendererComboBox comboCell = new CellRendererComboBox ();
			comboCell.Changed += new ComboSelectionChangedHandler (OnConfigSelectionChanged);
			configsList.AppendColumn (GettextCatalog.GetString ("Configuration"), comboCell, new TreeCellDataFunc (OnSetConfigurationsData));
			store.SetSortColumnId (1, SortType.Ascending);
		}
        void GroupData(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererPropertyGroup rc = (CellRendererPropertyGroup)cell;

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

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

            if (prop != null)
            {
                rc.SensitiveProperty = !prop.IsReadOnly;
            }
            else
            {
                rc.SensitiveProperty = true;
            }
        }
예제 #32
0
 public object AddColumn(ListViewColumn col)
 {
     Gtk.TreeViewColumn tc = new Gtk.TreeViewColumn();
     tc.Title         = col.Title;
     tc.Resizable     = col.CanResize;
     tc.Alignment     = col.Alignment.ToGtkAlignment();
     tc.Expand        = col.Expands;
     tc.SortIndicator = col.SortIndicatorVisible;
     tc.SortOrder     = (SortType)col.SortDirection;
     if (col.SortDataField != null)
     {
         tc.SortColumnId = col.SortDataField.Index;
     }
     Widget.AppendColumn(tc);
     MapTitle(col, tc);
     MapColumn(col, tc);
     return(tc);
 }
        void PropertyData(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererProperty rc = (CellRendererProperty)cell;
            bool group = (bool)model.GetValue(iter, 2);

            if (group)
            {
                rc.SetData(null, null, null);
            }
            else
            {
                PropertyDescriptor prop     = (PropertyDescriptor)model.GetValue(iter, 1);
                PropertyEditorCell propCell = editorManager.GetEditor(prop);
                InstanceData       idata    = (InstanceData)model.GetValue(iter, 3);
                propCell.Initialize(tree, editorManager, prop, idata.Instance);
                rc.SetData(idata.Instance, prop, propCell);
            }
        }
예제 #34
0
        public void UpdateColumn(ListViewColumn col, object handle, ListViewColumnChange change)
        {
            Gtk.TreeViewColumn tc = (Gtk.TreeViewColumn)handle;

            switch (change)
            {
            case ListViewColumnChange.Cells:
                tc.Clear();
                MapColumn(col, tc);
                break;

            case ListViewColumnChange.Title:
                MapTitle(col, tc);
                break;

            case ListViewColumnChange.CanResize:
                tc.Resizable = col.CanResize;
                break;

            case ListViewColumnChange.SortIndicatorVisible:
                tc.SortIndicator = col.SortIndicatorVisible;
                break;

            case ListViewColumnChange.SortDirection:
                tc.SortOrder = (SortType)col.SortDirection;
                break;

            case ListViewColumnChange.SortDataField:
                if (col.SortDataField != null)
                {
                    tc.SortColumnId = col.SortDataField.Index;
                }
                break;

            case ListViewColumnChange.Alignment:
                tc.Alignment = col.Alignment.ToGtkAlignment();
                break;

            // lytico:
            case ListViewColumnChange.Width:
                tc.MinWidth = col.Width;
                break;
            }
        }
예제 #35
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;
        }
예제 #36
0
        /// <summary>
        /// Populates the data from a selected table.
        /// </summary>
        /// <param name="table">Table.</param>
        private void populateGrid(Model.Table table)
        {
            Gtk.ListStore store = treeView.Model as Gtk.ListStore;

            // Empty the store on every new table-selection.
            if (store != null)
            {
                foreach (Gtk.TreeViewColumn col in treeView.Columns)
                {
                    treeView.RemoveColumn(col);
                }
                store.Clear();
            }

            // Construct the array of types which is the size of the columns.
            Type[] types = new Type[table.Columns.Count];
            for (int i = 0, e = table.Columns.Count; i < e; ++i)
            {
                types[i] = typeof(string);
            }

            // The list store must take array of types which it will hold.
            store          = new Gtk.ListStore(types);
            treeView.Model = store;

            // Put columns and cell renderers in the ListStore. There we will put the actual values.
            for (int i = 0, e = table.Columns.Count; i < e; ++i)
            {
                Model.Column         dcol = table.Columns[i];
                Gtk.TreeViewColumn   col  = new Gtk.TreeViewColumn();
                Gtk.CellRendererText cell = new Gtk.CellRendererText();
                col.PackStart(cell, true);
                col.AddAttribute(cell, "text", i);
                col.Title = dcol.Meta.Name;
                treeView.AppendColumn(col);
            }

            // Now fill in the rows.
            foreach (Model.Row r in table.GetAsRows())
            {
                store.AppendValues(r.GetAsStringArray());
            }
            treeView.ShowAll();
        }
예제 #37
0
        private void renderColumns()
        {
            Gtk.TreeViewColumn requestIDCol = new Gtk.TreeViewColumn();
            requestIDCol.Title = "Title";
            RequestTreeView.AppendColumn(requestIDCol);

            Gtk.TreeViewColumn titleCol = new Gtk.TreeViewColumn();
            titleCol.Title = "User";
            RequestTreeView.AppendColumn(titleCol);


            Gtk.CellRendererText requestIDCell = new Gtk.CellRendererText();
            requestIDCol.PackStart(requestIDCell, true);
            requestIDCol.AddAttribute(requestIDCell, "text", 0);

            Gtk.CellRendererText titleCell = new Gtk.CellRendererText();
            titleCol.PackStart(titleCell, true);
            titleCol.AddAttribute(titleCell, "text", 2);
        }
예제 #38
0
        private void StateCellTextDataFunc(Gtk.TreeViewColumn tree_column,
                                           Gtk.CellRenderer cell, Gtk.TreeModel tree_model,
                                           Gtk.TreeIter iter)
        {
            iFolderUser user = (iFolderUser)tree_model.GetValue(iter, 0);

            if (ifolder.OwnerID == user.UserID)
            {
                ((CellRendererText)cell).Text = Util.GS("Owner");
            }
            else if (user.State != "Member")
            {
                ((CellRendererText)cell).Text = Util.GS("Invited User");
            }
            else
            {
                ((CellRendererText)cell).Text = Util.GS("iFolder User");
            }
        }
예제 #39
0
 protected virtual void OnInfoTreeCellDescription(Gtk.TreeViewColumn aColumn, object aObject, Gtk.CellRenderer aCell)
 {
     if (aObject is DevelopmentInformationItem)
     {
         aCell.CellBackgroundGdk = new Gdk.Color(255, 255, 255);
         if (aCell is CellRendererText)
         {
             (aCell as CellRendererText).Font = "Normal";
         }
     }
     else
     {
         aCell.CellBackgroundGdk = new Gdk.Color(225, 225, 225);
         if (aCell is CellRendererText)
         {
             (aCell as CellRendererText).Font = "Bold";
         }
     }
 }
예제 #40
0
        private void UserCellPixbufDataFunc(Gtk.TreeViewColumn tree_column,
                                            Gtk.CellRenderer cell, Gtk.TreeModel tree_model,
                                            Gtk.TreeIter iter)
        {
            iFolderUser user = (iFolderUser)tree_model.GetValue(iter, 0);

            if (user.UserID == ifolder.OwnerID)
            {
                ((CellRendererPixbuf)cell).Pixbuf = OwnerUserPixbuf;
            }
            else if (user.UserID == ifolder.CurrentUserID)
            {
                ((CellRendererPixbuf)cell).Pixbuf = CurrentUserPixbuf;
            }
            else
            {
                ((CellRendererPixbuf)cell).Pixbuf = NormalUserPixbuf;
            }
        }
    void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
    {
        try
        {
            CellRendererDiff cellRendererDiff = (CellRendererDiff)cell;
            Change change = store.GetValue (iter, objColumn) as Change;
            cellRendererDiff.Visible = !(bool)store.GetValue (iter, statusVisibleColumn);
            if (change == null || !cellRendererDiff.Visible)
            {
                cellRendererDiff.InitCell (treeviewPreview, false, "", "");
                return;
            }
            TextReplaceChange replaceChange = change as TextReplaceChange;
            if (replaceChange == null)
                return;

            var openDocument = IdeApp.Workbench.GetDocument (replaceChange.FileName);
            Mono.TextEditor.TextDocument originalDocument = new Mono.TextEditor.TextDocument ();
            originalDocument.FileName = replaceChange.FileName;
            if (openDocument == null)
            {
                originalDocument.Text = Mono.TextEditor.Utils.TextFileUtility.ReadAllText (replaceChange.FileName);
            }
            else
            {
                originalDocument.Text = openDocument.Editor.Document.Text;
            }

            Mono.TextEditor.TextDocument changedDocument = new Mono.TextEditor.TextDocument ();
            changedDocument.FileName = replaceChange.FileName;
            changedDocument.Text = originalDocument.Text;

            changedDocument.Replace (replaceChange.Offset, replaceChange.RemovedChars, replaceChange.InsertedText);

            string diffString = Mono.TextEditor.Utils.Diff.GetDiffString (originalDocument, changedDocument);

            cellRendererDiff.InitCell (treeviewPreview, true, diffString, replaceChange.FileName);
        }
        catch (Exception e)
        {
            Console.WriteLine (e);
        }
    }
예제 #42
0
		void AuthorIconFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
		{
			CellRendererPixbuf renderer = (CellRendererPixbuf)cell;
			var rev = (Revision)model.GetValue (iter, 0);
			if (string.IsNullOrEmpty (rev.Email))
				return;
			ImageLoader img = ImageService.GetUserIcon (rev.Email, 16);
			if (img.LoadOperation.IsCompleted)
				renderer.Pixbuf = img.Pixbuf;
			else {
				renderer.Pixbuf = null;
				img.LoadOperation.Completed += delegate {
					Gtk.Application.Invoke (delegate {
						if (logstore.IterIsValid (iter))
							model.EmitRowChanged (model.GetPath (iter), iter);
					});
				};
			}
		}
예제 #43
0
        void GroupData(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererPropertyGroup rc = (CellRendererPropertyGroup)cell;

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

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

            if (prop != null)
            {
                InstanceData idata = (InstanceData)model.GetValue(iter, 3);
                rc.SensitiveProperty = prop.EnabledFor(idata.Instance) && prop.VisibleFor(idata.Instance);
            }
            else
            {
                rc.SensitiveProperty = true;
            }
        }
        void RenderPropertyName(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            bool   selected     = (bool)store.GetValue(iter, colCheckedIndex);
            string propertyName = (string)store.GetValue(iter, colPropertyNameIndex);
            string error;

            CellRendererText cellRendererText = (CellRendererText)cell;

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

            cellRendererText.Text = propertyName;
        }
        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();
        }
예제 #46
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));
        }
예제 #47
0
        /// <summary>
        /// 添加任务状态列表,列头信息
        /// </summary>
        /// <param name="tv">Tv.</param>
        private void addColumnsForTheTaskStateList(TreeView tv)
        {
            Gtk.TreeViewColumn idColumn = new Gtk.TreeViewColumn();

            idColumn.Title      = "Task ID";
            idColumn.Sizing     = TreeViewColumnSizing.Fixed;
            idColumn.FixedWidth = 70;
            var idCell = new CellRendererText();

            idColumn.PackStart(idCell, true);
            // Create a column for the song title
            Gtk.TreeViewColumn progressColumn = new Gtk.TreeViewColumn();

            progressColumn.Title      = "Progress Rate";
            progressColumn.Sizing     = TreeViewColumnSizing.Fixed;
            progressColumn.FixedWidth = 600;
            var progressCell = new CellRendererProgress();

            progressColumn.PackStart(progressCell, true);

            Gtk.TreeViewColumn msColumn = new Gtk.TreeViewColumn();
            msColumn.Title = "Delay (ms)";
            var msCell = new CellRendererText();

            msColumn.PackStart(msCell, true);
            // Add the columns to the TreeView
            tv.AppendColumn(idColumn);
            tv.AppendColumn(progressColumn);
            tv.AppendColumn(msColumn);

            idColumn.AddAttribute(idCell, "text", 0);
            progressColumn.AddAttribute(progressCell, "value", 1);
            msColumn.AddAttribute(msCell, "text", 2);


            // Create a model that will hold two strings - Artist Name and Song Title
            ListStore = new Gtk.ListStore(typeof(string), typeof(int), typeof(string));


            // Assign the model to the TreeView
            tv.Model = ListStore;
        }
        void SetDiffCellData(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            try {
                CellRendererDiff cellRendererDiff = (CellRendererDiff)cell;
                Change           change           = store.GetValue(iter, objColumn) as Change;
                cellRendererDiff.Visible = !(bool)store.GetValue(iter, statusVisibleColumn);
                if (change == null || !cellRendererDiff.Visible)
                {
                    cellRendererDiff.InitCell(treeviewPreview, false, "", "");
                    return;
                }
                TextReplaceChange replaceChange = change as TextReplaceChange;
                if (replaceChange == null)
                {
                    return;
                }

                Mono.TextEditor.Document doc = new Mono.TextEditor.Document();
                doc.Text = System.IO.File.ReadAllText(replaceChange.FileName);
                List <string> before = new List <string> ();
                foreach (var line in doc.Lines)
                {
                    before.Add(doc.GetTextAt(line.Offset, line.EditableLength));
                }

                ((Mono.TextEditor.IBuffer)doc).Replace(replaceChange.Offset, replaceChange.RemovedChars, replaceChange.InsertedText);

                List <string> after = new List <string> ();
                foreach (var line in doc.Lines)
                {
                    after.Add(doc.GetTextAt(line.Offset, line.EditableLength));
                }

                Diff diff = new Diff(before.ToArray(), after.ToArray(), true, true);

                System.IO.StringWriter w = new System.IO.StringWriter();
                UnifiedDiff.WriteUnifiedDiff(diff, w, replaceChange.FileName, replaceChange.FileName, 2);
                cellRendererDiff.InitCell(treeviewPreview, true, w.ToString().Trim(), replaceChange.FileName);
            } catch (Exception e) {
                Console.WriteLine(e);
            }
        }
예제 #49
0
        private void BuildFaceTable(TreeView tv)
        {
            // Fill the table out from here

            // Create a column for the artist name
            String[] columns = { "Column Name", "Language Code", "Voice" };
            for (int i = 0; i < columns.Length; i++)
            {
                Gtk.TreeViewColumn artistColumn = new Gtk.TreeViewColumn();
                artistColumn.Title = columns [i];

                // Create the text cell that will display the artist name
                Gtk.CellRendererText artistNameCell = new Gtk.CellRendererText();

                // Add the cell to the column
                artistColumn.PackStart(artistNameCell, true);

                // Create a column for the song title
                tv.AppendColumn(artistColumn);

                artistColumn.AddAttribute(artistNameCell, "text", i);
            }

            // add data
//			System.Type[] types = new System.Type[columns.Length];
//			for (int i = 0; i < columns.Length; i++) {
//				types [i] = columns [i].GetType ();
//			}
            System.Type[] types     = { typeof(String), typeof(String), typeof(String) };
            Gtk.ListStore listStore = new Gtk.ListStore(types);

            // Add some data to the store
//			foreach (Dictionary <String, String> entry in data) {
//				String[] row = new String[columns.Length];
//				for (int i = 0; i < columns.Length; i++) {
//					row [i] = entry [columns [i]];
//				}
//				listStore.AppendValues (row);
//			}

            tv.Model = listStore;
        }
예제 #50
0
        void SetDiffCellData(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            if (disposed)
            {
                return;
            }
            CellRendererDiff rc = (CellRendererDiff)cell;

            string[] lines = (string[])filestore.GetValue(iter, ColPath);
            TreePath path  = filestore.GetPath(iter);

            if (filestore.IterDepth(iter) == 0)
            {
                rc.InitCell(filelist, false, lines, path);
            }
            else
            {
                rc.InitCell(filelist, true, lines, path);
            }
        }
예제 #51
0
        void AddColumn(string title, int ncol, string desc)
        {
            Gtk.TreeViewColumn col = new Gtk.TreeViewColumn();
            Gtk.Label          lab = new Gtk.Label(title);
            lab.Xalign = 1;
            EventBox bx = new EventBox();

            bx.Add(lab);
            bx.ShowAll();
            col.Widget = bx;

            CellRendererText crt = new CellRendererText();

            crt.Xalign = 1;
            col.PackStart(crt, true);
            col.AddAttribute(crt, "text", ncol);

            treeview.AppendColumn(col);
            tips.SetTip(bx, desc, desc);
        }
예제 #52
0
        void AuthorFunc(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            CellRendererText renderer = (CellRendererText)cell;
            var    rev    = (Revision)model.GetValue(iter, 0);
            string author = rev.Author;
            int    idx    = author.IndexOf("<");

            if (idx >= 0 && idx < author.IndexOf(">"))
            {
                author = author.Substring(0, idx).Trim();
            }
            if (string.IsNullOrEmpty(currentFilter))
            {
                renderer.Text = author;
            }
            else
            {
                renderer.Markup = EscapeWithFilterMarker(author);
            }
        }
예제 #53
0
    /*
     *	METHODS FOR PREPARING STUFF IN GUI ----------------------------------------
     */
    protected void initTreeViews()
    {
        Gtk.TreeViewColumn lexCol   = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn classCol = new Gtk.TreeViewColumn();
        lexCol.Title   = "Lexeme";
        classCol.Title = "Classification";
        lexTree.AppendColumn(lexCol);
        lexTree.AppendColumn(classCol);

        // Create model for lexTree
        lexemeListStore = new Gtk.ListStore(typeof(string), typeof(string));
        lexTree.Model   = lexemeListStore;

        // Create columns for symbolTree
        Gtk.TreeViewColumn identCol = new Gtk.TreeViewColumn();
        Gtk.TreeViewColumn valCol   = new Gtk.TreeViewColumn();
        identCol.Title = "Identifier";
        valCol.Title   = "Value";
        symbolTree.AppendColumn(identCol);
        symbolTree.AppendColumn(valCol);

        // Create model for symbolTree
        symbolListStore  = new Gtk.ListStore(typeof(string), typeof(string));
        symbolTree.Model = symbolListStore;

        // Renderer for lexemeTree
        Gtk.CellRendererText lexCell   = new Gtk.CellRendererText();
        Gtk.CellRendererText classCell = new Gtk.CellRendererText();
        lexCol.PackStart(lexCell, true);
        classCol.PackStart(classCell, true);
        lexCol.AddAttribute(lexCell, "text", 0);
        classCol.AddAttribute(classCell, "text", 1);

        // Renderer for symbolTree
        Gtk.CellRendererText identCell = new Gtk.CellRendererText();
        Gtk.CellRendererText valueCell = new Gtk.CellRendererText();
        identCol.PackStart(identCell, true);
        valCol.PackStart(valueCell, true);
        identCol.AddAttribute(identCell, "text", 0);
        valCol.AddAttribute(valueCell, "text", 1);
    }
예제 #54
0
    //public event PropertyChangedEventHandler PropertyChanged;

    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        //Tree View 1 Stuff
        var inListColumn = new Gtk.TreeViewColumn
        {
            Title = "Available Items"
        };

        var inListCell = new Gtk.CellRendererText();

        inListColumn.PackStart(inListCell, true);

        treeview1.AppendColumn(inListColumn);

        inListColumn.AddAttribute(inListCell, "text", 0);

        treeview1.Model = inListStore;

        //Tree View 2 Stuff
        var outListColumn = new Gtk.TreeViewColumn
        {
            Title = "Shop Items"
        };

        var outListCell = new Gtk.CellRendererText();

        outListColumn.PackStart(outListCell, true);

        treeview2.AppendColumn(outListColumn);
        outListColumn.AddAttribute(outListCell, "text", 0);

        treeview2.Model = outListStore;

        PopulateDefaultBoxes();

        //Events
        treeview1.Selection.Changed += InRowChange;
        treeview2.Selection.Changed += OutRowChange;
    }
예제 #55
0
        private void StatusCellTextDataFunc(Gtk.TreeViewColumn tree_column,
                                            Gtk.CellRenderer cell, Gtk.TreeModel tree_model,
                                            Gtk.TreeIter iter)
        {
            string id     = (string)tree_model.GetValue(iter, 0);
            string status = GetEncryptionStatus(id);

            if (status == null)
            {
                status = Util.GS("Not encrypted");
            }
            else if (status == "BLWF")
            {
                status = Util.GS("Encrypted");
            }
            else
            {
                status = Util.GS("Not encrypted");
            }
            ((CellRendererText)cell).Text = status;
        }
예제 #56
0
        static void FileDataFunc(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell;
            Task task = model.GetValue(iter, DataColumns.Task) as Task;

            if (task == null)
            {
                return;
            }

            string tmpPath = GetPath(task);
            string fileName;

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

            SetText(textRenderer, model, iter, task, fileName);
        }
        void OnSetConfigurationsData(Gtk.TreeViewColumn treeColumn, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            var item = (SolutionEntityItem)store.GetValue(iter, ProjectCol);
            ConfigurationData data = parentDialog.ConfigurationData.FindConfigurationData(item);

            CellRendererComboBox comboCell = (CellRendererComboBox)cell;

            comboCell.Values = data.Configurations.Select(c => c.Id).ToArray();

            var conf    = GetSelectedConfiguration(item);
            var escaped = GLib.Markup.EscapeText(conf);

            if (item.Configurations [conf] == null)
            {
                comboCell.Markup = string.Format("<span color='red'>{0}</span>", escaped);
            }
            else
            {
                comboCell.Markup = escaped;
            }
        }
예제 #58
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);
        }
예제 #59
0
        void ResultLineDataFunc(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            if (TreeIter.Zero.Equals(iter))
            {
                return;
            }
            CellRendererText lineRenderer = (CellRendererText)cell;
            SearchResult     searchResult = (SearchResult)store.GetValue(iter, SearchResultColumn);

            if (searchResult == null)
            {
                return;
            }

            Mono.TextEditor.Document doc = GetDocument(searchResult);
            int  lineNr     = doc.OffsetToLineNumber(searchResult.Offset) + 1;
            bool didRead    = (bool)store.GetValue(iter, DidReadColumn);
            bool isSelected = treeviewSearchResults.Selection.IterIsSelected(iter);

            lineRenderer.Markup = MarkupText(lineNr.ToString(), didRead, isSelected);
        }
예제 #60
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);
        }