public WebDeployOptionsPanelWidget(AspNetAppProject project)
        {
            localCollection = project.WebDeployTargets.Clone();

            //fill model and set it up
            this.Build();
            foreach (WebDeployTarget target in localCollection)
            {
                targetList.AppendValues(target.GetMarkup(), target);
            }
            targetView.HeadersVisible = false;
            targetList.SetSortFunc(LISTCOL_TEXT, delegate(TreeModel m, TreeIter a, TreeIter b)
            {
                return(string.Compare((string)m.GetValue(a, LISTCOL_TEXT), (string)m.GetValue(b, LISTCOL_TEXT)));
            });
            targetList.SetSortColumnId(LISTCOL_TEXT, SortType.Ascending);

            //set up the view
            targetView.Model = targetList;
            targetView.AppendColumn("", new Gtk.CellRendererText(), "markup", LISTCOL_TEXT);
            targetView.Selection.Changed += delegate(object sender, EventArgs e)
            {
                UpdateButtonState();
            };

            UpdateButtonState();
        }
Beispiel #2
0
        public WebDeployLaunchDialog(AspNetAppProject project)
        {
            this.Build();

            this.project = project;

            //set up the sort order
            targetStore.SetSortFunc(LISTCOL_Text, delegate(TreeModel m, TreeIter a, TreeIter b) {
                return(string.Compare((string)m.GetValue(a, LISTCOL_Text), (string)m.GetValue(b, LISTCOL_Text)));
            });
            targetStore.SetSortColumnId(LISTCOL_Text, SortType.Ascending);

            //set up the view
            targetView.Model          = targetStore;
            targetView.HeadersVisible = false;

            CellRendererToggle toggleRenderer = new CellRendererToggle();

            toggleRenderer.Activatable = true;
            toggleRenderer.Xpad        = 6;
            TreeViewColumn checkCol = new TreeViewColumn("", toggleRenderer, "active", LISTCOL_Checked);

            checkCol.Expand = false;
            targetView.AppendColumn(checkCol);
            toggleRenderer.Toggled += HandleToggle;

            CellRendererText textRenderer = new CellRendererText();

            textRenderer.WrapMode = Pango.WrapMode.WordChar;
            targetView.AppendColumn("", textRenderer, "markup", LISTCOL_Text);

            fillStore();
        }
		public SortFuncListViewDialog ()
		{
			Title = "Gtk Sort Func List View Box Dialog";
			WidthRequest = 500;
			HeightRequest = 400;

			var vbox = new HBox ();
			VBox.PackStart (vbox);

			listView = new TreeView ();
			listView.HeadersVisible = false;
			vbox.PackStart (listView);

			listStore = new ListStore (typeof(SortedListViewItem));
			listView.Model = listStore;

//			listStore.SetSortFunc (0,
//				(model, a, b) => string.Compare (GetItem (a).Id, GetItem (b).Id, StringComparison.Ordinal));
			listStore.SetSortFunc (0, SortListItems);

			listStore.SetSortColumnId (0, SortType.Ascending);

//			var textRenderer = new CellRendererText ();
//			listView.AppendColumn ("id", textRenderer,
//				(TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) => {
//					((CellRendererText)cell).Text = GetItem (iter).Id;
//				}
//			);

			AddItems ();

			ShowAll ();
		}
Beispiel #4
0
        public RestoreBackupDialog(Gtk.Window parent)
            : base("Saves", parent)
        {
            this.IconName = "document-revert";

            XML gxml = new XML(null, "MultiMC.GTKGUI.RestoreBackupDialog.glade", "restoreRoot", null);
            gxml.Toplevel = this;
            gxml.Autoconnect(this);

            this.VBox.PackStart(restoreRoot);

            this.WidthRequest = 620;
            this.HeightRequest = 380;

            // set default button states
            btnCancel.Sensitive = true;
            btnOK.Sensitive = false;

            // FIXME: store date/time properly so ordering works.
            backupsStore = new ListStore(typeof(string), typeof(DateTime), typeof(string), typeof(string));
            restoreView.Model = backupsStore;
            restoreView.AppendColumn("Backup name", new CellRendererText(), "text", 0);
            restoreView.AppendColumn("Date", new CellRendererText(), new TreeCellDataFunc(DateTimeCell));
            restoreView.AppendColumn("Hash", new CellRendererText(), "text", 2);
            restoreView.Selection.Mode = SelectionMode.Single;

            // this binds view and model columns together for sorting
            restoreView.Columns[0].SortColumnId = 0;
            restoreView.Columns[1].SortColumnId = 1;
            restoreView.Columns[2].SortColumnId = 2;
            // the date column needs a custom sorting function that can compare DateTime objects
            backupsStore.SetSortFunc(1,new TreeIterCompareFunc(DateTimeTreeIterCompareFunc));
            backupsStore.SetSortColumnId(1,SortType.Ascending); // sort by date
            restoreView.Selection.Changed += (sender, e) =>
            {
                if(restoreView.Selection.CountSelectedRows() != 0)
                {
                    btnOK.Sensitive = true;
                    TreeIter iter;
                    restoreView.Selection.GetSelected(out iter);
                    currentHash = backupsStore.GetValue(iter,3) as string;
                }
                else
                {
                    btnOK.Sensitive = false;
                }
            };
            ShowAll();
        }
		public SortedTableListStore (TableSchemaCollection tables)
		{
			if (tables == null)
				throw new ArgumentNullException ("tables");
			
			this.tables = tables;
			
			store = new ListStore (typeof (bool), typeof (string), typeof (TableSchema));
			store.SetSortColumnId (ColNameIndex, SortType.Ascending);
			store.SetSortFunc (ColNameIndex, new TreeIterCompareFunc (SortName));
			
			foreach (TableSchema table in tables)
				AddTable (table);
			
			tables.ItemAdded += new SortedCollectionItemEventHandler<TableSchema> (OnTableAdded);
			tables.ItemRemoved += new SortedCollectionItemEventHandler<TableSchema> (OnTableRemoved);
		}
		public SortedColumnListStore (ColumnSchemaCollection columns)
		{
			if (columns == null)
				throw new ArgumentNullException ("columns");
			
			this.columns = columns;
			
			store = new ListStore (typeof (bool), typeof (string), typeof (ColumnSchema));
			store.SetSortColumnId (ColNameIndex, SortType.Ascending);
			store.SetSortFunc (ColNameIndex, new TreeIterCompareFunc (SortName));
			
			foreach (ColumnSchema col in columns)
				AddColumn (col);
			
			columns.ItemAdded += new SortedCollectionItemEventHandler<ColumnSchema> (OnColumnAdded);
			columns.ItemRemoved += new SortedCollectionItemEventHandler<ColumnSchema> (OnColumnRemoved);
		}
Beispiel #7
0
        public void AddColumnDateTime(string title, string format, int sortid, int col)
        {
            store.SetSortFunc(col, new TreeIterCompareFunc(DateTimeTreeIterCompareFunc));

            column                  = new TreeViewColumn();
            datetimerenderer        = new CellRendererDateTime();
            datetimerenderer.Format = format == null ? "G" : format;
            column.Title            = title;
            column.SortColumnId     = sortid;
            column.Sizing           = TreeViewColumnSizing.Autosize;
            column.Reorderable      = true;
            column.Resizable        = true;
            column.Expand           = false;
            column.Alignment        = 0.0f;
            column.PackStart(datetimerenderer, true);
            column.SetCellDataFunc(datetimerenderer, new TreeCellDataFunc(DateTimeColumnDataHandler));
            tree.AppendColumn(column);
        }
        public PatternEditorWidget()
        {
            this.Build();

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

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

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

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

            PatternListStore.SetSortColumnId(0, SortType.Ascending);

            treeviewPatterns.Model = PatternListStore;

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

            blinkstickemulatorwidget1.EmulatedDevice = BlinkStickDeviceEnum.BlinkStick;

            UpdateButtons();
        }
		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;
		}
        public GacReferencePanel (SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

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

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

            treeView.AppendColumn (firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn ();
            secondColumn.Title = GettextCatalog.GetString ("Assembly");
            CellRendererPixbuf crp = new CellRendererPixbuf ();
            secondColumn.PackStart (crp, false);
            crp.StockId = "md-package";

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

            treeView.AppendColumn (secondColumn);

            treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 1);
            treeView.AppendColumn (GettextCatalog.GetString ("Package"), new CellRendererText (), "text", 5);

            treeView.Columns[1].Resizable = true;

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

            ScrolledWindow sc = new ScrolledWindow ();
            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add (treeView);
            this.PackStart (sc, true, true, 0);
            ShowAll ();
            BorderWidth = 6;
        }
        public OpenTaskView()
        {
            store = new Gtk.ListStore (
                typeof (Gdk.Pixbuf), // image
                typeof (int),        // line
                typeof (string),     // desc
                typeof (string),     // file
                typeof (string),     // path
                typeof (Task),       // task
                typeof (bool),       // read?
                typeof (bool),       // marked?
                typeof (int));       // read? -- use Pango weight

            TreeIterCompareFunc sortFunc = new TreeIterCompareFunc (TaskSortFunc);
            store.SetSortFunc (COL_TASK, sortFunc);
            store.DefaultSortFunc = sortFunc;
            store.SetSortColumnId (COL_TASK, SortType.Ascending);

            view = new Gtk.TreeView (store);
            view.RulesHint = true;
            view.PopupMenu += new PopupMenuHandler (OnPopupMenu);
            view.ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressed);
            view.HeadersClickable = true;
            AddColumns ();

            sw = new Gtk.ScrolledWindow ();
            sw.ShadowType = ShadowType.In;
            sw.Add (view);

            Runtime.TaskService.TasksChanged     += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (ShowResults));
            Runtime.TaskService.TaskAdded        += (TaskEventHandler) Runtime.DispatchService.GuiDispatch (new TaskEventHandler (TaskAdded));
            Runtime.ProjectService.EndBuild      += (ProjectCompileEventHandler) Runtime.DispatchService.GuiDispatch (new ProjectCompileEventHandler (SelectTaskView));
            Runtime.ProjectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineOpen));
            Runtime.ProjectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineClosed));
            view.RowActivated            += new RowActivatedHandler (OnRowActivated);
            Control.ShowAll ();
        }
Beispiel #12
0
 private iFolderData()
 {
     simiasManager = Util.GetSimiasManager();
        try
        {
     Debug.PrintLine(String.Format("Url = {0}", simiasManager.WebServiceUri));
     ifws = new iFolderWebService();
     ifws.Url =
      simiasManager.WebServiceUri.ToString() +
      "/iFolder.asmx";
     LocalService.Start(ifws, simiasManager.WebServiceUri, simiasManager.DataPath);
        }
        catch(Exception e)
        {
     ifws = null;
     throw new Exception("Unable to create ifolder web service");
        }
        try
        {
     simws = new SimiasWebService();
     simws.Url =
      simiasManager.WebServiceUri.ToString() +
      "/Simias.asmx";
     LocalService.Start(simws, simiasManager.WebServiceUri, simiasManager.DataPath);
        }
        catch(Exception e)
        {
     simws = null;
     throw new Exception("Unable to create simias web service");
        }
        domainController = DomainController.GetDomainController();
        iFolderListStore = new ListStore(typeof(iFolderHolder));
        iFolderListStore.SetSortFunc(
     0,
     new TreeIterCompareFunc(TreeModelSortFunction));
        iFolderListStore.SetSortColumnId(0, SortType.Ascending);
        ifolderIters = new Hashtable();
        deletediFolders = new Hashtable();
        if (domainController != null)
        {
     domainController.DomainAdded +=
      new DomainAddedEventHandler(OnDomainAddedEvent);
     domainController.DomainDeleted +=
      new DomainDeletedEventHandler(OnDomainDeletedEvent);
     domainController.DomainLoggedOut +=
      new DomainLoggedOutEventHandler(OnDomainLoggedOutEvent);
        }
        eventBroker = SimiasEventBroker.GetSimiasEventBroker();
        if (eventBroker != null)
        {
     eventBroker.CollectionSyncEventFired += OniFolderSyncEvent;
     eventBroker.FileSyncEventFired += OniFolderFileSyncEvent;
        }
 }
Beispiel #13
0
        // TODO: Since allows editing probably should be renamed to SlideDialog
        public AddSlideDialog(Project project)
            : base("AddSlideDialog.ui", "addslide")
        {
            this.project = project;
            LoadWindowPosition ();

            image_view = new SlideShowImageView ();
            image_view.ChangeEvent = new ShowImageSelectionEventHandler (OnChangeImage);
            image_view.UpdatedElements = new ShowImageUpdatedElementsEventHandler (OnUpdatedImages);
            scrolled_images.Add (image_view);

            up_button.Clicked += new EventHandler (OnButtonUp);
            down_button.Clicked += new EventHandler (OnButtonDown);
            audio_button.Clicked += new EventHandler (OnButtonAudio);

            file_view = new ImagesFileView ();
            new DirectoryView (vbox_dir, new ChangeDirectoryEventHandler (OnDirectoryChanged),
                Mistelix.Preferences.GetStringValue (Preferences.ImagesDirectoryKey));

            scrolledwin_files.Add (file_view);

            drawing_area = new TransitionPreview ();
            ctrls_hbox.Add (drawing_area);
            drawing_area.Visible = true;

            file_view.ShowAll ();
            left_vbox.ShowAll ();
            vpaned.Position = 650; // W (left)
            hpaned.Position = 300; // H (right)

            transition_store = new ListStore (typeof (string), typeof (string)); // DisplayName, Name
            LoadTransitionsIntoCombo ();
            transition_combo.Model = transition_store;

            CellRenderer transition_cell = new CellRendererText ();
            transition_combo.PackStart (transition_cell, true);
            transition_combo.SetCellDataFunc (transition_cell, Utils.ComboBoxCellFunc);
            transition_store.SetSortFunc (0, new Gtk.TreeIterCompareFunc (TransitionSort));
            transition_store.SetSortColumnId (0, SortType.Ascending);

            textposition_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
            textposition_combo.Model = textposition_store;
            CellRenderer textposition_cell = new CellRendererText ();
            textposition_combo.PackStart (textposition_cell, true);
            textposition_combo.SetCellDataFunc (textposition_cell, Utils.ComboBoxCellFunc);
            LoadTextPositionsIntoCombo ();

            SetTransisitionToNone ();
            ImageControlsSensitive (false);
            OnUpdatedImages (this, EventArgs.Empty);
            duration_spin.ValueChanged += new EventHandler (TimeValueChanged);
        }
		public void BeginProgress ()
		{
			IdeApp.Workbench.ActiveLocationList = this;
			newStore = new ListStore (typeof (SearchResult), typeof (bool));
			newStore.DefaultSortFunc = DefaultSortFunc;
			newStore.SetSortFunc (1, CompareProjectFileNames);
			newStore.SetSortFunc (2, CompareFileNames);
			newStore.SetSortFunc (3, CompareFilePaths);
			newStore.SetSortColumnId (2, SortType.Ascending); 
			Reset ();
			buttonStop.Sensitive = true;
			treeviewSearchResults.FreezeChildNotify ();
		}
Beispiel #15
0
        private void InitPackTreeView()
        {
            packStore = new TreeStore(typeof(Packer.Item));

            folderStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(Packer.Item));
            packTreeView.Model = folderStore;
            packTreeView.HeadersVisible = false;
            packTreeView.Selection.Mode = SelectionMode.Multiple;
            packTreeView.EnableSearch = true;
            packTreeView.SearchColumn = 1;

            packTreeView.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0);
            packTreeView.AppendColumn("Name", new CellRendererText(), "text", 1);

            folderStore.SetSortFunc(0, (model, a, b) =>
            {
                Packer.Item itemA = model.GetValue(a, 2) as Packer.Item;
                Packer.Item itemB = model.GetValue(b, 2) as Packer.Item;

                var ItemCost = new Func<Packer.Item, int>(item =>
                {
                    return (null == item ? 0 : (item.IsFolder ? (item.IsRoot ? 3 : 2) : 1));
                });

                if (ItemCost(itemA) > ItemCost(itemB))
                    return -1;
                else if (ItemCost(itemA) < ItemCost(itemB))
                    return 1;
                else if (null == itemA && null == itemB)
                    return 0;
                else
                    return itemA.Name.CompareTo(itemB.Name);
            });
            folderStore.SetSortColumnId(0, SortType.Ascending);
        }
		public void Initialize (IPadWindow window)
		{
			this.window = window;
			window.PadShown += delegate {
				if (needsReload)
					Refresh ();
			};
			
			DockItemToolbar toolbar = window.GetToolbar (PositionType.Top);
			
			errorBtn = new ToggleButton ();
			errorBtn.Active = (bool)PropertyService.Get (showErrorsPropertyName, true);
			string errorTipText;
			if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Error) != EnabledLoggingLevel.Error
				&& (InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Fatal) != EnabledLoggingLevel.Fatal) {
				errorBtn.Sensitive = false;
				errorTipText = GettextCatalog.GetString ("Logging of errors is not enabled");
			} else {
				errorTipText = GettextCatalog.GetString ("Show errors");
			}
			errorBtn.Image = new Gtk.Image (Gtk.Stock.DialogError, Gtk.IconSize.Menu);
			errorBtn.Image.Show ();
			errorBtn.Toggled += new EventHandler (FilterChanged);
			errorBtn.TooltipText = errorTipText;
			UpdateErrorsNum();
			toolbar.Add (errorBtn);
			
			warnBtn = new ToggleButton ();
			warnBtn.Active = (bool)PropertyService.Get (showWarningsPropertyName, true);
			string warnTipText;
			if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Warn) != EnabledLoggingLevel.Warn) {
				warnBtn.Sensitive = false;
				warnTipText = GettextCatalog.GetString ("Logging of warnings is not enabled");
			} else {
				warnTipText = GettextCatalog.GetString ("Show warnings");
			}
			warnBtn.Image = new Gtk.Image (Gtk.Stock.DialogWarning, Gtk.IconSize.Menu);
			warnBtn.Image.Show ();
			warnBtn.Toggled += new EventHandler (FilterChanged);
			warnBtn.TooltipText = warnTipText;
			UpdateWarningsNum();
			toolbar.Add (warnBtn);
			
			msgBtn = new ToggleButton ();
			msgBtn.Active = (bool)PropertyService.Get (showMessagesPropertyName, true);
			string msgTipText;
			if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Info) != EnabledLoggingLevel.Info) {
				msgBtn.Sensitive = false;
				msgTipText = GettextCatalog.GetString ("Logging of informational messages is not enabled");
			} else {
				msgTipText = GettextCatalog.GetString ("Show messages");
			}
			msgBtn.Image = new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu);
			msgBtn.Image.Show ();
			msgBtn.Toggled += new EventHandler (FilterChanged);
			msgBtn.TooltipText = msgTipText;
			UpdateMessagesNum();
			toolbar.Add (msgBtn);
			
			debugBtn = new ToggleButton ();
			debugBtn.Active = (bool)PropertyService.Get (showDebugPropertyName, true);
			string debugTipText;
			if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Debug) != EnabledLoggingLevel.Debug) {
				debugBtn.Sensitive = false;
				debugTipText = GettextCatalog.GetString ("Logging of debug messages is not enabled");
			} else {
				debugTipText = GettextCatalog.GetString ("Show debug");
			}
			debugBtn.Image = new Gtk.Image (Gtk.Stock.DialogQuestion, Gtk.IconSize.Menu);
			debugBtn.Image.Show ();
			debugBtn.Toggled += new EventHandler (FilterChanged);
			debugBtn.TooltipText = debugTipText;
			UpdateDebugNum();
			toolbar.Add (debugBtn);
			
			toolbar.Add (new SeparatorToolItem ());
			
			Gtk.Button clearBtn = new Gtk.Button (new Gtk.Image (Gtk.Stock.Clear, Gtk.IconSize.Menu));
			clearBtn.Clicked += new EventHandler (OnClearList);
			toolbar.Add (clearBtn);
			toolbar.ShowAll ();

			// Content
			
			store = new Gtk.ListStore (typeof (Gdk.Pixbuf),      // image - type
			                           typeof (string),          // desc
			                           typeof (string),          // time
			                           typeof (string),          // type string
			                           typeof (LogMessage));     // message

			TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTaskTypes);
			filter = new TreeModelFilter (store, null);
            filter.VisibleFunc = filterFunct;
			
			view = new MonoDevelop.Ide.Gui.Components.PadTreeView (new Gtk.TreeModelSort (filter));
			view.RulesHint = true;
			view.PopupMenu += new PopupMenuHandler (OnPopupMenu);
			view.ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressed);
			view.HeadersClickable = true;
			view.Selection.Mode = SelectionMode.Multiple;
			
			AddColumns ();
			
			sw = new Gtk.ScrolledWindow ();
			sw.ShadowType = ShadowType.None;
			sw.Add (view);
			
			LoggingService.AddLogger (this);
						
			iconWarning = sw.RenderIcon (Gtk.Stock.DialogWarning, Gtk.IconSize.Menu, "");
			iconError = sw.RenderIcon (Gtk.Stock.DialogError, Gtk.IconSize.Menu, "");
			iconInfo = sw.RenderIcon (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, "");
			iconDebug = sw.RenderIcon (Gtk.Stock.DialogQuestion, Gtk.IconSize.Menu, "");
			
			control = sw;
			sw.ShowAll ();
			
			Refresh ();

			store.SetSortFunc ((int)Columns.Time, TimeSortFunc);
			((TreeModelSort)view.Model).SetSortColumnId ((int)Columns.Time, SortType.Descending);
		}
 private void InitializeWidgets()
 {
     this.SetDefaultSize (500, 400);
        this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));
        VBox dialogBox = new VBox();
        dialogBox.Spacing = 10;
        dialogBox.BorderWidth = 10;
        this.VBox.PackStart(dialogBox, true, true, 0);
        Label l = new Label(
     string.Format("<span size=\"large\" weight=\"bold\">{0}</span>",
     Util.GS("Add users to this iFolder")));
        l.Xalign = 0;
        l.UseMarkup = true;
        dialogBox.PackStart(l, false, false, 0);
        HBox selBox = new HBox(false, 10);
        dialogBox.PackStart(selBox, true, true, 0);
        VBox vbox = new VBox(false, 0);
        selBox.PackStart(vbox, false, false, 0);
        HBox searchHBox = new HBox(false, 4);
        vbox.PackStart(searchHBox, false, false, 0);
        Label findLabel = new Label(Util.GS("_Find:"));
        searchHBox.PackStart(findLabel, false, false, 0);
        findLabel.Xalign = 0;
        SearchEntry = new Entry();
        searchHBox.PackStart(SearchEntry, true, true, 0);
        findLabel.MnemonicWidget = SearchEntry;
        SearchEntry.SelectRegion(0, -1);
        SearchEntry.CanFocus = true;
        SearchEntry.Changed +=
     new EventHandler(OnSearchEntryChanged);
        Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu);
        stopImage.SetAlignment(0.5F, 0F);
        CancelSearchButton = new Button(stopImage);
        searchHBox.PackEnd(CancelSearchButton, false, false, 0);
        CancelSearchButton.Relief = ReliefStyle.None;
        CancelSearchButton.Sensitive = false;
        CancelSearchButton.Clicked +=
     new EventHandler(OnCancelSearchButton);
        memberListModel = new MemberListModel(domainID, simws);
        memberList = new BigList(memberListModel);
        ScrolledWindow sw = new ScrolledWindow(memberList.HAdjustment, memberList.VAdjustment);
        sw.ShadowType = Gtk.ShadowType.EtchedIn;
        sw.Add(memberList);
        vbox.PackStart(sw, true, true, 0);
        memberList.ItemSelected += new ItemSelected(OnMemberIndexSelected);
        memberList.ItemActivated += new ItemActivated(OnMemberIndexActivated);
        VBox btnBox = new VBox();
        btnBox.Spacing = 10;
        selBox.PackStart(btnBox, false, false, 0);
        Label spacer = new Label("");
        btnBox.PackStart(spacer, true, true, 0);
        HBox buttonHBox = new HBox(false, 4);
        spacer = new Label("");
        buttonHBox.PackStart(spacer, true, true, 0);
        Label buttonLabel = new Label(Util.GS("_Add"));
        buttonHBox.PackStart(buttonLabel, false, false, 0);
        Image buttonImage = new Image(Stock.GoForward, IconSize.Button);
        buttonHBox.PackStart(buttonImage, false, false, 0);
        spacer = new Label("");
        buttonHBox.PackStart(spacer, true, true, 0);
        UserAddButton = new Button(buttonHBox);
        btnBox.PackStart(UserAddButton, false, true, 0);
        UserAddButton.Clicked += new EventHandler(OnAddButtonClicked);
        buttonHBox = new HBox(false, 4);
        spacer = new Label("");
        buttonHBox.PackStart(spacer, true, true, 0);
        buttonImage = new Image(Stock.GoBack, IconSize.Button);
        buttonHBox.PackStart(buttonImage, false, false, 0);
        buttonLabel = new Label(Util.GS("_Remove"));
        buttonHBox.PackStart(buttonLabel, false, false, 0);
        spacer = new Label("");
        buttonHBox.PackStart(spacer, true, true, 0);
        UserDelButton = new Button(buttonHBox);
        btnBox.PackStart(UserDelButton, false, true, 0);
        UserDelButton.Clicked += new EventHandler(OnRemoveButtonClicked);
        spacer = new Label("");
        btnBox.PackStart(spacer, true, true, 0);
        vbox = new VBox(false, 0);
        selBox.PackStart(vbox, true, true, 0);
        l = new Label(Util.GS("_Users to add:"));
        l.Xalign = 0;
        vbox.PackStart(l, false, false, 0);
        SelTreeView = new TreeView();
        ScrolledWindow ssw = new ScrolledWindow();
        ssw.ShadowType = Gtk.ShadowType.EtchedIn;
        ssw.Add(SelTreeView);
        vbox.PackStart(ssw, true, true, 0);
        ssw.WidthRequest = 200;
        l.MnemonicWidget = SelTreeView;
        SelTreeStore = new ListStore(typeof(MemberInfo));
        SelTreeStore.SetSortFunc(
     0,
     new TreeIterCompareFunc(SelTreeStoreSortFunction));
        SelTreeStore.SetSortColumnId(0, SortType.Ascending);
        SelTreeView.Model = SelTreeStore;
        SelTreeView.HeadersVisible = false;
        TreeViewColumn selmemberColumn = new TreeViewColumn();
        CellRendererText smcrt = new CellRendererText();
        selmemberColumn.PackStart(smcrt, false);
        selmemberColumn.SetCellDataFunc(smcrt, new TreeCellDataFunc(
       UserCellTextDataFunc));
        selmemberColumn.Title = Util.GS("Users to Add...");
        SelTreeView.AppendColumn(selmemberColumn);
        SelTreeView.Selection.Mode = SelectionMode.Multiple;
        SelTreeView.Selection.Changed += new EventHandler(
       OnSelUserSelectionChanged);
        this.AddButton(Stock.Cancel, ResponseType.Cancel);
        this.AddButton(Stock.Ok, ResponseType.Ok);
        this.AddButton(Stock.Help, ResponseType.Help);
        SetResponseSensitive(ResponseType.Ok, false);
        SearchiFolderUsers();
 }
        public FriendsList()
        {
            this.Build();
            store= new Gtk.ListStore (typeof(Gdk.Pixbuf),typeof(string),typeof(Gdk.Pixbuf),typeof(Gdk.Pixbuf),typeof(Gdk.Pixbuf),typeof(Gdk.Pixbuf),typeof(string),typeof(bool));

            MyTreeViewColumn mycol;

            mycol = new MyTreeViewColumn("", new CellRendererPixbuf(), "pixbuf", 0,false);
            //    mycol.setmodel(store);
            mycol.Expand=false;
            mycol.FixedWidth=24;
            treeview_friends.AppendColumn(mycol);

            mycol = new MyTreeViewColumn("Name", new CellRendererText(), "text", 1,true);
            mycol.Expand=true;
            mycol.setmodel(store);
            treeview_friends.AppendColumn(mycol);

            mycol = new MyTreeViewColumn("", new CellRendererPixbuf(), "pixbuf", 2,false);
              //  mycol.setmodel(store);
            mycol.Expand=false;
            mycol.Spacing=0;
            mycol.FixedWidth=24;
            mycol.Sizing=Gtk.TreeViewColumnSizing.Fixed;
            treeview_friends.AppendColumn(mycol);

            mycol = new MyTreeViewColumn("", new CellRendererPixbuf(), "pixbuf", 3,false);
             //   mycol.setmodel(store);
            mycol.Expand=false;
            mycol.Spacing=0;
            mycol.Sizing=Gtk.TreeViewColumnSizing.Fixed;
            mycol.FixedWidth=24;
            treeview_friends.AppendColumn(mycol);

            mycol = new MyTreeViewColumn("", new CellRendererPixbuf(), "pixbuf", 4,false);
              //  mycol.setmodel(store);
            mycol.Expand=false;
            mycol.Spacing=0;
            mycol.FixedWidth=24;
            mycol.Sizing=Gtk.TreeViewColumnSizing.Fixed;
            treeview_friends.AppendColumn(mycol);

            mycol = new MyTreeViewColumn("", new CellRendererPixbuf(), "pixbuf", 5,false);
              //  mycol.setmodel(store);
            mycol.Expand=false;
            mycol.Spacing=0;
            mycol.FixedWidth=24;
            mycol.Sizing=Gtk.TreeViewColumnSizing.Fixed;
            treeview_friends.AppendColumn(mycol);

            treeview_friends.Model=store;
            store.SetSortColumnId(1, SortType.Ascending);
            store.SetSortFunc(1,sortfunc);
            treeview_friends.HeadersClickable=true;
            this.treeview_friends.Selection.Mode = SelectionMode.Multiple;

            online_img=MainClass.GetResource("icon_avatar_online.png");
            offline_img=MainClass.GetResource("icon_avatar_offline.png");
            this.img_blank=MainClass.GetResource("blank_arrow.png");
            this.img_edit_mine=MainClass.GetResource("ff_edit_mine.png");
            this.img_edit_theirs=MainClass.GetResource("ff_edit_theirs.png");
            this.img_map_me=MainClass.GetResource("ff_visible_map.png");
            this.img_see_my_status=MainClass.GetResource("ff_visible_online.png");

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

            treeview_friends.CursorChanged += new EventHandler(treeview_friends_CursorChanged);
        }
		public SearchResultWidget ()
		{
			this.Build ();
			
			store = new ListStore (typeof (SearchResult), 
			                       typeof (bool)          // didRead
			                       );
			treeviewSearchResults.Model = store;
			treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
			treeviewSearchResults.HeadersClickable = true;
			treeviewSearchResults.PopupMenu += OnPopupMenu;
			treeviewSearchResults.ButtonPressEvent += HandleButtonPressEvent;
			treeviewSearchResults.RulesHint = true;
			
			TreeViewColumn fileNameColumn = new TreeViewColumn ();
			fileNameColumn.Resizable = true;
			fileNameColumn.SortColumnId  = 0;
			fileNameColumn.Title = GettextCatalog.GetString ("File");
			var fileNamePixbufRenderer = new CellRendererPixbuf ();
			fileNameColumn.PackStart (fileNamePixbufRenderer, false);
			fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, new Gtk.TreeCellDataFunc (FileIconDataFunc));
			
			CellRendererText fileNameRenderer = new CellRendererText ();
			fileNameColumn.PackStart (fileNameRenderer, true);
			fileNameColumn.SetCellDataFunc (fileNameRenderer, new Gtk.TreeCellDataFunc (FileNameDataFunc));
			treeviewSearchResults.AppendColumn (fileNameColumn);
			
			TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new Gtk.CellRendererText (), new Gtk.TreeCellDataFunc (ResultLineDataFunc));
			lineColumn.SortColumnId = 1;
			
			TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"), new Gtk.CellRendererText (), new Gtk.TreeCellDataFunc (ResultTextDataFunc));
			textColumn.SortColumnId = 2;
			textColumn.Resizable = true;
			
			TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"), new Gtk.CellRendererText (), new Gtk.TreeCellDataFunc (ResultPathDataFunc));
			pathColumn.SortColumnId = 3;
			pathColumn.Resizable = true;
			store.SetSortFunc (0, new TreeIterCompareFunc (CompareFileNames));
			store.SetSortFunc (1, new TreeIterCompareFunc (CompareLineNumbers));
			store.SetSortFunc (3, new TreeIterCompareFunc (CompareFilePaths));
			
			treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;
			
			buttonStop = new ToolButton ("gtk-stop");
			buttonStop.Sensitive = false;
			buttonStop.Clicked += ButtonStopClicked;
			
			buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
			toolbar.Insert (buttonStop, -1);

			ToolButton buttonClear = new ToolButton ("gtk-clear");
			buttonClear.Clicked += ButtonClearClicked;
			buttonClear.TooltipText = GettextCatalog.GetString ("Clear results");
			toolbar.Insert (buttonClear, -1);
			
			ToggleToolButton buttonOutput = new ToggleToolButton (MonoDevelop.Ide.Gui.Stock.OutputIcon);
			buttonOutput.Clicked += ButtonOutputClicked;
			buttonOutput.TooltipText = GettextCatalog.GetString ("Show output");
			toolbar.Insert (buttonOutput, -1);
			
			buttonPin = new ToggleToolButton ("md-pin-up");
			buttonPin.Clicked += ButtonPinClicked;
			buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad");
			toolbar.Insert (buttonPin, -1);
			
			store.SetSortColumnId (3, SortType.Ascending);
			ShowAll ();
			
			scrolledwindowLogView.Hide ();
		}
		public XmlSchemasPanelWidget ()
		{
			Build ();
			
			//set up tree view for default schemas
			var textRenderer = new CellRendererText ();
			registeredSchemasStore = new ListStore (typeof (XmlSchemaCompletionData));
			registeredSchemasView.Model = registeredSchemasStore;
			
			registeredSchemasView.AppendColumn (GettextCatalog.GetString ("Namespace"), textRenderer,
				(TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) => {
					((CellRendererText)cell).Text = GetSchema (iter).NamespaceUri;
				}
			);
			
			registeredSchemasView.AppendColumn (GettextCatalog.GetString ("Type"), textRenderer,
				(TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) => {
					((CellRendererText)cell).Text = GetSchema (iter).ReadOnly? 
						  GettextCatalog.GetString ("Built in") 
						: GettextCatalog.GetString ("User schema");
			});
			
			registeredSchemasStore.SetSortFunc (0, SortSchemas);
			
			registeredSchemasStore.SetSortColumnId (0, SortType.Ascending);
			
			//update state of "remove" button depending on whether schema is read-only and anything's slected
			registeredSchemasView.Selection.Changed += delegate {
				var data = GetSelectedSchema ();
				registeredSchemasRemoveButton.Sensitive = (data != null && !data.ReadOnly);
			};
			registeredSchemasRemoveButton.Sensitive = false;
			
			//set up cells for associations
			var extensionTextRenderer = new CellRendererText ();
			extensionTextRenderer.Editable = true;
			var prefixTextRenderer = new CellRendererText ();
			prefixTextRenderer.Editable = true;
			
			var comboEditor = new CellRendererCombo ();
			registeredSchemasComboModel = new ListStore (typeof (string));
			comboEditor.Model = registeredSchemasComboModel;
			comboEditor.Mode = CellRendererMode.Editable;
			comboEditor.TextColumn = 0;
			comboEditor.Editable = true;
			comboEditor.HasEntry = false;
			
			//rebuild combo's model from default schemas whenever editing starts
			comboEditor.EditingStarted += delegate (object sender, EditingStartedArgs args) {
				registeredSchemasComboModel.Clear ();
				registeredSchemasComboModel.AppendValues (string.Empty);
				foreach (TreeIter iter in WalkStore (registeredSchemasStore))
					registeredSchemasComboModel.AppendValues (
						GetSchema (iter).NamespaceUri
					);
				args.RetVal = true;
				registeredSchemasComboModel.SetSortColumnId (0, SortType.Ascending);
			};
			
			//set up tree view for associations
			defaultAssociationsStore = new ListStore (typeof (string), typeof (string), typeof (string), typeof (bool));
			defaultAssociationsView.Model = defaultAssociationsStore;
			defaultAssociationsView.AppendColumn (GettextCatalog.GetString ("File Extension"), extensionTextRenderer, "text", COL_EXT);
			defaultAssociationsView.AppendColumn (GettextCatalog.GetString ("Namespace"), comboEditor, "text", COL_NS);
			defaultAssociationsView.AppendColumn (GettextCatalog.GetString ("Prefix"), prefixTextRenderer, "text", COL_PREFIX);
			defaultAssociationsStore.SetSortColumnId (COL_EXT, SortType.Ascending);
			
			//editing handlers
			extensionTextRenderer.Edited += handleExtensionSet;
			comboEditor.Edited += (sender, args) => setAssocValAndMarkChanged (args.Path, COL_NS, args.NewText ?? "");
			prefixTextRenderer.Edited += delegate (object sender, EditedArgs args) {
				foreach (char c in args.NewText)
					if (!char.IsLetterOrDigit (c))
						//FIXME: give an error message?
						return;
				setAssocValAndMarkChanged (args.Path, COL_PREFIX, args.NewText);
			};
			
			//update state of "remove" button depending on whether anything's slected
			defaultAssociationsView.Selection.Changed += delegate {
				TreeIter iter;
				defaultAssociationsRemoveButton.Sensitive =
					defaultAssociationsView.Selection.GetSelected (out iter);
			};
			defaultAssociationsRemoveButton.Sensitive = false;
		}
		public UserTasksView ()
		{
			highPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksHighPrioColor", ""));
			normalPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksNormalPrioColor", ""));
			lowPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksLowPrioColor", ""));
			
			store = new ListStore (
				typeof (string),     // priority
				typeof (bool),		 // completed 
				typeof (string),     // desc
				typeof (Task),	 // user task
				typeof (Gdk.Color),  // foreground color
				typeof (int));		 // font style
			
			view = new MonoDevelop.Ide.Gui.Components.PadTreeView (store);
			view.RulesHint = true;
			view.SearchColumn = (int)Columns.Description;
			view.Selection.Changed += new EventHandler (SelectionChanged);
			view.PopupMenu += new PopupMenuHandler (OnUserPopupMenu);
			view.ButtonPressEvent += new ButtonPressEventHandler (OnUserButtonPressed);
			
			TreeViewColumn col;
			
			CellRendererComboBox cellRendPriority = new CellRendererComboBox ();
			cellRendPriority.Values = priorities;
			cellRendPriority.Editable = true;
			cellRendPriority.Changed += new ComboSelectionChangedHandler (UserTaskPriorityEdited);
			col = view.AppendColumn (GettextCatalog.GetString ("Priority"), cellRendPriority, "text", Columns.Priority, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
			col.Clickable = true;
			col.Resizable = true;
			TreeIterCompareFunc sortFunc = new TreeIterCompareFunc (PrioirtySortFunc);
			store.SetSortFunc ((int)Columns.Priority, sortFunc);
			col.Clicked += new EventHandler (UserTaskPriorityResort);
			
			CellRendererToggle cellRendCompleted = new CellRendererToggle ();
			cellRendCompleted.Toggled += new ToggledHandler (UserTaskCompletedToggled);
			cellRendCompleted.Activatable = true;
			col = view.AppendColumn (String.Empty, cellRendCompleted, "active", Columns.Completed);
			col.Clickable = true;
			col.Clicked += new EventHandler (UserTaskCompletedResort);
			
			cellRendDesc = view.TextRenderer;
			cellRendDesc.Editable = true;
			cellRendDesc.Edited += new EditedHandler (UserTaskDescEdited);
			col = view.AppendColumn (GettextCatalog.GetString ("Description"), cellRendDesc, "text", Columns.Description, "strikethrough", Columns.Completed, "foreground-gdk", Columns.Foreground, "weight", Columns.Bold);
			col.Clickable = true;
			col.Resizable = true;
			col.Clicked += new EventHandler (UserTaskDescResort);
			
			newButton = new Button ();
			newButton.Image = new Gtk.Image (Gtk.Stock.New, IconSize.Button);
			newButton.Label = GettextCatalog.GetString ("New Task");
			newButton.ImagePosition = PositionType.Left;
			newButton.Clicked += new EventHandler (NewUserTaskClicked); 
			newButton.TooltipText = GettextCatalog.GetString ("Create New Task");
			
			delButton = new Button (new Gtk.Image (Gtk.Stock.Delete, IconSize.Button));
			delButton.Clicked += new EventHandler (DeleteUserTaskClicked); 
			delButton.TooltipText = GettextCatalog.GetString ("Delete Task");

			TaskService.UserTasks.TasksChanged += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (UserTasksChanged));
			TaskService.UserTasks.TasksAdded += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (UserTasksChanged));
			TaskService.UserTasks.TasksRemoved += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (UserTasksChanged));
			
			IdeApp.Workspace.FirstWorkspaceItemOpened += CombineOpened;
			IdeApp.Workspace.LastWorkspaceItemClosed += CombineClosed;
			PropertyService.PropertyChanged += (EventHandler<PropertyChangedEventArgs>) DispatchService.GuiDispatch (new EventHandler<PropertyChangedEventArgs> (OnPropertyUpdated));	
			ValidateButtons ();
			// Initialize with existing tags.
			UserTasksChanged (this, null);
		}
		public SearchResultWidget ()
		{
			Build ();
			
			store = new ListStore (typeof (SearchResult), 
			                       typeof (bool)          // didRead
			                       );
			treeviewSearchResults.Model = store;
			treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
			treeviewSearchResults.HeadersClickable = true;
			treeviewSearchResults.PopupMenu += OnPopupMenu;
			treeviewSearchResults.ButtonPressEvent += HandleButtonPressEvent;
			treeviewSearchResults.RulesHint = true;
			
			var fileNameColumn = new TreeViewColumn {
				Resizable = false,
				SortColumnId = 0,
				Title = GettextCatalog.GetString("File")
			};

			fileNameColumn.FixedWidth = 200;

			var fileNamePixbufRenderer = new CellRendererPixbuf ();
			fileNameColumn.PackStart (fileNamePixbufRenderer, false);
			fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, FileIconDataFunc);
			
			var fileNameRenderer = new CellRendererText ();
			fileNameColumn.PackStart (fileNameRenderer, true);
			fileNameColumn.SetCellDataFunc (fileNameRenderer, FileNameDataFunc);
			treeviewSearchResults.AppendColumn (fileNameColumn);
			
//			TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new CellRendererText (), ResultLineDataFunc);
//			lineColumn.SortColumnId = 1;
//			lineColumn.FixedWidth = 50;
//			
			
			TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"), new CellRendererText (), ResultTextDataFunc);
			textColumn.SortColumnId = 2;
			textColumn.Resizable = false;
			textColumn.FixedWidth = 300;

			
			TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"), new CellRendererText (), ResultPathDataFunc);
			pathColumn.SortColumnId = 3;
			pathColumn.Resizable = false;
			pathColumn.FixedWidth = 500;

			
			store.SetSortFunc (0, CompareFileNames);
//			store.SetSortFunc (1, CompareLineNumbers);
			store.SetSortFunc (3, CompareFilePaths);

			treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;
			
			buttonStop = new ToolButton (Stock.Stop) { Sensitive = false };

			buttonStop.Clicked += ButtonStopClicked;
			
			buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
			toolbar.Insert (buttonStop, -1);

			var buttonClear = new ToolButton (Gtk.Stock.Clear);
			buttonClear.Clicked += ButtonClearClicked;
			buttonClear.TooltipText = GettextCatalog.GetString ("Clear results");
			toolbar.Insert (buttonClear, -1);
			
			var buttonOutput = new ToggleToolButton (Gui.Stock.OutputIcon);
			buttonOutput.Clicked += ButtonOutputClicked;
			buttonOutput.TooltipText = GettextCatalog.GetString ("Show output");
			toolbar.Insert (buttonOutput, -1);
			
			buttonPin = new ToggleToolButton (Gui.Stock.PinUp);
			buttonPin.Clicked += ButtonPinClicked;
			buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad");
			toolbar.Insert (buttonPin, -1);
			
			store.SetSortColumnId (3, SortType.Ascending);
			ShowAll ();
			
			scrolledwindowLogView.Hide ();
		}
Beispiel #23
0
        void LoadGames()
        {
            if (games_store != null)
                return;

            games_store = new ListStore (typeof(string), typeof (string), typeof(bool), typeof (Game), typeof (int));
            games_store.SetSortFunc (0, new Gtk.TreeIterCompareFunc (GameSort));
            games_store.SetSortColumnId (COL_TYPE, SortType.Ascending);

            // Data
            string type;
            Game game;
            for (int i = 0; i < games.Length; i++)
            {
                if (games [i].IsGame == false)
                    continue;

                game = (Game) Activator.CreateInstance (games [i].TypeOf, true);
                game.Translations = Translations;
                game.Variant = games [i].Variant;
                type = GameTypesDescription.GetLocalized (Translations, game.Type);
                games_store.AppendValues (game.Name, type, true, game, i);
            }
        }
		public AssemblyReferencePanel (SelectReferenceDialog selectDialog)
		{
			Spacing = 6;
			this.selectDialog = selectDialog;

			store = new ListStore (typeof (string), typeof (string), typeof (AssemblyInfo), typeof (bool), typeof (string), typeof(IconId), typeof(int));
			treeView = new TreeView (store);

			TreeViewColumn firstColumn = new TreeViewColumn ();
			CellRendererToggle tog_render = new CellRendererToggle ();
			tog_render.Toggled += AddReference;
			firstColumn.PackStart (tog_render, false);
			firstColumn.AddAttribute (tog_render, "active", ColSelected);

			treeView.AppendColumn (firstColumn);

			TreeViewColumn secondColumn = new TreeViewColumn ();
			secondColumn.Title = GettextCatalog.GetString ("Assembly");
			CellRendererImage crp = new CellRendererImage ();
			secondColumn.PackStart (crp, false);
			secondColumn.AddAttribute (crp, "icon-id", ColIcon);

			CellRendererText text_render = new CellRendererText ();
			secondColumn.PackStart (text_render, true);
			secondColumn.AddAttribute (text_render, "markup", ColName);

			treeView.AppendColumn (secondColumn);

			treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "markup", ColVersion);
			treeView.AppendColumn (GettextCatalog.GetString ("Path"), new CellRendererText (), "text", ColPath);

			treeView.Columns[1].Resizable = true;

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

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

			var but = new Gtk.Button (GettextCatalog.GetString ("Browse..."));
			but.Clicked += HandleClicked;
			var hbox = new Gtk.HBox ();
			hbox.PackEnd (but, false, false, 0);
			PackStart (hbox, false, false, 0);

			ShowAll ();
			BorderWidth = 6;
		}
        // called on load and when catalog filtered
        public void UpdateFromCatalog()
        {
            var newStore = new ListStore (typeof (IStringResourceDisplay));
            int total = 0, found = 0;

            foreach (var re in Catalog) {
                if (re is StringEntry) {
                    if (options.ShouldFilter ((StringEntry) re)) {
                        total++;
                    } else {
                        newStore.AppendValues (re);
                        found++;
                    }
                }
            }

            newStore.DefaultSortFunc = nameSortFunc;
            newStore.SetSortFunc (0, nameSortFunc);
            newStore.SetSortFunc (1, baseValueSortFunc);
            newStore.SetSortFunc (2, valueSortFunc);
            newStore.SetSortFunc (3, commentSortFunc);

            int sortCol;
            SortType sortType;
            store.GetSortColumnId (out sortCol,out sortType);
            newStore.SetSortColumnId (sortCol, sortType);
            newStore.SortColumnChanged += HandleSortColumnChanged;

            //FIXME:
            if (Inserter == null)
                Inserter = new InserterRow (catalog, AddEntry);
            else if (Inserter.catalog != catalog)
                throw new Exception ("catalog didnt match"); // (?reinitialise)

            newStore.AppendValues (Inserter);
            store.Dispose ();
            entriesTV.Model = store = newStore;
            // FIXME: ??
            //IdeApp.Workbench.StatusBar.ShowMessage (string.Format (GettextCatalog.GetPluralString ("{0} string resource out of {1} match filter.", "{0} string resources out of {1} match filter.", found, total), found,total));
        }
		public SearchResultWidget ()
		{
			var vbox = new VBox ();
			var toolbar = new Toolbar () {
				Orientation = Orientation.Vertical,
				IconSize = IconSize.Menu,
				ToolbarStyle = ToolbarStyle.Icons,
			};
			this.PackStart (vbox, true, true, 0);
			this.PackStart (toolbar, false, false, 0);
			labelStatus = new Label () {
				Xalign = 0,
				Justify = Justification.Left,
			};
			var hpaned = new HPaned ();
			vbox.PackStart (hpaned, true, true, 0);
			vbox.PackStart (labelStatus, false, false, 0);
			var resultsScroll = new CompactScrolledWindow ();
			hpaned.Pack1 (resultsScroll, true, true);
			scrolledwindowLogView = new CompactScrolledWindow ();
			hpaned.Pack2 (scrolledwindowLogView, true, true);
			textviewLog = new TextView () {
				Editable = false,
			};
			scrolledwindowLogView.Add (textviewLog);
			
			store = new ListStore (typeof (SearchResult),
				typeof (bool) // didRead
				);
			
			treeviewSearchResults = new PadTreeView () {
				Model = store,
				HeadersClickable = true,
				RulesHint = true,
			};
			treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
			resultsScroll.Add (treeviewSearchResults);
			
			this.ShowAll ();
			
			var fileNameColumn = new TreeViewColumn {
				Resizable = true,
				SortColumnId = 0,
				Title = GettextCatalog.GetString("File")
			};

			fileNameColumn.FixedWidth = 200;

			var fileNamePixbufRenderer = new CellRendererPixbuf ();
			fileNameColumn.PackStart (fileNamePixbufRenderer, false);
			fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, FileIconDataFunc);
			
			fileNameColumn.PackStart (treeviewSearchResults.TextRenderer, true);
			fileNameColumn.SetCellDataFunc (treeviewSearchResults.TextRenderer, FileNameDataFunc);
			treeviewSearchResults.AppendColumn (fileNameColumn);
			
//			TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new CellRendererText (), ResultLineDataFunc);
//			lineColumn.SortColumnId = 1;
//			lineColumn.FixedWidth = 50;
//			
			
			TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"),
				treeviewSearchResults.TextRenderer, ResultTextDataFunc);
			textColumn.SortColumnId = 2;
			textColumn.Resizable = true;
			textColumn.FixedWidth = 300;

			
			TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"),
				treeviewSearchResults.TextRenderer, ResultPathDataFunc);
			pathColumn.SortColumnId = 3;
			pathColumn.Resizable = true;
			pathColumn.FixedWidth = 500;

			
			store.SetSortFunc (0, CompareFileNames);
//			store.SetSortFunc (1, CompareLineNumbers);
			store.SetSortFunc (3, CompareFilePaths);

			treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;
			
			buttonStop = new ToolButton (Stock.Stop) { Sensitive = false };

			buttonStop.Clicked += ButtonStopClicked;
			
			buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
			toolbar.Insert (buttonStop, -1);

			var buttonClear = new ToolButton (Gtk.Stock.Clear);
			buttonClear.Clicked += ButtonClearClicked;
			buttonClear.TooltipText = GettextCatalog.GetString ("Clear results");
			toolbar.Insert (buttonClear, -1);
			
			var buttonOutput = new ToggleToolButton (Gui.Stock.OutputIcon);
			buttonOutput.Clicked += ButtonOutputClicked;
			buttonOutput.TooltipText = GettextCatalog.GetString ("Show output");
			toolbar.Insert (buttonOutput, -1);
			
			buttonPin = new ToggleToolButton (Gui.Stock.PinUp);
			buttonPin.Clicked += ButtonPinClicked;
			buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad");
			toolbar.Insert (buttonPin, -1);
			
			store.SetSortColumnId (3, SortType.Ascending);
			ShowAll ();
			
			scrolledwindowLogView.Hide ();
		}
Beispiel #27
0
        /// <summary>
        /// Set up the UI inside the Window
        /// </summary>
        private void InitializeWidgets()
        {
            this.SetDefaultSize(500, 400);
            this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));

            VBox dialogBox = new VBox();

            dialogBox.Spacing     = 10;
            dialogBox.BorderWidth = 10;
            this.VBox.PackStart(dialogBox, true, true, 0);

            Label l = new Label(
                string.Format("<span size=\"large\" weight=\"bold\">{0}</span>",
                              Util.GS("Add users to this iFolder")));

            l.Xalign    = 0;
            l.UseMarkup = true;
            dialogBox.PackStart(l, false, false, 0);



            //------------------------------
            // Selection Area
            //------------------------------
            HBox selBox = new HBox(false, 10);

            dialogBox.PackStart(selBox, true, true, 0);

            //------------------------------
            // All Users tree
            //------------------------------
            VBox vbox = new VBox(false, 0);

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

            //------------------------------
            // Find Entry
            //------------------------------
            HBox searchHBox = new HBox(false, 4);

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

            Label findLabel = new Label(Util.GS("_Find:"));

            searchHBox.PackStart(findLabel, false, false, 0);
            findLabel.Xalign = 0;

            SearchEntry = new Entry();
            searchHBox.PackStart(SearchEntry, true, true, 0);
            findLabel.MnemonicWidget = SearchEntry;
            SearchEntry.SelectRegion(0, -1);
            SearchEntry.CanFocus = true;
            SearchEntry.Changed +=
                new EventHandler(OnSearchEntryChanged);

            Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu);

            stopImage.SetAlignment(0.5F, 0F);

            CancelSearchButton = new Button(stopImage);
            searchHBox.PackEnd(CancelSearchButton, false, false, 0);
            CancelSearchButton.Relief    = ReliefStyle.None;
            CancelSearchButton.Sensitive = false;

            CancelSearchButton.Clicked +=
                new EventHandler(OnCancelSearchButton);

            memberListModel = new MemberListModel(domainID, simws);

            memberList = new BigList(memberListModel);

            // FIXME: Fix up the BigList class to support both horizontal and vertical scrolling and then use the scroll adjustments to construct the ScrolledWindow
            ScrolledWindow sw = new ScrolledWindow(memberList.HAdjustment, memberList.VAdjustment);

            sw.ShadowType = Gtk.ShadowType.EtchedIn;
            sw.Add(memberList);
            vbox.PackStart(sw, true, true, 0);
            memberList.ItemSelected  += new ItemSelected(OnMemberIndexSelected);
            memberList.ItemActivated += new ItemActivated(OnMemberIndexActivated);


            //------------------------------
            // Buttons
            //------------------------------
            VBox btnBox = new VBox();

            btnBox.Spacing = 10;
            selBox.PackStart(btnBox, false, false, 0);

            Label spacer = new Label("");

            btnBox.PackStart(spacer, true, true, 0);

            HBox buttonHBox = new HBox(false, 4);

            spacer = new Label("");
            buttonHBox.PackStart(spacer, true, true, 0);
            Label buttonLabel = new Label(Util.GS("_Add"));

            buttonHBox.PackStart(buttonLabel, false, false, 0);
            Image buttonImage = new Image(Stock.GoForward, IconSize.Button);

            buttonHBox.PackStart(buttonImage, false, false, 0);
            spacer = new Label("");
            buttonHBox.PackStart(spacer, true, true, 0);
            UserAddButton = new Button(buttonHBox);
            btnBox.PackStart(UserAddButton, false, true, 0);
            UserAddButton.Clicked += new EventHandler(OnAddButtonClicked);

            buttonHBox = new HBox(false, 4);
            spacer     = new Label("");
            buttonHBox.PackStart(spacer, true, true, 0);
            buttonImage = new Image(Stock.GoBack, IconSize.Button);
            buttonHBox.PackStart(buttonImage, false, false, 0);
            buttonLabel = new Label(Util.GS("_Remove"));
            buttonHBox.PackStart(buttonLabel, false, false, 0);
            spacer = new Label("");
            buttonHBox.PackStart(spacer, true, true, 0);
            UserDelButton = new Button(buttonHBox);
            btnBox.PackStart(UserDelButton, false, true, 0);
            UserDelButton.Clicked += new EventHandler(OnRemoveButtonClicked);

            spacer = new Label("");
            btnBox.PackStart(spacer, true, true, 0);

            //------------------------------
            // Selected Users tree
            //------------------------------
            vbox = new VBox(false, 0);
            selBox.PackStart(vbox, true, true, 0);

            l        = new Label(Util.GS("_Users to add:"));
            l.Xalign = 0;
            vbox.PackStart(l, false, false, 0);

            SelTreeView = new TreeView();
            ScrolledWindow ssw = new ScrolledWindow();

            ssw.ShadowType = Gtk.ShadowType.EtchedIn;
            ssw.Add(SelTreeView);
            vbox.PackStart(ssw, true, true, 0);
            ssw.WidthRequest = 200;
            l.MnemonicWidget = SelTreeView;

            // Set up the iFolder TreeView
            SelTreeStore = new ListStore(typeof(MemberInfo));
            SelTreeStore.SetSortFunc(
                0,
                new TreeIterCompareFunc(SelTreeStoreSortFunction));
            SelTreeStore.SetSortColumnId(0, SortType.Ascending);
            SelTreeView.Model          = SelTreeStore;
            SelTreeView.HeadersVisible = false;

            // Set up Pixbuf and Text Rendering for "iFolder Users" column
            TreeViewColumn   selmemberColumn = new TreeViewColumn();
            CellRendererText smcrt           = new CellRendererText();

            selmemberColumn.PackStart(smcrt, false);
            selmemberColumn.SetCellDataFunc(smcrt, new TreeCellDataFunc(
                                                UserCellTextDataFunc));
            selmemberColumn.Title = Util.GS("Users to Add...");
            SelTreeView.AppendColumn(selmemberColumn);
            SelTreeView.Selection.Mode = SelectionMode.Multiple;

            SelTreeView.Selection.Changed += new EventHandler(
                OnSelUserSelectionChanged);

            this.AddButton(Stock.Cancel, ResponseType.Cancel);
            this.AddButton(Stock.Ok, ResponseType.Ok);
            this.AddButton(Stock.Help, ResponseType.Help);

            SetResponseSensitive(ResponseType.Ok, false);

            SearchiFolderUsers();
        }
Beispiel #28
0
        public VolumeView()
        {
            iconCache = new IconCache(this);
            sortProperty = VolumeSortProperty.VolumeID;
            toggleColumn = false;

            //
            // init columns
            //
            TreeViewColumn col;

            col = new TreeViewColumn(string.Empty, new CellRendererPixbuf(), "pixbuf", 0);
            col.Expand = false;
            AppendColumn(col);

            col = new TreeViewColumn(string.Empty, new CellRendererText(), "markup", 1);
            col.Expand = true;
            AppendColumn(col);

            //
            // setup store
            //
            ListStore store = new Gtk.ListStore(typeof(Gdk.Pixbuf),
                                                typeof(string),
                                                /* Volume - not visible */
                                                typeof(Volume));

            // must be assignet before
            // assinging the sort func
            this.Model = store;

            Gtk.TreeIterCompareFunc sortfunc = delegate(TreeModel m, TreeIter a, TreeIter b) {
                Volume vol_a = GetVolume(a);
                Volume vol_b = GetVolume(b);

                if (vol_a == null || vol_b == null)
                    return 0;

                switch (sortProperty) {
                    case VolumeSortProperty.Added:
                        return Math.Sign(vol_a.Added.Subtract(vol_b.Added).Ticks);
                    case VolumeSortProperty.ArchiveNo:
                        return Sorting.NatCompare(vol_a.ArchiveNo, vol_b.ArchiveNo);
                    case VolumeSortProperty.Category:
                        return string.Compare(vol_a.Category, vol_b.Category);
                    case VolumeSortProperty.DriveType:
                        return Math.Sign(vol_a.DriveType - vol_b.DriveType);
                    case VolumeSortProperty.Title:
                        return string.Compare(vol_a.Title, vol_b.Title);
                    case VolumeSortProperty.VolumeID:
                        return Math.Sign(vol_a.VolumeID - vol_b.VolumeID);
                    default:
                        throw new ArgumentException("Invalid VolumeSortProperty");
                }

                return 0;
            };

            store.SetSortFunc(0, sortfunc);
            store.SetSortFunc(1, sortfunc);

            // set initial sorting
            /* Sort(sortProperty, true); */
        }
Beispiel #29
0
		public TypesView ()
		{
			window = new ScrolledWindow ();
			list = new TreeView ();
			list.RulesHint = true;
			
			//                               icon            type            count            #bytes         avg size         avg age          # backtraces
			store = new ListStore (typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (object));
			list.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 ();
			CellRendererText backtracesRenderer = new CellRendererText ();
			
			TreeViewColumn columnType = new TreeViewColumn ();
			TreeViewColumn columnCount = new TreeViewColumn ();
			TreeViewColumn columnTotalSize = new TreeViewColumn ();
			TreeViewColumn columnAvgSize = new TreeViewColumn ();
			TreeViewColumn columnAvgAge = new TreeViewColumn ();
			TreeViewColumn columnBacktraces = 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");
			columnBacktraces.Title = GettextCatalog.GetString ("Backtraces");
			
			columnType.PackStart (pixbufRenderer, false);
			columnType.PackStart (typeRenderer, true);
			columnCount.PackStart (countRenderer, true);
			columnTotalSize.PackStart (totalSizeRenderer, true);
			columnAvgSize.PackStart (avgSizeRenderer, true);
			columnAvgAge.PackStart (avgAgeRenderer, true);
			columnBacktraces.PackStart (backtracesRenderer, 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);
			columnBacktraces.AddAttribute (backtracesRenderer, "text", 6);
			
			list.AppendColumn (columnType);
			list.AppendColumn (columnCount);
			list.AppendColumn (columnTotalSize);
			list.AppendColumn (columnAvgSize);
			list.AppendColumn (columnAvgAge);
			list.AppendColumn (columnBacktraces);
			
			int nc = 0;
			foreach (TreeViewColumn c in list.Columns) {
				store.SetSortFunc (nc, CompareNodes);
				c.SortColumnId = nc++;
			}
			store.SetSortColumnId (1, SortType.Descending);
			
			window.Add (list);
			window.ShowAll ();
		}
		public SearchResultWidget ()
		{
			var vbox = new VBox ();
			var toolbar = new Toolbar () {
				Orientation = Orientation.Vertical,
				IconSize = IconSize.Menu,
				ToolbarStyle = ToolbarStyle.Icons,
			};
			this.PackStart (vbox, true, true, 0);
			this.PackStart (toolbar, false, false, 0);
			labelStatus = new Label () {
				Xalign = 0,
				Justify = Justification.Left,
			};
			var hpaned = new HPaned ();
			vbox.PackStart (hpaned, true, true, 0);
			vbox.PackStart (labelStatus, false, false, 0);
			var resultsScroll = new CompactScrolledWindow ();
			hpaned.Pack1 (resultsScroll, true, true);
			scrolledwindowLogView = new CompactScrolledWindow ();
			hpaned.Pack2 (scrolledwindowLogView, true, true);
			textviewLog = new TextView () {
				Editable = false,
			};
			scrolledwindowLogView.Add (textviewLog);
			
			store = new ListStore (typeof (SearchResult),
				typeof (bool) // didRead
				);
			
			treeviewSearchResults = new PadTreeView () {
				Model = store,
				HeadersClickable = true,
				RulesHint = true,
			};

			treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
			resultsScroll.Add (treeviewSearchResults);

			var projectColumn = new TreeViewColumn {
				Resizable = true,
				SortColumnId = 1,
				Title = GettextCatalog.GetString ("Project"),
				Sizing = TreeViewColumnSizing.Fixed,
				FixedWidth = 100
			};

			var projectPixbufRenderer = new CellRendererImage ();
			projectColumn.PackStart (projectPixbufRenderer, false);
			projectColumn.SetCellDataFunc (projectPixbufRenderer, ResultProjectIconDataFunc);

			var renderer = treeviewSearchResults.TextRenderer;
			renderer.Ellipsize = Pango.EllipsizeMode.End;
			projectColumn.PackStart (renderer, true);
			projectColumn.SetCellDataFunc (renderer, ResultProjectDataFunc);
			treeviewSearchResults.AppendColumn (projectColumn);

			var fileNameColumn = new TreeViewColumn {
				Resizable = true,
				SortColumnId = 2,
				Title = GettextCatalog.GetString ("File"),
				Sizing = TreeViewColumnSizing.Fixed,
				FixedWidth = 200
			};

			var fileNamePixbufRenderer = new CellRendererImage ();
			fileNameColumn.PackStart (fileNamePixbufRenderer, false);
			fileNameColumn.SetCellDataFunc (fileNamePixbufRenderer, FileIconDataFunc);
			
			fileNameColumn.PackStart (renderer, true);
			fileNameColumn.SetCellDataFunc (renderer, FileNameDataFunc);
			treeviewSearchResults.AppendColumn (fileNameColumn);


			TreeViewColumn textColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Text"),
				renderer, ResultTextDataFunc);
			textColumn.Resizable = true;
			textColumn.Sizing = TreeViewColumnSizing.Fixed;
			textColumn.FixedWidth = 300;

			pathColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Path"),
				                            renderer, ResultPathDataFunc);
			pathColumn.SortColumnId = 3;
			pathColumn.Resizable = true;
			pathColumn.Sizing = TreeViewColumnSizing.Fixed;
			pathColumn.FixedWidth = 500;

			store.DefaultSortFunc = DefaultSortFunc;
			store.SetSortFunc (1, CompareProjectFileNames);
			store.SetSortFunc (2, CompareFileNames);
			store.SetSortFunc (3, CompareFilePaths);

			treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;
			
			buttonStop = new ToolButton (new ImageView (Gui.Stock.Stop, Gtk.IconSize.Menu), null) { Sensitive = false };
			buttonStop.Clicked += ButtonStopClicked;
			buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
			toolbar.Insert (buttonStop, -1);

			var buttonClear = new ToolButton (new ImageView (Gui.Stock.Clear, Gtk.IconSize.Menu), null);
			buttonClear.Clicked += ButtonClearClicked;
			buttonClear.TooltipText = GettextCatalog.GetString ("Clear results");
			toolbar.Insert (buttonClear, -1);
			
			var buttonOutput = new ToggleToolButton ();
			buttonOutput.IconWidget = new ImageView (Gui.Stock.OutputIcon, Gtk.IconSize.Menu);
			buttonOutput.Clicked += ButtonOutputClicked;
			buttonOutput.TooltipText = GettextCatalog.GetString ("Show output");
			toolbar.Insert (buttonOutput, -1);
			
			buttonPin = new ToggleToolButton ();
			buttonPin.IconWidget = new ImageView (Gui.Stock.PinUp, Gtk.IconSize.Menu);
			buttonPin.Clicked += ButtonPinClicked;
			buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad");
			toolbar.Insert (buttonPin, -1);

			// store.SetSortColumnId (3, SortType.Ascending);
			ShowAll ();
			
			scrolledwindowLogView.Hide ();
			treeviewSearchResults.FixedHeightMode = true;

			UpdateStyles ();
			IdeApp.Preferences.ColorScheme.Changed += UpdateStyles;
		}
        private void initRecordTable(DynamicMatrixThresholdFilter module)
        {
            // TODO: possibly add:
            // - string column for ThresholdMatrix name
            // - double column for noise amplitude
            recordStore = new ListStore(
                typeof(DynamicMatrixThresholdFilter.ThresholdRecord));
            // make the list store records sorted
            recordStore.SetSortFunc(0,
                    (TreeModel model, TreeIter iter1, TreeIter iter2) =>
                    ((DynamicMatrixThresholdFilter.ThresholdRecord)
                    recordStore.GetValue(iter1, 0)).CompareTo(
                    ((DynamicMatrixThresholdFilter.ThresholdRecord)
                    recordStore.GetValue(iter2, 0)))
                );
            recordStore.SetSortColumnId(0, SortType.Ascending);
            foreach (DynamicMatrixThresholdFilter.ThresholdRecord record in
                module.MatrixTable.listDefinitionRecords()) {
                recordStore.AppendValues(record);
            }
            recordTreeView = new TreeView(recordStore);
            TreeViewColumn intensityColumn = new TreeViewColumn();
            intensityColumn.Title = "Start intensity";
            CellRendererText intensityRenderer = new CellRendererText();
            intensityColumn.PackStart(intensityRenderer, true);
            intensityColumn.SetCellDataFunc(intensityRenderer,
                (TreeViewColumn column, CellRenderer cell,
                    TreeModel model, TreeIter iter) =>
                {
                    DynamicMatrixThresholdFilter.ThresholdRecord record =
                        (DynamicMatrixThresholdFilter.ThresholdRecord)
                            recordStore.GetValue(iter, 0);
                    (cell as CellRendererText).Text =
                        record.keyRangeStart.ToString();
                }
                );

            recordTreeView.AppendColumn(intensityColumn);
        }
Beispiel #32
0
		void UpdateFromCatalog ()
		{
			filter = this.searchEntryFilter.Entry.Text;
			if (!IsCaseSensitive && filter != null)
				filter = filter.ToUpper ();
			if (RegexSearch) {
				try {
					RegexOptions options = RegexOptions.Compiled;
					if (!IsCaseSensitive)
						options |= RegexOptions.IgnoreCase;
					regex = new Regex (filter, options);
				} catch (Exception e) {
					IdeApp.Workbench.StatusBar.ShowError (e.Message);
					this.searchEntryFilter.Entry.ModifyBase (StateType.Normal, errorColor);
					return;
				}
			}
			this.searchEntryFilter.Entry.ModifyBase (StateType.Normal, Style.Base (StateType.Normal));
			
			int found = 0;
			ListStore newStore = new ListStore (typeof(CatalogEntry));
			
			try {
				foreach (CatalogEntry entry in catalog) {
					if (!ShouldFilter (entry, filter)) {
						newStore.AppendValues (entry);
						found++;
					}
				}
			} catch (Exception) {
				
			}
			
			newStore.SetSortFunc (0, delegate (TreeModel model, TreeIter iter1, TreeIter iter2) {
				CatalogEntry entry1 = (CatalogEntry)model.GetValue (iter1, 0);
				CatalogEntry entry2 = (CatalogEntry)model.GetValue (iter2, 0);
				return GetTypeSortIndicator (entry1).CompareTo (GetTypeSortIndicator (entry2));
			});
			newStore.SetSortFunc (1, delegate (TreeModel model, TreeIter iter1, TreeIter iter2) {
				CatalogEntry entry1 = (CatalogEntry)model.GetValue (iter1, 0);
				CatalogEntry entry2 = (CatalogEntry)model.GetValue (iter2, 0);
				return entry1.String.CompareTo (entry2.String);
			});
			newStore.SetSortFunc (2, delegate (TreeModel model, TreeIter iter1, TreeIter iter2) {
				CatalogEntry entry1 = (CatalogEntry)model.GetValue (iter1, 0);
				CatalogEntry entry2 = (CatalogEntry)model.GetValue (iter2, 0);
				return entry1.GetTranslation (0).CompareTo (entry2.GetTranslation (0));
			});
			IdeApp.Workbench.StatusBar.ShowMessage (string.Format (GettextCatalog.GetPluralString ("Found {0} catalog entry.", "Found {0} catalog entries.", found), found));
			store.Dispose ();
			treeviewEntries.Model = store = newStore;
		}
    public ChannelWindow(Store s)
        : base(IntPtr.Zero)
    {
        chanstore = s;
        Glade.XML gxml = new Glade.XML (null, "AddWindow.glade", "window", null);
        gxml.Autoconnect (this);
        Raw = window.Handle;
        search_label.MnemonicWidget = entry;
        entry_container.Add (entry);
        entry.KeyPressEvent += new Gtk.KeyPressEventHandler (OnEntryKeyPressEvent);
        entry.Changed += new System.EventHandler (OnEntryChanged);

        scrolledwindow.Add (list);

        window.SetDefaultSize (500, 400);
        window.Title = Catalog.GetString ("Subscriptions - Monopod Podcast Client");

        TreeViewColumn col = new TreeViewColumn ();
        col.Sizing = TreeViewColumnSizing.GrowOnly;
        col.Resizable = true;
        col.Spacing = 4;
        col.PackStart (TextRenderer, true);
        col.SetCellDataFunc (TextRenderer, new TreeCellDataFunc (TextCellDataFunc));
        col.Title = Catalog.GetString ("Channel");
        col.Expand = true;

        TreeViewColumn col2 = new TreeViewColumn ();
        col2.Sizing = TreeViewColumnSizing.Autosize;
        CellRendererToggle tog = new Gtk.CellRendererToggle ();
        col2.PackStart (tog, true);
        col2.SetCellDataFunc (tog, new TreeCellDataFunc (BoolCellDataFunc));
        tog.Activatable = true;
        col2.Spacing = 4;
        col2.Title = Catalog.GetString ("Subscribed");
        col2.Expand = false;
        col2.Alignment = 0.5f;
        tog.Toggled += OnCellToggled;

        //pix_error = new Gdk.Pixbuf (null, "rss-error.png");
        //pix_ok = new Gdk.Pixbuf (null, "rss-ok.png");
        //pix_queued = new Gdk.Pixbuf (null, "rss-queued.png");

        TreeViewColumn col3 = new TreeViewColumn ();
        col3.Sizing = TreeViewColumnSizing.Autosize;
        CellRendererPixbuf pix = new Gtk.CellRendererPixbuf ();
        col3.PackStart (pix, true);
        col3.SetCellDataFunc (pix, new TreeCellDataFunc (PixCellDataFunc));
        col3.Spacing = 4;
        col3.Title = Catalog.GetString ("Status");
        col3.Expand = false;
        col3.Alignment = 0.5f;

        list.AppendColumn (col);
        list.AppendColumn (col2);
        list.AppendColumn (col3);

        list.Selection.Changed += OnSelectionChanged;

        showbox.Active = (int) ShowMode.All;

        window.Icon = MainClass.program_pixbuf48;

        entry.Show ();
        list.Show ();
        window.Realize ();

        // handler for when the database gets updated
        chanstore.ChannelUpdated += OnChannelUpdated;
        chanstore.ChannelAdded += OnChannelAdded;

        // model is simply a list of integers of channel IDs
        ListStore store = new ListStore (typeof (Channel));
        list.Model = store;
        store.SetSortFunc (0, StoreSortFunc);
        store.SetSortColumnId (0, SortType.Ascending);

        lastsearch = null;
        lastmode = -1;
    }
Beispiel #34
0
		public void DataBind ()
		{
			if (dataSource == null) {
				Clear ();
				return;
			}
			
			int index = 0;
			Type[] storeTypes = new Type[dataSource.Columns.Count];
			columnCount = dataSource.Columns.Count;
			foreach (DataColumn col in dataSource.Columns) {
				DataGridColumn dgCol = new DataGridColumn (this, col, index);
				grid.AppendColumn (dgCol);

				if (col.DataType == typeof (byte)) {
					//special case for gchar (TODO: look up the bugzilla bug id)
					storeTypes[index] = typeof (string);
					conversionLookup.Add (index, byteConvertFunc);
				} else if (col.DataType == typeof (sbyte)) {
					storeTypes[index] = typeof (string);
					conversionLookup.Add (index, sbyteConvertFunc);
				} else if (col.DataType.IsPrimitive || col.DataType == typeof (string) || col.DataType.IsEnum) {
					storeTypes[index] = col.DataType;
				} else {
					//the ListStore doesn't allow types that can't be converted to a GType
					storeTypes[index] = typeof (object);
				}

				index++;
			}
			store = new ListStore (storeTypes);
			grid.Model = store;
			
			TreeIterCompareFunc sortFunc = new TreeIterCompareFunc (SortFunc);
			store.SetSortFunc (0, sortFunc);
			store.SetSortColumnId (0, SortType.Ascending); //TODO: is this needed ?
			
			NavigateToRecord (0);
		}
Beispiel #35
0
        public VolumeView()
        {
            iconCache    = new IconCache(this);
            sortProperty = VolumeSortProperty.VolumeID;
            toggleColumn = false;

            //
            // init columns
            //
            TreeViewColumn col;

            col        = new TreeViewColumn(string.Empty, new CellRendererPixbuf(), "pixbuf", 0);
            col.Expand = false;
            AppendColumn(col);

            col        = new TreeViewColumn(string.Empty, new CellRendererText(), "markup", 1);
            col.Expand = true;
            AppendColumn(col);

            //
            // setup store
            //
            ListStore store = new Gtk.ListStore(typeof(Gdk.Pixbuf),
                                                typeof(string),
                                                /* Volume - not visible */
                                                typeof(Volume));

            // must be assignet before
            // assinging the sort func
            this.Model = store;

            Gtk.TreeIterCompareFunc sortfunc = delegate(TreeModel m, TreeIter a, TreeIter b) {
                Volume vol_a = GetVolume(a);
                Volume vol_b = GetVolume(b);

                if (vol_a == null || vol_b == null)
                {
                    return(0);
                }

                switch (sortProperty)
                {
                case VolumeSortProperty.Added:
                    return(Math.Sign(vol_a.Added.Subtract(vol_b.Added).Ticks));

                case VolumeSortProperty.ArchiveNo:
                    return(Sorting.NatCompare(vol_a.ArchiveNo, vol_b.ArchiveNo));

                case VolumeSortProperty.Category:
                    return(string.Compare(vol_a.Category, vol_b.Category));

                case VolumeSortProperty.DriveType:
                    return(Math.Sign(vol_a.DriveType - vol_b.DriveType));

                case VolumeSortProperty.Title:
                    return(string.Compare(vol_a.Title, vol_b.Title));

                case VolumeSortProperty.VolumeID:
                    return(Math.Sign(vol_a.VolumeID - vol_b.VolumeID));

                default:
                    throw new ArgumentException("Invalid VolumeSortProperty");
                }

                return(0);
            };

            store.SetSortFunc(0, sortfunc);
            store.SetSortFunc(1, sortfunc);

            // set initial sorting
            /* Sort(sortProperty, true); */
        }
        public PackageReferencePanel (SelectReferenceDialog selectDialog, bool showAll)
        {
            this.selectDialog = selectDialog;
			this.showAll = showAll;
			
            store = new ListStore (typeof (string), typeof (string), typeof (SystemAssembly), typeof (bool), typeof (string), typeof (string), typeof(IconId), typeof(int), typeof(ReferenceType));
            treeView = new TreeView (store);

            TreeViewColumn firstColumn = new TreeViewColumn ();
            CellRendererToggle tog_render = new CellRendererToggle ();
            tog_render.Toggled += new Gtk.ToggledHandler (AddReference);
            firstColumn.PackStart (tog_render, false);
            firstColumn.AddAttribute (tog_render, "active", ColSelected);

            treeView.AppendColumn (firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn ();
            secondColumn.Title = GettextCatalog.GetString ("Assembly");
            CellRendererIcon crp = new CellRendererIcon ();
            secondColumn.PackStart (crp, false);
            secondColumn.AddAttribute (crp, "icon-id", ColIcon);

            CellRendererText text_render = new CellRendererText ();
            secondColumn.PackStart (text_render, true);
            secondColumn.AddAttribute (text_render, "markup", ColName);

            treeView.AppendColumn (secondColumn);

            treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "markup", ColVersion);
            treeView.AppendColumn (GettextCatalog.GetString ("Package"), new CellRendererText (), "text", ColPackage);

            treeView.Columns[1].Resizable = true;

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

            ScrolledWindow sc = new ScrolledWindow ();
            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add (treeView);
            this.PackStart (sc, true, true, 0);
            ShowAll ();
            BorderWidth = 6;
        }
        public void Initialize()
        {
            log.Debug("Setting up treeview");

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

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

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

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

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

            CellRendererPixbuf iconCell = new CellRendererPixbuf();

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

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

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

            treeviewEvents.AppendColumn(enabledColumn);

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

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

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

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

            log.Debug("Adding notifications to the tree");
            foreach (CustomNotification e in DataModel.Notifications)
            {
                NotificationListStore.AppendValues(e, "icon-dark-pencil-square-o", "icon-dark-clone", "icon-dark-trash", NotificationRegistry.FindIcon(e.GetType()));
            }
        }