Inheritance: ISerializable, IDisposable
Beispiel #1
0
        protected void RenderMiniature(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            var item = model.GetValue(iter, 0);
            var c    = cell as CellRendererPixbuf;

            if (item is Play)
            {
                Image img = (item as Play).Miniature;
                c.Pixbuf = img != null ? img.Value : null;
                if (Colors)
                {
                    c.CellBackgroundGdk = Helpers.Misc.ToGdkColor((item as Play).Category.Color);
                }
                else
                {
                    c.CellBackground = "white";
                }
            }
            else if (item is Player)
            {
                Image img = (item as Player).Photo;
                c.Pixbuf         = img != null ? img.Value : null;
                c.CellBackground = "white";
            }
            else
            {
                c.Pixbuf         = null;
                c.CellBackground = "white";
            }
        }
 public void LoadBackgrounds(Image fieldImage, Image halfFieldImage, Image goalImage)
 {
     if (fieldImage != null)
     {
         fieldPixbuf = fieldImage.Value;
     }
     else
     {
         fieldPixbuf = Gdk.Pixbuf.LoadFromResource(Constants.FIELD_BACKGROUND);
     }
     field.Background = fieldPixbuf;
     if (halfFieldImage != null)
     {
         hFieldPixbuf = halfFieldImage.Value;
     }
     else
     {
         hFieldPixbuf = Gdk.Pixbuf.LoadFromResource(Constants.HALF_FIELD_BACKGROUND);
     }
     hfield.Background = hFieldPixbuf;
     if (goalImage != null)
     {
         goalPixbuf = goalImage.Value;
     }
     else
     {
         goalPixbuf = Gdk.Pixbuf.LoadFromResource(Constants.GOAL_BACKGROUND);
     }
     goal.Background = goalPixbuf;
 }
        protected virtual void OnImageClicked(object sender, EventArgs args)
        {
            Pixbuf shield;

            shield = Helpers.Misc.OpenImage((Gtk.Window) this.Toplevel);
            if (shield != null)
            {
                Image img = new Image(shield);
                img.Scale();
                Template.Shield    = img;
                shieldImage.Pixbuf = img.Value;
            }
        }
Beispiel #4
0
        public void DrawingTool(Image image, Play play, int stopTime)
        {
            DrawingTool dialog = new DrawingTool();

            dialog.Image = image.Value;
            if (play != null)
            {
                dialog.SetPlay(play, stopTime);
            }
            dialog.TransientFor = mainWindow as Gtk.Window;
            image.Dispose();
            dialog.Run();
            dialog.Destroy();
        }
Beispiel #5
0
        void SetGoalImage(Pixbuf pix)
        {
            Image img;

            if (pix == null)
            {
                img            = Config.GoalBackground;
                gReset.Visible = false;
            }
            else
            {
                img            = new Image(pix);
                gReset.Visible = true;
            }
            img.Scale();
            goalImage.Pixbuf = img.Value;
        }
Beispiel #6
0
        void SetHalfFieldImage(Pixbuf pix)
        {
            Image img;

            if (pix == null)
            {
                img             = Config.HalfFieldBackground;
                hfReset.Visible = false;
            }
            else
            {
                img             = new Image(pix);
                hfReset.Visible = true;
            }
            img.Scale();
            halffieldImage.Pixbuf = img.Value;
        }
Beispiel #7
0
        void SetGoalImage(Pixbuf pix)
        {
            Image img;

            if (pix == null)
            {
                img = new Image(
                    Gdk.Pixbuf.LoadFromResource(Constants.GOAL_BACKGROUND));
                gReset.Visible = false;
            }
            else
            {
                img            = new Image(pix);
                gReset.Visible = true;
            }
            img.Scale();
            goalImage.Pixbuf = img.Value;
        }
Beispiel #8
0
        void SetHalfFieldImage(Pixbuf pix)
        {
            Image img;

            if (pix == null)
            {
                img = new Image(
                    Gdk.Pixbuf.LoadFromResource(Constants.HALF_FIELD_BACKGROUND));
                hfReset.Visible = false;
            }
            else
            {
                img             = new Image(pix);
                hfReset.Visible = true;
            }
            img.Scale();
            halffieldImage.Pixbuf = img.Value;
        }
Beispiel #9
0
        public void DrawingTool(Image image, Play play, int stopTime)
        {
            DrawingTool dialog = new DrawingTool();

            dialog.Image = image.Value;
            if (play != null)
                dialog.SetPlay(play, stopTime);
            dialog.TransientFor = mainWindow as Gtk.Window;
            image.Dispose();
            dialog.Run();
            dialog.Destroy();
        }
Beispiel #10
0
 public void LoadBackgrounds(Image field, Image halfField, Image goal)
 {
     alltagger.LoadBackgrounds(field, halfField, goal);
     hometagger.LoadBackgrounds(field, halfField, goal);
     awaytagger.LoadBackgrounds(field, halfField, goal);
 }