Пример #1
0
 public ImageButton()
 {
     Events       |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask;
     VisibleWindow = false;
     imageWidget   = new ImageView();
     imageWidget.Show();
     Add(imageWidget);
 }
Пример #2
0
		public ImageButton ()
		{
			Events |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask;
			VisibleWindow = false;
			imageWidget = new ImageView ();
			imageWidget.Show ();
			Add (imageWidget);
		}
Пример #3
0
 public HoverImageButton()
 {
     Gtk.Alignment al = new Alignment(0.5f, 0.5f, 0f, 0f);
     al.Show();
     CanFocus      = true;
     VisibleWindow = false;
     image         = new ImageView();
     image.Show();
     al.Add(image);
     Add(al);
 }
        public HoverImageButton()
        {
			Gtk.Alignment al = new Alignment (0.5f, 0.5f, 0f, 0f);
			al.Show ();
            CanFocus = true;
			VisibleWindow = false;
			image = new ImageView();
            image.Show();
			al.Add (image);
            Add(al);
        }
Пример #5
0
        public ImageButton()
        {
            var actionHandler = new ActionDelegate(this);

            actionHandler.PerformPress += HandlePress;

            Accessible.Role = Atk.Role.PushButton;

            Events       |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask;
            VisibleWindow = false;
            imageWidget   = new ImageView();
            imageWidget.Accessible.SetShouldIgnore(true);
            imageWidget.Show();
            Add(imageWidget);
        }
Пример #6
0
        public HoverImageButton()
        {
            var actionHandler = new ActionDelegate(this);

            actionHandler.PerformPress += OnPerformPress;

            Accessible.SetRole(AtkCocoa.Roles.AXButton);

            Gtk.Alignment al = new Alignment(0.5f, 0.5f, 0f, 0f);
            al.Accessible.SetShouldIgnore(true);
            al.Show();
            CanFocus      = true;
            VisibleWindow = false;
            image         = new ImageView();
            image.Accessible.SetShouldIgnore(true);
            image.Show();
            al.Add(image);
            Add(al);
        }
		static void SetButtonIcon (Button button, string stockIcon)
		{
			Alignment alignment = new Alignment (0.5f, 0.5f, 0f, 0f);
			Label label = new Label (button.Label);
			HBox hbox = new HBox (false, 2);
			ImageView image = new ImageView ();
			
			image.Image = ImageService.GetIcon (stockIcon, IconSize.Menu);
			image.Show ();
			hbox.Add (image);
			
			label.Show ();
			hbox.Add (label);
			
			hbox.Show ();
			alignment.Add (hbox);
			
			button.Child.Destroy ();
			
			alignment.Show ();
			button.Add (alignment);
		}
Пример #8
0
		Widget CreateExceptionHeader ()
		{
			var icon = new ImageView (WarningIconPixbuf);
			icon.Show ();

			var hbox = new HBox (false, 12) { BorderWidth = 12 };
			hbox.PackStart (icon, false, true, 0);
			hbox.PackStart (CreateExceptionInfoHeader (), true, true, 0);
			hbox.Show ();

			return hbox;
		}
Пример #9
0
		public void SetLabel (Gtk.Widget page, Xwt.Drawing.Image icon, string label)
		{
			this.label = label;
			this.page = page;
			if (Child != null) {
				Gtk.Widget oc = Child;
				Remove (oc);
				oc.Destroy ();
			}
			
			Gtk.HBox box = new HBox ();
			box.Spacing = -2;
			
			if (icon == null)
				icon = ImageService.GetIcon ("md-empty");

			tabIcon = new ImageView (icon);
			tabIcon.Show ();
			box.PackStart (tabIcon, false, false, 3);

			if (!string.IsNullOrEmpty (label)) {
				labelWidget = new ExtendedLabel (label);
				labelWidget.UseMarkup = true;
				labelWidget.Yalign = 0.85f;
				var alignLabel = new Alignment (0.0f, 1.0f, 1, 1);
				alignLabel.BottomPadding = 0;
				alignLabel.RightPadding = 15;
				alignLabel.Add (labelWidget);
				box.PackStart (alignLabel, true, true, 0);
			} else {
				labelWidget = null;
			}

			btnDock = new ImageButton ();
			btnDock.Image = pixAutoHide;
			btnDock.TooltipText = GettextCatalog.GetString ("Auto Hide");
			btnDock.CanFocus = false;
//			btnDock.WidthRequest = btnDock.HeightRequest = 17;
			btnDock.Clicked += OnClickDock;
			btnDock.ButtonPressEvent += (o, args) => args.RetVal = true;
			btnDock.WidthRequest = btnDock.SizeRequest ().Width;

			btnClose = new ImageButton ();
			btnClose.Image = pixClose;
			btnClose.TooltipText = GettextCatalog.GetString ("Close");
			btnClose.CanFocus = false;
//			btnClose.WidthRequest = btnClose.HeightRequest = 17;
			btnClose.WidthRequest = btnDock.SizeRequest ().Width;
			btnClose.Clicked += delegate {
				item.Visible = false;
			};
			btnClose.ButtonPressEvent += (o, args) => args.RetVal = true;

			Gtk.Alignment al = new Alignment (0, 0.5f, 1, 1);
			HBox btnBox = new HBox (false, 0);
			btnBox.PackStart (btnDock, false, false, 3);
			btnBox.PackStart (btnClose, false, false, 1);
			al.Add (btnBox);
			box.PackEnd (al, false, false, 3);

			Add (box);
			
			// Get the required size before setting the ellipsize property, since ellipsized labels
			// have a width request of 0
			box.ShowAll ();
			Show ();

			UpdateBehavior ();
			UpdateVisualStyle ();
		}