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;
		}
        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 ();
        }
		public GitConfigurationDialog (GitRepository repo)
		{
			this.Build ();
			this.repo = repo;
			this.HasSeparator = false;
			
			// Branches list
			
			storeBranches = new ListStore (typeof(Branch), typeof(string), typeof(string), typeof(string));
			listBranches.Model = storeBranches;
			listBranches.HeadersVisible = true;
			
			listBranches.AppendColumn (GettextCatalog.GetString ("Branch"), new CellRendererText (), "markup", 1);
			listBranches.AppendColumn (GettextCatalog.GetString ("Tracking"), new CellRendererText (), "text", 2);
			
			// Sources tree
			
			storeRemotes = new TreeStore (typeof(RemoteSource), typeof(string), typeof(string), typeof(string), typeof(string));
			treeRemotes.Model = storeRemotes;
			treeRemotes.HeadersVisible = true;
			
			treeRemotes.AppendColumn ("Remote Source / Branch", new CellRendererText (), "markup", 1);
			treeRemotes.AppendColumn ("Url", new CellRendererText (), "text", 2);
			
			// Fill data
			
			FillBranches ();
			FillRemotes ();
		}
Example #4
0
        public PackageBuilderMainPage()
        {
            this.Build();

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

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

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

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

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

            EnableDrop();
        }
Example #5
0
 public ObjectWindow(RuntimeThread runtimeThread, object root)
     : base(GetTitle(root))
 {
     SetDefaultSize(250, 300);
     SkipPagerHint = true;
     SkipTaskbarHint = true;
     
     scroller = new ScrolledWindow();
     scroller.BorderWidth = 5;
     scroller.ShadowType = ShadowType.In;
     Add(scroller);
     
     store = new TreeStore(typeof(string), typeof(object), typeof(bool));
     
     //TreeModelSort storeSort = new TreeModelSort(store);
     //storeSort.SetSortColumnId(0, SortType.Ascending);
     
     view = new TreeView(store);
     view.AppendColumn(null, new CellRendererText(), "text", VALUE_TEXT);
     view.HeadersVisible = false;
     view.RowExpanded += OnTreeRowExpanded;
     view.RowCollapsed += OnTreeRowCollapsed;
     scroller.Add(view);
     
     Add(false, new TreeIter(), "", root, false, false);
     
     TreeIter first;
     store.GetIterFirst(out first);
     view.ExpandRow(store.GetPath(first), false);
 }
Example #6
0
        public DateRangeDialog(DateRange query_range, Gtk.Window parent_window)
            : base("DateRangeDialog.ui", "date_range_dialog")
        {
            this.parent_window = parent_window;
            TransientFor = parent_window;
            DefaultResponse = ResponseType.Ok;

            (startframe.Child as Bin).Child = start_dateedit = new DateEdit ();
            start_dateedit.Show ();
            (endframe.Child as Bin).Child = end_dateedit = new DateEdit ();
            end_dateedit.Show ();

            var cell_renderer = new CellRendererText ();

            // Build the combo box with years and month names
            period_combobox.Model = rangestore = new TreeStore (typeof (string));
            period_combobox.PackStart (cell_renderer, true);

            period_combobox.SetCellDataFunc (cell_renderer, new CellLayoutDataFunc (RangeCellFunc));

            foreach (string range in ranges)
                rangestore.AppendValues (GetString(range));

            period_combobox.Changed += HandlePeriodComboboxChanged;
               	 	period_combobox.Active = System.Array.IndexOf(ranges, "last7days"); // Default to Last 7 days

            if (query_range != null) {
                start_dateedit.DateTimeOffset = query_range.Start;
                end_dateedit.DateTimeOffset = query_range.End;
            }
        }
        public HelpTree()
            : base(GettextCatalog.GetString ("Help"), Gtk.Stock.Help)
        {
            tree_view = new TreeView ();

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

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

            PopulateNode (root_iter);

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

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

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

            Control.ShowAll ();
        }
Example #8
0
        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;
        }
		public ExceptionCaughtWidget (ExceptionInfo exception)
		{
			this.Build ();

			vboxExceptionInfo.Remove (labelMessage);
			var frame = new InfoFrame (labelMessage);
			frame.Show ();
			vboxExceptionInfo.PackStart (frame, false, true, 0);

			stackStore = new TreeStore (typeof(string), typeof(string), typeof(int), typeof(int));
			treeStack.Model = stackStore;
			var crt = new CellRendererText ();
			crt.Ellipsize = Pango.EllipsizeMode.End;
			crt.WrapWidth = -1;
			treeStack.AppendColumn ("", crt, "markup", 0);
			treeStack.ShowExpanders = false;
			treeStack.RulesHint = true;
			
			valueView.AllowExpanding = true;
			valueView.Frame = DebuggingService.CurrentFrame;
			this.exception = exception;
			
			exception.Changed += HandleExceptionChanged;
			treeStack.SizeAllocated += (object o, SizeAllocatedArgs args) => crt.WrapWidth = args.Allocation.Width;
			
			Fill ();
			treeStack.RowActivated += HandleRowActivated;
		}
        public AddinLoadErrorDialog(AddinError[] errors)
        {
            XML glade = new XML (null, "MonoDevelop.Startup.glade", "addinLoadErrorDialog", null);
            glade.Autoconnect (this);

            TreeStore store = new TreeStore (typeof(string));
            errorTree.AppendColumn ("Addin", new CellRendererText (), "text", 0);
            errorTree.Model = store;

            bool fatal = false;

            foreach (AddinError err in errors) {
                string name = Path.GetFileNameWithoutExtension (err.AddinFile);
                if (err.Fatal) name += " (Fatal error)";
                TreeIter it = store.AppendValues (name);
                store.AppendValues (it, "Full Path: " + err.AddinFile);
                store.AppendValues (it, "Error: " + err.Exception.Message);
                it = store.AppendValues (it, "Exception: " + err.Exception.GetType ());
                store.AppendValues (it, err.Exception.StackTrace.ToString ());
                if (err.Fatal) fatal = true;
            }

            //			addinLoadErrorDialog.ShowAll ();

            if (fatal) {
                noButton.Hide ();
                yesButton.Hide ();
                labelContinue.Hide ();
                closeButton.Show ();
                labelFatal.Show ();
            }
        }
Example #11
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 ();
		}
Example #12
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++;
            }
        }
Example #13
0
 public ServiceScpdInfo (ServiceController service)
 {
     this.Build ();
     
     this.service = service;
     
     actionModel = new TreeStore (typeof (string));
     stateVariableModel = new TreeStore (typeof (string));
     
     foreach (var action in service.Actions) {
         var iter = actionModel.AppendValues (action.Key);
         
         foreach (var argument in action.Value.Arguments) {
             var argument_iter = actionModel.AppendValues (iter, argument.Key);
             
             actionModel.AppendValues (argument_iter, Catalog.GetString ("Direction: ") +
                 (argument.Value.Direction == ArgumentDirection.In ? "In" : "Out"));
             actionModel.AppendValues (argument_iter, Catalog.GetString ("Is Return Value: ") + argument.Value.IsReturnValue);
             actionModel.AppendValues (argument_iter, Catalog.GetString ("Related State Variable: ") + argument.Value.RelatedStateVariable);
         }
     }
     
     foreach (var stateVariable in service.StateVariables) {
         var iter = stateVariableModel.AppendValues (stateVariable.Key);
         
         stateVariableModel.AppendValues (iter, Catalog.GetString ("Data Type: ") + stateVariable.Value.DataType);
         stateVariableModel.AppendValues (iter, Catalog.GetString ("Sends Events: ") + stateVariable.Value.SendsEvents);
         stateVariableModel.AppendValues (iter, Catalog.GetString ("Is Multicast: ") + stateVariable.Value.IsMulticast);
         
         if (stateVariable.Value.DefaultValue != null) {
             stateVariableModel.AppendValues (iter, Catalog.GetString ("Default Value: ") + stateVariable.Value.DefaultValue);
         }
         
         if (stateVariable.Value.AllowedValues != null) {
             var allowed_values_iter = stateVariableModel.AppendValues (iter, Catalog.GetString ("Allowed Values"));
             foreach (var value in stateVariable.Value.AllowedValues) {
                 stateVariableModel.AppendValues (allowed_values_iter, value);
             }
         }
         
         if (stateVariable.Value.AllowedValueRange != null) {
             var allowed_value_range_iter = stateVariableModel.AppendValues (iter, Catalog.GetString ("Allowed Value Range"));
             stateVariableModel.AppendValues (allowed_value_range_iter,
                 "Minimum: " + stateVariable.Value.AllowedValueRange.Minimum);
             stateVariableModel.AppendValues (allowed_value_range_iter,
                 "Maximum: " + stateVariable.Value.AllowedValueRange.Maximum);
             if (stateVariable.Value.AllowedValueRange.Step != null) {
                 stateVariableModel.AppendValues (allowed_value_range_iter,
                     "Step: " + stateVariable.Value.AllowedValueRange.Step);
             }
         }
     }
     
     actions.AppendColumn (Catalog.GetString ("Actions"), new CellRendererText (), "text", 0);
     actions.Model = actionModel;
     actions.Selection.Changed += ActionsSelectionChanged;
     
     stateVariables.AppendColumn (Catalog.GetString ("State Variables"), new CellRendererText (), "text", 0);
     stateVariables.Model = stateVariableModel;
 }
		public CounterSelectorDialog ()
		{
			this.Build ();
			
			HasSeparator = false;
			store = new TreeStore (typeof(bool), typeof(string), typeof(CounterCategory), typeof(Counter), typeof(bool));
			treeCounters.Model = store;
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererToggle crt = new CellRendererToggle ();
			col.PackStart (crt, false);
			col.AddAttribute (crt, "active", 0);
			col.AddAttribute (crt, "visible", 4);
			
			CellRendererText crx = new CellRendererText ();
			col.PackStart (crx, true);
			col.AddAttribute (crx, "text", 1);
			treeCounters.AppendColumn (col);
			
			foreach (CounterCategory cat in App.Service.GetCategories ())
				AppendCategory (TreeIter.Zero, cat);
			
			UpdateSelectedCounters ();
			treeCounters.ExpandAll ();
			
			crt.Toggled += CrtToggled;
		}
    private TreeView InitTreeViewCollapsibleRowsWithIcon()
    {
        // Model:
        Gtk.TreeStore musicListStore = new Gtk.TreeStore (typeof(Gdk.Pixbuf), typeof(string), typeof(string));
        Gtk.TreeIter iter;

        // View:
        Gtk.TreeView tree = new Gtk.TreeView ();
        tree.AppendColumn ("Icon", new Gtk.CellRendererPixbuf (), "pixbuf", 0);
        tree.AppendColumn ("Artist", new Gtk.CellRendererText (), "text", 1);
        tree.AppendColumn ("Song", new Gtk.CellRendererText (), "text", 2);

        // Controller:
        iter = musicListStore.AppendValues (defaultIcon, "Country");
        musicListStore.AppendValues (iter, "Johnny Cash", "Ring of fire");

        iter = musicListStore.AppendValues ("Punk Rock"); // <- 'Punk Rock' will not be displayed, because column 0 is of type "pixbuf"
        musicListStore.AppendValues (iter, defaultIcon, "Iggy Pop", "The passenger");

        iter = musicListStore.AppendValues ("", defaultIcon, "BLA"); // <- 'defaultIcon' will not be displayed, because column 1 is of type "text"
        musicListStore.AppendValues (iter, defaultIcon, "Stooges", "Dog food");

        // --> MVP:
        tree.Model = musicListStore;
        return tree;
    }
        public GacReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

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

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

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

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

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

            PrintCache();
            ScrolledWindow sc = new ScrolledWindow ();
            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add (treeView);
            this.PackStart (sc, true, true, 0);
            ShowAll ();
            BorderWidth = 6;
        }
		public CombineEntryConfigurationsPanelWidget (MultiConfigItemOptionsDialog dlg)
		{
			Build ();
			
			configData = dlg.ConfigurationData;
			
			store = new TreeStore (typeof(object), typeof(string));
			configsList.Model = store;
			configsList.HeadersVisible = true;
			store.SetSortColumnId (1, SortType.Ascending);
			
			TreeViewColumn col = new TreeViewColumn ();
			CellRendererText sr = new CellRendererText ();
			col.PackStart (sr, true);
			col.AddAttribute (sr, "text", 1);
			col.Title = GettextCatalog.GetString ("Configuration");
			col.SortColumnId = 1;
			configsList.AppendColumn (col);

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

			addButton.Clicked += new EventHandler (OnAddConfiguration);
			removeButton.Clicked += new EventHandler (OnRemoveConfiguration);
			renameButton.Clicked += new EventHandler (OnRenameConfiguration);
			copyButton.Clicked += new EventHandler (OnCopyConfiguration);
		}
		public HelpTree () : base (GettextCatalog.GetString ("Help"), Gtk.Stock.Help)
		{
			tree_view = new MonoDevelop.Ide.Gui.Components.PadTreeView ();

			tree_view.AppendColumn ("name_col", tree_view.TextRenderer, "text", 0);
			tree_view.RowExpanded += new Gtk.RowExpandedHandler (RowExpanded);
			tree_view.Selection.Changed += new EventHandler (RowActivated);
			
			store = new TreeStore (typeof (string), typeof (Node));
			tree_view.Model = store;
			tree_view.HeadersVisible = false;
			
			scroller = new MonoDevelop.Components.CompactScrolledWindow ();
			scroller.ShadowType = Gtk.ShadowType.None;
			scroller.Add (tree_view);
			
			if (HelpService.HelpTree != null) {
				root_iter = store.AppendValues (GettextCatalog.GetString ("Mono Documentation"), HelpService.HelpTree);
				PopulateNode (root_iter);
	
				tree_view.ExpandRow (new TreePath ("0"), false);
				TreeIter child_iter;
			start:
				if (store.IterChildren (out child_iter, root_iter)) {
					do {
						if (!store.IterHasChild (child_iter)) {
							store.Remove (ref child_iter);
							goto start;
						}
					} while (store.IterNext (ref child_iter));
				}
			}
			Control.ShowAll ();
		}
        public ContentDirectoryInfo (RemoteContentDirectory contentDirectory)
        {
            if (contentDirectory == null) {
                throw new ArgumentNullException ("contentDirectory");
            }

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

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

            Add (objects);
        }
        public StackTracePad()
        {
            this.ShadowType = ShadowType.In;

            store = new TreeStore (typeof (string));

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

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

            Add (tree);
            ShowAll ();

            Runtime.DebuggingService.PausedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnPausedEvent));
            Runtime.DebuggingService.ResumedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnResumedEvent));
            Runtime.DebuggingService.StoppedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (OnStoppedEvent));
        }
            public CombineConfigurationPanelWidget(IProperties CustomizationObject)
                : base("Base.glade", "CombineConfigurationsPanel")
            {
                configuration = (CombineConfiguration)((IProperties)CustomizationObject).GetProperty("Config");

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

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

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

                foreach (CombineConfigurationEntry ce in configuration.Entries)
                    store.AppendValues (ce, ce.Entry.Name, ce.Build, ce.ConfigurationName);
            }
		public MergeDialog (GitRepository repo, bool rebasing)
		{
			this.Build ();

			this.UseNativeContextMenus ();

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

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

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

			tree.Selection.Changed += HandleTreeSelectionChanged;

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

			checkStage.Active = true;

			Fill ();
		}
		public ExceptionCaughtWidget (ExceptionInfo exception)
		{
			this.Build ();

			stackStore = new TreeStore (typeof(string), typeof(string), typeof(int), typeof(int));
			treeStack.Model = stackStore;
			var crt = new CellRendererText ();
			crt.WrapWidth = 200;
			crt.WrapMode = Pango.WrapMode.WordChar;
			treeStack.AppendColumn ("", crt, "markup", 0);
			treeStack.ShowExpanders = false;
			
			valueView.AllowExpanding = true;
			valueView.Frame = DebuggingService.CurrentFrame;
			this.exception = exception;
			
			exception.Changed += HandleExceptionChanged;
			treeStack.SizeAllocated += delegate(object o, SizeAllocatedArgs args) {
				if (crt.WrapWidth != args.Allocation.Width)
					crt.WrapWidth = args.Allocation.Width;
			};
			
			Fill ();
			treeStack.RowActivated += HandleRowActivated;
		}
        public ProjectSelectorWidget()
        {
            this.Build();

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

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

            tree.Selection.Changed += HandleTreeSelectionChanged;
        }
Example #25
0
        public PeopleTreeView()
        {
            Selection.Mode = SelectionMode.Single;
            HeadersVisible = false;

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

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

            complete_column = new TreeViewColumn();

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

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

            AppendColumn(complete_column);

            RefreshPeopleTreeStore ();

            //TODO If have time - add people search.
        }
Example #26
0
 public GrammarWindow(RuntimeThread runtimeThread) : base("Grammar")
 {
     runtimeThread.Runtime.Grammar.Trace.PatternDefinedEvent += OnGrammarPatternDefined;
     runtimeThread.Runtime.Grammar.Trace.PatternChangedEvent += OnGrammarPatternChanged;
     
     SetDefaultSize(250, 300);
     SkipPagerHint = true;
     SkipTaskbarHint = true;
     
     scroller = new ScrolledWindow();
     scroller.BorderWidth = 5;
     scroller.ShadowType = ShadowType.In;
     Add(scroller);
     
     store = new TreeStore(typeof(string), typeof(Source));
     
     // FIXME - only want to sort top level
     
     //TreeModelSort storeSort = new TreeModelSort(store);
     //storeSort.SetSortColumnId(0, SortType.Ascending);
     
     view = new TreeView(store);
     
     view.AppendColumn(null, new CellRendererText(), "text", VALUE_TEXT);
     view.HeadersVisible = false;
     view.RowActivated += OnTreeRowActivated;
     view.ButtonPressEvent += OnTreeButtonPress;
     scroller.Add(view);
     
     MenuBuilder menuBuilder = new MenuBuilder();
     menu = menuBuilder.StartMenu();
     menuBuilder.Add("Show source", OnMenuShowSource);
     menuBuilder.Add("Show object", OnMenuShowObject);
     menu.ShowAll();
 }
Example #27
0
        private void BuildMediaTypeCombo ()
        {
            var store = media_type_store = new TreeStore (typeof (IA.MediaType), typeof (string));
            var combo = media_type_combo = new ComboBox ();
            combo.Model = store;

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

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

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

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

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

            PackStart (new Label (Catalog.GetString ("Collection:")), false, false, 0);
            PackStart (combo, false, false, 0);
        }
Example #28
0
        private void build()
        {
            this.vbox1 = new VBox();

            this.toolbar1 = new Toolbar();
            this.aboutbtn1 = new ToolButton(Stock.About);
            this.aboutbtn1.Label = "About";
            this.aboutbtn1.IsImportant = true;
            this.toolbar1.ToolbarStyle = ToolbarStyle.BothHoriz;
            this.toolbar1.Add(this.aboutbtn1);
            this.vbox1.PackStart(this.toolbar1, false, true, 0);

            this.treestore1 = this.populateTreeStoreFromSession();
            this.scrollw1 = new ScrolledWindow();
            this.hpaned1 = new HPaned();
            this.treeview1 = new TreeView(this.treestore1);
            this.treeview1.HeadersVisible = true;
            this.treeview1.AppendColumn("Session", new CellRendererText(), "text", 0);
            this.treeview1.AppendColumn("Name", new CellRendererText(), "text", 1);
            this.treeview1.ExpandAll();
            this.scrollw1.Add(this.treeview1);
            this.iconview1 = new IconView();
            this.hpaned1.Add1(this.scrollw1);
            this.hpaned1.Add2(this.iconview1);
            this.hpaned1.Position = 254;
            this.vbox1.PackStart(this.hpaned1, true, true, 0);

            this.statusbar1 = new Statusbar();
            this.vbox1.PackEnd(this.statusbar1, false, true, 0);

            this.Add(this.vbox1);
            this.SetSizeRequest(800,600);

            this.DeleteEvent += HandleDeleteEvent;
        }
Example #29
0
		public NewCounter()
		{
			this.Build();
			cats = PerformanceCounterCategory.GetCategories ();
			for (int i = 0; i < cats.Length; ++i) {
				categories.AppendText (cats [i].CategoryName);
			}
			CellRendererText renderer = new CellRendererText ();
			counters.AppendColumn ("Name", renderer, "text", 0);
			CellRendererText renderer2 = new CellRendererText ();
			instances.AppendColumn ("Instance", renderer2, "text", 0);
			counters_store = new TreeStore (typeof (string));
			instances_store = new TreeStore (typeof (string));
			counters.Model = counters_store;
			instances.Model = instances_store;
			counters.Selection.Changed += delegate {
				TreeSelection ts = counters.Selection;
				TreeIter iter;
				TreeModel mod;
				if (ts.GetSelected (out mod, out iter)) {
					counter = mod.GetValue (iter, 0) as string;
				}
			};
			instances.Selection.Changed += delegate {
				TreeSelection ts = instances.Selection;
				TreeIter iter;
				TreeModel mod;
				if (ts.GetSelected (out mod, out iter)) {
					instance = mod.GetValue (iter, 0) as string;
				}
			};
			if (cats.Length > 0)
				categories.Active = 0;
		}
		void CreateFolderTreeViewColumns ()
		{
			folderTreeStore = new TreeStore (typeof(string), typeof(string), typeof (Xwt.Drawing.Image));
			folderTreeView.Model = folderTreeStore;
			folderTreeView.Selection.SelectFunction = TreeViewSelection;
			folderTreeView.ShowExpanders = false;
			folderTreeView.LevelIndentation = 10;
			folderTreeView.CanFocus = false;

			SemanticModelAttribute modelAttr = new SemanticModelAttribute ("folderTreeStore__IconId", "folderTreeStore__NodeName", "folderTreeStore__Image");
			TypeDescriptor.AddAttributes (folderTreeStore, modelAttr);

			var column = new TreeViewColumn ();
			var iconRenderer = new CellRendererImage ();
			column.PackStart (iconRenderer, false);
			column.AddAttribute (iconRenderer, "stock-id", column: 0);
			column.AddAttribute (iconRenderer, "image", ImageColumn);

			var textRenderer = new CellRendererText ();
			textRenderer.Ellipsize = Pango.EllipsizeMode.Middle;
			column.PackStart (textRenderer, true);
			column.AddAttribute (textRenderer, "markup", TextColumn);

			folderTreeView.AppendColumn (column);
		}
Example #31
0
 public static int CountRows(Gtk.TreeStore ts)
 {
     return(ts.IterNChildren());
 }
Example #32
0
    public bool ChooseStat()
    {
        if (statisticType == Constants.TypeSessionSummary)
        {
            int    jumperID   = -1;        //all jumpers
            string jumperName = "";        //all jumpers
            if (graph)
            {
                myStat = new GraphGlobal(myStatTypeStruct, jumperID, jumperName);
            }
            else
            {
                myStat = new StatGlobal(myStatTypeStruct, treeview_stats, jumperID, jumperName);
            }
        }
        else if (statisticType == Constants.TypeJumperSummary)
        {
            if (statisticApplyTo.Length == 0)
            {
                LogB.Information("Jumper-ret");
                return(false);
            }
            int jumperID = Util.FetchID(statisticApplyTo);
            if (jumperID == -1)
            {
                return(false);
            }

            string jumperName = Util.FetchName(statisticApplyTo);
            if (graph)
            {
                myStat = new GraphGlobal(myStatTypeStruct, jumperID, jumperName);
            }
            else
            {
                myStat = new StatGlobal(myStatTypeStruct, treeview_stats,
                                        jumperID, jumperName);
            }
        }
        else if (statisticType == Constants.TypeJumpsSimple)
        {
            if (statisticApplyTo.Length == 0)
            {
                LogB.Information("Simple-ret");
                return(false);
            }

            if (statisticSubType != Catalog.GetString("No indexes"))
            {
                string indexType = "";
                if (statisticSubType == Catalog.GetString(Constants.SubtractionBetweenTests))
                {
                    indexType = "subtraction";
                }
                else if (statisticSubType == Constants.ChronojumpProfile)
                {
                    indexType = "ChronojumpProfile";
                }
                else if (statisticSubType == Constants.IeIndexFormula)
                {
                    indexType = "IE";
                }
                else if (statisticSubType == Constants.ArmsUseIndexFormula)
                {
                    indexType = "Arms Use Index";
                }
                else if (statisticSubType == Constants.IRnaIndexFormula)
                {
                    indexType = "IRna";
                }
                else if (statisticSubType == Constants.IRaIndexFormula)
                {
                    indexType = "IRa";
                }
                else if (statisticSubType == Constants.FvIndexFormula)
                {
                    indexType = "F/V";
                }
                else if (
                    statisticSubType == Constants.PotencyLewisFormulaShort ||
                    statisticSubType == Constants.PotencyHarmanFormulaShort ||
                    statisticSubType == Constants.PotencySayersSJFormulaShort ||
                    statisticSubType == Constants.PotencySayersCMJFormulaShort ||
                    statisticSubType == Constants.PotencyShettyFormulaShort ||
                    statisticSubType == Constants.PotencyCanavanFormulaShort ||
                    //statisticSubType == Constants.PotencyBahamondeFormula ||
                    statisticSubType == Constants.PotencyLaraMaleApplicantsSCFormulaShort ||
                    statisticSubType == Constants.PotencyLaraFemaleEliteVoleiFormulaShort ||
                    statisticSubType == Constants.PotencyLaraFemaleMediumVoleiFormulaShort ||
                    statisticSubType == Constants.PotencyLaraFemaleSCStudentsFormulaShort ||
                    statisticSubType == Constants.PotencyLaraFemaleSedentaryFormulaShort
                    )
                {
                    indexType = statisticSubType;
                }

                if (indexType == "subtraction")
                {
                    if (graph)
                    {
                        myStat = new GraphJumpSimpleSubtraction(myStatTypeStruct);
                    }
                    else
                    {
                        myStat = new StatJumpSimpleSubtraction(myStatTypeStruct, treeview_stats);
                    }
                }
                else if (indexType == "ChronojumpProfile")
                {
                    if (graph)
                    {
                        //myStat = new GraphChronojumpProfile(myStatTypeStruct);
                        LogB.Warning("TODO");
                    }
                    else
                    {
                        myStat = new StatChronojumpProfile(myStatTypeStruct, treeview_stats);
                    }
                }
                else if (indexType == "IE" || indexType == Constants.ArmsUseIndexName ||
                         indexType == "IRna" || indexType == "IRa")
                {
                    if (graph)
                    {
                        myStat = new GraphJumpIndexes(myStatTypeStruct, indexType);
                    }
                    else
                    {
                        myStat = new StatJumpIndexes(myStatTypeStruct, treeview_stats, indexType);
                    }
                }
                else if (indexType == "F/V")
                {
                    if (graph)
                    {
                        myStat = new GraphFv(myStatTypeStruct, indexType);
                    }
                    else
                    {
                        myStat = new StatFv(myStatTypeStruct, treeview_stats, indexType);
                    }
                }
                else
                {
                    //indexType = (Potency sayers or lewis);
                    if (graph)
                    {
                        myStat = new GraphPotency(myStatTypeStruct, indexType);
                    }
                    else
                    {
                        myStat = new StatPotency(myStatTypeStruct, treeview_stats, indexType);
                    }
                }
            }
            else
            {
                JumpType myType = new JumpType(statisticApplyTo);

                //manage all weight jumps and the AllJumpsName (simple)
                if (myType.HasWeight ||
                    statisticApplyTo == Constants.AllJumpsName)
                {
                    if (graph)
                    {
                        myStat = new GraphSjCmjAbkPlus(myStatTypeStruct);
                    }
                    else
                    {
                        myStat = new StatSjCmjAbkPlus(myStatTypeStruct, treeview_stats);
                    }
                }
                else
                {
                    if (graph)
                    {
                        myStat = new GraphSjCmjAbk(myStatTypeStruct);
                    }
                    else
                    {
                        myStat = new StatSjCmjAbk(myStatTypeStruct, treeview_stats);
                    }
                }
            }
        }
        else if (statisticType == Constants.TypeJumpsSimpleWithTC)
        {
            if (statisticApplyTo.Length == 0)
            {
                LogB.Information("WithTC-ret");
                return(false);
            }

            if (statisticSubType == Constants.DjIndexFormula)
            {
                if (graph)
                {
                    myStat = new GraphDjIndex(myStatTypeStruct);
                }
                //heightPreferred is not used, check this
                else
                {
                    myStat = new StatDjIndex(myStatTypeStruct, treeview_stats);
                }
                //heightPreferred is not used, check this
            }
            else if (statisticSubType == Constants.QIndexFormula)
            {
                if (graph)
                {
                    myStat = new GraphDjQ(myStatTypeStruct);
                }
                //heightPreferred is not used, check this
                else
                {
                    myStat = new StatDjQ(myStatTypeStruct, treeview_stats);
                }
                //heightPreferred is not used, check this
            }
            else if (statisticSubType == Constants.DjPowerFormula)
            {
                if (graph)
                {
                    myStat = new GraphDjPower(myStatTypeStruct);
                }
                //heightPreferred is not used, check this
                else
                {
                    myStat = new StatDjPower(myStatTypeStruct, treeview_stats);
                }
                //heightPreferred is not used, check this
            }
        }
        else if (statisticType == Constants.TypeJumpsReactive)
        {
            if (statisticSubType == Catalog.GetString("Average Index"))
            {
                if (graph)
                {
                    myStat = new GraphRjIndex(myStatTypeStruct);
                }
                else
                {
                    myStat = new StatRjIndex(myStatTypeStruct, treeview_stats);
                }
            }
            else if (statisticSubType == Constants.RJPotencyBoscoFormula)
            {
                if (graph)
                {
                    myStat = new GraphRjPotencyBosco(myStatTypeStruct);
                }
                else
                {
                    myStat = new StatRjPotencyBosco(myStatTypeStruct, treeview_stats);
                }
            }
            else if (statisticSubType == Catalog.GetString("Evolution"))
            {
                if (graph)
                {
                    myStat = new GraphRjEvolution(myStatTypeStruct, evolution_mark_consecutives);
                }
                else
                {
                    myStat = new StatRjEvolution(myStatTypeStruct, evolution_mark_consecutives, treeview_stats);
                }
            }
            else if (statisticSubType == Constants.RJAVGSDRjIndexName)
            {
                if (graph)
                {
                    myStat = new GraphRjAVGSD(myStatTypeStruct, Constants.RjIndexName);
                }
                else
                {
                    myStat = new StatRjAVGSD(myStatTypeStruct, treeview_stats, Constants.RjIndexName);
                }
            }
            else if (statisticSubType == Constants.RJAVGSDQIndexName)
            {
                if (graph)
                {
                    myStat = new GraphRjAVGSD(myStatTypeStruct, Constants.QIndexName);
                }
                else
                {
                    myStat = new StatRjAVGSD(myStatTypeStruct, treeview_stats, Constants.QIndexName);
                }
            }
        }
        else if (statisticType == Constants.TypeRunsSimple)
        {
            if (statisticApplyTo.Length == 0)
            {
                LogB.Information("Simple-ret");
                return(false);
            }

            if (graph)
            {
                myStat = new GraphRunSimple(myStatTypeStruct);
            }
            else
            {
                myStat = new StatRunSimple(myStatTypeStruct, treeview_stats);
            }
        }
        else if (statisticType == Constants.TypeRunsIntervallic)
        {
            if (statisticApplyTo.Length == 0)
            {
                LogB.Information("Simple-ret");
                return(false);
            }

            if (graph)
            {
                myStat = new GraphRunIntervallic(myStatTypeStruct, evolution_mark_consecutives);
            }
            else
            {
                myStat = new StatRunIntervallic(myStatTypeStruct,
                                                evolution_mark_consecutives, treeview_stats);
            }
        }

        myStat.FakeButtonRowCheckedUnchecked.Clicked +=
            new EventHandler(on_fake_button_row_checked_clicked);
        myStat.FakeButtonRowsSelected.Clicked +=
            new EventHandler(on_fake_button_rows_selected_clicked);
        myStat.FakeButtonNoRowsSelected.Clicked +=
            new EventHandler(on_fake_button_no_rows_selected_clicked);

        myStat.PrepareData();

        if (toReport)
        {
            if (graph)
            {
                bool notEmpty = myStat.CreateGraphR(fileName, false, statCount);                 //dont' show
                if (notEmpty)
                {
                    linkImage(fileName);
                }
            }
            else
            {
                writer.WriteLine(myStat.ReportString());
            }
        }
        else
        {
            if (graph)
            {
                //myStat.CreateGraph();
                myStat.CreateGraphR(Constants.FileNameRGraph, true, -1);                 //show
            }
        }


        //if we just made a graph, store is not made,
        //and we cannot change the Male/female visualizations in the combo
        //with this we can assign a store to the graph (we assign the store of the last stat (not graph)
        if (!toReport)
        {
            if (!graph)
            {
                lastStore = myStat.Store;
            }
            else
            {
                myStat.Store      = lastStore;
                myStat.MarkedRows = markedRows;
            }
        }

        return(true);
    }
        public void Initialize(IPadWindow window)
        {
            // Toolbar and menu definitions

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

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

            CommandEntrySet toolbarSet = new CommandEntrySet();

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

            // The breakpoint list

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

            tree                = new BreakpointsTreeView(this);
            tree.Model          = store;
            tree.RulesHint      = true;
            tree.HeadersVisible = true;

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

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

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

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

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

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

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

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

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

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

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

            control = sw;

            control.ShowAll();

            bps = DebuggingService.Breakpoints;

            UpdateDisplay();

            tree.PopupMenu += new PopupMenuHandler(OnPopupMenu);

            breakpointUpdatedHandler = DispatchService.GuiDispatch(new EventHandler <BreakpointEventArgs> (OnBreakpointUpdated));

            DebuggingService.Breakpoints.BreakpointAdded   += OnBpAdded;
            DebuggingService.Breakpoints.BreakpointRemoved += OnBpRemoved;
            DebuggingService.Breakpoints.Changed           += OnBpChanged;
            DebuggingService.Breakpoints.BreakpointUpdated += breakpointUpdatedHandler;

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

            tree.RowActivated += OnRowActivated;

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

            toolbar.Add(toolbarSet, sw);
            toolbar.ShowAll();
        }
Example #34
0
 public static bool TreeviewSelectFirstRow(Gtk.TreeView tv, Gtk.TreeStore store, bool scrollToRow)
 {
     return(treeviewSelectRow(tv, store, 0, scrollToRow));
 }
 protected abstract TabContent GenerateTabContent(Gtk.TreeStore treeContent);
Example #36
0
        private void ShowAdd2Page()
        {
            Header = CmisSync.Properties_Resources.ResourceManager.GetString("Which", CultureInfo.CurrentCulture);

            VBox layout_vertical = new VBox(false, 12);

            Button cancel_button = new Button(cancelText);

            cancel_button.Clicked += delegate {
                Controller.PageCancelled();
            };

            Button continue_button = new Button(continueText)
            {
                Sensitive = false
            };

            continue_button.Clicked += delegate {
                Controller.Add2PageCompleted(
                    Controller.saved_repository, Controller.saved_remote_path);
            };

            Button back_button = new Button(backText)
            {
                Sensitive = true
            };

            back_button.Clicked += delegate {
                Controller.BackToPage1();
            };

            TreeStore repoStore = new Gtk.TreeStore(typeof(string), typeof(SelectionTreeItem));
            TreeIter  iter;

            foreach (KeyValuePair <String, String> repository in Controller.repositories)
            {
                iter = repoStore.AppendNode();
                repoStore.SetValues(iter, repository.Value, new SelectionTreeItem(repository.Key, "/"));
            }
            Gtk.TreeView treeView = new Gtk.TreeView(repoStore);
            treeView.HeadersVisible = false;
            treeView.Selection.Mode = SelectionMode.Single;
            treeView.AppendColumn("Name", new CellRendererText(), "text", 0);
            treeView.CursorChanged += delegate(object o, EventArgs args) {
                TreeSelection selection = (o as TreeView).Selection;
                TreeModel     model;
                if (selection.GetSelected(out model, out iter))
                {
                    SelectionTreeItem sti = model.GetValue(iter, 1) as SelectionTreeItem;

                    // Identify the selected remote path.
                    Controller.saved_remote_path = sti.fullPath;

                    // Identify the selected repository.
                    TreeIter cnode = iter;
                    TreeIter pnode = iter;
                    while (model.IterParent(out pnode, cnode))
                    {
                        cnode = pnode;
                    }
                    Controller.saved_repository = (model.GetValue(cnode, 1) as SelectionTreeItem).repository;

                    // Load sub-folders if it has not been done already.
                    // We use each item's Tag to store metadata: whether this item's subfolders have been loaded or not.
                    if (sti.childrenLoaded == false)
                    {
                        this.GdkWindow.Cursor = wait_cursor;

                        // Get list of subfolders asynchronously
                        GetSubfoldersDelegate dlgt = new GetSubfoldersDelegate(CmisUtils.GetSubfolders);
                        IAsyncResult          ar   = dlgt.BeginInvoke(Controller.saved_repository,
                                                                      Controller.saved_remote_path, Controller.saved_address,
                                                                      Controller.saved_user, Controller.saved_password, null, null);
                        while (!ar.AsyncWaitHandle.WaitOne(100))
                        {
                            while (Application.EventsPending())
                            {
                                Application.RunIteration();
                            }
                        }
                        string[] subfolders = dlgt.EndInvoke(ar);

                        TreePath tp = null;
                        // Create a sub-item for each subfolder
                        foreach (string subfolder in subfolders)
                        {
                            TreeIter newchild = repoStore.AppendNode(iter);
                            repoStore.SetValues(newchild, System.IO.Path.GetFileName(subfolder),
                                                new SelectionTreeItem(null, subfolder));
                            if (null == tp)
                            {
                                tp = repoStore.GetPath(newchild);
                            }
                        }
                        sti.childrenLoaded = true;
                        if (null != tp)
                        {
                            treeView.ExpandToPath(tp);
                        }
                        this.GdkWindow.Cursor = default_cursor;
                    }
                    continue_button.Sensitive = true;
                }
            };

            ScrolledWindow sw = new ScrolledWindow()
            {
                ShadowType = Gtk.ShadowType.In
            };

            sw.Add(treeView);

            layout_vertical.PackStart(new Label(""), false, false, 0);
            layout_vertical.PackStart(sw, true, true, 0);
            Add(layout_vertical);
            AddButton(back_button);
            AddButton(continue_button);
            AddButton(cancel_button);
        }