当前位置: 首页>>代码示例>>C#>>正文


C# Image.SetPadding方法代码示例

本文整理汇总了C#中Gtk.Image.SetPadding方法的典型用法代码示例。如果您正苦于以下问题:C# Image.SetPadding方法的具体用法?C# Image.SetPadding怎么用?C# Image.SetPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.Image的用法示例。


在下文中一共展示了Image.SetPadding方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TabLabel

		public TabLabel (Label label, Gtk.Image icon) : base (false, 0)
		{	
			this.title = label;
			this.icon = icon;
			icon.Xpad = 2;
			
			EventBox eventBox = new EventBox ();
			eventBox.BorderWidth = 0;
			eventBox.VisibleWindow = false;			
			eventBox.Add (icon);
			this.PackStart (eventBox, false, true, 0);

			titleBox = new EventBox ();
			titleBox.VisibleWindow = false;			
			titleBox.Add (title);
			this.PackStart (titleBox, true, true, 0);
			
			Gtk.Rc.ParseString ("style \"MonoDevelop.TabLabel.CloseButton\" {\n GtkButton::inner-border = {0,0,0,0}\n }\n");
			Gtk.Rc.ParseString ("widget \"*.MonoDevelop.TabLabel.CloseButton\" style  \"MonoDevelop.TabLabel.CloseButton\"\n");
			Button button = new Button ();
			button.CanDefault = false;
			Gtk.Image closeIcon = new Gtk.Image (closeImage);
			closeIcon.SetPadding (0, 0);
			button.Image = closeIcon;
			button.Relief = ReliefStyle.None;
			button.BorderWidth = 0;
			button.Clicked += new EventHandler(ButtonClicked);
			button.Name = "MonoDevelop.TabLabel.CloseButton";
			this.PackStart (button, false, true, 0);
			this.ClearFlag (WidgetFlags.CanFocus);
			this.BorderWidth = 0;

			this.ShowAll ();
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:34,代码来源:TabLabel.cs

示例2: NotebookLabel

        public NotebookLabel(string stockIcon, string caption)
        {
            this.BorderWidth = 1;

            Gtk.Image image = new Gtk.Image(MainClass.Tools.GetIconFromStock(stockIcon, Gtk.IconSize.Menu));
            image.SetPadding(2,2);
            this.PackStart(image, false, false, 0);

            lblDisplay.Text = caption;

            this.PackStart(lblDisplay, false, false, 0);

            this.ShowAll();
        }
开发者ID:moscrif,项目名称:ide,代码行数:14,代码来源:NotebookLabel.cs

示例3: NotebookMenuLabel

        //Gtk.Image image;
        public NotebookMenuLabel(string stockIcon, string caption, Gtk.Menu popupMenu)
        {
            this.CanFocus=false;
            this.BorderWidth = 1;
            this.popupMenu = popupMenu;

            Gtk.Image image = new Gtk.Image(MainClass.Tools.GetIconFromStock(stockIcon, Gtk.IconSize.Menu));
            image.SetPadding(2,2);
            this.PackStart(image, false, false, 0);

            lblDisplay.Text = caption;
            this.caption = caption;

            this.PackStart(lblDisplay, false, false, 0);

            Pixbuf default_pixbuf = null;
            string file = System.IO.Path.Combine(MainClass.Paths.ResDir, "stock-menu.png");
            if (System.IO.File.Exists(file)) {
                default_pixbuf = new Pixbuf(file);

                Button btnClose = new Button(new Gtk.Image(default_pixbuf));
                btnClose.TooltipText = "Menu";
                btnClose.Relief = ReliefStyle.None;
                btnClose.CanFocus = false;
                btnClose.WidthRequest = btnClose.HeightRequest = 22;

                this.popupMenu.AttachToWidget(btnClose,new Gtk.MenuDetachFunc(DetachWidget));

                btnClose.Clicked += delegate {
                    if (this.popupMenu!= null){
                        this.popupMenu.ShowAll();
                        //this.popupMenu.Popup();
                        this.popupMenu.Popup(null,null, new Gtk.MenuPositionFunc (GetPosition) ,3,Gtk.Global.CurrentEventTime);
                    }
                };

                this.PackEnd(btnClose, false, false, 0);
            }

            this.ShowAll();
        }
开发者ID:moscrif,项目名称:ide,代码行数:42,代码来源:NotebookMenuLabel.cs

示例4: NotebookEditorLabel

        public NotebookEditorLabel(EditorNotebook parent_netbook, IEditor se)
        {
            this.CanFocus=false;
            this.BorderWidth = 1;

            string stockIcon = "home.png";

            if (se.FileName != "StartPage"){
                stockIcon = MainClass.Tools.GetIconForExtension( System.IO.Path.GetExtension(se.Caption) );
            }

            image = new Gtk.Image(MainClass.Tools.GetIconFromStock(stockIcon, Gtk.IconSize.Menu));
            image.SetPadding(2,2);
            this.PackStart(image, false, false, 0);

            caption =se.Caption.Replace("_","__");

            lblDisplay.Text = caption;
            lblDisplay.CanFocus=false;

            this.PackStart(lblDisplay, false, false, 0);

            Pixbuf default_pixbuf = null;
            string file = System.IO.Path.Combine(MainClass.Paths.ResDir, "stock-close.png");
            if (System.IO.File.Exists(file)) {
                default_pixbuf = new Pixbuf(file);

                Button btnClose = new Button(new Gtk.Image(default_pixbuf));
                btnClose.TooltipText = MainClass.Languages.Translate("close");
                btnClose.Relief = ReliefStyle.None;
                btnClose.CanFocus = false;
                btnClose.WidthRequest = btnClose.HeightRequest = 18;
                btnClose.Clicked += delegate { parent_netbook.ClosePage(se); };

                this.PackEnd(btnClose, false, false, 0);
            }

            lblDisplay.TooltipText = se.FileName;

            this.ShowAll();
        }
开发者ID:moscrif,项目名称:ide,代码行数:41,代码来源:NotebookEditorLabel.cs

示例5: StatusIcon

			public StatusIcon (MonoDevelopStatusBar statusBar, Gdk.Pixbuf icon)
			{
				this.statusBar = statusBar;
				this.icon = icon;
				box = new EventBox ();
				image = new Image (icon);
				image.SetPadding (0, 0);
				box.Child = image;
			}
开发者ID:nocache,项目名称:monodevelop,代码行数:9,代码来源:MonoDevelopStatusBar.cs

示例6: StatusIcon

			public StatusIcon (StatusArea statusBar, Gdk.Pixbuf icon)
			{
				this.statusBar = statusBar;
				this.icon = icon;
				box = new EventBox ();
				box.VisibleWindow = false;
				image = new Image (icon);
				image.SetPadding (0, 0);
				box.Child = image;
				box.Events |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
				box.EnterNotifyEvent += HandleEnterNotifyEvent;
				box.LeaveNotifyEvent += HandleLeaveNotifyEvent;
			}
开发者ID:jmloeffler,项目名称:monodevelop,代码行数:13,代码来源:StatusArea.cs


注:本文中的Gtk.Image.SetPadding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。