コード例 #1
0
		protected override void Initialize ()
		{
			base.Initialize ();

			folderOpenIcon = Context.GetIcon (Stock.OpenFolder);
			folderClosedIcon = Context.GetIcon (Stock.ClosedFolder);
		}
コード例 #2
0
		public WelcomePageBarButton (string title, string href, string iconResource = null)
		{
			UpdateStyle ();

			VisibleWindow = false;
			this.Text = GettextCatalog.GetString (title);
			this.actionLink = href;
			if (!string.IsNullOrEmpty (iconResource)) {
				imageHover = Xwt.Drawing.Image.FromResource (iconResource);
				imageNormal = imageHover.WithAlpha (0.7);
			}

			IconTextSpacing = Styles.WelcomeScreen.Links.IconTextSpacing;
			image = new Xwt.ImageView ();
			label = CreateLabel ();
			imageWidget = image.ToGtkWidget ();
			box.PackStart (imageWidget, false, false, 0);
			if (imageNormal == null)
				imageWidget.NoShowAll = true;
			box.PackStart (label, false, false, 0);
			box.ShowAll ();
			Add (box);

			Gui.Styles.Changed += UpdateStyle;
			Update ();

			Events |= (Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask);
		}
		public GtkAspNetProjectTemplateWizardPageWidget ()
		{
			this.Build ();

			if (Platform.IsMac) {
				int labelPaddingHeight = 5;
				if (IsYosemiteOrHigher ())
					labelPaddingHeight--;
				includeLabelPadding.HeightRequest = labelPaddingHeight;
				testingLabelPadding.HeightRequest = labelPaddingHeight;

				int leftPaddingWidth = 28;
				mvcDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
				webFormsDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
				webApiDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
				includeUnitTestProjectDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
			}

			backgroundImage = Xwt.Drawing.Image.FromResource ("aspnet-wizard-page.png");
			backgroundImageView = new ImageView (backgroundImage);
			backgroundImageView.Xalign = 1.0f;
			backgroundImageView.Yalign = 1.0f;
			backgroundLargeImageVBox.PackStart (backgroundImageView, true, true, 0);

			var separatorColor = Ide.Gui.Styles.NewProjectDialog.ProjectConfigurationSeparatorColor.ToGdkColor ();
			var backgroundColor = Ide.Gui.Styles.NewProjectDialog.ProjectConfigurationLeftHandBackgroundColor.ToGdkColor ();
			testingSeparator.ModifyBg (StateType.Normal, separatorColor);

			leftBorderEventBox.ModifyBg (StateType.Normal, backgroundColor);
			configurationTopEventBox.ModifyBg (StateType.Normal, backgroundColor);
			configurationTableEventBox.ModifyBg (StateType.Normal, backgroundColor);
			configurationBottomEventBox.ModifyBg (StateType.Normal, backgroundColor);
			backgroundLargeImageEventBox.ModifyBg (StateType.Normal, backgroundColor);
		}
コード例 #4
0
 static WelcomePageListButton()
 {
     starNormal = Xwt.Drawing.Image.FromResource ("unstar-overlay-light-16.png");
     starNormalHover = Xwt.Drawing.Image.FromResource ("unstar-overlay-hover-light-16.png");
     starPinned = Xwt.Drawing.Image.FromResource ("star-overlay-light-16.png");
     starPinnedHover = Xwt.Drawing.Image.FromResource ("star-overlay-hover-light-16.png");
 }
コード例 #5
0
		public ProjectFileSelectorDialog (Project project, string defaultFilterName, string defaultFilterPattern, string [] buildActions)
		{
			this.project = project;
			this.defaultFilter = new SelectFileDialogFilter (defaultFilterName, defaultFilterPattern ?? "*");
			this.buildActions = buildActions;
			
			this.Build();
			
			projBuf = ImageService.GetIcon (project.StockIcon, IconSize.Menu);
			dirClosedBuf = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.ClosedFolder, IconSize.Menu);
			dirOpenBuf = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.OpenFolder, IconSize.Menu);
			
			TreeViewColumn projectCol = new TreeViewColumn ();
			projectCol.Title = GettextCatalog.GetString ("Project Folders");
			var pixRenderer = new CellRendererImage ();
			CellRendererText txtRenderer = new CellRendererText ();
			projectCol.PackStart (pixRenderer, false);
			projectCol.PackStart (txtRenderer, true);
			projectCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (PixDataFunc));
			projectCol.SetCellDataFunc (txtRenderer, new TreeCellDataFunc (TxtDataFunc));
			projectTree.Model = dirStore;
			projectTree.AppendColumn (projectCol);
			TreeIter projectIter = dirStore.AppendValues ("", FilePath.Empty);
			InitDirs (projectIter);
			projectTree.ExpandAll ();
			projectTree.RowActivated += delegate {
				fileList.GrabFocus ();
			};
			projectTree.KeyPressEvent += ProjectListKeyPressEvent;
			
			TreeViewColumn fileCol = new TreeViewColumn ();
			var filePixRenderer = new CellRendererImage ();
			fileCol.Title = GettextCatalog.GetString ("Files");
			fileCol.PackStart (filePixRenderer, false);
			fileCol.PackStart (txtRenderer, true);
			fileCol.AddAttribute (filePixRenderer, "image", 1);
			fileCol.SetCellDataFunc (txtRenderer, new TreeCellDataFunc (TxtFileDataFunc));
			fileList.Model = fileStore;
			fileList.AppendColumn (fileCol);
			fileList.RowActivated += delegate {
				TreeIter iter;
				if (fileList.Selection.GetSelected (out iter))
					Respond (ResponseType.Ok);
			};
			fileList.KeyPressEvent += FileListKeyPressEvent;
			fileList.KeyReleaseEvent += FileListKeyReleaseEvent;
			
			TreeIter root;
			if (dirStore.GetIterFirst (out root))
				projectTree.Selection.SelectIter (root);
			
			UpdateFileList (null, null);
			
			projectTree.Selection.Changed += UpdateFileList;
			fileList.Selection.Changed += UpdateSensitivity;
			
			
			this.DefaultResponse = ResponseType.Cancel;
			this.Modal = true;
		}
コード例 #6
0
		protected override void Read (NodeElement elem)
		{
			base.Read (elem);
			if (headerImageResource != null)
				HeaderImage = Addin.GetImageResource (headerImageResource);
			if (headerFillerImageResource != null)
				HeaderFillerImageResource = Addin.GetImageResource (headerFillerImageResource);
		}
コード例 #7
0
		public StockIconsNodeBuilder ()
		{
			try {
				iconsIcon = Xwt.Drawing.Image.FromResource ("image-x-generic.png");
			} catch (Exception e) {
				Console.WriteLine ("Error while loading pixbuf 'image-x-generic.png': " + e);
			}
		}
コード例 #8
0
		static TabLabel ()
		{
			try {
				closeImage = Xwt.Drawing.Image.FromResource ("popup-close-16.png");
			} catch (Exception e) {
				MonoDevelop.Core.LoggingService.LogError ("Can't create pixbuf from resource: popup-close-16.png", e);
			}
		}
コード例 #9
0
		public AboutMonoDevelopTabPage ()
		{
			BorderWidth = 0;

			var aboutFile = BrandingService.GetFile ("AboutImage.png");
			if (aboutFile != null)
				imageSep = Xwt.Drawing.Image.FromFile (aboutFile);
			else
				imageSep = Xwt.Drawing.Image.FromResource ("AboutImage.png");

			PackStart (new ImageView (imageSep), false, false, 0);

			Xwt.VBox infoBox = new Xwt.VBox ();
			Xwt.FrameBox mbox = new Xwt.FrameBox (infoBox);

			infoBox.Spacing = 6;
			infoBox.Margin = 12;
			PackStart (mbox.ToGtkWidget (), false, false, 0);

			infoBox.PackStart (new Xwt.Label () {
				Text = GettextCatalog.GetString ("Version"),
				Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold)
			});
			infoBox.PackStart (new Xwt.Label () {
				Text = IdeVersionInfo.MonoDevelopVersion,
				MarginLeft = 12
			});

			infoBox.PackStart (new Xwt.Label () {
				Text = GettextCatalog.GetString ("License"),
				Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold)
			});
			infoBox.PackStart (new Xwt.Label () {
				Text = GettextCatalog.GetString ("Released under the GNU Lesser General Public License."),
				MarginLeft = 12
			});

			infoBox.PackStart (new Xwt.Label () {
				Text = GettextCatalog.GetString ("Copyright"),
				Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold)
			});
			var cbox = new Xwt.HBox () {
				Spacing = 0,
				MarginLeft = 12
			};
			cbox.PackStart (new Xwt.Label ("© 2011-" + DateTime.Now.Year + " "));
			cbox.PackStart (new Xwt.LinkLabel () {
				Text = string.Format ("Xamarin Inc."),
				Uri = new Uri ("http://www.xamarin.com")
			});
			infoBox.PackStart (cbox);
			infoBox.PackStart (new Xwt.Label () {
				Text = "© 2004-" + DateTime.Now.Year + " MonoDevelop contributors",
				MarginLeft = 12
			});

			this.ShowAll ();
		}
コード例 #10
0
ファイル: DockBarItem.cs プロジェクト: vvarshne/monodevelop
		public CrossfadeIcon (Xwt.Drawing.Image primary, Xwt.Drawing.Image secondary)
		{
			if (primary == null)
				throw new ArgumentNullException ("primary");
			if (secondary == null)
				throw new ArgumentNullException ("secondary");

			this.primary = primary;
			this.secondary = secondary;
		}
コード例 #11
0
        void AddRecentTemplateCategory()
        {
            Xwt.Drawing.Image icon = GetIcon("md-recent", IconSize.Menu);
            categoryTextRenderer.CategoryIconWidth = (int)icon.Width;

            templateCategoriesListStore.AppendValues(
                Core.GettextCatalog.GetString("Recently used"),
                icon,
                null);
        }
コード例 #12
0
 public ExceptionCaughtButton(ExceptionInfo val, ExceptionCaughtMessage dlg, FilePath file, int line)
 {
     this.exception    = val;
     this.dlg          = dlg;
     OffsetX           = 6;
     File              = file;
     Line              = line;
     closeSelImage     = ImageService.GetIcon("md-popup-close", IconSize.Menu);
     closeSelOverImage = ImageService.GetIcon("md-popup-close-hover", IconSize.Menu);
 }
コード例 #13
0
		protected override void Initialize ()
		{
			base.Initialize ();

			folderOpenIcon = Context.GetIcon (Stock.OpenFolder);
			folderClosedIcon = Context.GetIcon (Stock.ClosedFolder);
			
			fileRenamedHandler = DispatchService.GuiDispatch<EventHandler<FileCopyEventArgs>> (OnFolderRenamed);
			fileRemovedHandler = DispatchService.GuiDispatch<EventHandler<FileEventArgs>> (OnFolderRemoved);
		}
コード例 #14
0
ファイル: ImageService.cs プロジェクト: dipakbhau/monodevelop
        static Xwt.Drawing.Image LoadStockIcon(RuntimeAddin addin, string stockId, string resource, string imageFile, string iconId, Gtk.IconSize iconSize, string animation, bool forceWildcard)
        {
            try {
                AnimatedIcon    animatedIcon = null;
                Func <Stream[]> imageLoader  = null;

                Xwt.Drawing.Image img = null;

                if (!string.IsNullOrEmpty(resource) || !string.IsNullOrEmpty(imageFile))
                {
                    if (resource != null)
                    {
                        CustomImageLoader loader;
                        if (!imageLoaders.TryGetValue(addin, out loader))
                        {
                            loader = imageLoaders [addin] = new CustomImageLoader(addin);
                        }
                        img = Xwt.Drawing.Image.FromCustomLoader(loader, resource);
                    }
                    else
                    {
                        img = Xwt.Drawing.Image.FromFile(addin.GetFilePath(imageFile));
                    }
                }
                else if (!string.IsNullOrEmpty(iconId))
                {
                    var id = GetStockIdForImageSpec(addin, iconId, iconSize);
                    img = GetIcon(id, iconSize);
                    // This may be an animation, get it
                    animationFactory.TryGetValue(id, out animatedIcon);
                }
                else if (!string.IsNullOrEmpty(animation))
                {
                    string id = GetStockIdForImageSpec(addin, "animation:" + animation, iconSize);
                    img = GetIcon(id, iconSize);
                    // This *should* be an animation
                    animationFactory.TryGetValue(id, out animatedIcon);
                }

                if (animatedIcon != null)
                {
                    AddToAnimatedIconFactory(stockId, animatedIcon);
                }

                if (imageLoader != null)
                {
                    img.SetStreamSource(imageLoader);
                }

                return(img);
            } catch (Exception ex) {
                LoggingService.LogError(string.Format("Error loading icon '{0}'", stockId), ex);
                return(null);
            }
        }
コード例 #15
0
            public override void DrawForeground(TextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
            {
                isFailed = false;
                var  test        = NUnitService.Instance.SearchTestById(unitTest.UnitTestIdentifier);
                bool searchCases = false;

                Xwt.Drawing.Image icon = null;

                if (test != null)
                {
                    icon = test.StatusIcon;
                    var result = test.GetLastResult();
                    if (result == null)
                    {
                        searchCases = true;
                    }
                    else if (result.IsFailure)
                    {
                        failMessage = result.Message;
                        isFailed    = true;
                    }
                }
                else
                {
                    searchCases = true;
                }

                if (searchCases)
                {
                    foreach (var caseId in unitTest.TestCases)
                    {
                        test = NUnitService.Instance.SearchTestById(unitTest.UnitTestIdentifier + caseId);
                        if (test != null)
                        {
                            icon = test.StatusIcon;
                            var result = test.GetLastResult();
                            if (result != null && result.IsFailure)
                            {
                                failMessage = result.Message;
                                isFailed    = true;
                                break;
                            }
                        }
                    }
                }

                if (icon != null)
                {
                    if (icon.Width > metrics.Width || icon.Height > metrics.Height)
                    {
                        icon = icon.WithBoxSize(metrics.Width, metrics.Height);
                    }
                    cr.DrawImage(editor, icon, Math.Truncate(metrics.X + metrics.Width / 2 - icon.Width / 2), Math.Truncate(metrics.Y + metrics.Height / 2 - icon.Height / 2));
                }
            }
コード例 #16
0
ファイル: TabStrip.cs プロジェクト: noah1510/dotdevelop
 public void SetTabLabel(Gtk.Widget page, Xwt.Drawing.Image icon, string label)
 {
     foreach (DockItemTitleTab tab in box.Children)
     {
         if (tab.Page == page)
         {
             tab.SetLabel(page, icon, label);
             UpdateEllipsize(Allocation);
             break;
         }
     }
 }
コード例 #17
0
        public static void RenderTiled(this Cairo.Context self, Gtk.Widget target, Xwt.Drawing.Image source, Gdk.Rectangle area, Gdk.Rectangle clip, double opacity = 1)
        {
            var ctx = Xwt.Toolkit.CurrentEngine.WrapContext(target, self);

            ctx.Save();
            ctx.Rectangle(clip.X, clip.Y, clip.Width, clip.Height);
            ctx.Clip();
            ctx.Pattern = new Xwt.Drawing.ImagePattern(source);
            ctx.Rectangle(area.X, area.Y, area.Width, area.Height);
            ctx.Fill();
            ctx.Restore();
        }
コード例 #18
0
 protected override void Read(NodeElement elem)
 {
     base.Read(elem);
     if (headerImageResource != null)
     {
         HeaderImage = Addin.GetImageResource(headerImageResource);
     }
     if (headerFillerImageResource != null)
     {
         HeaderFillerImageResource = Addin.GetImageResource(headerFillerImageResource);
     }
 }
コード例 #19
0
 public virtual void Init(string imageUnCheck, string imageCheck, int tag)
 {
     this.ImageCheck                = imageCheck;
     this.ImageUnCheck              = imageUnCheck;
     this.Tag                       = tag;
     this.checkedImage              = ImageIcon.GetIcon(imageCheck);
     this.uncheckedImage            = ImageIcon.GetIcon(imageUnCheck);
     this.imageWidget.Image         = this.uncheckedImage;
     this.imageWidget.WidthRequest  = 24;
     this.imageWidget.HeightRequest = 24;
     this.imageWidget.Show();
 }
コード例 #20
0
        private void ScaleImage(Xwt.Drawing.Image image)
        {
            double num1 = image.Width > image.Height ? image.Width : image.Height;

            if (num1 > 46.0)
            {
                double num2 = 46.0 / num1;
                image = image.Scale(num2, num2);
            }
            this.imageWidget.Image = image;
            this.imageWidget.QueueDraw();
        }
コード例 #21
0
 public virtual void SetImage(Xwt.Drawing.Image image)
 {
     if (this.Parent != null)
     {
         this.Parent.SuspendLayout();
     }
     this.Image = image.ToGdi();
     if (this.Parent != null)
     {
         this.Parent.ResumeLayout();
     }
 }
コード例 #22
0
ファイル: ImageService.cs プロジェクト: dipakbhau/monodevelop
 public static void AddIcon(string iconId, Xwt.Drawing.Image icon)
 {
     if (iconId == null)
     {
         throw new ArgumentNullException(nameof(iconId));
     }
     if (icon == null)
     {
         throw new ArgumentNullException(nameof(icon));
     }
     icons.Add(iconId, icon);
 }
コード例 #23
0
ファイル: ImageService.cs プロジェクト: Redth/monodevelop-1
        static string GetComposedIcon(string[] ids, Gtk.IconSize size)
        {
            string id = string.Join("_", ids);
            string cid;

            if (composedIcons.TryGetValue(id, out cid))
            {
                return(cid);
            }
            System.Collections.ICollection col = size == Gtk.IconSize.Invalid ? Enum.GetValues(typeof(Gtk.IconSize)) : new object [] { size };
            var frames = new List <Xwt.Drawing.Image> ();

            foreach (Gtk.IconSize sz in col)
            {
                if (sz == Gtk.IconSize.Invalid)
                {
                    continue;
                }
                Xwt.Drawing.ImageBuilder ib   = null;
                Xwt.Drawing.Image        icon = null;
                for (int n = 0; n < ids.Length; n++)
                {
                    var px = GetIcon(ids[n], sz);
                    if (px == null)
                    {
                        LoggingService.LogError("Error creating composed icon {0} at size {1}. Icon {2} is missing.", id, sz, ids[n]);
                        icon = null;
                        break;
                    }

                    if (n == 0)
                    {
                        ib = new Xwt.Drawing.ImageBuilder(px.Width, px.Height);
                        ib.Context.DrawImage(px, 0, 0);
                        icon = px;
                        continue;
                    }

                    if (icon.Width != px.Width || icon.Height != px.Height)
                    {
                        px = px.WithSize(icon.Width, icon.Height);
                    }

                    ib.Context.DrawImage(px, 0, 0);
                }
                frames.Add(ib.ToVectorImage());
            }

            icons [id]        = Xwt.Drawing.Image.CreateMultiSizeIcon(frames);
            composedIcons[id] = id;
            return(id);
        }
コード例 #24
0
        EventBoxTooltip CreateTooltip(EventBox eventBox, string tooltipText)
        {
            Xwt.Drawing.Image image = ImageService.GetIcon("md-help");
            eventBox.ModifyBg(StateType.Normal, leftHandBackgroundColor);
            eventBox.Add(new ImageView(image));
            eventBox.ShowAll();

            return(new EventBoxTooltip(eventBox)
            {
                ToolTip = GettextCatalog.GetString(tooltipText),
                Severity = TaskSeverity.Information
            });
        }
コード例 #25
0
        public PropertyGridTable(EditorManager editorManager, PropertyGrid parentGrid)
        {
            Mono.TextEditor.GtkWorkarounds.FixContainerLeak(this);

            this.editorManager = editorManager;
            WidgetFlags       |= Gtk.WidgetFlags.AppPaintable;
            Events            |= Gdk.EventMask.PointerMotionMask;
            CanFocus           = true;
            resizeCursor       = new Cursor(CursorType.SbHDoubleArrow);
            handCursor         = new Cursor(CursorType.Hand1);
            discloseDown       = Xwt.Drawing.Image.FromResource("disclose-arrow-down-light-16.png");
            discloseUp         = Xwt.Drawing.Image.FromResource("disclose-arrow-up-light-16.png");
        }
コード例 #26
0
        public FilterTextBox(Xwt.Drawing.Image background)
        {
            var hbox1 = new global::Gtk.HBox();

            hbox1.Spacing = 6;

            entry.CanFocus      = true;
            entry.IsEditable    = true;
            entry.InvisibleChar = '●';
            hbox1.Add(entry);
            Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(hbox1[entry]));
            w1.Position = 0;

            CSImageButton button1 = new CSImageButton();

            button1.Image = background;

            button1.CanFocus     = true;
            button1.WidthRequest = 20;
            hbox1.Add(button1);
            Box.BoxChild w2 = ((Box.BoxChild)(hbox1[button1]));
            w2.Position = 1;
            w2.Expand   = false;
            w2.Fill     = false;

            EventBox space = new EventBox();

            space.WidthRequest = 20;
            hbox1.Add(space);
            Box.BoxChild w3 = ((Box.BoxChild)(hbox1[space]));
            w3.Position = 2;
            w3.Expand   = false;
            w3.Fill     = false;

            this.Add(hbox1);

            if (this.Child != null)
            {
                this.Child.ShowAll();
            }

            entry.TextInserted += (o, s) => OnTextChangedHandle();
            entry.TextDeleted  += (o, s) => OnTextChangedHandle();

            button1.ButtonPressEvent += button1_ButtonPressEvent;

            entry.FocusInEvent  += FilterTextBox_FocusInEvent;
            entry.FocusOutEvent += FilterTextBox_FocusOutEvent;

            SetShowInfo(DefaultInfo);
        }
コード例 #27
0
        private void PopulateCombo()
        {
            Solution cmb = IdeApp.ProjectOperations.CurrentSelectedSolution;

            if (cmb != null)
            {
                SolutionItem selected   = IdeApp.ProjectOperations.CurrentSelectedSolutionItem;
                TreeIter     activeIter = TreeIter.Zero;

                //TODO: add support for recursive combines
                foreach (Project entry in IdeApp.Workspace.GetAllProjects())
                {
                    if (!(entry is DotNetProject))
                    {
                        continue;
                    }

                    DotNetProject     proj   = (DotNetProject)entry;
                    Xwt.Drawing.Image pixbuf = null;

                    if (proj is DotNetProject && (proj as DotNetProject).LanguageBinding == null)
                    {
                        pixbuf = ImageService.GetIcon(Gtk.Stock.DialogError, IconSize.Menu);
                    }
                    else
                    {
                        pixbuf = ImageService.GetIcon(proj.StockIcon, IconSize.Menu);
                    }

                    TreeIter iter = store.AppendValues(pixbuf, "<b>" + proj.Name + "</b>", proj, proj.BaseDirectory);
                    PopulateCombo(iter, proj.BaseDirectory, proj);

                    if (proj == selected)
                    {
                        activeIter = iter;
                    }
                }

                if (activeIter.Equals(TreeIter.Zero))
                {
                    if (store.GetIterFirst(out activeIter))
                    {
                        this.SetActiveIter(activeIter);
                    }
                }
                else
                {
                    this.SetActiveIter(activeIter);
                }
            }
        }
コード例 #28
0
        EventBoxTooltip ShowErrorTooltip(EventBox eventBox, string tooltipText)
        {
            eventBox.ModifyBg(StateType.Normal, backgroundColor);
            Xwt.Drawing.Image image = ImageService.GetIcon("md-error", IconSize.Menu);

            eventBox.Add(new ImageView(image));
            eventBox.ShowAll();

            return(new EventBoxTooltip(eventBox)
            {
                ToolTip = tooltipText,
                Severity = TaskSeverity.Error
            });
        }
コード例 #29
0
ファイル: SplashScreen.cs プロジェクト: Kalnor/monodevelop
		protected override void OnDestroyed ()
		{
			isDestroyed = true;
			MessageService.PopupDialog -= HandlePopupDialog;
			base.OnDestroyed ();
			if (bitmap != null) {
				bitmap.Dispose ();
				bitmap = null;
			}
			if (monitor != null) {
				monitor.Dispose ();
				monitor = null;
			}
		}
コード例 #30
0
 protected void GetImageInfo(Gdk.Rectangle cell_area, out Xwt.Drawing.Image img, out int x, out int y)
 {
     img = GetImage();
     if (img == null)
     {
         x = (int)(cell_area.X + cell_area.Width / 2);
         y = (int)(cell_area.Y + cell_area.Height / 2);
     }
     else
     {
         x = (int)(cell_area.X + cell_area.Width / 2 - (int)(img.Width / 2));
         y = (int)(cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2));
     }
 }
コード例 #31
0
 protected override void Render(Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags)
 {
     Xwt.Drawing.Image image = this.GetImage();
     if (image == null)
     {
         return;
     }
     using (Cairo.Context s = CairoHelper.Create(window))
     {
         int num1 = cell_area.X + cell_area.Width / 2 - (int)(image.Width / 2.0);
         int num2 = cell_area.Y + cell_area.Height / 2 - (int)(image.Height / 2.0);
         s.DrawImage(widget, image, (double)num1, (double)num2);
     }
 }
コード例 #32
0
 public ToolboxWidget()
 {
     this.Events = EventMask.ExposureMask |
                   EventMask.EnterNotifyMask |
                   EventMask.LeaveNotifyMask |
                   EventMask.ButtonPressMask |
                   EventMask.ButtonReleaseMask |
                   EventMask.KeyPressMask |
                   EventMask.PointerMotionMask;
     this.CanFocus = true;
     discloseDown  = ImageService.GetIcon("md-disclose-arrow-down", Gtk.IconSize.Menu);
     discloseUp    = ImageService.GetIcon("md-disclose-arrow-up", Gtk.IconSize.Menu);
     handCursor    = new Cursor(CursorType.Hand1);
 }
コード例 #33
0
        public static Xwt.Drawing.Image WithSize(this Xwt.Drawing.Image image, Gtk.IconSize size)
        {
            int w, h;

            if (!Gtk.Icon.SizeLookup(size, out w, out h))
            {
                return(image);
            }
            if (size == IconSize.Menu)
            {
                w = h = 16;
            }
            return(image.WithSize(w, h));
        }
コード例 #34
0
ファイル: DockBarItem.cs プロジェクト: tirx1/monodevelop
        public CrossfadeIcon(Xwt.Drawing.Image primary, Xwt.Drawing.Image secondary)
        {
            if (primary == null)
            {
                throw new ArgumentNullException("primary");
            }
            if (secondary == null)
            {
                throw new ArgumentNullException("secondary");
            }

            this.primary   = primary;
            this.secondary = secondary;
        }
コード例 #35
0
        public WelcomePageBarButton(string title, string href, string iconResource = null)
        {
            var actionHandler = new ActionDelegate(this);

            actionHandler.PerformPress += HandlePress;

            Accessible.Role = Atk.Role.Link;

            Accessible.SetTitle(title);
            if (!string.IsNullOrEmpty(href))
            {
                Accessible.SetUrl(href);
            }
            Accessible.Description = "Opens the link in a web browser";

            UpdateStyle();

            VisibleWindow   = false;
            this.Text       = title;
            this.actionLink = href;
            if (!string.IsNullOrEmpty(iconResource))
            {
                imageHover  = Xwt.Drawing.Image.FromResource(iconResource);
                imageNormal = imageHover.WithAlpha(0.7);
            }

            box.Accessible.SetShouldIgnore(true);

            IconTextSpacing = Styles.WelcomeScreen.Links.IconTextSpacing;
            image           = new Xwt.ImageView();
            label           = CreateLabel();
            imageWidget     = image.ToGtkWidget();

            label.Accessible.SetShouldIgnore(true);
            imageWidget.Accessible.SetShouldIgnore(true);

            box.PackStart(imageWidget, false, false, 0);
            if (imageNormal == null)
            {
                imageWidget.NoShowAll = true;
            }
            box.PackStart(label, false, false, 0);
            box.ShowAll();
            Add(box);

            Gui.Styles.Changed += UpdateStyle;
            Update();

            Events |= (Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask);
        }
コード例 #36
0
ファイル: DropDownBox.cs プロジェクト: noah1510/dotdevelop
        public void SetItem(string text, Xwt.Drawing.Image icon, object currentItem)
        {
            if (currentItem != CurrentItem)              // don't update when the same item is set.
            {
                this.Text        = text;
                this.CurrentItem = currentItem;
                this.Pixbuf      = icon;
                this.QueueDraw();
            }

            if (ItemSet != null)
            {
                ItemSet(this, EventArgs.Empty);
            }
        }
コード例 #37
0
        public static Xwt.Drawing.Image GetIcon(string resourceID)
        {
            Xwt.Drawing.Image image = (Xwt.Drawing.Image)null;
            if (ImageIcon.icons.TryGetValue(resourceID, out image))
            {
                return(image);
            }
            Stream stream = Assembly.GetCallingAssembly().GetManifestResourceStream(resourceID) ?? Resources.GetResourceStream(resourceID);

            if (stream != null)
            {
                ImageIcon.icons[resourceID] = image = Xwt.Drawing.Image.FromStream(stream);
            }
            return(image);
        }
コード例 #38
0
ファイル: ImageService.cs プロジェクト: dipakbhau/monodevelop
        public static void AddImage(ImageId imageId, Xwt.Drawing.Image icon)
        {
            if (Guid.Empty == imageId.Guid)
            {
                throw new ArgumentException(nameof(imageId));
            }
            if (icon == null)
            {
                throw new ArgumentNullException(nameof(icon));
            }
            var iconId = $"{imageId.Guid};{imageId.Id}";

            imageIdToStockId.Add(imageId, iconId);
            AddIcon(iconId, icon);
        }
コード例 #39
0
        void AddTopLevelTemplateCategory(TemplateCategory category)
        {
            Xwt.Drawing.Image icon = GetIcon(category.IconId, IconSize.Menu);
            categoryTextRenderer.CategoryIconWidth = (int)icon.Width;

            templateCategoriesListStore.AppendValues(
                MarkupTopLevelCategoryName(category.Name),
                icon,
                category);

            foreach (TemplateCategory subCategory in category.Categories)
            {
                AddSubTemplateCategory(subCategory);
            }
        }
コード例 #40
0
		public MessageBubbleCache (TextEditor editor)
		{
			this.editor = editor;
			errorPixbuf = Xwt.Drawing.Image.FromResource ("gutter-error-light-15.png");
			warningPixbuf = Xwt.Drawing.Image.FromResource ("gutter-warning-light-15.png");
			
			editor.EditorOptionsChanged += HandleEditorEditorOptionsChanged;
			editor.TextArea.LeaveNotifyEvent += HandleLeaveNotifyEvent;
			editor.TextArea.MotionNotifyEvent += HandleMotionNotifyEvent;
			editor.TextArea.BeginHover += HandleBeginHover;
			editor.VAdjustment.ValueChanged += HandleValueChanged;
			editor.HAdjustment.ValueChanged += HandleValueChanged;
			fontDescription = FontService.GetFontDescription ("MessageBubbles");
			tooltipFontDescription = FontService.GetFontDescription ("MessageBubbleTooltip");
			errorCountFontDescription = FontService.GetFontDescription ("MessageBubbleCounter");
		}
コード例 #41
0
		public WelcomePageRecentProjectsList (string title = null, int count = 10): base (title)
		{
			openProjectIcon = Xwt.Drawing.Image.FromResource ("open_solution.png");
			newProjectIcon = Xwt.Drawing.Image.FromResource ("new_solution.png");
			box = new VBox ();

			itemCount = count;
			
			DesktopService.RecentFiles.Changed += RecentFilesChanged;
			RecentFilesChanged (null, null);

			SetContent (box);
			TitleAlignment.BottomPadding = Styles.WelcomeScreen.Pad.Solutions.LargeTitleMarginBottom;
			ContentAlignment.LeftPadding = 0;
			ContentAlignment.RightPadding = 0;
		}
コード例 #42
0
 protected override void OnDestroyed()
 {
     isDestroyed = true;
     MessageService.PopupDialog -= HandlePopupDialog;
     base.OnDestroyed();
     if (bitmap != null)
     {
         bitmap.Dispose();
         bitmap = null;
     }
     if (monitor != null)
     {
         monitor.Dispose();
         monitor = null;
     }
 }
コード例 #43
0
        public WelcomePageListButton(string title, string subtitle, Xwt.Drawing.Image icon, string actionUrl)
        {
            VisibleWindow = false;
            this.title = title;
            this.subtitle = subtitle;
            this.icon = icon;
            this.actionUrl = actionUrl;
            this.SmallTitleColor = smallTitleColor;
            this.MediumTitleColor = mediumTitleColor;
            WidthRequest = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.Width;
            HeightRequest = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.Height + 2;
            Events |= (Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask);

            LeftTextPadding = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TextLeftPadding;
            InternalPadding = Styles.WelcomeScreen.Pad.Padding;
        }
コード例 #44
0
        public WelcomePageRecentProjectsList(string title = null, int count = 10) : base(title)
        {
            openProjectIcon = Xwt.Drawing.Image.FromResource("welcome-open-solution-16.png");
            newProjectIcon  = Xwt.Drawing.Image.FromResource("welcome-new-solution-16.png");
            box             = new VBox();

            itemCount = count;

            DesktopService.RecentFiles.ProjectsChanged += RecentFilesChanged;
            RecentFilesChanged(null, null);

            SetContent(box);
            TitleAlignment.BottomPadding  = Styles.WelcomeScreen.Pad.Solutions.LargeTitleMarginBottom;
            ContentAlignment.LeftPadding  = 0;
            ContentAlignment.RightPadding = 0;
        }
コード例 #45
0
        void AddTopLevelTemplateCategory(TemplateCategory category)
        {
            Xwt.Drawing.Image icon = GetIcon(category.IconId ?? "md-platform-other", IconSize.Menu);
            categoryTextRenderer.CategoryIconWidth = (int)icon.Width;

            var iter = templateCategoriesTreeStore.AppendValues(
                MarkupTopLevelCategoryName(category.Name),
                icon,
                category);

            foreach (TemplateCategory subCategory in category.Categories)
            {
                AddSubTemplateCategory(iter, subCategory);
            }
            templateCategoriesTreeView.ExpandAll();
        }
コード例 #46
0
		public MessageBubbleCache (MonoTextEditor editor)
		{
			this.editor = editor;
			errorPixbuf = Xwt.Drawing.Image.FromResource ("gutter-error-15.png");
			warningPixbuf = Xwt.Drawing.Image.FromResource ("gutter-warning-15.png");
			
			editor.EditorOptionsChanged += HandleEditorEditorOptionsChanged;
			editor.TextArea.LeaveNotifyEvent += HandleLeaveNotifyEvent;
			editor.TextArea.MotionNotifyEvent += HandleMotionNotifyEvent;
			editor.TextArea.BeginHover += HandleBeginHover;
			editor.VAdjustment.ValueChanged += HandleValueChanged;
			editor.HAdjustment.ValueChanged += HandleValueChanged;
			fontDescription = FontService.GetFontDescription ("Pad");
			tooltipFontDescription = FontService.GetFontDescription ("Pad").CopyModified (weight: Pango.Weight.Bold);
			errorCountFontDescription = FontService.GetFontDescription ("Pad").CopyModified (weight: Pango.Weight.Bold);
		}
コード例 #47
0
ファイル: SplashScreen.cs プロジェクト: Kalnor/monodevelop
		//this is a popup so it behaves like other splashes on Windows, i.e. doesn't show up as a second window in the taskbar.
		public SplashScreenForm () : base (WindowType.Popup)
		{
			AppPaintable = true;
			this.Decorated = false;
			this.WindowPosition = WindowPosition.Center;
			this.TypeHint = Gdk.WindowTypeHint.Splashscreen;
			this.showVersionInfo = BrandingService.GetBool ("SplashScreen", "ShowVersionInfo") ?? true;

			var file = BrandingService.GetFile ("SplashScreen.png");
			if (file != null)
				bitmap = Xwt.Drawing.Image.FromFile (file);
			else
				bitmap = Xwt.Drawing.Image.FromResource ("SplashScreen.png");

			this.Resize ((int)bitmap.Width, (int)bitmap.Height);
			MessageService.PopupDialog += HandlePopupDialog;
		}
コード例 #48
0
ファイル: TestStatusIcon.cs プロジェクト: Kalnor/monodevelop
		static TestStatusIcon ()
		{
			try {
				Running = Xwt.Drawing.Image.FromResource ("unit-running-light-16.png");
				Failure = Xwt.Drawing.Image.FromResource ("unit-failed-light-16.png");
				None = Xwt.Drawing.Image.FromResource ("unit-not-yet-run-light-16.png");
				NotRun = Xwt.Drawing.Image.FromResource ("unit-skipped-light-16.png");
				Success = Xwt.Drawing.Image.FromResource ("unit-success-light-16.png");
				SuccessAndFailure = Xwt.Drawing.Image.FromResource ("unit-mixed-results-light-16.png");
				Loading = Xwt.Drawing.Image.FromResource ("unit-loading-light-16.png");
				Inconclusive = Xwt.Drawing.Image.FromResource ("unit-inconclusive-light-16.png");
				OldFailure = Failure.WithAlpha (0.4);
				OldSuccess = Success.WithAlpha (0.4);
				OldSuccessAndFailure = SuccessAndFailure.WithAlpha (0.4);
				OldInconclusive = Inconclusive.WithAlpha (0.4);
			} catch (Exception e) {
				LoggingService.LogError ("Error while loading icons.", e);
			}
		}
		public GtkPackagingProjectTemplateWizardPageWidget ()
		{
			this.Build ();

			backgroundImage = Xwt.Drawing.Image.FromResource ("preview-nuget.png");
			backgroundImageView = new ImageView (backgroundImage);
			backgroundImageView.Xalign = 1.0f;
			backgroundImageView.Yalign = 0.5f;
			backgroundLargeImageVBox.PackStart (backgroundImageView, true, true, 0);

			var separatorColor = Styles.NewProjectDialog.ProjectConfigurationSeparatorColor.ToGdkColor ();
			separator.ModifyBg (StateType.Normal, separatorColor);

			backgroundColor = Styles.NewProjectDialog.ProjectConfigurationLeftHandBackgroundColor.ToGdkColor ();
			leftBorderEventBox.ModifyBg (StateType.Normal, backgroundColor);
			configurationTopEventBox.ModifyBg (StateType.Normal, backgroundColor);
			configurationTableEventBox.ModifyBg (StateType.Normal, backgroundColor);
			configurationBottomEventBox.ModifyBg (StateType.Normal, backgroundColor);
			backgroundLargeImageEventBox.ModifyBg (StateType.Normal, backgroundColor);
		}
コード例 #50
0
ファイル: RoundButton.cs プロジェクト: Kalnor/monodevelop
        public RoundButton()
        {
            WidgetFlags |= Gtk.WidgetFlags.AppPaintable;
            Events |= EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.LeaveNotifyMask | EventMask.PointerMotionMask;
            VisibleWindow = false;
            SetSizeRequest (height, height);

            btnNormal = Xwt.Drawing.Image.FromResource (GetType (), "btn-execute-normal-light-32.png");
            //			btnInactive = new LazyImage ("btn-execute-disabled-light-32.png");
            //			btnPressed = new LazyImage ("btn-execute-pressed-light-32.png");
            //			btnHover = new LazyImage ("btn-execute-hover-light-32.png");

            iconRunNormal = Xwt.Drawing.Image.FromResource (GetType (), "ico-execute-normal-light-32.png");
            iconRunDisabled = Xwt.Drawing.Image.FromResource (GetType (), "ico-execute-disabled-light-32.png");

            iconStopNormal = Xwt.Drawing.Image.FromResource (GetType (), "ico-stop-normal-light-32.png");
            iconStopDisabled = Xwt.Drawing.Image.FromResource (GetType (), "ico-stop-disabled-light-32.png");

            iconBuildNormal = Xwt.Drawing.Image.FromResource (GetType (), "ico-build-normal-light-32.png");
            iconBuildDisabled = Xwt.Drawing.Image.FromResource (GetType (), "ico-build-disabled-light-32.png");
        }
コード例 #51
0
		static VersionControlService ()
		{
			IdeApp.Initialized += delegate {
				try {
					overlay_modified = Xwt.Drawing.Image.FromResource("modified-overlay-16.png");
					overlay_removed = Xwt.Drawing.Image.FromResource("removed-overlay-16.png");
					overlay_renamed = Xwt.Drawing.Image.FromResource("renamed-overlay-16.png");
					overlay_conflicted = Xwt.Drawing.Image.FromResource("conflict-overlay-16.png");
					overlay_added = Xwt.Drawing.Image.FromResource("added-overlay-16.png");
					overlay_controled = Xwt.Drawing.Image.FromResource("versioned-overlay-16.png");
					overlay_unversioned = Xwt.Drawing.Image.FromResource("unversioned-overlay-16.png");
					overlay_protected = Xwt.Drawing.Image.FromResource("lock-required-overlay-16.png");
					overlay_unlocked = Xwt.Drawing.Image.FromResource("unlocked-overlay-16.png");
					overlay_locked = Xwt.Drawing.Image.FromResource("locked-overlay-16.png");
					overlay_ignored = Xwt.Drawing.Image.FromResource("ignored-overlay-16.png");

					icon_modified = ImageService.GetIcon ("vc-file-modified", Gtk.IconSize.Menu);
					icon_removed = ImageService.GetIcon ("vc-file-removed", Gtk.IconSize.Menu);
					icon_conflicted = ImageService.GetIcon ("vc-file-conflicted", Gtk.IconSize.Menu);
					icon_added = ImageService.GetIcon ("vc-file-added", Gtk.IconSize.Menu);
					icon_controled = Xwt.Drawing.Image.FromResource("versioned-overlay-16.png");
				} catch (Exception e) {
					LoggingService.LogError ("Error while loading icons.", e);
				}

				IdeApp.Workspace.SolutionLoaded += (sender, e) => SessionSolutionDisabled |= IsSolutionDisabled (e.Solution);

				IdeApp.Workspace.FileAddedToProject += OnFileAdded;
				//IdeApp.Workspace.FileChangedInProject += OnFileChanged;
				//IdeApp.Workspace.FileRemovedFromProject += OnFileRemoved;
				//IdeApp.Workspace.FileRenamedInProject += OnFileRenamed;

				IdeApp.Workspace.ItemAddedToSolution += OnEntryAdded;
				IdeApp.Exiting += delegate {
					DelayedSaveComments (null);
				};
			};

			AddinManager.AddExtensionNodeHandler ("/MonoDevelop/VersionControl/VersionControlSystems", OnExtensionChanged);
		}
コード例 #52
0
		public SearchBarControl ()
		{
			InitializeComponent ();
			DataContext = this;

			SearchBar.GotKeyboardFocus += (o, e) => {
				if (searchText == placeholderText)
					SearchText = string.Empty;
			};
			IdeApp.Workbench.RootWindow.SetFocus += (o, e) =>
			{
				if (Keyboard.FocusedElement == SearchBar) {
					Keyboard.ClearFocus ();
					IdeApp.Workbench.RootWindow.Present ();
				}
			};

			searchIcon = Stock.SearchboxSearch.GetStockIcon ().WithSize (Xwt.IconSize.Small);
			clearIcon = ((MonoDevelop.Core.IconId)"md-searchbox-clear").GetStockIcon ().WithSize (Xwt.IconSize.Small);
			SearchIcon.Image = searchIcon;
			SearchIcon.Focusable = false;
		}
		public GtkAspNetProjectTemplateWizardPageWidget ()
		{
			this.Build ();

			if (Platform.IsMac) {
				int labelPaddingHeight = 5;
				if (IsYosemiteOrHigher ())
					labelPaddingHeight--;
				includeLabelPadding.HeightRequest = labelPaddingHeight;
				testingLabelPadding.HeightRequest = labelPaddingHeight;

				int leftPaddingWidth = 28;
				mvcDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
				webFormsDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
				webApiDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
				includeUnitTestProjectDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
			}

			double scale = GtkWorkarounds.GetPixelScale ();

			backgroundImage = Xwt.Drawing.Image.FromResource ("aspnet-wizard-page.png");
			backgroundImageView = new ImageView (backgroundImage);
			backgroundImageView.Xalign = (float)(1/scale);
			backgroundImageView.Yalign = (float)(1/scale);
			backgroundLargeImageVBox.PackStart (backgroundImageView, true, true, 0);

			var separatorColor = new Color (176, 178, 181);
			testingSeparator.ModifyBg (StateType.Normal, separatorColor);

			leftBorderEventBox.ModifyBg (StateType.Normal, backgroundColor);
			configurationTopEventBox.ModifyBg (StateType.Normal, backgroundColor);
			configurationTableEventBox.ModifyBg (StateType.Normal, backgroundColor);
			configurationBottomEventBox.ModifyBg (StateType.Normal, backgroundColor);
			backgroundLargeImageEventBox.ModifyBg (StateType.Normal, backgroundColor);

			if (Platform.IsWindows && scale > 1.0)
				ScaleWidgets (scale);
		}
コード例 #54
0
		public WelcomePageFirstRun ()
		{
			VisibleWindow = false;
			SetSizeRequest (WidgetSize.Width, WidgetSize.Height);

			string iconFile = BrandingService.GetString ("ApplicationIcon");
			if (iconFile != null) {
				iconFile = BrandingService.GetFile (iconFile);
				brandedIcon = Xwt.Drawing.Image.FromFile (iconFile);
			}

			TitleOffset = TextOffset = IconOffset = new Gdk.Point ();

			tracker = new MouseTracker (this);
			tracker.MouseMoved += (sender, e) => {
				ButtonHovered = new Gdk.Rectangle (ButtonPosistion, ButtonSize).Contains (tracker.MousePosition);
			};

			tracker.HoveredChanged += (sender, e) => {
				if (!tracker.Hovered) 
					ButtonHovered = false;
			};
		}
コード例 #55
0
		static DockItemTitleTab ()
		{
			pixClose = Xwt.Drawing.Image.FromResource ("pad-close-9.png");
			pixAutoHide = Xwt.Drawing.Image.FromResource ("pad-minimize-9.png");
			pixDock = Xwt.Drawing.Image.FromResource ("pad-dock-9.png");

			Xwt.Drawing.NinePatchImage tabBackImage9;
			if (dockTabBackImage is Xwt.Drawing.ThemedImage) {
				var img = ((Xwt.Drawing.ThemedImage)dockTabBackImage).GetImage (Xwt.Drawing.Context.GlobalStyles);
				tabBackImage9 = img as Xwt.Drawing.NinePatchImage;
			} else
				tabBackImage9 = dockTabBackImage as Xwt.Drawing.NinePatchImage;
			TabPadding = tabBackImage9.Padding;


			Xwt.Drawing.NinePatchImage tabActiveBackImage9;
			if (dockTabActiveBackImage is Xwt.Drawing.ThemedImage) {
				var img = ((Xwt.Drawing.ThemedImage)dockTabActiveBackImage).GetImage (Xwt.Drawing.Context.GlobalStyles);
				tabActiveBackImage9 = img as Xwt.Drawing.NinePatchImage;
			} else
				tabActiveBackImage9 = dockTabActiveBackImage as Xwt.Drawing.NinePatchImage;
			TabActivePadding = tabActiveBackImage9.Padding;
		}
コード例 #56
0
ファイル: RoundButton.cs プロジェクト: Kalnor/monodevelop
        protected override void OnDestroyed()
        {
            base.OnDestroyed ();

            if (btnNormal != null) {
                btnNormal.Dispose ();
                btnNormal = null;
            }

            if (iconRunNormal != null) {
                iconRunNormal.Dispose ();
                iconRunNormal = null;
            }

            if (iconRunDisabled != null) {
                iconRunDisabled.Dispose ();
                iconRunDisabled = null;
            }

            if (iconStopNormal != null) {
                iconStopNormal.Dispose ();
                iconStopNormal = null;
            }

            if (iconStopDisabled != null) {
                iconStopDisabled.Dispose ();
                iconStopDisabled = null;
            }

            if (iconBuildNormal != null) {
                iconBuildNormal.Dispose ();
                iconBuildNormal = null;
            }

            if (iconBuildDisabled != null) {
                iconBuildDisabled.Dispose ();
                iconBuildDisabled = null;
            }
        }
コード例 #57
0
		void CreateControl ()
		{
			control = new HPaned ();

			store = new Gtk.TreeStore (typeof (Xwt.Drawing.Image), // image - type
									   typeof (bool),       // read?
									   typeof (TaskListEntry),       // read? -- use Pango weight
									   typeof (string));
			SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Type", "store__Read", "store__Task", "store__Description");
			TypeDescriptor.AddAttributes (store, modelAttr);

			TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTasks);
			filter = new TreeModelFilter (store, null);
			filter.VisibleFunc = filterFunct;
			
			sort = new TreeModelSort (filter);
			sort.SetSortFunc (VisibleColumns.Type, SeverityIterSort);
			sort.SetSortFunc (VisibleColumns.Project, ProjectIterSort);
			sort.SetSortFunc (VisibleColumns.File, FileIterSort);
			
			view = new PadTreeView (sort);
			view.ShowExpanders = true;
			view.RulesHint = true;
			view.DoPopupMenu = (evnt) => IdeApp.CommandService.ShowContextMenu (view, evnt, CreateMenu ());
			AddColumns ();
			LoadColumnsVisibility ();
			view.Columns[VisibleColumns.Type].SortColumnId = VisibleColumns.Type;
			view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project;
			view.Columns[VisibleColumns.File].SortColumnId = VisibleColumns.File;
			
			sw = new MonoDevelop.Components.CompactScrolledWindow ();
			sw.ShadowType = ShadowType.None;
			sw.Add (view);
			TaskService.Errors.TasksRemoved      += ShowResults;
			TaskService.Errors.TasksAdded        += TaskAdded;
			TaskService.Errors.TasksChanged      += TaskChanged;
			TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged;
			
			IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
			IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed;
			
			view.RowActivated += new RowActivatedHandler (OnRowActivated);
			
			iconWarning = ImageService.GetIcon (Ide.Gui.Stock.Warning, Gtk.IconSize.Menu);
			iconError = ImageService.GetIcon (Ide.Gui.Stock.Error, Gtk.IconSize.Menu);
			iconInfo = ImageService.GetIcon (Ide.Gui.Stock.Information, Gtk.IconSize.Menu);
			iconEmpty = ImageService.GetIcon (Ide.Gui.Stock.Empty, Gtk.IconSize.Menu);
			
			control.Add1 (sw);
			
			outputView = new LogView { Name = "buildOutput" };
			control.Add2 (outputView);
			
			control.ShowAll ();
			
			control.SizeAllocated += HandleControlSizeAllocated;
			
			bool outputVisible = OutputViewVisible;
			if (outputVisible) {
				outputView.Visible = true;
				logBtn.Active = true;
			} else {
				outputView.Hide ();
			}
			
			sw.SizeAllocated += HandleSwSizeAllocated;
			
			// Load existing tasks
			foreach (TaskListEntry t in TaskService.Errors) {
				AddTask (t);
			}

			control.FocusChain = new Gtk.Widget [] { sw };
		}
コード例 #58
0
ファイル: ImageView.cs プロジェクト: riverans/monodevelop
		public ImageView (Xwt.Drawing.Image image): this ()
		{
			this.image = image;
		}
コード例 #59
0
 static SearchEntry()
 {
     clearImage = Xwt.Drawing.Image.FromResource ("searchbox-clear-16.png");
     searchImage = Xwt.Drawing.Image.FromResource ("searchbox-search-16.png");
 }
コード例 #60
0
 public HoverImageButton(Xwt.Drawing.Image img)
     : this()
 {
     normal_pixbuf = img;
     active_pixbuf = img;
     UpdateImage ();
 }