Exemplo n.º 1
0
 public WelcomeButton(Image icon, string text, Action func)
 {
     Icon = icon;
     Text = text;
     Func = func;
     Name = null;
 }
Exemplo n.º 2
0
 public WelcomeButton(string name, string text, Action func)
 {
     Name = name;
     Text = text;
     Func = func;
     Icon = null;
 }
Exemplo n.º 3
0
 public void DrawImage(Image image, float alpha = 1)
 {
     DrawImage(new Point(0, 0), image.Width, image.Height,
               image, ScaleMode.Fill, false, alpha);
 }
Exemplo n.º 4
0
        public ISurface CreateSurface(string absolutePath, bool warnOnDispose = true, bool useDeviceScaleFactor = true)
        {
            Image img = new Image(absolutePath);

            return(CreateSurface(img.Width, img.Height, img, warnOnDispose, useDeviceScaleFactor));
        }
Exemplo n.º 5
0
 public ISurface CreateSurface(int width, int height, Image image = null, bool warnOnDispose = true, bool useDeviceScaleFactor = true)
 {
     return(new Surface(width, height, image, warnOnDispose, useDeviceScaleFactor));
 }
Exemplo n.º 6
0
        void HandleShieldButtonPressEvent(object o, ButtonPressEventArgs args)
        {
            Image shield;
            Pixbuf pix = Helpers.Misc.OpenImage (this);

            if (pix == null) {
                return;
            }

            shield = new Image (pix);
            if (shield != null) {
                shield.ScaleInplace (Constants.MAX_SHIELD_ICON_SIZE,
                    Constants.MAX_SHIELD_ICON_SIZE);
                template.Shield = shield;
                shieldimage.Pixbuf = shield.Scale (SHIELD_SIZE, SHIELD_SIZE).Value;
                Edited = true;
            }
        }
Exemplo n.º 7
0
        public ISurface CreateSurfaceFromResource(string resourceName, bool warnOnDispose = true, bool useDeviceScaleFactor = true)
        {
            Image img = App.Current.ResourcesLocator.LoadImage(resourceName);

            return(CreateSurface(img.Width, img.Height, img, warnOnDispose, useDeviceScaleFactor));
        }
Exemplo n.º 8
0
        void HandlePlayerButtonPressEvent(object o, ButtonPressEventArgs args)
        {
            Image player;
            Pixbuf pix = Helpers.Misc.OpenImage (this);

            if (pix == null) {
                return;
            }

            player = new Image (pix);
            player.ScaleInplace (Constants.MAX_PLAYER_ICON_SIZE,
                Constants.MAX_PLAYER_ICON_SIZE);
            if (player != null && loadedPlayer != null) {
                playerimage.Pixbuf = player.Value;
                loadedPlayer.Photo = player;
                teamtagger.Reload ();
                Edited = true;
            }
        }
Exemplo n.º 9
0
 /// <summary>
 /// Sets the tab icon.
 /// </summary>
 /// <param name="widget">Widget which is being modifyed</param>
 /// <param name="pixIcon">Icon showed when the tab is not selected</param>
 /// <param name="pixActiveIcon">Icon showed when the tab is selected</param>
 /// <param name="tooltiptext">Text to add to the tab of the widget as tooltip</param>
 public void SetTabIcon(Widget widget, Image pixIcon, Image pixActiveIcon, string tooltiptext, Color color = null)
 {
     TabIcons.Add(widget, new Tuple <Image, Image, Color> (pixIcon, pixActiveIcon, color));
     TabToolTips.Add(widget, tooltiptext);
 }
Exemplo n.º 10
0
        public void SetCursorForTool(DrawTool tool)
        {
            string cursorStr = null;

            Gdk.Cursor cursor = null;

            if (widget.GdkWindow == null)
            {
                return;
            }

            switch (tool)
            {
            case DrawTool.Line:
                cursorStr = "arrow";
                break;

            case DrawTool.Cross:
                cursorStr = "cross";
                break;

            case DrawTool.Text:
                cursorStr = "text";
                break;

            case DrawTool.Counter:
                cursorStr = "number";
                break;

            case DrawTool.Ellipse:
            case DrawTool.CircleArea:
                cursorStr = "ellipse";
                break;

            case DrawTool.Rectangle:
            case DrawTool.RectangleArea:
                cursorStr = "rect";
                break;

            case DrawTool.Angle:
                cursorStr = "angle";
                break;

            case DrawTool.Pen:
                cursorStr = "freehand";
                break;

            case DrawTool.Eraser:
                cursorStr = "eraser";
                break;

            case DrawTool.Player:
                cursorStr = "player";
                break;

            case DrawTool.Zoom:
                cursorStr = "zoom";
                break;

            case DrawTool.CanMove:
                cursorStr = "hand_opened";
                break;

            case DrawTool.Move:
                cursorStr = "hand_closed";
                break;

            case DrawTool.Selection:
                cursorStr = "hand_select";
                break;

            default:
                cursor = null;
                break;
            }
            if (cursorStr == null)
            {
                widget.GdkWindow.Cursor = cursor;
            }
            else
            {
                Image  img = App.Current.ResourcesLocator.LoadImage(Path.Combine("images/cursors", cursorStr));
                Cursor c   = new Cursor(widget.Display, img.Value, 0, 0);
                widget.GdkWindow.Cursor = c;
            }
        }
Exemplo n.º 11
0
 void UpdateBackground(Image background, int index)
 {
     if (index == 0) {
         template.FieldBackground = background;
         fieldimage.Pixbuf = background.Scale (50, 50).Value;
     } else if (index == 1) {
         template.HalfFieldBackground = background;
         hfieldimage.Pixbuf = background.Scale (50, 50).Value;
     } else if (index == 2) {
         template.GoalBackground = background;
         goalimage.Pixbuf = background.Scale (50, 50).Value;
     }
     Edited = true;
 }
Exemplo n.º 12
0
        void HandleFieldButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
        {
            Image background;
            Gdk.Pixbuf pix = Helpers.Misc.OpenImage (this);

            if (pix == null) {
                return;
            }

            background = new Image (pix);
            background.ScaleInplace (Constants.MAX_BACKGROUND_WIDTH,
                Constants.MAX_BACKGROUND_HEIGHT);
            if (o == fieldeventbox) {
                UpdateBackground (background, 0);
            } else if (o == hfieldeventbox) {
                UpdateBackground (background, 1);
            } else if (o == goaleventbox) {
                UpdateBackground (background, 2);
            }
            Edited = true;
        }