Exemplo n.º 1
0
        public MetroButton(global::Gdk.Pixbuf normalImage,
                           global::Gdk.Pixbuf mousedown,
                           global::Gdk.Pixbuf highlighted)
        {
            global::Stetic.Gui.Initialize(this);
            // Widget CrossPlatformWebServer.MetroButton
            global::Stetic.BinContainer.Attach(this);
            this.Name = "CrossPlatformWebServer.MetroButton";
            if ((this.Child != null))
            {
                this.Child.ShowAll();
            }
            this.Hide();

            this.NormalImage = normalImage;
            this.MouseDown   = mousedown;
            this.Highlighted = highlighted;

            //fixed
            this.fixed1           = new global::Gtk.Fixed();
            this.fixed1.Name      = "fixed1";
            this.fixed1.HasWindow = false;
            this.Add(this.fixed1);
            // Container child fixed1.Gtk.Fixed+FixedChild
            if (highlighted == null)
            {
                this.drawingarea1              = new global::Gtk.DrawingArea();
                this.drawingarea1.Name         = "drawingarea1";
                this.drawingarea1.ExposeEvent += OnExpose;
                this.fixed1.Add(this.drawingarea1);
                global::Gtk.Fixed.FixedChild w1 = ((global::Gtk.Fixed.FixedChild)(this.fixed1 [this.drawingarea1]));
                w1.X = 1;
                w1.Y = 1;
            }
            // Container child fixed1.Gtk.Fixed+FixedChild
            this.eventbox1 = new global::Gtk.EventBox();
            //this.eventbox1.VisibleWindow = false;
            this.eventbox1.ModifyBg(StateType.Normal, new Color(65, 177, 225));
            this.eventbox1.Name                = "eventbox1";
            this.eventbox1.ButtonPressEvent   += new global::Gtk.ButtonPressEventHandler(this.OnEventbox1ButtonPressEvent);
            this.eventbox1.ButtonReleaseEvent += new global::Gtk.ButtonReleaseEventHandler(this.OnEventbox1ButtonReleaseEvent);
            this.eventbox1.EnterNotifyEvent   += new global::Gtk.EnterNotifyEventHandler(this.OnEventbox1EnterNotifyEvent);
            this.eventbox1.LeaveNotifyEvent   += new global::Gtk.LeaveNotifyEventHandler(this.OnEventbox1LeaveNotifyEvent);
            // Container child eventbox1.Gtk.Container+ContainerChild
            this.image1        = new global::Gtk.Image();
            this.image1.Name   = "image1";
            this.image1.Pixbuf = this.NormalImage;
            this.eventbox1.Add(this.image1);
            this.fixed1.Add(this.eventbox1);
            global::Gtk.Fixed.FixedChild w3 = ((global::Gtk.Fixed.FixedChild)(this.fixed1 [this.eventbox1]));
            w3.X = 2;
            w3.Y = 2;

            this.WidthRequest  = normalImage.Width;
            this.HeightRequest = normalImage.Height;
        }
Exemplo n.º 2
0
 public static Gdk.Pixbuf LoadImage(Bitmap SourceBitmap)
 {
     Gdk.Pixbuf Result;
     using (MemoryStream imgstream = new MemoryStream()) {
         imgstream.Position = 0;
         SourceBitmap.Save(imgstream, ImageFormat.Bmp);
         imgstream.Position = 0;
         Result             = new global::Gdk.Pixbuf(imgstream);
         imgstream.Close();
     }
     return(Result);
 }
Exemplo n.º 3
0
 public MetroButton(global::Gdk.Pixbuf normalImage,
                    global::Gdk.Pixbuf mousedown)
     : this(normalImage, mousedown, null)
 {
 }