Пример #1
0
        protected override void LoadIcon(Gtk.Image image, int size)
        {
            base.LoadIcon(image, size);

            string parent_mime_type = XdgMime.GetMimeTypeFromFileName(Hit.EscapedParentUri);

            if (parent_mime_type == null)
            {
                return;
            }

            Gdk.Pixbuf emblem = WidgetFu.LoadMimeIcon(parent_mime_type, 24);

            if (emblem == null)
            {
                return;
            }

            Gdk.Pixbuf icon = image.Pixbuf.Copy();

            emblem.Composite(icon,
                             0,                                             // dest_x
                             icon.Height - emblem.Height,                   // dest_y
                             emblem.Width,                                  // dest_width
                             emblem.Height,                                 // dest_height
                             0,                                             // offset_x
                             icon.Height - emblem.Height,                   // offset_y
                             1, 1,                                          // scale
                             Gdk.InterpType.Bilinear, 255);

            image.Pixbuf.Dispose();
            image.Pixbuf = icon;
        }
            public GameAdvertisementGraph(ICSClient c)
            {
                graph = new Graph ();
                categories = new Hashtable ();
                categories["blitz"] = 1;
                categories["standard"] = 1;
                categories["lightning"] = 1;
                categories["untimed"] = 1;

                graph.GameFocusedEvent += OnGameFocused;
                graph.GameClickedEvent += OnGameClicked;

                infoLabel = new Label ();
                infoLabel.Xalign = 0;
                infoLabel.Xpad = 4;
                this.client = c;

                client.GameAdvertisementAddEvent +=
                    OnGameAdvertisementAddEvent;
                client.GameAdvertisementRemoveEvent +=
                    OnGameAdvertisementRemoveEvent;
                client.GameAdvertisementsClearedEvent +=
                    OnGameAdvertisementsCleared;
                SetSizeRequest (600, 400);

                image = new Gtk.Image ();
                PackStart (graph, true, true, 4);

                HBox box = new HBox ();
                  box.PackStart (image, false, false, 4);
                  box.PackStart (infoLabel, true, true, 4);

                  PackStart (box, false, true, 4);
                  ShowAll ();
            }
Пример #3
0
			public ThumbnailRequest (Gtk.Image image, string thumbnail_file, Beagle.Hit hit, int size)
			{
				Image = image;
				ThumbnailFile = thumbnail_file;
				Hit = hit;
				Size = size;
			}
        public ScreenshotViewerController(Glade.XML gxml, ScreenshotViewerModel ssViewerModel)
        {
            this.ssViewerModel = ssViewerModel;

            nextNoteButton = (Gtk.Button)gxml.GetWidget ("nextNoteButton");
            previousNoteButton = (Gtk.Button)gxml.GetWidget ("previousNoteButton");
            forwardHourButton = (Gtk.Button)gxml.GetWidget ("forwardHourButton");
            backHourButton = (Gtk.Button)gxml.GetWidget ("backHourButton");

            forward10MinButton = (Gtk.Button)gxml.GetWidget ("foward10MinButton");
            back10MinButton = (Gtk.Button)gxml.GetWidget ("back10MinButton");

            noteViewBox = (Gtk.VBox)gxml.GetWidget ("noteViewBox");

            screenshotImage = (Gtk.Image)gxml.GetWidget ("noteImage");

            nextNoteButton.Clicked += this.NextNoteButtonPressed;
            previousNoteButton.Clicked += this.PrevNoteButtonPressed;

            forwardHourButton.Clicked += this.ForwardHourButtonPressed;
            backHourButton.Clicked += this.BackHourButtonPressed;

            forward10MinButton.Clicked += this.Forward10MinButtonPressed;
            back10MinButton.Clicked += this.Back10MinButtonPressed;

            noteViewBox.ScrollEvent += this.NoteViewScroll;
            screenshotImage.ScrollEvent += this.NoteViewScroll;

            doUpdateTimeCheckFilters ();
        }
Пример #5
0
		public override Gtk.Widget GetVisualizerWidget (ObjectValue val)
		{
			var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
			string file = Path.GetTempFileName ();
			Gdk.Pixbuf pixbuf;

			ops.AllowTargetInvoke = true;

			try {
				var pix = (RawValue) val.GetRawValue (ops);
				pix.CallMethod ("Save", file, "png");
				pixbuf = new Gdk.Pixbuf (file);
			} finally {
				File.Delete (file);
			}

			var sc = new Gtk.ScrolledWindow ();
			sc.ShadowType = Gtk.ShadowType.In;
			sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			var image = new Gtk.Image (pixbuf);
			sc.AddWithViewport (image);
			sc.ShowAll ();
			return sc;
		}
Пример #6
0
        public ImageSelectorEditor()
        {
            Spacing                = 3;
            imageFrame             = new Gtk.Frame();
            imageFrame.Shadow      = Gtk.ShadowType.In;
            imageFrame.BorderWidth = 2;
            PackStart(imageFrame, false, false, 0);

            image = new Gtk.Image(GnomeStock.Blank, Gtk.IconSize.Button);
            imageFrame.Add(image);

            Gtk.Frame frame = new Gtk.Frame();
            entry             = new Gtk.Label();
            entry.Xalign      = 0;
            frame.Shadow      = Gtk.ShadowType.In;
            frame.BorderWidth = 2;
            frame.Add(entry);
            PackStart(frame, true, true, 0);

            clearButton          = new Gtk.Button(new Gtk.Image(Gtk.Stock.Clear, Gtk.IconSize.Menu));
            clearButton.Clicked += OnClearImage;
            PackStart(clearButton, false, false, 0);

            button = new Gtk.Button("...");
            PackStart(button, false, false, 0);
            button.Clicked += button_Clicked;
            ShowAll();
        }
Пример #7
0
        public override Gtk.Widget GetVisualizerWidget(ObjectValue val)
        {
            var    ops  = DebuggingService.DebuggerSession.EvaluationOptions.Clone();
            string file = Path.GetTempFileName();

            Gdk.Pixbuf pixbuf;

            ops.AllowTargetInvoke = true;

            try {
                var pix = (RawValue)val.GetRawValue(ops);
                pix.CallMethod("Save", file, "png");
                pixbuf = new Gdk.Pixbuf(file);
            } finally {
                File.Delete(file);
            }

            var sc = new Gtk.ScrolledWindow();

            sc.ShadowType       = Gtk.ShadowType.In;
            sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            var image = new Gtk.Image(pixbuf);

            sc.AddWithViewport(image);
            sc.ShowAll();
            return(sc);
        }
Пример #8
0
        protected override void LoadIcon(Gtk.Image image, int size)
        {
            Hashtable icons = (Hashtable)all_icons[size];

            if (icons == null)
            {
                all_icons[size] = icons = IconsForSize(size);
            }

            string protocol = Hit.GetFirstProperty("fixme:protocol");

            if (protocol == null)
            {
                protocol = String.Empty;
            }

            if (icons [protocol] != null)
            {
                image.Pixbuf = (Gdk.Pixbuf)icons [protocol];
            }
            else
            {
                image.Pixbuf = WidgetFu.LoadThemeIcon("im", size);
            }
        }
Пример #9
0
        private void CreateContent(Gtk.Image img)
        {
            if (button.Child != null)
            {
                button.Remove(button.Child);
            }


            Gtk.Box content = new Gtk.HBox();
            button.Add(content);
            content.Show();

            if (img != null)
            {
                content.Add(img);
            }


            if (label != null)
            {
                label = new Gtk.Label(label.Text);  //for some stupid reason we have to re-create it (why??)
                label.Show();
                content.Add(label);
            }
        }
 protected virtual void Build()
 {
     Stetic.Gui.Initialize(this);
     // Widget omvviewerlight.TexturePreview
     this.Name = "omvviewerlight.TexturePreview";
     this.Title = Mono.Unix.Catalog.GetString("TexturePreview");
     this.WindowPosition = ((Gtk.WindowPosition)(4));
     // Container child omvviewerlight.TexturePreview.Gtk.Container+ContainerChild
     this.vbox1 = new Gtk.VBox();
     this.vbox1.Name = "vbox1";
     this.vbox1.Spacing = 6;
     // Container child vbox1.Gtk.Box+BoxChild
     this.label_title = new Gtk.Label();
     this.label_title.Name = "label_title";
     this.vbox1.Add(this.label_title);
     Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox1[this.label_title]));
     w1.Position = 0;
     w1.Expand = false;
     w1.Fill = false;
     // Container child vbox1.Gtk.Box+BoxChild
     this.image = new Gtk.Image();
     this.image.Name = "image";
     this.vbox1.Add(this.image);
     Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox1[this.image]));
     w2.Position = 1;
     w2.Expand = false;
     w2.Fill = false;
     this.Add(this.vbox1);
     if ((this.Child != null)) {
         this.Child.ShowAll();
     }
     this.DefaultWidth = 400;
     this.DefaultHeight = 300;
     this.Show();
 }
Пример #11
0
        public SearchGroupWidget()
        {
            this.Build();
            image = new Gtk.Image();
            image.SetFromIconName("system-search", Gtk.IconSize.Dnd);

            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Search Group"));
            label.Show();

            userTreeview.Selection.Mode = Gtk.SelectionMode.Multiple;


            user_id_column        = new Gtk.TreeViewColumn();
            user_id_column.Title  = Mono.Unix.Catalog.GetString("Group ID");
            user_id_cell_renderer = new Gtk.CellRendererText();
            user_id_column.PackStart(user_id_cell_renderer, true);
            user_id_column.AddAttribute(user_id_cell_renderer, "text", 0);
            userTreeview.AppendColumn(user_id_column);
            store = new Gtk.ListStore(typeof(string), typeof(string));
            userTreeview.Model = store;

            Gtk.TreeViewColumn user_name_column = new Gtk.TreeViewColumn();
            user_name_column.Title = Mono.Unix.Catalog.GetString("Description");
            Gtk.CellRendererText user_name_cell_renderer = new Gtk.CellRendererText();
            user_name_column.PackStart(user_name_cell_renderer, true);
            user_name_column.AddAttribute(user_name_cell_renderer, "text", 1);
            userTreeview.AppendColumn(user_name_column);
            userTreeview.ShowAll();

            //store.AppendValues("a","b");
        }
Пример #12
0
        public static void SetCachedImage(this Image self, string imageUrl)
        {
            int  maxRetries = 2;
            bool loaded     = false;

            for (int count = 1; !loaded; count++)
            {
                using (var file = new FileStream(FileCache.FromUrl(imageUrl), FileMode.Open))
                {
                    try
                    {
                        self.Pixbuf = new Pixbuf(file);
                        loaded      = true;
                    }
                    catch (Exception e)
                    {
                        //possible corruption in a cached file, for example an partial aborted file.

                        if (count == maxRetries)
                        {
                            throw e;
                        }
                        else
                        {
                            file.Close();
                            HandeException(imageUrl, e);
                        }
                    }
                }
            }
        }
Пример #13
0
 public ThumbnailRequest(Gtk.Image image, string thumbnail_file, Beagle.Hit hit, int size)
 {
     Image         = image;
     ThumbnailFile = thumbnail_file;
     Hit           = hit;
     Size          = size;
 }
Пример #14
0
        /// <summary>
        /// Loads the pdf.  This is the function you call when you want to display a pdf.
        /// </summary>
        /// <param name='pdfFileName'>
        /// Pdf file name.
        /// </param>
        public void LoadPdf(string pdfFileName)
        {
            pdf = Poppler.Document.NewFromFile(pdfFileName, "");
            PageCountLabel.Text = @"/" + (pdf.NPages - 1).ToString();
            CurrentPage.Value = 0;
            CurrentPage.Adjustment.Upper = pdf.NPages-1;

            foreach (Gtk.Widget w in vboxImages.AllChildren)
            {
                vboxImages.Remove(w);
            }

            for (this.pageIndex = 0; this.pageIndex < pdf.NPages; this.pageIndex++)
            {
                Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (Gdk.Colorspace.Rgb, false, 8, 0, 0);
                Gtk.Image img = new Gtk.Image();
                img.Pixbuf = pixbuf;
                img.Name = "image1";

                //vboxImages.Add (img);
                RenderPage(ref img);
            }

            this.ShowAll();
        }
Пример #15
0
        // TODO: remove the method if gkt supports entry icons
        // on all platforms
        public Gtk.Widget GetFallbackWrapper()
        {
            if (IconsSupported)
            {
                return(this);
            }

            // if the entry does not support embedded icons (old gtk version, e.g. on MS Windows),
            // return a wrapper with the icon left to the entry
            Gtk.HBox hbox = new Gtk.HBox(false, 3);

            Gdk.Pixbuf pb  = Basenji.Icons.Icon.Stock_Find.Render(this, Gtk.IconSize.Menu);
            Gtk.Image  img = new Gtk.Image(pb);

            Gtk.Button btn = new Gtk.Button();
            btn.Relief   = Gtk.ReliefStyle.None;
            btn.Clicked += delegate { ShowPopup(); };
            btn.Image    = img;

            // also disable the button if the Search entry is disabled
            this.StateChanged += delegate { btn.Sensitive = this.Sensitive; };

            hbox.PackStart(btn, false, false, 0);
            hbox.PackStart(this, true, true, 0);

            return(hbox);
        }
Пример #16
0
        protected virtual void OnComboChanged(object sender, System.EventArgs e)
        {
            string newIcon = null;

            if (combo.Entry.Text == newClassLabel)
            {
                newIcon = "md-addinauthoring-newclass";
            }
            if (combo.Entry.Text == newInterfaceLabel)
            {
                newIcon = "md-addinauthoring-newinterface";
            }

            if (newIcon != null)
            {
                if (project.DefaultNamespace.Length > 0)
                {
                    combo.Entry.Text = project.DefaultNamespace + ".";
                }
                eventbox.Remove(typeImage);
                typeImage = new Gtk.Image(newIcon, Gtk.IconSize.Menu);
                eventbox.Add(typeImage);
                eventbox.ShowAll();
            }
            else
            {
                eventbox.Hide();
            }
            if (!loading)
            {
                OnChanged();
            }
        }
Пример #17
0
        public static Gtk.Image GetImage(string name, Gtk.IconSize size)
        {
            var img = new Gtk.Image();

            //img.LoadIcon (name, size);
            return(img);
        }
Пример #18
0
        public Gtk.Button create_button(Gtk.Label label, Gtk.Image image)
        {
            Gtk.Button button = new Gtk.Button();
            Gtk.VBox   vbox   = new Gtk.VBox();

            label.WidthChars    = 24;
            label.MaxWidthChars = 24;
            label.LineWrap      = true;
            label.Justify       = Gtk.Justification.Center;

            vbox.Add(image);
            vbox.Add(label);
            button.Add(vbox);
            button.ShowAll();

            int h = 46 + label.SizeRequest().Height;

            if (h < 80)
            {
                h = 80;
            }

            button.SetSizeRequest(1, h);

            return(button);
        }
Пример #19
0
 protected override void LoadIcon(Gtk.Image image, int size)
 {
     if (!thumbnailer.SetThumbnailIcon(image, Hit, size))
     {
         base.LoadIcon(image, size);
     }
 }
        public QueryWidget(PhotoQuery query, Db db, TagSelectionWidget selector)
        {
            tips.Enable();

            this.query     = query;
            query.Changed += HandleChanged;

            Gtk.HSeparator sep = new Gtk.HSeparator();
            sep.Show();
            this.PackStart(sep, false, false, 0);

            Gtk.HBox hbox = new Gtk.HBox();
            hbox.Show();
            this.PackStart(hbox, false, false, 0);

            label = new Gtk.Label(Catalog.GetString("Find: "));
            label.Show();
            label.Ypad = 9;
            hbox.PackStart(label, false, false, 0);

            untagged         = new Gtk.Label(Catalog.GetString("Untagged photos"));
            untagged.Visible = false;
            hbox.PackStart(untagged, false, false, 0);

            comma_label         = new Gtk.Label(", ");
            comma_label.Visible = false;
            hbox.PackStart(comma_label, false, false, 0);

            rollfilter         = new Gtk.Label(Catalog.GetString("Import roll"));
            rollfilter.Visible = false;
            hbox.PackStart(rollfilter, false, false, 0);

            logic_widget = new LogicWidget(query, db.Tags, selector);
            logic_widget.Show();
            hbox.PackStart(logic_widget, true, true, 0);

            warning_box = new Gtk.HBox();
            warning_box.PackStart(new Gtk.Label(System.String.Empty));

            Gtk.Image warning_image = new Gtk.Image("gtk-info", Gtk.IconSize.Button);
            warning_image.Show();
            warning_box.PackStart(warning_image, false, false, 0);

            clear_button = new Gtk.Button();
            clear_button.Add(new Gtk.Image("gtk-close", Gtk.IconSize.Button));
            clear_button.Clicked += HandleClearButtonClicked;
            clear_button.Relief   = Gtk.ReliefStyle.None;
            hbox.PackEnd(clear_button, false, false, 0);
            tips.SetTip(clear_button, Catalog.GetString("Clear search"), null);

            Gtk.Label warning = new Gtk.Label(Catalog.GetString("No matching photos found"));
            warning_box.PackStart(warning, false, false, 0);
            warning_box.ShowAll();
            warning_box.Spacing = 6;
            warning_box.Visible = false;

            hbox.PackEnd(warning_box, false, false, 0);

            warning_box.Visible = false;
        }
Пример #21
0
        public static void CreateUICanvasButtonAddTab(Gtk.Window window, Gtk.Notebook parentNotebook, Gtk.ButtonReleaseEventHandler buttonPressEvent)
        {
            Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow();
            scrolledWindow.Name       = "_scrolledWindow" + nextGeneratedTabIndex;
            scrolledWindow.ShadowType = ((Gtk.ShadowType)(1));
            scrolledWindow.ShowAll();

            Gtk.Image buttonAddTabImage = new Gtk.Image();
            buttonAddTabImage.Pixbuf = global::Stetic.IconLoader.LoadIcon(window, "gtk-add", Gtk.IconSize.Button);
            buttonAddTabImage.ShowAll();

            Gtk.Button buttonAddTab = new Gtk.Button();
            buttonAddTab.CanFocus = true;
            buttonAddTab.Name     = "_buttonAddhostEntry";
            buttonAddTab.Image    = buttonAddTabImage;
            buttonAddTab.ShowAll();
            buttonAddTab.ButtonReleaseEvent += buttonPressEvent;

            Gtk.Viewport viewportLabel = new Gtk.Viewport();
            viewportLabel.ShadowType = ((Gtk.ShadowType)(0));
            viewportLabel.Add(buttonAddTab);

            parentNotebook.Add(scrolledWindow);
            parentNotebook.SetTabLabel(scrolledWindow, viewportLabel);
        }
Пример #22
0
 ImageContainer()
 {
     image = new Gtk.Image();
     Add(image);
     image.SetAlignment(0.5f, 0f);
     Show();
 }
Пример #23
0
        protected override void LoadIcon(Gtk.Image image, int size)
        {
            base.LoadIcon(image, size);

            // Draw the F-Spot overlay
            if (size > 32 && Hit ["fspot:IsIndexed"] == "true")
            {
                Gdk.Pixbuf emblem = WidgetFu.LoadThemeIcon("f-spot", 24);
                Gdk.Pixbuf icon   = image.Pixbuf.Copy();

                if (icon == null || emblem == null)
                {
                    return;
                }

                // FIXME: Ideally we'd composite into a fresh new pixbuf of
                // the correct size in this case, but really, who's going to
                // have images shorter or narrower than 16 pixels in f-spot??
                if (icon.Height < emblem.Height || icon.Width < emblem.Width)
                {
                    icon.Dispose();
                    emblem.Dispose();
                    return;
                }

                emblem.Composite(icon, 0, icon.Height - emblem.Height, emblem.Width,
                                 emblem.Height, 0, icon.Height - emblem.Height, 1, 1,
                                 Gdk.InterpType.Bilinear, 255);

                image.Pixbuf.Dispose();
                image.Pixbuf = icon;
            }
        }
Пример #24
0
        protected override void LoadIcon(Gtk.Image image, int size)
        {
            Gdk.Pixbuf pixbuf = null;

            string path = Hit ["fixme:cachedimg"];

            if (path != null && File.Exists(path))
            {
                try {
                    pixbuf = new Gdk.Pixbuf(path);
                } catch (GLib.GException) {
                    // Catch in case of an invalid pixbuf.
                }
            }

            if (pixbuf != null && (pixbuf.Width > size || pixbuf.Height > size))
            {
                pixbuf = pixbuf.ScaleSimple(size, size, Gdk.InterpType.Bilinear);
            }

            if (pixbuf == null)
            {
                pixbuf = WidgetFu.LoadThemeIcon("gnome-fs-bookmark", size);                  // FIXME: RSS icon?
            }
            image.Pixbuf = pixbuf;
        }
Пример #25
0
		public override void SetImage(Gtk.Image imageView, Gtk.IconSize? iconSize)
		{
			if (iconSize != null)
				imageView.SetFromIconSet(Control, iconSize.Value);
			else
				imageView.Pixbuf = Pixbuf;
		}
Пример #26
0
        public Gtk.Image CreateGtkImage()
        {
            var res = new Gtk.Image(pixbuf);

            res.Show();
            return(res);
        }
 public StatusProgressMonitor(string title, string iconName, bool showErrorDialogs)
 {
     this.showErrorDialogs = showErrorDialogs;
     icon = Runtime.Gui.Resources.GetImage (iconName, Gtk.IconSize.Menu);
     Runtime.Gui.StatusBar.BeginProgress (title);
     Runtime.Gui.StatusBar.SetMessage (icon, title);
 }
Пример #28
0
 protected virtual void Build()
 {
     Stetic.Gui.Initialize(this);
     // Widget Jeton.LabCtrlScreen
     Stetic.BinContainer.Attach(this);
     this.Name = "Jeton.LabCtrlScreen";
     // Container child Jeton.LabCtrlScreen.Gtk.Container+ContainerChild
     this.vbox1         = new Gtk.VBox();
     this.vbox1.Name    = "vbox1";
     this.vbox1.Spacing = 6;
     // Container child vbox1.Gtk.Box+BoxChild
     this.image273        = new Gtk.Image();
     this.image273.Name   = "image273";
     this.image273.Pixbuf = Gdk.Pixbuf.LoadFromResource("LaborLogo.png");
     this.vbox1.Add(this.image273);
     Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox1[this.image273]));
     w1.Position = 0;
     // Container child vbox1.Gtk.Box+BoxChild
     this.label3           = new Gtk.Label();
     this.label3.Name      = "label3";
     this.label3.LabelProp = Mono.Unix.Catalog.GetString("<b>Labor Control Panel</b>\n\nIst noch nicht fertig...\n\n");
     this.label3.UseMarkup = true;
     this.label3.Justify   = ((Gtk.Justification)(2));
     this.vbox1.Add(this.label3);
     Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox1[this.label3]));
     w2.Position = 1;
     this.Add(this.vbox1);
     if ((this.Child != null))
     {
         this.Child.ShowAll();
     }
     this.Show();
 }
Пример #29
0
        private void appendThread()
        {
            Gtk.Image frame = null;


            while (true)
            {
                while (myQueue.Count > 0)
                {
                    lock (myQueue)
                    {
                        if (frame != null)
                        {
                            frame.Dispose();
                            frame = null;
                        }

                        frame = myQueue.Dequeue();
                    }
                }

                if (frame != null)
                {
                    append(frame);
                }

                Thread.Sleep(1000 / 25);
            }
        }
Пример #30
0
		public void Fill (Extension ext, ITreeNavigator nav)
		{
			labelName.Markup = "<small>Extension</small>\n<big><b>" + GLib.Markup.EscapeText (Util.GetDisplayName (ext)) + "</b></big>";
			object parent = ext.GetExtendedObject ();
			
			if (parent is ExtensionPoint) {
				ExtensionPoint ep = (ExtensionPoint) parent;
				string txt = "<small>Extension Point</small>\n<b>" + GLib.Markup.EscapeText (Util.GetDisplayName (ep)) + "</b>";
				if (!string.IsNullOrEmpty (ep.Description))
					txt += "\n" + GLib.Markup.EscapeText (ep.Description);
				Gtk.Label lab = new Gtk.Label ();
				lab.Xalign = lab.Yalign = 0;
				lab.Markup = txt;
				lab.WidthRequest = 400;
				lab.Wrap = true;
				Gtk.Image img = new Gtk.Image (ImageService.GetPixbuf ("md-extension-point", Gtk.IconSize.Menu));
				img.Yalign = 0;
				Gtk.HBox box = new Gtk.HBox (false, 6);
				box.PackStart (img, false, false, 0);
				box.PackStart (lab, true, true, 0);
				buttonExt.Add (box);
				buttonExt.ShowAll ();
				buttonExt.Clicked += delegate {
					if (nav.MoveToObject (ext)) {
						nav.MoveToParent (typeof(Solution));
						nav.Expanded = true;
						if (nav.MoveToObject (ep.ParentAddinDescription)) {
							nav.Expanded = true;
							if (nav.MoveToObject (ep))
								nav.Selected = true;
						}
					}
				};
			}
		}
Пример #31
0
        /// <summary>
        /// Loads the pdf.  This is the function you call when you want to display a pdf.
        /// </summary>
        /// <param name='pdfFileName'>
        /// Pdf file name.
        /// </param>
        private void LoadPdf(Uri pdfFileName)
        {
            pdf = Poppler.Document.NewFromFile(pdfFileName.AbsoluteUri, "");
            PageCountLabel.Text          = @"/" + (pdf.NPages - 1).ToString();
            CurrentPage.Value            = 0;
            CurrentPage.Adjustment.Upper = pdf.NPages - 1;

            foreach (Gtk.Widget w in vboxImages.AllChildren)
            {
                vboxImages.Remove(w);
            }

            for (this.pageIndex = 0; this.pageIndex < pdf.NPages; this.pageIndex++)
            {
                Gdk.Pixbuf pixbuf = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, false, 8, 0, 0);
                Gtk.Image  img    = new Gtk.Image();
                img.Pixbuf = pixbuf;
                img.Name   = "image1";

                //vboxImages.Add (img);
                RenderPage(ref img);
            }

            this.ShowAll();
        }
Пример #32
0
        public TomboyPanelAppletEventBox(NoteManager manager)
            : base()
        {
            this.manager = manager;
            tray         = new TomboyTray(manager, this);

            // Load a 16x16-sized icon to ensure we don't end up with a
            // 1x1 pixel.
            panel_size = 16;
            // Load Icon to display in the panel.
            // First we try the "tomboy-panel" icon. This icon can be replaced
            // by the user's icon theme. If the theme does not have this icon
            // then we fall back to the Tomboy Menu icon named "tomboy".
            var icon = GuiUtils.GetIcon("tomboy-panel", panel_size) ??
                       GuiUtils.GetIcon("tomboy", panel_size);

            this.image = new Gtk.Image(icon);

            this.CanFocus          = true;
            this.ButtonPressEvent += ButtonPress;
            this.Add(image);
            this.ShowAll();

            string tip_text = TomboyTrayUtils.GetToolTipText();

            tips = new Gtk.Tooltips();
            tips.SetTip(this, tip_text, null);
            tips.Enable();
            tips.Sink();

            SetupDragAndDrop();
        }
Пример #33
0
        public static void LoadIcon(this Gtk.Image image, string iconId, Gtk.IconSize size)
        {
            AnimatedImageInfo ainfo = animatedImages.Select(a => (AnimatedImageInfo)a.Target).FirstOrDefault(a => a != null && a.Image == image);

            if (ainfo != null)
            {
                if (ainfo.AnimatedIcon.AnimationSpec == iconId)
                {
                    return;
                }
                UnregisterImageAnimation(ainfo);
            }
            if (IsAnimation(iconId, size))
            {
                var anim = GetAnimatedIcon(iconId);
                ainfo           = new AnimatedImageInfo(image, anim);
                ainfo.Animation = anim.StartAnimation(delegate(Xwt.Drawing.Image pix) {
                    image.Pixbuf = pix.ToPixbuf();
                });
                animatedImages.Add(new WeakReference(ainfo));
            }
            else
            {
                image.SetFromStock(iconId, size);
            }
        }
Пример #34
0
 public static void SetCachedImage(this Image self, string imageUrl)
 {
     using (var file = new FileStream(FileCache.FromUrl(imageUrl), FileMode.Open))
     {
         self.Pixbuf = new Pixbuf(file);
     }
 }
Пример #35
0
		public QueryWidget (PhotoQuery query, Db db, TagSelectionWidget selector)
		{
			tips.Enable ();

			this.query = query;
			query.Changed += HandleChanged;

			Gtk.HSeparator sep = new Gtk.HSeparator ();
			sep.Show ();
			this.PackStart (sep, false, false, 0);
			
			Gtk.HBox hbox = new Gtk.HBox ();
			hbox.Show ();
			this.PackStart (hbox, false, false, 0);
			
			label = new Gtk.Label (Catalog.GetString ("Find: "));
			label.Show ();
			label.Ypad = 9;
			hbox.PackStart (label, false, false, 0);

			untagged = new Gtk.Label (Catalog.GetString ("Untagged photos"));
			untagged.Visible = false;
			hbox.PackStart (untagged, false, false, 0);

			comma_label = new Gtk.Label (", ");
			comma_label.Visible = false;
			hbox.PackStart (comma_label, false, false, 0);

			rollfilter = new Gtk.Label (Catalog.GetString ("Import roll"));	
			rollfilter.Visible = false;
			hbox.PackStart (rollfilter, false, false, 0);

			logic_widget = new LogicWidget (query, db.Tags, selector);
			logic_widget.Show ();
			hbox.PackStart (logic_widget, true, true, 0);

			warning_box = new Gtk.HBox ();
			warning_box.PackStart (new Gtk.Label (System.String.Empty));
			
			Gtk.Image warning_image = new Gtk.Image ("gtk-info", Gtk.IconSize.Button);
			warning_image.Show ();
			warning_box.PackStart (warning_image, false, false, 0);
			
			clear_button = new Gtk.Button ();
			clear_button.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Button));
			clear_button.Clicked += HandleClearButtonClicked;
			clear_button.Relief = Gtk.ReliefStyle.None;
			hbox.PackEnd (clear_button, false, false, 0);
			tips.SetTip (clear_button, Catalog.GetString("Clear search"), null);

			Gtk.Label warning = new Gtk.Label (Catalog.GetString ("No matching photos found"));
			warning_box.PackStart (warning, false, false, 0);
			warning_box.ShowAll ();
			warning_box.Spacing = 6;
			warning_box.Visible = false;

			hbox.PackEnd (warning_box, false, false, 0);
			
			warning_box.Visible = false;
		}
Пример #36
0
        public EngineManagerDialog(EngineManager engineManager)
        {
            Trace.Call(engineManager);

            if (engineManager == null) {
                throw new ArgumentNullException("engineManager");
            }

            _EngineManager = engineManager;

            Modal = true;
            Title = "Smuxi - " + _("Engine Manager");
            SetPosition(Gtk.WindowPosition.CenterAlways);

            Gtk.HBox connect_hbox = new Gtk.HBox();
            Gtk.Image connect_image = new Gtk.Image(
                new Gdk.Pixbuf(null, "connect-button.svg", 22, 22));
            connect_hbox.Add(connect_image);
            connect_hbox.Add(new Gtk.Label(_("_Connect")));
            AddActionWidget(new Gtk.Button(connect_hbox), 1);

            AddActionWidget(new Gtk.Button(Gtk.Stock.New), 3);

            Gtk.Button edit_button = new Gtk.Button(Gtk.Stock.Edit);
            _EditButton = edit_button;
            AddActionWidget(edit_button, 2);

            _DeleteButton = new Gtk.Button(Gtk.Stock.Delete);
            AddActionWidget(_DeleteButton, 4);
            AddActionWidget(new Gtk.Button(Gtk.Stock.Quit), 5);
            Response += new Gtk.ResponseHandler(_OnResponse);

            Gtk.VBox vbox = new Gtk.VBox();
            Gtk.Label label = new Gtk.Label("<b>" +
                                            _("Select which Smuxi engine you want to connect to") +
                                            "</b>");
            label.UseMarkup = true;
            vbox.PackStart(label, false, false, 5);

            Gtk.HBox hbox = new Gtk.HBox();
            hbox.PackStart(new Gtk.Label(_("Engine:")), false, false, 5);

            _ListStore = new Gtk.ListStore(typeof(string));
            _ComboBox = new Gtk.ComboBox();
            Gtk.CellRendererText cell = new Gtk.CellRendererText();
            _ComboBox.PackStart(cell, false);
            _ComboBox.AddAttribute(cell, "text", 0);
            _ComboBox.Changed += new EventHandler(_OnComboBoxChanged);
            _ComboBox.Model = _ListStore;
            _InitEngineList();

            hbox.PackStart(_ComboBox, true, true, 10);

            vbox.PackStart(hbox, false, false, 10);

            VBox.Add(vbox);

            ShowAll();
        }
Пример #37
0
        //Add the shows to the table
        //Each one is stored in an eventbox
        protected void populateTable()
        {
            int curShow;

            if (isSearch)
            {
                curShow = start;
            }
            else
            {
                curShow = 0;
            }

            for (uint i = 0; i < 5; i++)
            {
                if (curShow >= shows.Count)
                {
                    break;
                }

                for (uint j = 0; j < 5; j++)
                {
                    if (curShow >= shows.Count)
                    {
                        break;
                    }

                    //show item
                    Gtk.Image img = new Gtk.Image();
                    if (shows[curShow].thumb != null)
                    {
                        img.Pixbuf = shows[curShow].thumb;
                    }

                    Gtk.Label lbl = new Gtk.Label(shows[curShow].title);
                    lbl.ModifyFont(Pango.FontDescription.FromString("12"));
                    Gtk.VBox box = new Gtk.VBox();
                    box.Add(img);
                    box.Add(lbl);
                    Gtk.EventBox eventbox = new Gtk.EventBox();
                    eventbox.Add(box);

                    //create event for clicking show
                    Func <Show, Gtk.ButtonPressEventHandler> ButtonPressWrapper = ((show) => ((s, e) => { OnShowSelected(s, e, show); }));
                    eventbox.ButtonPressEvent += ButtonPressWrapper(shows[curShow]);

                    //create hover events
                    Func <Gtk.EventBox, Gtk.EnterNotifyEventHandler> EnterNotifyWrapper = ((Gtk.EventBox eBox) => ((s, e) => { OnHoverEnter(s, e, eBox); }));
                    eventbox.EnterNotifyEvent += EnterNotifyWrapper(eventbox);

                    Func <Gtk.EventBox, Gtk.LeaveNotifyEventHandler> LeaveNotifyWrapper = ((Gtk.EventBox eBox) => ((s, e) => { OnHoverLeave(s, e, eBox); }));
                    eventbox.LeaveNotifyEvent += LeaveNotifyWrapper(eventbox);

                    table.Attach(eventbox, j, j + 1, i, i + 1);

                    curShow++;
                }
            }
        }
Пример #38
0
        public FreezeWidget()
        {
            this.Build();
            msgLabel.Text = "";

            image = new Gtk.Image();
            image.SetFromIconName("frostwire", Gtk.IconSize.Dnd);
            label = new Gtk.Label(Mono.Unix.Catalog.GetString("Freeze Users"));
            label.Show();

            searchImage.Animation = new Gdk.PixbufAnimation(null, "llum.watch.gif");

            Gtk.TreeViewColumn available_groups_column = new Gtk.TreeViewColumn();
            available_groups_column.Title = Mono.Unix.Catalog.GetString("Available groups");
            Gtk.CellRendererText available_groups_cell = new Gtk.CellRendererText();
            available_groups_column.PackStart(available_groups_cell, true);
            available_groups_column.AddAttribute(available_groups_cell, "text", 0);
            availableGroupsTreeview.AppendColumn(available_groups_column);
            available_groups_store                 = new Gtk.TreeStore(typeof(string));
            availableGroupsTreeview.Model          = available_groups_store;
            availableGroupsTreeview.Selection.Mode = Gtk.SelectionMode.Multiple;


            Gtk.TreeViewColumn frozen_groups_column = new Gtk.TreeViewColumn();
            frozen_groups_column.Title = Mono.Unix.Catalog.GetString("Frozen groups");
            Gtk.CellRendererText frozen_groups_cell = new Gtk.CellRendererText();
            frozen_groups_column.PackStart(frozen_groups_cell, true);
            frozen_groups_column.AddAttribute(frozen_groups_cell, "text", 0);
            frozenGroupsTreeview.AppendColumn(frozen_groups_column);
            frozen_groups_store                 = new Gtk.TreeStore(typeof(string));
            frozenGroupsTreeview.Model          = frozen_groups_store;
            frozenGroupsTreeview.Selection.Mode = Gtk.SelectionMode.Multiple;



            Gtk.TreeViewColumn available_users_column = new Gtk.TreeViewColumn();
            available_users_column.Title = Mono.Unix.Catalog.GetString("Available users");
            Gtk.CellRendererText available_users_cell = new Gtk.CellRendererText();
            available_users_column.PackStart(available_users_cell, true);
            available_users_column.AddAttribute(available_users_cell, "text", 0);
            availableUsersTreeview.AppendColumn(available_users_column);
            available_users_store                 = new Gtk.TreeStore(typeof(string));
            availableUsersTreeview.Model          = available_users_store;
            availableUsersTreeview.Selection.Mode = Gtk.SelectionMode.Multiple;


            Gtk.TreeViewColumn frozen_users_column = new Gtk.TreeViewColumn();
            frozen_users_column.Title = Mono.Unix.Catalog.GetString("Frozen users");
            Gtk.CellRendererText frozen_users_cell = new Gtk.CellRendererText();
            frozen_users_column.PackStart(frozen_users_cell, true);
            frozen_users_column.AddAttribute(frozen_users_cell, "text", 0);
            frozenUsersTreeview.AppendColumn(frozen_users_column);
            frozen_users_store                 = new Gtk.TreeStore(typeof(string));
            frozenUsersTreeview.Model          = frozen_users_store;
            frozenUsersTreeview.Selection.Mode = Gtk.SelectionMode.Multiple;


            disable_gui();
        }
 public ImageButton()
 {
     Events       |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask;
     VisibleWindow = false;
     imageWidget   = new Gtk.Image();
     imageWidget.Show();
     Add(imageWidget);
 }
Пример #40
0
        private void BuildImageControl()
        {
            CanFocus = true;

            _image = new Gtk.Image();

            PackStart(_image, true, true, 0);
        }
		public ImageButton ()
		{
			Events |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask;
			VisibleWindow = false;
			imageWidget = new Gtk.Image ();
			imageWidget.Show ();
			Add (imageWidget);
		}
Пример #42
0
        public CrashDialog(Gtk.Window parent, Exception e)
            : base(null, parent, Gtk.DialogFlags.Modal)
        {
            SetDefaultSize(640, 480);
            Title = "Smuxi - " + _("Oops, I did it again...");

            Gtk.HBox hbox = new Gtk.HBox();

            Gtk.Image image = new Gtk.Image(Gtk.Stock.DialogError, Gtk.IconSize.Dialog);
            hbox.PackStart(image, false, false, 2);

            Gtk.VBox label_vbox = new Gtk.VBox();
            Gtk.Label label1 = new Gtk.Label();
            Gtk.Label label2 = new Gtk.Label();
            label1.Markup = String.Format(
                "<b>{0}</b>",
                GLib.Markup.EscapeText(
                    _("Smuxi crashed because an unhandled exception was thrown!")
                )
            );
            label2.Markup = GLib.Markup.EscapeText(
                _("Here is the stacktrace, please report this bug!")
            );
            label_vbox.PackStart(label1, false, false, 0);
            label_vbox.PackStart(new Gtk.Fixed(), true, true, 0);
            label_vbox.PackStart(label2, false, false, 0);
            hbox.PackStart(label_vbox, true, true, 0);

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.PackStart(hbox, false, false, 2);

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType = Gtk.ShadowType.In;
            Gtk.TextView tv = new Gtk.TextView();
            tv.Editable = false;
            tv.CursorVisible = false;
            sw.Add(tv);
            vbox.PackStart(sw, true, true, 2);

            // add to the dialog
            VBox.PackStart(vbox, true, true, 2);
            AddButton(_("_Report Bug"), -1);
            AddButton(Gtk.Stock.Quit, 0);

            string message = String.Empty;
            if (e.InnerException != null) {
                message = "Inner-Exception Type:\n"+e.InnerException.GetType()+"\n\n"+
                          "Inner-Exception Message:\n"+e.InnerException.Message+"\n\n"+
                          "Inner-Exception StackTrace:\n"+e.InnerException.StackTrace+"\n";
            }
            message += "Exception Type:\n"+e.GetType()+"\n\n"+
                       "Exception Message:\n"+e.Message+"\n\n"+
                       "Exception StackTrace:\n"+e.StackTrace;
            tv.Buffer.Text = message;

            ShowAll();
        }
        public void createGui()
        {
            basedir_section=new Section("cuesheets-basedir","CueSheet Music Directory:",20);
            source_page.Add (basedir_section);

            string dir=_source.getCueSheetDir();
            Gtk.Label lbl=new Gtk.Label("CueSheet Music Directory:");
            Gtk.FileChooserButton btn=new Gtk.FileChooserButton("CueSheet Music Directory:",Gtk.FileChooserAction.SelectFolder);
            if (dir!=null) {
                btn.SelectFilename (dir);
            }
            Gtk.HBox box=new Gtk.HBox();
            box.Add (lbl);
            box.Add (btn);
            box.ShowAll ();
            btn.CurrentFolderChanged+=delegate(object sender,EventArgs args) {
                string dir1=btn.Filename;
                Hyena.Log.Information ("Folder changed to = "+dir1);
            };
            btn.FileSet+=delegate(object sender,EventArgs args) {
                string dir1=btn.Filename;
                Hyena.Log.Information ("Base directory changed to = "+dir1);
                _source.setCueSheetDir(dir1);
            };

            Console.WriteLine (_source);

            Gtk.VBox vb=new Gtk.VBox();
            vb.PackStart (box,false,false,0);

            Gtk.Image icn_about=new Gtk.Image(Gtk.Stock.About,Gtk.IconSize.Button);
            Gtk.Button about=new Gtk.Button(icn_about);
            about.Clicked+=new EventHandler(handleAbout);
            Gtk.HBox hb=new Gtk.HBox();
            Gtk.Label _about=new Gtk.Label("About the CueSheet extension");
            hb.PackEnd (about,false,false,0);
            hb.PackEnd (_about,false,false,5);
            vb.PackStart (hb,false,false,0);
            Gtk.HBox hb1=new Gtk.HBox();
            Gtk.Label _info=new Gtk.Label("How to use the Cuesheet extension (opens browser)");
            Gtk.Image icn_info=new Gtk.Image(Gtk.Stock.Info,Gtk.IconSize.Button);
            Gtk.Button btn_info=new Gtk.Button(icn_info);
            btn_info.Clicked+=new EventHandler(handleInfo);
            hb1.PackEnd(btn_info,false,false,0);
            hb1.PackEnd(_info,false,false,5);
            vb.PackStart (hb1,false,false,0);

            Gtk.HBox hbX=new Gtk.HBox();
            vb.PackEnd (hbX,true,true,0);

            vb.ShowAll ();

            source_page.DisplayWidget = vb;
        }
Пример #44
0
 public void appendFrameToVideo(Gtk.Image frame)
 {
     lock (myQueue)
     {
         lock (frame) {
             Gtk.Image newframe = new Gtk.Image ();
             newframe.Pixbuf = (Gdk.Pixbuf)frame.Pixbuf.Clone ();
             myQueue.Enqueue (newframe);
         }
     }
 }
Пример #45
0
		public DetailsPane () : base (1, 2, false)
		{
			RowSpacing = ColumnSpacing = 6;
			BorderWidth = 6;

			icon = new Gtk.Image ();
			icon.SetAlignment (0.5f, 0.5f);
			icon.Show ();
			Attach (icon, 0, 1, 0, 1, fill, fill, 6, 0);

			base.SizeRequested += DetailsSizeRequested;
		}
Пример #46
0
 protected MultipleObjectViewer(IBroadcaster hub, string caption)
     : base(false, 0)
 {
     _hub = hub;
     // --- first line: caption and buttons
     Gtk.HBox hbxFirstLine = new Gtk.HBox(false, 2);
     // Caption label
     Gtk.Alignment labelAlign = new Gtk.Alignment(0F, 0F, 1F, 1F);
     labelAlign.Add(new Gtk.Label(caption));
     hbxFirstLine.PackStart(labelAlign, false, false, 0);
     hbxFirstLine.PackStart(new Gtk.Label(String.Empty), true, true, 0);
     // "Add" button
     Gtk.Image image = new Gtk.Image();
     image.Stock = Gtk.Stock.Add;
     _btnAdd = new Gtk.Button();
     _btnAdd.Add(image);
     _btnAdd.Relief = Gtk.ReliefStyle.None;
     _btnAdd.Clicked += new EventHandler(OnAddButtonClicked);
     _btnAdd.Sensitive = false;
     hbxFirstLine.PackStart(_btnAdd, false, false, 0);
     // "Edit" button
     image = new Gtk.Image();
     image.Stock = Gtk.Stock.JumpTo;
     _btnEdit = new Gtk.Button();
     _btnEdit.Add(image);
     _btnEdit.Relief = Gtk.ReliefStyle.None;
     _btnEdit.Clicked += new EventHandler(OnEditButtonClicked);
     _btnEdit.Sensitive = false;
     hbxFirstLine.PackStart(_btnEdit, false, false, 0);
     // "Delete" button
     image = new Gtk.Image();
     image.Stock = Gtk.Stock.Remove;
     _btnDelete = new Gtk.Button();
     _btnDelete.Add(image);
     _btnDelete.Relief = Gtk.ReliefStyle.None;
     _btnDelete.Clicked += new EventHandler(OnDeleteButtonClicked);
     _btnDelete.Sensitive = false;
     hbxFirstLine.PackStart(_btnDelete, false, false, 0);
     base.PackStart(hbxFirstLine, false, false, 0);
     // --- second line: element list
     _store = new Gtk.TreeStore(typeof(string));
     _tvList = new Gtk.TreeView();
     _tvList.HeadersVisible = false;
     _tvList.AppendColumn("", new Gtk.CellRendererText(), "text", 0);
     _tvList.Model = _store;
     _tvList.FocusInEvent += new Gtk.FocusInEventHandler(EnableButtons);
     _tvList.ButtonPressEvent += new Gtk.ButtonPressEventHandler(ListClickedHandler);
     Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
     sw.ShadowType = Gtk.ShadowType.In;
     sw.Add(_tvList);
     base.PackStart(sw, true, true, 0);
     sw.Show();
 }
 protected virtual void Build()
 {
     Stetic.Gui.Initialize(this);
     // Widget ocmgtk.ImageDialog
     this.Name = "ocmgtk.ImageDialog";
     this.Title = Mono.Unix.Catalog.GetString("Image");
     this.WindowPosition = ((Gtk.WindowPosition)(4));
     // Internal child ocmgtk.ImageDialog.VBox
     Gtk.VBox w1 = this.VBox;
     w1.Name = "dialog1_VBox";
     w1.BorderWidth = ((uint)(2));
     // Container child dialog1_VBox.Gtk.Box+BoxChild
     this.scrolledwindow1 = new Gtk.ScrolledWindow();
     this.scrolledwindow1.CanFocus = true;
     this.scrolledwindow1.Name = "scrolledwindow1";
     this.scrolledwindow1.ShadowType = ((Gtk.ShadowType)(1));
     // Container child scrolledwindow1.Gtk.Container+ContainerChild
     Gtk.Viewport w2 = new Gtk.Viewport();
     w2.ShadowType = ((Gtk.ShadowType)(0));
     // Container child GtkViewport.Gtk.Container+ContainerChild
     this.image = new Gtk.Image();
     this.image.Name = "image";
     w2.Add(this.image);
     this.scrolledwindow1.Add(w2);
     w1.Add(this.scrolledwindow1);
     Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(w1[this.scrolledwindow1]));
     w5.Position = 0;
     // Internal child ocmgtk.ImageDialog.ActionArea
     Gtk.HButtonBox w6 = this.ActionArea;
     w6.Name = "dialog1_ActionArea";
     w6.Spacing = 10;
     w6.BorderWidth = ((uint)(5));
     w6.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
     // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
     this.buttonOk = new Gtk.Button();
     this.buttonOk.CanDefault = true;
     this.buttonOk.CanFocus = true;
     this.buttonOk.Name = "buttonOk";
     this.buttonOk.UseStock = true;
     this.buttonOk.UseUnderline = true;
     this.buttonOk.Label = "gtk-close";
     this.AddActionWidget(this.buttonOk, -7);
     Gtk.ButtonBox.ButtonBoxChild w7 = ((Gtk.ButtonBox.ButtonBoxChild)(w6[this.buttonOk]));
     w7.Expand = false;
     w7.Fill = false;
     if ((this.Child != null)) {
         this.Child.ShowAll();
     }
     this.DefaultWidth = 400;
     this.DefaultHeight = 300;
     this.Show();
     this.buttonOk.Clicked += new System.EventHandler(this.OnCloseClick);
 }
Пример #48
0
        public SessionChatView(ChatModel chat)
            : base(chat)
        {
            Trace.Call(chat);

            OutputMessageTextView.ShowMarkerline = false;

            var tabImage = new Gtk.Image(IconPixbuf);
            TabHBox.PackStart(tabImage, false, false, 2);
            TabHBox.ShowAll();

            Add(OutputScrolledWindow);
        }
Пример #49
0
        public PersonChatView(PersonChatModel chat)
            : base(chat)
        {
            Trace.Call(chat);

            PersonChatModel = chat;

            var tabImage = new Gtk.Image(IconPixbuf);
            TabHBox.PackStart(tabImage, false, false, 2);
            TabHBox.ShowAll();

            Add(OutputScrolledWindow);
        }
		public StatusProgressMonitor (string title, string iconName, bool showErrorDialogs, bool showTaskTitles, bool lockGui, Pad statusSourcePad)
		{
			this.lockGui = lockGui;
			this.showErrorDialogs = showErrorDialogs;
			this.showTaskTitles = showTaskTitles;
			this.title = title;
			this.statusSourcePad = statusSourcePad;
			icon = ImageService.GetImage (iconName, Gtk.IconSize.Menu);
			statusBar = IdeApp.Workbench.StatusBar.CreateContext ();
			statusBar.StatusSourcePad = statusSourcePad;
			statusBar.BeginProgress (icon, title);
			if (lockGui)
				IdeApp.Workbench.LockGui ();
		}
Пример #51
0
        public FileCloseableIconTitle(FileBuffer fileBuffer)
            : base(false, 0)
        {
            this.fileBuffer = fileBuffer;

            fileIconTitle = new FileIconTitle(fileBuffer) { Visible = true };

            imageClose = new Gtk.Image(Gtk.Stock.Close, Gtk.IconSize.Menu) { Visible = true };

            buttonClose = new Gtk.Button(imageClose) { Visible = true, Relief = Gtk.ReliefStyle.None };
            buttonClose.Clicked += ButtonClose_Clicked;

            PackStart(fileIconTitle, false, true, 0);
            PackStart(buttonClose, false, true, 0);
        }
Пример #52
0
 protected virtual void OnMapped (object sender, System.EventArgs e)
 {
     if (!mapped) {
         mapped = true;
         ThreadPool.QueueUserWorkItem(state => {
             var stream = new MemoryStream (icon.GetData ());
             var pixbuf = new Gdk.Pixbuf (stream);
             var image = new Gtk.Image (pixbuf);
             Gtk.Application.Invoke ((o, a) => {
                 alignment.Remove (alignment.Child);
                 alignment.Add (image);
                 ShowAll ();
             });
         });
     }
 }
Пример #53
0
        public PreviewPopup(IconView view)
            : base(Gtk.WindowType.Toplevel)
        {
            Gtk.VBox vbox = new Gtk.VBox ();
            this.Add (vbox);
            this.AddEvents ((int) (Gdk.EventMask.PointerMotionMask |
                           Gdk.EventMask.KeyReleaseMask |
                           Gdk.EventMask.ButtonPressMask));

            this.Decorated = false;
            this.SkipTaskbarHint = true;
            this.SkipPagerHint = true;
            this.SetPosition (Gtk.WindowPosition.None);

            this.KeyReleaseEvent += HandleKeyRelease;
            this.ButtonPressEvent += HandleButtonPress;
            this.Destroyed += HandleDestroyed;

            this.view = view;
            view.MotionNotifyEvent += HandleIconViewMotion;
            view.KeyPressEvent += HandleIconViewKeyPress;
            view.KeyReleaseEvent += HandleKeyRelease;
            view.DestroyEvent += HandleIconViewDestroy;

            this.BorderWidth = 6;

            hist = new FSpot.Histogram ();
            hist.RedColorHint = 127;
            hist.GreenColorHint = 127;
            hist.BlueColorHint = 127;
            hist.BackgroundColorHint = 0xff;

            image = new Gtk.Image ();
            image.CanFocus = false;

            label = new Gtk.Label (String.Empty);
            label.CanFocus = false;
            label.ModifyFg (Gtk.StateType.Normal, new Gdk.Color (127, 127, 127));
            label.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (0, 0, 0));

            this.ModifyFg (Gtk.StateType.Normal, new Gdk.Color (127, 127, 127));
            this.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (0, 0, 0));

            vbox.PackStart (image, true, true, 0);
            vbox.PackStart (label, true, false, 0);
            vbox.ShowAll ();
        }
		public void RunServer()
		{
			this.Build();

			this.bg = new global::Gtk.Image();
			this.bg.Name = "bg";

			this.bg.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("OpenGraal.GraalIM.Resources.rc_images.rc_opengraal.jpg");

			if (this.rcSettings.Loaded)
			{
				if (System.IO.File.Exists("skins/" + this.rcSettings.Background))
					this.bg.Pixbuf = new Gdk.Pixbuf("skins/" + this.rcSettings.Background);
			}
							
			this.bg.SetAlignment(0, 0);
			this.bg.HeightRequest = 160;
			
			this.SizeRequested += OnResize;
			this.table3.Add(this.bg);

			global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table3[this.bg]));
			w4.BottomAttach = ((uint)(0));


			//this.ResizeChecked += OnResize;
			//this.SizeRequested += OnResize;
			this.CreateButtons();

			this.Framework = Framework.GetInstance();
			this.PMWindowManager = PMWindowList.GetInstance();
			this.DeleteEvent += delegate
			{
				this.Framework.CloseServers();

				ServerWindow serverWindow = ServerWindow.GetInstance();
				serverWindow.Show();
			};
			this.DestroyEvent += delegate
			{
				this.Framework.CloseServers();

				ServerWindow serverWindow = ServerWindow.GetInstance();
				serverWindow.Show();
			};
			this.ShowAll();
		}
Пример #55
0
        public Image(bool allowStock, bool allowFile)
            : base(false, 6)
        {
            image = new Gtk.Image (Gnome.Stock.Blank, Gtk.IconSize.Button);
            PackStart (image, false, false, 0);

            if (allowStock) {
                store = new Gtk.ListStore (typeof (string), typeof (string));
                store.AppendValues (Gnome.Stock.Blank, Catalog.GetString ("(None)"));
                for (int i = 0; i < stockIds.Length; i++)
                    store.AppendValues (stockIds[i], stockLabels[i]);

                combo = new Gtk.ComboBoxEntry (store, LabelColumn);
                Gtk.CellRendererPixbuf iconRenderer = new Gtk.CellRendererPixbuf ();
                iconRenderer.StockSize = (uint)Gtk.IconSize.Menu;
                combo.PackStart (iconRenderer, false);
                combo.Reorder (iconRenderer, 0);
                combo.AddAttribute (iconRenderer, "stock-id", IconColumn);
                combo.Changed += combo_Changed;

                // Pack the combo non-expandily into a VBox so it doesn't
                // get stretched to the file button's height
                Gtk.VBox vbox = new Gtk.VBox (false, 0);
                vbox.PackStart (combo, true, false, 0);
                PackStart (vbox, true, true, 0);

                entry = (Gtk.Entry)combo.Child;
                entry.Changed += entry_Changed;

                useStock = true;
            }

            if (allowFile) {
                if (!allowStock) {
                    entry = new Gtk.Entry ();
                    PackStart (entry, true, true, 0);
                    entry.Changed += entry_Changed;
                }

                button = new Gtk.Button ();
                Gtk.Image icon = new Gtk.Image (Gtk.Stock.Open, Gtk.IconSize.Button);
                button.Add (icon);
                PackStart (button, false, false, 0);
                button.Clicked += button_Clicked;
            }
            ShowAll ();
        }
Пример #56
0
        public LicenceExpiredDialog(string message)
        {
            this.Build();

            Gtk.Image image1 = new Gtk.Image(MainClass.Tools.GetIconFromStock("logo74.png", Gtk.IconSize.Dialog));

            image1.SetPadding(2,2);
            hbox1.PackStart(image1, false, false, 0);

            Gtk.Label lblMessage = new Gtk.Label("<b>"+message+"</b>");
            lblMessage.UseMarkup = true;
            hbox1.PackEnd(lblMessage, true ,true, 0);
            ShowAll ();

            while (Gtk.Application.EventsPending ())
                Gtk.Application.RunIteration ();
        }
Пример #57
0
 public static Gtk.Image LoadImageFromFile(string fileName)
 {
     Stream file_stream = null;
     try {
         file_stream = System.IO.File.OpenRead(fileName);
         Gtk.Image img = new Gtk.Image(file_stream);
         img.SetSizeRequest(13, 16);
         return img;
     } catch {
         return null;
     } finally {
         try {
             if (null != file_stream)
                 file_stream.Close();
         } catch {
         }
     }
 }
Пример #58
0
		protected void PrepareUpdateWidget ()
		{
			// This method is called when the child widget is going to be changed.
			// It takes a 'screenshot' of the widget. This image will be shown until
			// UpdateWidget is called.
			
			if (book.NPages == 1) {
				Gtk.Widget w = book.GetNthPage (0);
				Gdk.Window win = w.GdkWindow;
				if (win != null && win.IsViewable) {
					Gdk.Pixbuf img = Gdk.Pixbuf.FromDrawable (win, win.Colormap, w.Allocation.X, w.Allocation.Y, 0, 0, w.Allocation.Width, w.Allocation.Height);
					Gtk.Image oldImage = new Gtk.Image (img);
					oldImage.Show ();
					book.AppendPage (oldImage, null);
					book.Page = 1;
					book.RemovePage (0);
				}
			}
		}
Пример #59
0
        public PersonChatView(ChatModel chat)
            : base(chat)
        {
            Trace.Call(chat);

            _TabImage = new Gtk.Image(
                new Gdk.Pixbuf(
                    null,
                    "person-chat.svg",
                    16,
                    16
                )
            );

            TabHBox.PackStart(_TabImage, false, false, 2);
            TabHBox.ShowAll();

            Add(OutputScrolledWindow);
        }
 protected virtual void Build()
 {
     Stetic.Gui.Initialize(this);
     // Widget omvviewerlight.ScaleImage
     Stetic.BinContainer.Attach(this);
     this.Name = "omvviewerlight.ScaleImage";
     // Container child omvviewerlight.ScaleImage.Gtk.Container+ContainerChild
     this.eventbox2 = new Gtk.EventBox();
     this.eventbox2.Name = "eventbox2";
     // Container child eventbox2.Gtk.Container+ContainerChild
     this.dispimage = new Gtk.Image();
     this.dispimage.Name = "dispimage";
     this.eventbox2.Add(this.dispimage);
     this.Add(this.eventbox2);
     if ((this.Child != null)) {
         this.Child.ShowAll();
     }
     this.Hide();
 }