コード例 #1
0
		public SelectRenamedClassDialog (IEnumerable<IType> classes)
		{
			XML glade = new XML (null, "gui.glade", "SelectRenamedClassDialog", null);
			glade.Autoconnect (this);
			
			store = new ListStore (typeof(Pixbuf), typeof(string));
			treeClasses.Model = store;
			
			TreeViewColumn column = new TreeViewColumn ();
		
			var pr = new CellRendererPixbuf ();
			column.PackStart (pr, false);
			column.AddAttribute (pr, "pixbuf", 0);
			
			CellRendererText crt = new CellRendererText ();
			column.PackStart (crt, true);
			column.AddAttribute (crt, "text", 1);
			
			treeClasses.AppendColumn (column);
			
			foreach (var cls in classes) {
				Pixbuf pic = ImageService.GetPixbuf (cls.GetStockIcon ());
				store.AppendValues (pic, cls.FullName);
			}
		}
コード例 #2
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);
			Gtk.CellRendererPixbuf cr = new Gtk.CellRendererPixbuf();
			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;
		}
コード例 #3
0
		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.GetPixbuf (project.StockIcon, IconSize.Menu);
			dirClosedBuf = ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.ClosedFolder, IconSize.Menu);
			dirOpenBuf = ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.OpenFolder, IconSize.Menu);
			
			TreeViewColumn projectCol = new TreeViewColumn ();
			projectCol.Title = GettextCatalog.GetString ("Project Folders");
			var pixRenderer = new CellRendererPixbuf ();
			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 CellRendererPixbuf ();
			fileCol.Title = GettextCatalog.GetString ("Files");
			fileCol.PackStart (filePixRenderer, false);
			fileCol.PackStart (txtRenderer, true);
			fileCol.AddAttribute (filePixRenderer, "pixbuf", 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;
		}
コード例 #4
0
ファイル: Tree.cs プロジェクト: MonoBrasil/historico
 // Default constructor
 public Tree()
     : base()
 {
     _store = new TreeStore(typeof(Gdk.Pixbuf), typeof (string), typeof(bool), typeof (string));
     base.Model = _store;
     CellRendererText ct = new CellRendererText ();
     ct.Edited += OnTreeViewCellEdited;
     CellRendererPixbuf cb = new CellRendererPixbuf ();
     TreeViewColumn column = new TreeViewColumn ();
     column.PackStart(cb, false);
     column.PackStart(ct, false);
     column.AddAttribute(cb, "pixbuf", 0);
     column.AddAttribute(ct, "text", 1);
     column.AddAttribute(ct, "editable", 2);
     AppendColumn(column);
     AppendColumn("ElementType", new CellRendererText(), "text", 3);
     GetColumn(1).Visible = false; //Hides the "what-am-I" column
     HeightRequest = 350;
     WidthRequest = 180;
     HeadersVisible = false;
     //
     _table = new Hashtable();
     _key = 0; // hastable key
     //
     //Drag&Drop
     base.Selection.Changed += new EventHandler(TreeSelectionChanged);
     Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, _fromTree, DragAction.Copy);
     //Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, FromImage, DragAction.Copy | DragAction.Move);
     DragDataGet += Data_Get;
     DragBegin += Drag_Begin;
 }
コード例 #5
0
ファイル: DirectoryView.cs プロジェクト: Jeff-Lewis/opentf
        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;
        }
コード例 #6
0
        void AddColumns()
        {
            Gtk.CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

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

            TreeViewColumn col;

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

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

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

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

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

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

            col = view.AppendColumn(GettextCatalog.GetString("Path"), view.TextRenderer);
            col.SetCellDataFunc(view.TextRenderer, new Gtk.TreeCellDataFunc(PathDataFunc));
            col.Resizable = true;
        }
コード例 #7
0
ファイル: BuildOutput.cs プロジェクト: Cardanis/MonoGame
        public BuildOutput()
        {
            Build();

            outputParser = new OutputParser();

            var column = new TreeViewColumn ();

            var iconCell = new CellRendererPixbuf ();
            var textCell = new CellRendererText ();
            var idCell = new CellRendererText ();

            idCell.Visible = false;

            column.PackStart (iconCell, false);
            column.PackStart (textCell, false);
            column.PackStart (idCell, false);

            treeview1.AppendColumn (column);

            column.AddAttribute (iconCell,  "pixbuf", 0);
            column.AddAttribute (textCell, "text", 1);
            column.AddAttribute (idCell, "text", 2);

            listStore = new TreeStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string));

            treeview1.Model = listStore;

            textView1.SizeAllocated += TextView1_SizeAllocated;
        }
コード例 #8
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);
		}
コード例 #9
0
ファイル: ItemList.cs プロジェクト: GNOME/blam
	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));

	}
コード例 #10
0
        /// <summary>Default constructor for ExplorerView</summary>
        public PropertyCategorisedView(ViewBase owner) : base(owner)
        {
            Builder builder = ViewBase.BuilderFromResource("ApsimNG.Resources.Glade.PropertyCategoryView.glade");

            Gtk.HPaned hpaned = (Gtk.HPaned)builder.GetObject("hpaned1");
            treeview1                 = (Gtk.TreeView)builder.GetObject("treeview1");
            rightHandView             = (Viewport)builder.GetObject("RightHandView");
            mainWidget                = hpaned;
            rightHandView.BorderWidth = 7;

#if NETFRAMEWORK
            rightHandView.ModifyBg(StateType.Normal, mainWidget.Style.Base(StateType.Normal));
            rightHandView.ShadowType = ShadowType.None;
#endif

            treeview1.Model = treemodel;
            TreeViewColumn     column     = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();
            column.PackStart(iconRender, false);
            textRender          = new Gtk.CellRendererText();
            textRender.Editable = false;

            column.PackStart(textRender, true);
            column.SetAttributes(iconRender, "pixbuf", 1);
            column.SetAttributes(textRender, "text", 0);
            treeview1.AppendColumn(column);
            treeview1.TooltipColumn = 2;

            treeview1.CursorChanged      += OnAfterSelect;
            treeview1.ButtonReleaseEvent += OnButtonUp;
            treeview1.ButtonPressEvent   += OnButtonPress;
            treeview1.RowActivated       += OnRowActivated;

            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
コード例 #11
0
ファイル: MainWindow.cs プロジェクト: artifexor/NRefactory
		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);
		}
コード例 #12
0
ファイル: MainWindow.cs プロジェクト: Netring/ILSpy
		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.scrolledwindow1.Child = editor;
			this.scrolledwindow1.Child.ShowAll ();
			this.editor.Document.MimeType = "text/x-csharp";
			this.editor.Options.FontName = "Mono 14";
			this.editor.Caret.PositionChanged += HandlePositionChanged;
			string path = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "CSharpDemo.cs");
			this.editor.Text = File.ReadAllText (path);
			buttonParse.Clicked += HandleClicked;
			buttonGenerate.Clicked += CSharpGenerateCodeButtonClick;
			HandleClicked (this, EventArgs.Empty);
		}
コード例 #13
0
ファイル: PageComboBox.cs プロジェクト: haugjan/banshee-hacks
        public PageComboBox (IList<Page> pages, Notebook notebook)
        {
            this.pages = pages;
            this.notebook = notebook;

            // icon, name, order, Page object itself
            model = new ListStore (typeof(Gdk.Pixbuf), typeof(string), typeof(int), typeof(Page));
            model.SetSortColumnId (2, SortType.Ascending);
            Model = model;

            CellRendererPixbuf icon = new CellRendererPixbuf ();
            PackStart (icon, false);
            AddAttribute (icon, "pixbuf", 0);

            CellRendererText name = new CellRendererText ();
            PackStart (name, true);
            AddAttribute (name, "markup", 1);

            foreach (Page page in pages) {
                model.AppendValues (
                    Banshee.Gui.IconThemeUtils.LoadIcon (page.IconName, 22),
                    String.Format ("<b>{0}</b>", page.Name),
                    page.Order,
                    page
                );
            }

            Active = 0;
            Show ();
        }
コード例 #14
0
        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 ();
        }
コード例 #15
0
		public DeployDialog (SolutionItem defaultEntry, bool createBuilderOnly)
		{
			this.Build();
			notebook.ShowTabs = false;
			this.defaultEntry = defaultEntry;
			
			if (createBuilderOnly) {
				vboxSaveProject.Hide ();
				checkSave.Active = true;
				checkSave.Hide ();
				saveSeparator.Hide ();
			}
			else {
				pageSave.Hide ();
				FillProjectSelectors ();
			}
			
			store = new ListStore (typeof(Gdk.Pixbuf), typeof(string), typeof(object));
			targetsTree.Model = store;
			
			targetsTree.HeadersVisible = false;
			Gtk.CellRendererPixbuf cr = new Gtk.CellRendererPixbuf();
			cr.Yalign = 0;
			targetsTree.AppendColumn ("", cr, "pixbuf", 0);
			targetsTree.AppendColumn ("", new Gtk.CellRendererText(), "markup", 1);
			
			targetsTree.Selection.Changed += delegate (object s, EventArgs a) {
				UpdateButtons ();
			};
			
			FillBuilders ();
			
			UpdateButtons ();
		}
コード例 #16
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 ();
        }
コード例 #17
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 CellRendererPixbuf ();
			textColumn.PackStart (pixbufRenderer, false);
			textColumn.AddAttribute (pixbufRenderer, "pixbuf", Columns.IconOpened);
			textColumn.AddAttribute (pixbufRenderer, "pixbuf-expander-open", Columns.IconOpened);
			textColumn.AddAttribute (pixbufRenderer, "pixbuf-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;
		}
コード例 #18
0
        /// <summary>Default constructor for ExplorerView</summary>
        public PropertyTreeView(ViewBase owner) : base(owner)
        {
            Builder builder = ViewBase.BuilderFromResource("ApsimNG.Resources.Glade.ExplorerView.glade");

            vbox1                    = (VBox)builder.GetObject("vbox1");
            treeview1                = (Gtk.TreeView)builder.GetObject("treeview1");
            rightHandView            = (Viewport)builder.GetObject("RightHandView");
            mainWidget               = vbox1;
            rightHandView.ShadowType = ShadowType.EtchedOut;

            treeview1.Model = treemodel;
            TreeViewColumn     column     = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

            column.PackStart(iconRender, false);
            textRender          = new Gtk.CellRendererText();
            textRender.Editable = false;

            column.PackStart(textRender, true);
            column.SetAttributes(iconRender, "pixbuf", 1);
            column.SetAttributes(textRender, "text", 0);
            treeview1.AppendColumn(column);
            treeview1.TooltipColumn = 2;

            treeview1.CursorChanged      += OnAfterSelect;
            treeview1.ButtonReleaseEvent += OnButtonUp;
            treeview1.ButtonPressEvent   += OnButtonPress;
            treeview1.RowActivated       += OnRowActivated;

            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
コード例 #19
0
ファイル: ViewNameIcon.cs プロジェクト: hpbaotho/supos
		public ViewNameIcon() : base()
		{
			upbutton = new Button();
			upbutton.Add( new Image(Stock.GoUp, IconSize.Button) );
			upbutton.Clicked += OnUpClicked;
			downbutton = new Button();			
			downbutton.Add( new Image(Stock.GoDown, IconSize.Button) );
			downbutton.Clicked += OnDownClicked;
			swindow = new ScrolledWindow();
			view = new IconView();
			
			CellRendererPixbuf cellicon= new CellRendererPixbuf();
			CellRendererText celltext = new CellRendererText();
			celltext.Xalign=0.5f;
			view.PackStart(cellicon, false);
			view.SetCellDataFunc(cellicon, CellRenderFunctions.RenderIcon);
			view.PackStart(celltext, false);
			view.SetCellDataFunc(celltext, CellRenderFunctions.RenderName);
			view.SelectionMode = Gtk.SelectionMode.Browse;
			view.SelectionChanged += OnSelectionChanged;
			view.ItemActivated += OnRowActivated;
			swindow.Add(view);
			swindow.HscrollbarPolicy = PolicyType.Never;
			swindow.VscrollbarPolicy = PolicyType.Automatic;
			this.PackStart(upbutton, false, false, 0);
			this.PackStart(swindow, true, true, 0);
			this.PackStart(downbutton, false, false, 0);
			
			store = new StoreBase();
			view.Model=store.ViewModel;
			
			ShowAll();
		}
コード例 #20
0
		public ExtensionEditorWidget()
		{
			this.Build();
			
			pixAddin = ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Addin, IconSize.Menu);
			pixLocalAddin = ImageService.GetPixbuf ("md-addinauthoring-current-addin", IconSize.Menu);
			pixExtensionPoint = ImageService.GetPixbuf ("md-extension-point", IconSize.Menu);
			pixExtensionNode = ImageService.GetPixbuf ("md-extension-node", IconSize.Menu);
			
			store = new TreeStore (typeof(string), typeof(string), typeof(Extension), typeof(ExtensionNodeDescription), typeof(Gdk.Pixbuf), typeof(bool), typeof(ExtensionPoint));
			state = new TreeViewState (tree, 0);

			TreeViewColumn col = new TreeViewColumn ();
			CellRendererPixbuf cpix = new CellRendererPixbuf ();
			col.PackStart (cpix, false);
			col.AddAttribute (cpix, "pixbuf", ColIcon);
			col.AddAttribute (cpix, "visible", ColShowIcon);
			
			CellRendererExtension crt = new CellRendererExtension ();
			crt.Yalign = 0;
			col.PackStart (crt, true);
			col.AddAttribute (crt, "markup", ColLabel);
			
			tree.AppendColumn (col);
			tree.Model = store;
			tree.HeadersVisible = false;
			
			tree.Selection.Changed += OnSelectionChanged;
			
			IdeApp.ProjectOperations.EndBuild += OnEndBuild;
		}
コード例 #21
0
ファイル: HistoryTreeView.cs プロジェクト: joehillen/Pinta
        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);
        }
コード例 #22
0
ファイル: ProjectView.cs プロジェクト: KennethYap/MonoGame
        public ProjectView ()
        {
            Build();
            basename = "base";

            var column = new TreeViewColumn ();

            var iconCell = new CellRendererPixbuf ();
            var textCell = new CellRendererText ();
            var idCell = new CellRendererText ();

            idCell.Visible = false;

            column.PackStart (iconCell, false);
            column.PackStart (textCell, false);
            column.PackStart (idCell, false);

            treeview1.AppendColumn (column);

            column.AddAttribute (iconCell,  "pixbuf", 0);
            column.AddAttribute (textCell, "text", 1);
            column.AddAttribute (idCell, "text", 2);

            listStore = new TreeStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string));

            treeview1.Model = listStore;
            treeview1.Selection.Mode = SelectionMode.Multiple;

            treeview1.ButtonPressEvent += OnTreeview1ButtonPressEvent;
            treeview1.KeyReleaseEvent += HandleKeyReleaseEvent;
            treeview1.ButtonReleaseEvent += OnTreeview1ButtonReleaseEvent;
            treeview1.CursorChanged += OnTreeview1CursorChanged;
        }
コード例 #23
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);
            Gtk.CellRendererPixbuf cr = new Gtk.CellRendererPixbuf();
            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;
        }
コード例 #24
0
		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);
		}
コード例 #25
0
		public ProjectViewBackendNodeView (ProjectViewFrontend frontend)
		{
			this.frontend = frontend;
			HeadersVisible = false;
			
			store = new TreeStore (typeof(Gdk.Pixbuf), typeof(string), typeof(ObjectWrapper), typeof(bool));
			Model = store;
			
			TreeViewColumn col;
			CellRenderer renderer;

			col = new TreeViewColumn ();

			renderer = new CellRendererPixbuf ();
			col.PackStart (renderer, false);
			col.AddAttribute (renderer, "pixbuf", 0);

			renderer = new CellRendererText ();
			col.PackStart (renderer, true);
			col.AddAttribute (renderer, "text", 1);

			AppendColumn (col);

			Selection.Mode = SelectionMode.Single;
			Selection.Changed += RowSelected;
			TestExpandRow += OnTestExpandRow;
			ShowAll ();
		}
コード例 #26
0
        public OpenImagesListWidget()
        {
            CanFocus = false;
            SetSizeRequest (200, 200);
            SetPolicy (PolicyType.Automatic, PolicyType.Automatic);

            tree = new TreeView ();
            tree.HeadersVisible = false;
            tree.EnableGridLines = TreeViewGridLines.None;
            tree.Selection.Mode = SelectionMode.Single;
            tree.Selection.SelectFunction = HandleDocumentSelected;

            file_name_column = new TreeViewColumn ();
            CellRendererText file_name_cell = new CellRendererText ();
            file_name_column.PackStart (file_name_cell, true);
            file_name_column.AddAttribute (file_name_cell, "text", 0);

            file_close_cell = new CellRendererPixbuf ();
            file_name_column.PackStart (file_close_cell, false);
            file_name_column.AddAttribute (file_close_cell, "pixbuf", 1);

            tree.AppendColumn (file_name_column);

            store = new ListStore (typeof (string), typeof (Gdk.Pixbuf));
            tree.Model = store;
            tree.ButtonPressEvent += HandleTreeButtonPressEvent;

            Add (tree);
            ShowAll ();

            PintaCore.Workspace.DocumentOpened += HandleDocumentOpenedOrClosed;
            PintaCore.Workspace.DocumentClosed += HandleDocumentOpenedOrClosed;
            PintaCore.Workspace.DocumentCreated += HandleDocumentOpenedOrClosed;
            PintaCore.Workspace.ActiveDocumentChanged += HandleActiveDocumentChanged;
        }
コード例 #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
ファイル: MainWindow.cs プロジェクト: kmnb/ReduktuMi
 public MainWindow()
     : base(WindowType.Toplevel)
 {
     this.controler = new ReduktuMi.Controlers.Controler();
     this.Build();
     // Colonne image
     TreeViewColumn imageColumn = new TreeViewColumn();
     CellRendererPixbuf imageCell = new CellRendererPixbuf();
     imageColumn.PackStart(imageCell, true);
     // Colonne Nom
     TreeViewColumn nameColumn = new TreeViewColumn();
     nameColumn.Title = "Name";
     CellRendererText nameCell = new CellRendererText();
     nameColumn.PackStart(nameCell, true);
     // Colonne Full Path
     TreeViewColumn pathColumn = new TreeViewColumn();
     pathColumn.Title = "Path";
     CellRendererText pathCell = new CellRendererText();
     pathColumn.PackStart (pathCell, false);
     // Add columns
     this.treeViewImages.AppendColumn(imageColumn);
     this.treeViewImages.AppendColumn(nameColumn);
     this.treeViewImages.AppendColumn(pathColumn);
     // Assign the model
     this.treeViewImages.Model = this.controler.ImagesModel;
 }
コード例 #29
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 (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;
		}
コード例 #30
0
ファイル: PeopleTreeView.cs プロジェクト: kanitw/facespot
        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.
        }
コード例 #31
0
        public NewTemplateDialog (IEnumerator<ContentItemTemplate> enums)
        {
            Build();

            Title = "New Item";
            var column = new TreeViewColumn ();

            var iconCell = new CellRendererPixbuf ();
            var textCell = new CellRendererText ();
            var textCell2 = new CellRendererText ();

            column.PackStart (iconCell, false);
            column.PackStart (textCell, false);
            column.PackStart (textCell2, false);

            treeview1.AppendColumn (column);

            column.AddAttribute (iconCell,  "pixbuf", 0);
            column.AddAttribute (textCell, "text", 1);
            column.AddAttribute (textCell, "text", 2);

            listStore = new TreeStore (typeof (Gdk.Pixbuf), typeof (string), typeof (string));
            treeview1.Model = listStore;

            items = new List<ContentItemTemplate> ();
            int i = 0;

            while (enums.MoveNext ()) {
                listStore.AppendValues (new Gdk.Pixbuf (System.IO.Path.GetDirectoryName (enums.Current.TemplateFile) + "/" + enums.Current.Icon), enums.Current.Label, i.ToString());
                items.Add (enums.Current);
                i++;
            }
        }
コード例 #32
0
ファイル: BacktracesView.cs プロジェクト: Kalnor/monodevelop
		public BacktracesView ()
		{
			window = new ScrolledWindow ();
			tree = new TreeView ();
			tree.RulesHint = true;
			
			//                               icon            type            count            #bytes         avg size         avg age
			store = new TreeStore (typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (object));
			tree.Model = store;

			CellRendererPixbuf pixbufRenderer = new CellRendererPixbuf ();
			CellRendererText typeRenderer = new CellRendererText ();
			CellRendererText countRenderer = new CellRendererText ();
			CellRendererText totalSizeRenderer = new CellRendererText ();
			CellRendererText avgSizeRenderer = new CellRendererText ();
			CellRendererText avgAgeRenderer = new CellRendererText ();
			
			TreeViewColumn columnType = new TreeViewColumn ();
			TreeViewColumn columnCount = new TreeViewColumn ();
			TreeViewColumn columnTotalSize = new TreeViewColumn ();
			TreeViewColumn columnAvgSize = new TreeViewColumn ();
			TreeViewColumn columnAvgAge = new TreeViewColumn ();
			
			columnType.Title = GettextCatalog.GetString ("Type");
			columnCount.Title = GettextCatalog.GetString ("Count");
			columnTotalSize.Title = GettextCatalog.GetString ("Total Size");
			columnAvgSize.Title = GettextCatalog.GetString ("Avg Size");
			columnAvgAge.Title = GettextCatalog.GetString ("Avg Age");
			
			columnType.PackStart (pixbufRenderer, false);
			columnType.PackStart (typeRenderer, true);
			columnCount.PackStart (countRenderer, true);
			columnTotalSize.PackStart (totalSizeRenderer, true);
			columnAvgSize.PackStart (avgSizeRenderer, true);
			columnAvgAge.PackStart (avgAgeRenderer, true);
			
			columnType.AddAttribute (pixbufRenderer, "stock-id", 0);
			columnType.AddAttribute (typeRenderer, "text", 1);
			columnCount.AddAttribute (countRenderer, "text", 2);
			columnTotalSize.AddAttribute (totalSizeRenderer, "text", 3);
			columnAvgSize.AddAttribute (avgSizeRenderer, "text", 4);
			columnAvgAge.AddAttribute (avgAgeRenderer, "text", 5);
			
			tree.AppendColumn (columnType);
			tree.AppendColumn (columnCount);
			tree.AppendColumn (columnTotalSize);
			tree.AppendColumn (columnAvgSize);
			tree.AppendColumn (columnAvgAge);
			
			int nc = 0;
			foreach (TreeViewColumn c in tree.Columns) {
				store.SetSortFunc (nc, CompareNodes);
				c.SortColumnId = nc++;
			}
			store.SetSortColumnId (1, SortType.Descending);
			
			window.Add (tree);
			window.ShowAll ();
		}
コード例 #33
0
        public LocalsPad()
        {
            this.ShadowType = ShadowType.In;

            variable_rows = new Hashtable();
            iters = new Hashtable();

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

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

            TreeViewColumn NameCol = new TreeViewColumn ();
            CellRenderer NameRenderer = new CellRendererText ();
            CellRenderer IconRenderer = new CellRendererPixbuf ();
            NameCol.Title = "Name";
            NameCol.PackStart (IconRenderer, false);
            NameCol.PackStart (NameRenderer, true);
            NameCol.AddAttribute (IconRenderer, "pixbuf", PIXBUF_COL);
            NameCol.AddAttribute (NameRenderer, "text", NAME_COL);
            NameCol.Resizable = true;
            NameCol.Alignment = 0.0f;
            tree.AppendColumn (NameCol);

            TreeViewColumn ValueCol = new TreeViewColumn ();
            CellRenderer ValueRenderer = new CellRendererText ();
            ValueCol.Title = "Value";
            ValueCol.PackStart (ValueRenderer, true);
            ValueCol.AddAttribute (ValueRenderer, "text", VALUE_COL);
            ValueCol.Resizable = true;
            NameCol.Alignment = 0.0f;
            tree.AppendColumn (ValueCol);

            TreeViewColumn TypeCol = new TreeViewColumn ();
            CellRenderer TypeRenderer = new CellRendererText ();
            TypeCol.Title = "Type";
            TypeCol.PackStart (TypeRenderer, true);
            TypeCol.AddAttribute (TypeRenderer, "text", TYPE_COL);
            TypeCol.Resizable = true;
            NameCol.Alignment = 0.0f;
            tree.AppendColumn (TypeCol);

            tree.TestExpandRow += new TestExpandRowHandler (TestExpandRow);

            #if NET_2_0
            tree.PopupMenu += new PopupMenuHandler (TreePopup);
            #endif

            Add (tree);
            ShowAll ();

            Runtime.DebuggingService.PausedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnPausedEvent));
            Runtime.DebuggingService.StoppedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnStoppedEvent));
        }
コード例 #34
0
ファイル: TagSelectionWidget.cs プロジェクト: iainlane/f-spot
        // 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);
        }
コード例 #35
0
ファイル: ExplorerView.cs プロジェクト: nastaranch/ApsimX
        /// <summary>Default constructor for ExplorerView</summary>
        public ExplorerView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.ExplorerView.glade");

            vbox1                    = (VBox)builder.GetObject("vbox1");
            toolStrip                = (Toolbar)builder.GetObject("toolStrip");
            treeview1                = (TreeView)builder.GetObject("treeview1");
            RightHandView            = (Viewport)builder.GetObject("RightHandView");
            _mainWidget              = vbox1;
            RightHandView.ShadowType = ShadowType.EtchedOut;
            treeview1.Model          = treemodel;
            TreeViewColumn     column     = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

            column.PackStart(iconRender, false);
            textRender                 = new Gtk.CellRendererText();
            textRender.Editable        = false;
            textRender.EditingStarted += OnBeforeLabelEdit;
            textRender.Edited         += OnAfterLabelEdit;
            column.PackStart(textRender, true);
            column.SetCellDataFunc(textRender, OnSetCellData);

            CellRendererText tickCell = new CellRendererText();

            tickCell.Editable = false;
            column.PackEnd(tickCell, false);
            column.SetAttributes(iconRender, "pixbuf", 1);
            column.SetAttributes(textRender, "text", 0);
            column.SetAttributes(tickCell, "text", 3);
            // column.SetCellDataFunc(textRender, treecelldatafunc);
            treeview1.AppendColumn(column);
            treeview1.TooltipColumn = 2;

            treeview1.CursorChanged      += OnAfterSelect;
            treeview1.ButtonReleaseEvent += OnButtonUp;
            treeview1.ButtonPressEvent   += OnButtonPress;
            treeview1.RowActivated       += OnRowActivated;

            TargetEntry[] target_table = new TargetEntry[] {
                new TargetEntry(modelMime, TargetFlags.App, 0)
            };

            Gdk.DragAction actions = Gdk.DragAction.Copy | Gdk.DragAction.Link | Gdk.DragAction.Move;
            // treeview1.EnableModelDragDest(target_table, actions);
            // treeview1.EnableModelDragSource(Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.SourceSet(treeview1, Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.DestSet(treeview1, 0, target_table, actions);
            treeview1.DragMotion       += OnDragOver;
            treeview1.DragDrop         += OnDragDrop;
            treeview1.DragBegin        += OnDragBegin;
            treeview1.DragDataGet      += OnDragDataGet;
            treeview1.DragDataReceived += OnDragDataReceived;
            treeview1.DragEnd          += OnDragEnd;
            treeview1.FocusInEvent     += Treeview1_FocusInEvent;
            treeview1.FocusOutEvent    += Treeview1_FocusOutEvent;
            timer.Elapsed         += Timer_Elapsed;
            _mainWidget.Destroyed += _mainWidget_Destroyed;
        }
コード例 #36
0
        /// <summary>Default constructor for ExplorerView</summary>
        public ExplorerView(ViewBase owner) : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.ExplorerView.glade", "vpaned1");
            gxml.Autoconnect(this);
            _mainWidget = vpaned1;

            progressbar1.Visible       = false;
            statusWindow.HeightRequest = 20;
            treeview1.Model            = treemodel;
            TreeViewColumn     column     = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

            column.PackStart(iconRender, false);
            CellRendererText textRender = new Gtk.CellRendererText();

            textRender.Editable        = true;
            textRender.EditingStarted += OnBeforeLabelEdit;
            textRender.Edited         += OnAfterLabelEdit;
            column.PackStart(textRender, true);
            column.SetAttributes(iconRender, "pixbuf", 1);
            column.SetAttributes(textRender, "text", 0);
//            column.SetCellDataFunc(textRender, treecelldatafunc);
            treeview1.AppendColumn(column);

            treeview1.CursorChanged      += OnAfterSelect;
            treeview1.ButtonReleaseEvent += OnButtonUp;

            TargetEntry[] target_table = new TargetEntry[] {
                new TargetEntry("application/x-model-component", TargetFlags.App, 0)
            };

            Gdk.DragAction actions = Gdk.DragAction.Copy | Gdk.DragAction.Link | Gdk.DragAction.Move;
            //treeview1.EnableModelDragDest(target_table, actions);
            //treeview1.EnableModelDragSource(Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.SourceSet(treeview1, Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.DestSet(treeview1, 0, target_table, actions);
            treeview1.DragMotion       += OnDragOver;
            treeview1.DragDrop         += OnDragDrop;
            treeview1.DragBegin        += OnDragBegin;
            treeview1.DragDataGet      += OnDragDataGet;
            treeview1.DragDataReceived += OnDragDataReceived;
            treeview1.DragEnd          += OnDragEnd;
            treeview1.DragDataDelete   += OnDragDataDelete;

            TextTag tag = new TextTag("error");

            tag.Foreground = "red";
            statusWindow.Buffer.TagTable.Add(tag);
            tag            = new TextTag("warning");
            tag.Foreground = "brown";
            statusWindow.Buffer.TagTable.Add(tag);
            tag            = new TextTag("normal");
            tag.Foreground = "blue";
            statusWindow.ModifyBase(StateType.Normal, new Gdk.Color(0xff, 0xff, 0xf0));
        }
コード例 #37
0
ファイル: DropDownHandler.cs プロジェクト: nzysoft/Eto
        protected override void Create()
        {
            Control = new Gtk.ComboBox();
            var imageCell = new Gtk.CellRendererPixbuf();

            Control.PackStart(imageCell, false);
            Control.AddAttribute(imageCell, "pixbuf", 1);
            text = new Gtk.CellRendererText();

            Control.PackStart(text, true);
            Control.Changed += Connector.HandleChanged;
        }
コード例 #38
0
ファイル: DropDownHandler.cs プロジェクト: zzlvff/Eto
        protected override void Create()
        {
            listStore = new Gtk.ListStore(typeof(string), typeof(Gdk.Pixbuf));
            Control   = new Gtk.ComboBox(listStore);
            var imageCell = new Gtk.CellRendererPixbuf();

            Control.PackStart(imageCell, false);
            Control.SetAttributes(imageCell, "pixbuf", 1);
            text = new Gtk.CellRendererText();
            Control.PackStart(text, true);
            Control.SetAttributes(text, "text", 0);
            Control.Changed += Connector.HandleChanged;
        }
コード例 #39
0
        void CreateColumns()
        {
            foreach (TreeViewColumn column in searchTreeview.Columns)
            {
                searchTreeview.RemoveColumn(column);
            }
            TreeViewColumn col;

            Gtk.CellRenderer crp, crt;
            switch (searchMode)
            {
            case SearchMode.Member:
            case SearchMode.Disassembler:
            case SearchMode.Decompiler:
                col       = new TreeViewColumn();
                col.Title = GettextCatalog.GetString("Member");
                crp       = new Gtk.CellRendererPixbuf();
                crt       = new Gtk.CellRendererText();
                col.PackStart(crp, false);
                col.PackStart(crt, true);
                col.AddAttribute(crp, "pixbuf", 0);
                col.AddAttribute(crt, "text", 1);
                searchTreeview.AppendColumn(col);
                col.Resizable        = true;
                col                  = searchTreeview.AppendColumn(GettextCatalog.GetString("Declaring Type"), new Gtk.CellRendererText(), "text", 2);
                col.Resizable        = true;
                col                  = searchTreeview.AppendColumn(GettextCatalog.GetString("Assembly"), new Gtk.CellRendererText(), "text", 3);
                col.Resizable        = true;
                searchTreeview.Model = memberListStore;
                break;

            case SearchMode.Type:
                col       = new TreeViewColumn();
                col.Title = GettextCatalog.GetString("Type");
                crp       = new Gtk.CellRendererPixbuf();
                crt       = new Gtk.CellRendererText();
                col.PackStart(crp, false);
                col.PackStart(crt, true);
                col.AddAttribute(crp, "pixbuf", 0);
                col.AddAttribute(crt, "text", 1);
                searchTreeview.AppendColumn(col);
                col.Resizable        = true;
                col                  = searchTreeview.AppendColumn(GettextCatalog.GetString("Namespace"), new Gtk.CellRendererText(), "text", 2);
                col.Resizable        = true;
                col                  = searchTreeview.AppendColumn(GettextCatalog.GetString("Assembly"), new Gtk.CellRendererText(), "text", 3);
                col.Resizable        = true;
                searchTreeview.Model = typeListStore;
                break;
            }
        }
コード例 #40
0
ファイル: TreeView.cs プロジェクト: lie112/ApsimX
        protected override void Initialise(ViewBase ownerView, GLib.Object gtkControl)
        {
            treeview1       = (Gtk.TreeView)gtkControl;
            mainWidget      = treeview1;
            treeview1.Model = treemodel;
            TreeViewColumn     column     = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

            iconRender.SetPadding(2, 1);
            column.PackStart(iconRender, false);
            textRender                 = new Gtk.CellRendererText();
            textRender.Editable        = false;
            textRender.EditingStarted += OnBeforeLabelEdit;
            textRender.Edited         += OnAfterLabelEdit;
            column.PackStart(textRender, true);
            column.SetCellDataFunc(textRender, OnSetCellData);

            CellRendererText tickCell = new CellRendererText();

            tickCell.Editable = false;
            column.PackEnd(tickCell, false);
            column.SetAttributes(iconRender, "pixbuf", 1);
            column.SetAttributes(textRender, "text", 0);
            column.SetAttributes(tickCell, "text", 3);
            treeview1.AppendColumn(column);
            treeview1.TooltipColumn = 2;

            treeview1.CursorChanged      += OnAfterSelect;
            treeview1.ButtonReleaseEvent += OnButtonUp;
            treeview1.ButtonPressEvent   += OnButtonPress;
            treeview1.RowActivated       += OnRowActivated;
            treeview1.FocusInEvent       += OnTreeGainFocus;
            treeview1.FocusOutEvent      += OnTreeLoseFocus;

            TargetEntry[] target_table = new TargetEntry[] {
                new TargetEntry(modelMime, TargetFlags.App, 0)
            };

            Gdk.DragAction actions = Gdk.DragAction.Copy | Gdk.DragAction.Link | Gdk.DragAction.Move;
            Drag.SourceSet(treeview1, Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.DestSet(treeview1, 0, target_table, actions);
            treeview1.DragMotion       += OnDragOver;
            treeview1.DragDrop         += OnDragDrop;
            treeview1.DragBegin        += OnDragBegin;
            treeview1.DragDataGet      += OnDragDataGet;
            treeview1.DragDataReceived += OnDragDataReceived;
            treeview1.DragEnd          += OnDragEnd;
            timer.Elapsed        += OnTimerElapsed;
            mainWidget.Destroyed += OnDestroyed;
        }
コード例 #41
0
ファイル: TreeView.cs プロジェクト: jcbowden/ApsimX
        /// <summary>Constructor</summary>
        public TreeView(ViewBase owner, Gtk.TreeView treeView) : base(owner)
        {
            treeview1       = treeView;
            treeview1.Model = treemodel;
            TreeViewColumn     column     = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

            column.PackStart(iconRender, false);
            textRender                 = new Gtk.CellRendererText();
            textRender.Editable        = false;
            textRender.EditingStarted += OnBeforeLabelEdit;
            textRender.Edited         += OnAfterLabelEdit;
            column.PackStart(textRender, true);
            column.SetCellDataFunc(textRender, OnSetCellData);

            CellRendererText tickCell = new CellRendererText();

            tickCell.Editable = false;
            column.PackEnd(tickCell, false);
            column.SetAttributes(iconRender, "pixbuf", 1);
            column.SetAttributes(textRender, "text", 0);
            column.SetAttributes(tickCell, "text", 3);
            // column.SetCellDataFunc(textRender, treecelldatafunc);
            treeview1.AppendColumn(column);
            treeview1.TooltipColumn = 2;

            treeview1.CursorChanged      += OnAfterSelect;
            treeview1.ButtonReleaseEvent += OnButtonUp;
            treeview1.ButtonPressEvent   += OnButtonPress;
            treeview1.RowActivated       += OnRowActivated;
            treeview1.FocusInEvent       += OnTreeGainFocus;
            treeview1.FocusOutEvent      += OnTreeLoseFocus;

            TargetEntry[] target_table = new TargetEntry[] {
                new TargetEntry(modelMime, TargetFlags.App, 0)
            };

            Gdk.DragAction actions = Gdk.DragAction.Copy | Gdk.DragAction.Link | Gdk.DragAction.Move;
            // treeview1.EnableModelDragDest(target_table, actions);
            // treeview1.EnableModelDragSource(Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.SourceSet(treeview1, Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.DestSet(treeview1, 0, target_table, actions);
            treeview1.DragMotion       += OnDragOver;
            treeview1.DragDrop         += OnDragDrop;
            treeview1.DragBegin        += OnDragBegin;
            treeview1.DragDataGet      += OnDragDataGet;
            treeview1.DragDataReceived += OnDragDataReceived;
            treeview1.DragEnd          += OnDragEnd;
            timer.Elapsed += OnTimerElapsed;
        }
コード例 #42
0
        private void TaskNotesCellDataFunc(Gtk.TreeViewColumn treeColumn,
                                           Gtk.CellRenderer renderer, Gtk.TreeModel model,
                                           Gtk.TreeIter iter)
        {
            Gtk.CellRendererPixbuf crp = renderer as Gtk.CellRendererPixbuf;
            ITask task = model.GetValue(iter, 0) as ITask;

            if (task == null)
            {
                crp.Pixbuf = null;
                return;
            }

            crp.Pixbuf = task.HasNotes ? notePixbuf : null;
        }
コード例 #43
0
        void AddColumns()
        {
            Gtk.CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();
            iconRender.Yalign        = 0;
            iconRender.Ypad          = 2;
            view.TextRenderer.Yalign = 0;

            TreeViewColumn col;

            col = view.AppendColumn("", iconRender, "pixbuf", Columns.Type);
            col.SortColumnId = (int)Columns.TypeString;
            col = view.AppendColumn(GettextCatalog.GetString("Time"), view.TextRenderer, "text", Columns.Time);
            col.SortColumnId = (int)Columns.Time;
            col = view.AppendColumn(GettextCatalog.GetString("Description"), view.TextRenderer, "text", Columns.Description);
            col.SortColumnId = (int)Columns.Description;
        }
コード例 #44
0
 public void AddColumnIcon(string iconname, int col)
 {
     column             = new TreeViewColumn();
     iconrenderer       = new Gtk.CellRendererPixbuf();
     column.Expand      = false;
     column.Resizable   = false;
     column.Clickable   = false;
     column.Reorderable = false;
     column.Alignment   = 0.5f;
     column.Widget      = new Gtk.Image(
         Gtk.IconTheme.Default.LoadIcon(iconname, 16, 0)
         );
     column.Widget.Show();
     column.PackStart(iconrenderer, true);
     column.AddAttribute(iconrenderer, "pixbuf", col);
     tree.AppendColumn(column);
 }
コード例 #45
0
        /// <summary>Default constructor for ExplorerView</summary>
        public ExplorerView(ViewBase owner) : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.ExplorerView.glade", "vbox1");
            gxml.Autoconnect(this);
            _mainWidget = vbox1;
            RightHandView.ShadowType = ShadowType.EtchedOut;

            treeview1.Model = treemodel;
            TreeViewColumn     column     = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

            column.PackStart(iconRender, false);
            textRender                 = new Gtk.CellRendererText();
            textRender.Editable        = true;
            textRender.EditingStarted += OnBeforeLabelEdit;
            textRender.Edited         += OnAfterLabelEdit;
            column.PackStart(textRender, true);
            column.SetAttributes(iconRender, "pixbuf", 1);
            column.SetAttributes(textRender, "text", 0);
            // column.SetCellDataFunc(textRender, treecelldatafunc);
            treeview1.AppendColumn(column);
            treeview1.TooltipColumn = 2;

            treeview1.CursorChanged      += OnAfterSelect;
            treeview1.ButtonReleaseEvent += OnButtonUp;

            TargetEntry[] target_table = new TargetEntry[] {
                new TargetEntry("application/x-model-component", TargetFlags.App, 0)
            };

            Gdk.DragAction actions = Gdk.DragAction.Copy | Gdk.DragAction.Link | Gdk.DragAction.Move;
            // treeview1.EnableModelDragDest(target_table, actions);
            // treeview1.EnableModelDragSource(Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.SourceSet(treeview1, Gdk.ModifierType.Button1Mask, target_table, actions);
            Drag.DestSet(treeview1, 0, target_table, actions);
            treeview1.DragMotion       += OnDragOver;
            treeview1.DragDrop         += OnDragDrop;
            treeview1.DragBegin        += OnDragBegin;
            treeview1.DragDataGet      += OnDragDataGet;
            treeview1.DragDataReceived += OnDragDataReceived;
            treeview1.DragEnd          += OnDragEnd;
            treeview1.DragDataDelete   += OnDragDataDelete;
            treeview1.FocusInEvent     += Treeview1_FocusInEvent;
            treeview1.FocusOutEvent    += Treeview1_FocusOutEvent;
            _mainWidget.Destroyed      += _mainWidget_Destroyed;
        }
コード例 #46
0
        public ReferenceTreeViewer()
        {
            Build();
            store                     = new Gtk.TreeStore(typeof(object), typeof(string), typeof(string), typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
            treeview.Model            = store;
            treeview.HeadersClickable = true;

            Gtk.TreeViewColumn complete_column = new Gtk.TreeViewColumn();
            complete_column.Title     = "Type";
            complete_column.Resizable = true;

            Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf();
            complete_column.PackStart(pix_render, false);
            complete_column.AddAttribute(pix_render, "stock-id", ImageCol);

            Gtk.CellRendererText text_render = new Gtk.CellRendererText();
            complete_column.PackStart(text_render, true);

            complete_column.AddAttribute(text_render, "text", TypeCol);
            complete_column.Clickable = true;

            treeview.AppendColumn(complete_column);

            AddColumn("Instances", InstancesCol, "Number of instances of a type. Only instances that contain references are included.");
            TreeColRefs = treeview.Columns.Length;
            AddColumn("References", RefsCol, "Number of references to the parent type.");
            AddColumn("Root Refs", RootRefsCol, "Number of indirect references to instances of the tree root type.");
            AddColumn("Root Mem", RootMemCol, "Amount of memory of the root instances indirectly referenced.");
            AddColumn("Memory Size", SizeCol, "Memory allocated by instances of the type.");
            AddColumn("Avg. Size", AvgSizeCol, "Average size of the instances.");

            treeview.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow);
            treeview.RowActivated  += new Gtk.RowActivatedHandler(OnNodeActivated);
//			treeview.AppendColumn (new Gtk.TreeViewColumn());

            int nc = 0;

            foreach (TreeViewColumn c in treeview.Columns)
            {
                store.SetSortFunc(nc, CompareNodes);
                c.SortColumnId = nc++;
            }
            store.SetSortColumnId(1, Gtk.SortType.Descending);
            treeview.RulesHint = true;
            tips.Enable();
        }
コード例 #47
0
        public ProjectReferencePanel(SelectReferenceDialog selectDialog) : base(false, 6)
        {
            this.selectDialog = selectDialog;

            store = new ListStore(typeof(string), typeof(string), typeof(Project), typeof(bool), typeof(Gdk.Pixbuf), typeof(bool), typeof(string));
            store.SetSortFunc(0, CompareNodes);
            treeView = new TreeView(store);

            TreeViewColumn firstColumn  = new TreeViewColumn();
            TreeViewColumn secondColumn = new TreeViewColumn();

            CellRendererToggle tog_render = new CellRendererToggle();

            tog_render.Xalign   = 0;
            tog_render.Toggled += new Gtk.ToggledHandler(AddReference);
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", 3);
            firstColumn.AddAttribute(tog_render, "visible", 5);

            secondColumn.Title = GettextCatalog.GetString("Project");
            Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf();
            secondColumn.PackStart(pix_render, false);
            secondColumn.AddAttribute(pix_render, "pixbuf", 4);

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "text", 0);
            secondColumn.AddAttribute(text_render, "foreground", 6);

            treeView.AppendColumn(firstColumn);
            treeView.AppendColumn(secondColumn);
            treeView.AppendColumn(GettextCatalog.GetString("Directory"), new CellRendererText(), "markup", 1);

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            PackStart(sc, true, true, 0);

            store.SetSortColumnId(0, SortType.Ascending);
            ShowAll();

            BorderWidth = 6;
        }
コード例 #48
0
ファイル: SettingsMain.cs プロジェクト: kavniekerk/ide-as
        private void CreateSettingsTree()
        {
            Gtk.TreeStore trsSettingsTreeStore = new Gtk.TreeStore(typeof(Gdk.Pixbuf), typeof(string));

            Gtk.CellRendererPixbuf celSettingsTreeItemIcon = new Gtk.CellRendererPixbuf();
            Gtk.CellRendererText   celSettingsTreeItemText = new Gtk.CellRendererText();

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

            trcSettingsTreeColumn.PackStart(celSettingsTreeItemIcon, false);
            trcSettingsTreeColumn.AddAttribute(celSettingsTreeItemIcon, "pixbuf", 0);

            trcSettingsTreeColumn.PackStart(celSettingsTreeItemText, true);
            trcSettingsTreeColumn.AddAttribute(celSettingsTreeItemText, "text", 1);

            trvSettingsTree.AppendColumn(trcSettingsTreeColumn);
            trvSettingsTree.Model = trsSettingsTreeStore;
        }
コード例 #49
0
        public ProjectListWidget()
        {
            this.Build();
            projectsListStore = new Gtk.ListStore(typeof(Project));

            Gtk.TreeViewColumn fileDescriptionColumn = new Gtk.TreeViewColumn();
            fileDescriptionColumn.Title = Catalog.GetString("Filename");
            Gtk.CellRendererText   filenameCell       = new Gtk.CellRendererText();
            Gtk.CellRendererText   filePropertiesCell = new Gtk.CellRendererText();
            Gtk.CellRendererPixbuf miniatureCell      = new Gtk.CellRendererPixbuf();
            fileDescriptionColumn.PackStart(miniatureCell, false);
            fileDescriptionColumn.PackStart(filenameCell, true);
            fileDescriptionColumn.PackStart(filePropertiesCell, true);

            fileDescriptionColumn.SetCellDataFunc(filenameCell, new Gtk.TreeCellDataFunc(RenderName));
            fileDescriptionColumn.SetCellDataFunc(filePropertiesCell, new Gtk.TreeCellDataFunc(RenderProperties));
            fileDescriptionColumn.SetCellDataFunc(miniatureCell, new Gtk.TreeCellDataFunc(RenderPixbuf));

            treeview.AppendColumn(fileDescriptionColumn);
            treeview.EnableGridLines = TreeViewGridLines.Horizontal;
            treeview.HeadersVisible  = false;
        }
コード例 #50
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();
        }
コード例 #51
0
        private void buildColumns()
        {
            iconColumn = new TreeViewColumn();
            nameColumn = new TreeViewColumn();
            sizeColumn = new TreeViewColumn();

            Gtk.CellRendererPixbuf iconRendererCell = new Gtk.CellRendererPixbuf();
            Gtk.CellRendererText   nameRendererCell = new Gtk.CellRendererText();
            Gtk.CellRendererText   sizeRendererCell = new Gtk.CellRendererText();

            iconColumn.PackStart(iconRendererCell, true);
            nameColumn.PackStart(nameRendererCell, true);
            sizeColumn.PackStart(sizeRendererCell, true);

            iconColumn.SetCellDataFunc(iconRendererCell, new Gtk.TreeCellDataFunc(RenderIcon));
            nameColumn.SetCellDataFunc(nameRendererCell, new Gtk.TreeCellDataFunc(RenderName));
            sizeColumn.SetCellDataFunc(sizeRendererCell, new Gtk.TreeCellDataFunc(RenderSize));

            AppendColumn(iconColumn);
            AppendColumn(nameColumn);
            AppendColumn(sizeColumn);
        }
コード例 #52
0
        private void TaskTimerCellDataFunc(Gtk.TreeViewColumn treeColumn,
                                           Gtk.CellRenderer renderer, Gtk.TreeModel model,
                                           Gtk.TreeIter iter)
        {
            Gtk.CellRendererPixbuf crp = renderer as Gtk.CellRendererPixbuf;
            ITask task = model.GetValue(iter, 0) as ITask;

            if (task == null)
            {
                return;
            }

            if (task.State != TaskState.Inactive)
            {
                // The task is not in the inactive state so don't show any icon
                crp.Pixbuf = null;
                return;
            }

            Preferences prefs        = Application.Preferences;
            int         timerSeconds = prefs.GetInt(Preferences.InactivateTimeoutKey);
            // convert to milliseconds for more granularity
            long timeout = timerSeconds * 1000;

            //Logger.Debug ("TaskTimerCellDataFunc ()\n\tNow.Ticks: {0}\n\tCompletionDate.Ticks: {1}",
            //				DateTime.Now.Ticks, task.CompletionDate.Ticks);
            long elapsedTicks = DateTime.Now.Ticks - task.CompletionDate.Ticks;
            //Logger.Debug ("\tElapsed Ticks: {0}", elapsedTicks);
            long elapsedMillis = elapsedTicks / 10000;
            //Logger.Debug ("\tElapsed Milliseconds: {0}", elapsedMillis);

            double percentComplete = (double)elapsedMillis / (double)timeout;

            //Logger.Debug ("\tPercent Complete: {0}", percentComplete);

            Gdk.Pixbuf pixbuf = GetIconForPercentage(percentComplete * 100);
            crp.Pixbuf = pixbuf;
        }
コード例 #53
0
        public DeployDialog(SolutionItem defaultEntry, bool createBuilderOnly)
        {
            this.Build();
            notebook.ShowTabs = false;
            this.defaultEntry = defaultEntry;

            if (createBuilderOnly)
            {
                vboxSaveProject.Hide();
                checkSave.Active = true;
                checkSave.Hide();
                saveSeparator.Hide();
            }
            else
            {
                pageSave.Hide();
                FillProjectSelectors();
            }

            store             = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(object));
            targetsTree.Model = store;

            targetsTree.HeadersVisible = false;
            Gtk.CellRendererPixbuf cr = new Gtk.CellRendererPixbuf();
            cr.Yalign = 0;
            targetsTree.AppendColumn("", cr, "pixbuf", 0);
            targetsTree.AppendColumn("", new Gtk.CellRendererText(), "markup", 1);

            targetsTree.Selection.Changed += delegate(object s, EventArgs a)
            {
                UpdateButtons();
            };

            FillBuilders();

            UpdateButtons();
        }
コード例 #54
0
        private void buildColumns()
        {
            Model = new ListStore(typeof(TorrentLabel), typeof(Gdk.Pixbuf),
                                  typeof(string), typeof(string), typeof(bool));

            iconColumn = new TreeViewColumn();
            nameColumn = new TreeViewColumn();
            sizeColumn = new TreeViewColumn();

            Gtk.CellRendererPixbuf iconRendererCell = new Gtk.CellRendererPixbuf();
            Gtk.CellRendererText   nameRendererCell = new Gtk.CellRendererText {
                Editable = true
            };
            Gtk.CellRendererText sizeRendererCell = new Gtk.CellRendererText();

            iconColumn.PackStart(iconRendererCell, true);
            nameColumn.PackStart(nameRendererCell, true);
            sizeColumn.PackStart(sizeRendererCell, true);

            iconColumn.AddAttribute(iconRendererCell, "pixbuf", 1);
            nameColumn.AddAttribute(nameRendererCell, "text", 2);
            sizeColumn.AddAttribute(sizeRendererCell, "text", 3);
            nameColumn.AddAttribute(nameRendererCell, "editable", 4);

            AppendColumn(iconColumn);
            AppendColumn(nameColumn);
            AppendColumn(sizeColumn);

            nameRendererCell.Edited += Event.Wrap((EditedHandler) delegate(object o, Gtk.EditedArgs args) {
                Gtk.TreeIter iter;
                if (Model.GetIter(out iter, new Gtk.TreePath(args.Path)))
                {
                    TorrentLabel label = (TorrentLabel)Model.GetValue(iter, 0);
                    label.Name         = args.NewText;
                }
            });
        }
コード例 #55
0
        public ListTreeViewBase()
        {
            Selection.Mode           = SelectionMode.Multiple;
            Selection.SelectFunction = SelectFunction;
            RowActivated            += new RowActivatedHandler(OnTreeviewRowActivated);
            HeadersVisible           = false;

            SetMenu();
            ProjectIsLive  = false;
            PlayListLoaded = false;

            nameColumn       = new Gtk.TreeViewColumn();
            nameColumn.Title = "Name";
            nameCell         = new Gtk.CellRendererText();
            nameCell.Edited += OnNameCellEdited;
            Gtk.CellRendererPixbuf miniatureCell = new Gtk.CellRendererPixbuf();
            nameColumn.PackStart(nameCell, true);
            nameColumn.PackEnd(miniatureCell, true);

            nameColumn.SetCellDataFunc(miniatureCell, new Gtk.TreeCellDataFunc(RenderMiniature));
            nameColumn.SetCellDataFunc(nameCell, new Gtk.TreeCellDataFunc(RenderName));

            AppendColumn(nameColumn);
        }
コード例 #56
0
ファイル: myListStore.cs プロジェクト: Gladius1/Catadesigner
        // adds a new column;; option(s) could eventually be a list of options, right now only "text" and "pixbuf"
        public TreeViewColumn addTVColumn(string title, string option, int position)
        {
            TreeViewColumn tVColumn = new TreeViewColumn();

            tVColumn.Title = title;
            Gtk.CellRendererText   cRText;
            Gtk.CellRendererPixbuf cRPixbuf;
            //check wether the option is "text" or "pixbuf" and initializes the apropriate CellRenderer
            if (option == "text")
            {
                cRText = new Gtk.CellRendererText();
                tVColumn.PackStart(cRText, true);
                tVColumn.AddAttribute(cRText, option, position);
            }
            if (option == "pixbuf")
            {
                cRPixbuf = new Gtk.CellRendererPixbuf();
                tVColumn.PackStart(cRPixbuf, true);
                tVColumn.AddAttribute(cRPixbuf, option, position);
            }
            // append the column to the treeview
            myTreeview.AppendColumn(tVColumn);
            return(tVColumn);
        }
コード例 #57
0
        public SelectImageDialog(Gtk.Window parent, Stetic.IProject project)
        {
            this.parent  = parent;
            this.project = project;
            Glade.XML xml = new Glade.XML(null, "stetic.glade", "SelectImageDialog", null);
            xml.Autoconnect(this);

            // Stock icon list

            iconList = new ThemedIconList();
            iconList.SelectionChanged += new EventHandler(OnIconSelectionChanged);
            iconScrolledwindow.AddWithViewport(iconList);

            // Icon Sizes

            foreach (IconSize s in Enum.GetValues(typeof(Gtk.IconSize)))
            {
                if (s != IconSize.Invalid)
                {
                    iconSizeCombo.AppendText(s.ToString());
                }
            }
            iconSizeCombo.Active = 0;

            // Resource list

            resourceListStore  = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string));
            resourceList.Model = resourceListStore;

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

            Gtk.CellRendererPixbuf pr = new Gtk.CellRendererPixbuf();
            pr.Xpad = 3;
            col.PackStart(pr, false);
            col.AddAttribute(pr, "pixbuf", 0);

            Gtk.CellRendererText crt = new Gtk.CellRendererText();
            col.PackStart(crt, true);
            col.AddAttribute(crt, "markup", 1);

            resourceList.AppendColumn(col);
            resourceProvider = project.ResourceProvider;
            if (resourceProvider == null)
            {
                buttonAdd.Sensitive    = false;
                buttonRemove.Sensitive = false;
            }
            FillResources();
            resourceList.Selection.Changed += OnResourceSelectionChanged;

            if (project.FolderName != null)
            {
                fileChooser.SetCurrentFolder(project.ImagesRootPath);
            }

            fileChooser.SelectionChanged += delegate(object s, EventArgs a) {
                UpdateButtons();
            };

            fileChooser.FileActivated += delegate(object s, EventArgs a) {
                if (Icon != null)
                {
                    if (Validate())
                    {
                        dialog.Respond(Gtk.ResponseType.Ok);
                    }
                }
            };

            okButton.Clicked += OnOkClicked;

            UpdateButtons();
        }
コード例 #58
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
#pragma warning disable RECS0021 // Avisa sobre las llamadas a funciones de miembros virtuales que tienen lugar en el constructor
        Build();
#pragma warning restore RECS0021 // Avisa sobre las llamadas a funciones de miembros virtuales que tienen lugar en el constructor
        Gtk.TreeViewColumn ColumnaIt = new TreeViewColumn
        {
            Title = "Numero",
            //MinWidth = 20,
            //MaxWidth = 50,

            Expand = true,
            Sizing = TreeViewColumnSizing.Fixed
        };
        Gtk.CellRendererPixbuf activeCell = new Gtk.CellRendererPixbuf();
        ColumnaIt.PackStart(activeCell, true);
        ColumnaIt.AddAttribute(activeCell, "pixbuf", 6);
        Gtk.TreeViewColumn Columnaxl = new TreeViewColumn
        {
            Title = "Xl",
            //MinWidth = 20,
            //MaxWidth = 50,

            Expand = true,
            Sizing = TreeViewColumnSizing.Fixed
        };
        Columnaxl.PackStart(activeCell, true);
        Columnaxl.AddAttribute(activeCell, "pixbuf", 6);
        Gtk.TreeViewColumn Columnaxu = new TreeViewColumn
        {
            Title = "Xu",

            Expand = true,
            Sizing = TreeViewColumnSizing.Fixed
        };
        Columnaxu.PackStart(activeCell, true);
        Columnaxu.AddAttribute(activeCell, "pixbuf", 6);
        Gtk.TreeViewColumn Columnaxr = new TreeViewColumn
        {
            Title = "Xr",

            Expand = true,
            Sizing = TreeViewColumnSizing.Fixed
        };
        Columnaxr.PackStart(activeCell, true);
        Columnaxr.AddAttribute(activeCell, "pixbuf", 6);
        Gtk.TreeViewColumn Columnaet = new TreeViewColumn
        {
            Title = "Et",

            Expand = true,
            Sizing = TreeViewColumnSizing.Fixed
        };
        Columnaet.PackStart(activeCell, true);
        Columnaet.AddAttribute(activeCell, "pixbuf", 6);
        Gtk.TreeViewColumn Columnaea = new TreeViewColumn
        {
            Title = "Ea",

            Expand = true,
            Sizing = TreeViewColumnSizing.Fixed
        };
        Columnaea.PackStart(activeCell, true);
        Columnaea.AddAttribute(activeCell, "pixbuf", 6);
        Tabla.AppendColumn(ColumnaIt);
        Tabla.AppendColumn(Columnaxl);
        Tabla.AppendColumn(Columnaxu);
        Tabla.AppendColumn(Columnaxr);
        Tabla.AppendColumn(Columnaea);
        Tabla.AppendColumn(Columnaet);
        Gtk.CellRendererText xlNameCell = new Gtk.CellRendererText();
        Columnaxl.PackStart(xlNameCell, true);
        Gtk.CellRendererText xuNameCell = new Gtk.CellRendererText();
        Columnaxu.PackStart(xuNameCell, true);
        Gtk.CellRendererText ItNameCell = new Gtk.CellRendererText();
        ColumnaIt.PackStart(ItNameCell, true);
        Gtk.CellRendererText xrNameCell = new Gtk.CellRendererText();
        Columnaxr.PackStart(xrNameCell, true);
        Gtk.CellRendererText eaNameCell = new Gtk.CellRendererText();
        Columnaea.PackStart(eaNameCell, true);
        Gtk.CellRendererText etNameCell = new Gtk.CellRendererText();
        Columnaet.PackStart(etNameCell, true);
        ColumnaIt.AddAttribute(ItNameCell, "text", 0);
        Columnaxl.AddAttribute(xlNameCell, "text", 1);
        Columnaxu.AddAttribute(xuNameCell, "text", 2);
        Columnaxr.AddAttribute(xrNameCell, "text", 3);
        Columnaea.AddAttribute(eaNameCell, "text", 4);
        Columnaet.AddAttribute(etNameCell, "text", 5);
        musicListStore = new Gtk.ListStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
        //musicListStore.AppendValues("1", "Garbage", "Dog","xxxx","x");
        Tabla.Model = musicListStore;
        this.ShowAll();
    }
コード例 #59
0
    public MainWindow(string profilePath) : base(Gtk.WindowType.Toplevel)
    {
        Build();
        notebook1.Page = 1;

        Config = GuiCompare.Config.GetConfig();

        //
        // Configure the GUI
        //
        info_manager = new InfoManager(this, profilePath);

        treeStore = new Gtk.TreeStore(typeof(string),                          // Name
                                      typeof(Gdk.Pixbuf), typeof(Gdk.Pixbuf),  // TypeIcon, StatusIcon
                                      typeof(Gdk.Pixbuf), typeof(string),      // MissingIcon, MissingText
                                      typeof(Gdk.Pixbuf), typeof(string),      // ExtraIcon, ExtraText
                                      typeof(Gdk.Pixbuf), typeof(string),      // ErrorIcon, ErrorText
                                      typeof(Gdk.Pixbuf), typeof(string),      // TodoIcon, TodoText
                                      typeof(Gdk.Pixbuf), typeof(string),      // NiexIcon, NiexText
                                      typeof(ComparisonNode), typeof(string)); // Node, Foreground

        treeFilter             = new Gtk.TreeModelFilter(treeStore, null);
        treeFilter.VisibleFunc = FilterTree;
        tree.Model             = treeFilter;

        // Create a column for the node name
        Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn();
        nameColumn.Title     = "Name";
        nameColumn.Resizable = true;

        Gtk.CellRendererText   nameCell   = new Gtk.CellRendererText();
        Gtk.CellRendererPixbuf typeCell   = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererPixbuf statusCell = new Gtk.CellRendererPixbuf();

        nameColumn.PackStart(statusCell, false);
        nameColumn.PackStart(typeCell, false);
        nameColumn.PackStart(nameCell, true);

        tree.AppendColumn(nameColumn);

        nameColumn.AddAttribute(nameCell, "text", (int)TreeCol.Name);
        nameColumn.AddAttribute(nameCell, "foreground", (int)TreeCol.Foreground);
        nameColumn.AddAttribute(typeCell, "pixbuf", (int)TreeCol.TypeIcon);
        nameColumn.AddAttribute(statusCell, "pixbuf", (int)TreeCol.StatusIcon);

        // Create a column for the status counts
        Gtk.TreeViewColumn countsColumn = new Gtk.TreeViewColumn();
        countsColumn.Title     = "Counts";
        countsColumn.Resizable = true;

        Gtk.CellRendererPixbuf missingPixbufCell = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererText   missingTextCell   = new Gtk.CellRendererText();
        Gtk.CellRendererPixbuf extraPixbufCell   = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererText   extraTextCell     = new Gtk.CellRendererText();
        Gtk.CellRendererPixbuf errorPixbufCell   = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererText   errorTextCell     = new Gtk.CellRendererText();
        Gtk.CellRendererPixbuf todoPixbufCell    = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererText   todoTextCell      = new Gtk.CellRendererText();
        Gtk.CellRendererPixbuf niexPixbufCell    = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererText   niexTextCell      = new Gtk.CellRendererText();

        countsColumn.PackStart(missingPixbufCell, false);
        countsColumn.PackStart(missingTextCell, false);
        countsColumn.PackStart(extraPixbufCell, false);
        countsColumn.PackStart(extraTextCell, false);
        countsColumn.PackStart(errorPixbufCell, false);
        countsColumn.PackStart(errorTextCell, false);
        countsColumn.PackStart(todoPixbufCell, false);
        countsColumn.PackStart(todoTextCell, false);
        countsColumn.PackStart(niexPixbufCell, false);
        countsColumn.PackStart(niexTextCell, false);

        tree.AppendColumn(countsColumn);

        countsColumn.AddAttribute(missingPixbufCell, "pixbuf", (int)TreeCol.MissingIcon);
        countsColumn.AddAttribute(missingTextCell, "text", (int)TreeCol.MissingText);
        countsColumn.AddAttribute(extraPixbufCell, "pixbuf", (int)TreeCol.ExtraIcon);
        countsColumn.AddAttribute(extraTextCell, "text", (int)TreeCol.ExtraText);
        countsColumn.AddAttribute(errorPixbufCell, "pixbuf", (int)TreeCol.ErrorIcon);
        countsColumn.AddAttribute(errorTextCell, "text", (int)TreeCol.ErrorText);
        countsColumn.AddAttribute(todoPixbufCell, "pixbuf", (int)TreeCol.TodoIcon);
        countsColumn.AddAttribute(todoTextCell, "text", (int)TreeCol.TodoText);
        countsColumn.AddAttribute(niexPixbufCell, "pixbuf", (int)TreeCol.NiexIcon);
        countsColumn.AddAttribute(niexTextCell, "text", (int)TreeCol.NiexText);

        CreateTags(AdditionalInfoText.Buffer);

        tree.Selection.Changed += delegate(object sender, EventArgs e) {
            Gtk.TreeIter iter;
            if (tree.Selection.GetSelected(out iter))
            {
                List <string>  msgs     = null;
                ComparisonNode n        = tree.Model.GetValue(iter, (int)TreeCol.Node) as ComparisonNode;
                TextBuffer     buffer   = AdditionalInfoText.Buffer;
                bool           showInfo = false;
                TextIter       textIter = TextIter.Zero;

                buffer.Clear();

                if (!String.IsNullOrEmpty(n.ExtraInfo))
                {
                    showInfo = true;
                    textIter = buffer.StartIter;

                    buffer.InsertWithTagsByName(ref textIter, "Additional information:\n", "bold");
                    InsertWithMarkup(buffer, ref textIter, "\t" + n.ExtraInfo + "\n");
                }

                if (n != null)
                {
                    msgs = n.Messages;
                }
                if (msgs != null && msgs.Count > 0)
                {
                    if (!showInfo)
                    {
                        showInfo = true;
                        textIter = buffer.StartIter;
                    }

                    buffer.InsertWithTagsByName(ref textIter, "Errors:\n", "red", "bold");

                    for (int i = 0; i < msgs.Count; i++)
                    {
                        buffer.InsertWithTagsByName(ref textIter, String.Format("\t{0}: ", i + 1), "bold");
                        InsertWithMarkup(buffer, ref textIter, msgs [i]);
                    }
                }

                if (n != null)
                {
                    msgs = n.Todos;
                }
                if (msgs != null && msgs.Count > 0)
                {
                    if (!showInfo)
                    {
                        showInfo = true;
                        textIter = buffer.StartIter;
                    }

                    buffer.InsertWithTagsByName(ref textIter, "TODO:\n", "green", "bold");
                    for (int i = 0; i < msgs.Count; i++)
                    {
                        buffer.InsertWithTagsByName(ref textIter, String.Format("\t{0}: ", i + 1), "bold");
                        buffer.Insert(ref textIter, msgs [i]);
                    }
                }

                if (showInfo)
                {
                    AdditionalInfoWindow.Visible = true;
                }
                else
                {
                    AdditionalInfoWindow.Visible = false;
                }

                string msdnUrl = n != null ? n.MSDNUrl : null;
                if (!String.IsNullOrEmpty(msdnUrl))
                {
                    Status = GetMSDNVersionedUrl(msdnUrl);
                }
                else
                {
                    Status = String.Empty;
                }
            }
        };

        tree.RowActivated += delegate(object sender, RowActivatedArgs args) {
            Gtk.TreeIter iter;
            if (!tree.Model.GetIter(out iter, args.Path))
            {
                return;
            }

            ComparisonNode n = tree.Model.GetValue(iter, (int)TreeCol.Node) as ComparisonNode;
            if (n == null || String.IsNullOrEmpty(n.MSDNUrl))
            {
                return;
            }

            System.Diagnostics.Process browser = new System.Diagnostics.Process();
            browser.StartInfo.FileName        = GetMSDNVersionedUrl(n.MSDNUrl);
            browser.StartInfo.UseShellExecute = true;
            browser.Start();
        };

        //
        // Load configuration
        //
        ShowMissing.Active = Config.ShowMissing;
        ShowErrors.Active  = Config.ShowErrors;
        ShowExtra.Active   = Config.ShowExtra;
        ShowPresent.Active = Config.ShowPresent;
        ShowTodo.Active    = Config.ShowTodo;

        //
        // Legend
        //
        legendImageOK.Pixbuf      = okPixbuf;
        legendImageError.Pixbuf   = errorPixbuf;
        legendImageNIEX.Pixbuf    = niexPixbuf;
        legendImageMissing.Pixbuf = missingPixbuf;
        legendImageTODO.Pixbuf    = todoPixbuf;
        legendImageExtra.Pixbuf   = extraPixbuf;
    }
コード例 #60
0
ファイル: EditorView.cs プロジェクト: oseledets/ApsimX
        /// <summary>
        /// Default constructor that configures the Completion form.
        /// </summary>
        public EditorView(ViewBase owner) : base(owner)
        {
            scroller   = new ScrolledWindow();
            textEditor = new MonoTextEditor();
            scroller.Add(textEditor);
            _mainWidget = scroller;
            Mono.TextEditor.TextEditorOptions options = new Mono.TextEditor.TextEditorOptions();
            options.EnableSyntaxHighlighting = true;
            options.ColorScheme                = "Visual Studio";
            options.HighlightCaretLine         = true;
            textEditor.Options                 = options;
            textEditor.TextArea.DoPopupMenu    = DoPopup;
            textEditor.Document.LineChanged   += OnTextHasChanged;
            textEditor.TextArea.FocusInEvent  += OnTextBoxEnter;
            textEditor.TextArea.FocusOutEvent += OnTextBoxLeave;
            _mainWidget.Destroyed             += _mainWidget_Destroyed;

            AddContextActionWithAccel("Cut", OnCut, "Ctrl+X");
            AddContextActionWithAccel("Copy", OnCopy, "Ctrl+C");
            AddContextActionWithAccel("Paste", OnPaste, "Ctrl+V");
            AddContextActionWithAccel("Delete", OnDelete, "Delete");
            AddContextSeparator();
            AddContextActionWithAccel("Undo", OnUndo, "Ctrl+Z");
            AddContextActionWithAccel("Redo", OnRedo, "Ctrl+Y");
            AddContextActionWithAccel("Find", OnFind, "Ctrl+F");
            AddContextActionWithAccel("Replace", OnReplace, "Ctrl+H");

            CompletionForm                 = new Window(WindowType.Toplevel);
            CompletionForm.Decorated       = false;
            CompletionForm.SkipPagerHint   = true;
            CompletionForm.SkipTaskbarHint = true;
            Frame completionFrame = new Frame();

            CompletionForm.Add(completionFrame);
            ScrolledWindow completionScroller = new ScrolledWindow();

            completionFrame.Add(completionScroller);
            completionModel = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
            CompletionView  = new TreeView(completionModel);
            completionScroller.Add(CompletionView);
            TreeViewColumn     column     = new TreeViewColumn();
            CellRendererPixbuf iconRender = new Gtk.CellRendererPixbuf();

            column.PackStart(iconRender, false);
            CellRendererText textRender = new Gtk.CellRendererText();

            textRender.Editable = false;
            column.PackStart(textRender, true);
            column.SetAttributes(iconRender, "pixbuf", 0);
            column.SetAttributes(textRender, "text", 1);
            column.Title     = "Item";
            column.Resizable = true;
            CompletionView.AppendColumn(column);
            textRender       = new CellRendererText();
            column           = new TreeViewColumn("Units", textRender, "text", 2);
            column.Resizable = true;
            CompletionView.AppendColumn(column);
            textRender       = new CellRendererText();
            column           = new TreeViewColumn("Type", textRender, "text", 3);
            column.Resizable = true;
            CompletionView.AppendColumn(column);
            textRender       = new CellRendererText();
            column           = new TreeViewColumn("Descr", textRender, "text", 4);
            column.Resizable = true;
            CompletionView.AppendColumn(column);
            functionPixbuf = new Gdk.Pixbuf(null, "ApsimNG.Resources.Function.png", 16, 16);
            propertyPixbuf = new Gdk.Pixbuf(null, "ApsimNG.Resources.Property.png", 16, 16);
            textEditor.TextArea.KeyPressEvent += OnKeyPress;
            CompletionView.HasTooltip          = true;
            CompletionView.TooltipColumn       = 5;
            CompletionForm.FocusOutEvent      += OnLeaveCompletion;
            CompletionView.ButtonPressEvent   += OnContextListMouseDoubleClick;
            CompletionView.KeyPressEvent      += OnContextListKeyDown;
            CompletionView.KeyReleaseEvent    += CompletionView_KeyReleaseEvent;
            IntelliSenseChars = ".";
        }