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 ();
		}
 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;
 }
Example #3
0
 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;
 }
Example #4
0
        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();
        }
Example #5
0
        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();
        }
Example #6
0
        //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();
        }
Example #7
0
        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();
        }
Example #8
0
        //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();
        }
Example #9
0
        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();
        }
        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();
        }
			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;
			}
Example #12
0
			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;
			}