AllocResources() public méthode

public AllocResources ( ) : void
Résultat void
 /// <summary>
 /// Allocates the control its DirectX resources.
 /// </summary>
 public override void AllocResources()
 {
     base.AllocResources();
     _imageCheckMarkFocused.AllocResources();
     _imageCheckMarkNonFocused.AllocResources();
     _font = GUIFontManager.GetFont(_fontName);
 }
Exemple #2
0
 public override void AllocResources()
 {
     base.AllocResources();
     _imageFocusRectangle.AllocResources();
     thumbImage.AllocResources();
     blackImage.AllocResources();
 }
        //public event SortEventHandler	SortChanged;

        #endregion Events

        #region Methods

        public override void AllocResources()
        {
            base.AllocResources();

            ImgUpButtonNormal.AllocResources();
            ImgUpButtonFocused.AllocResources();

            ImgDownButtonNormal.AllocResources();
            ImgDownButtonFocused.AllocResources();

            ImgDeleteButtonNormal.AllocResources();
            ImgDeleteButtonFocused.AllocResources();

            if (ImgUpButtonDisabled != null)
            {
                ImgUpButtonDisabled.AllocResources();
            }

            if (ImgDownButtonDisabled != null)
            {
                ImgDownButtonDisabled.AllocResources();
            }

            if (ImgDeleteButtonDisabled != null)
            {
                ImgDeleteButtonDisabled.AllocResources();
            }
        }
 /// <summary>
 /// Allocates the control its DirectX resources.
 /// </summary>
 public override void AllocResources()
 {
     base.AllocResources();
     _imageBackGround.AllocResources();
     _imageRight.AllocResources();
     _imageLeft.AllocResources();
 }
Exemple #5
0
 /// <summary>
 /// Allocates the control its DirectX resources.
 /// </summary>
 public override void AllocResources()
 {
     base.AllocResources();
     _imageBackGround.AllocResources();
     _imageMid.AllocResources();
     _imageMidFocus.AllocResources();
 }
 /// <summary>
 /// Allocates the control its DirectX resources.
 /// </summary>
 public override void AllocResources()
 {
     base.AllocResources();
     _frameCounter = 0;
     _imageFocused.AllocResources();
     _imageNonFocused.AllocResources();
     _width               = _imageFocused.Width;
     _height              = _imageFocused.Height;
     _labelControl.Width  = _width;
     _labelControl.Height = _height;
     _labelControl.AllocResources();
     _spinControl.AllocResources();
 }
Exemple #7
0
        /// <summary>
        /// Allocates the control its DirectX resources.
        /// </summary>
        public override void AllocResources()
        {
            base.AllocResources();
            _frameCounter = 0;
            _imageFocused.AllocResources();
            _imageNonFocused.AllocResources();
            _width  = _imageFocused.Width;
            _height = _imageFocused.Height;

            if (SubItemCount > 0)
            {
                Label = (string)GetSubItem(SelectedItem);
            }
            _labelControl.Width  = _width;
            _labelControl.Height = _height;
            _labelControl.AllocResources();
            checkMark.AllocResources();
        }
        /// <summary>
        /// Allocates the control its DirectX resources.
        /// </summary>
        public override void AllocResources()
        {
            base.AllocResources();
            _imageBackGround.AllocResources();
            _imageMid.AllocResources();
            _imageRight.AllocResources();
            _imageLeft.AllocResources();

            _imageBackGround.Filtering = false;
            _imageMid.Filtering        = false;
            _imageRight.Filtering      = false;
            _imageLeft.Filtering       = false;

            _imageBackGround.Height = 25;
            _imageRight.Height      = 20;
            _imageLeft.Height       = 20;
            _imageMid.Height        = 20;
        }
        public override void AllocResources()
        {
            base.AllocResources();
            _font = GUIFontManager.GetFont(_fontName);
            _imageTop.AllocResources();
            _imageBottom.AllocResources();
            _imageMid.AllocResources();
            _imageRight.AllocResources();
            _imageLeft.AllocResources();
            _imageFillBackground.AllocResources();
            _imageFill1.AllocResources();
            _imageFill2.AllocResources();
            _imageFill3.AllocResources();
            if (_imageFillMarker != null)
            {
                _imageFillMarker.AllocResources();
                _imageFillMarker.Height    = _height - 6;
                _imageFillMarker.Filtering = false;
            }
            _imageTick.AllocResources();
            _imageLogo.AllocResources();

            _imageTop.Filtering    = false;
            _imageBottom.Filtering = false;
            _imageMid.Filtering    = false;
            _imageRight.Filtering  = false;
            _imageLeft.Filtering   = false;
            _imageFill1.Filtering  = false;
            _imageFill2.Filtering  = false;
            _imageFill3.Filtering  = false;
            _imageTick.Filtering   = false;
            if (_height == 0)
            {
                _height = _imageRight.TextureHeight;
            }
            //      _imageTop.Height=_height;
            _imageRight.Height = _height;
            _imageLeft.Height  = _height;
            _imageMid.Height   = _height;
            _imageFill1.Height = _height - 6;
            _imageFill2.Height = _height - 6;
            _imageFill3.Height = _height - 6;
            //_imageTick.Height=_height;
        }
Exemple #10
0
        public static void Init()
        {
            if (_countLabel == null)
            {
                _countLabel                = new GUILabelControl(0);
                _countLabel.FontName       = "waitcursor";
                _countLabel.TextColor      = 0x66ffffff;
                _countLabel.TextAlignment  = Alignment.ALIGN_CENTER;
                _countLabel.TextVAlignment = VAlignment.ALIGN_MIDDLE;
                _countLabel.Width          = 96;
                _countLabel.Height         = 96;
            }

            if (_animation == null)
            {
                _animation = new GUIAnimation();

                string themedFilename;
                foreach (string filename in Directory.GetFiles(GUIGraphicsContext.Skin + @"\media\", "common.waiting.*.png"))
                {
                    themedFilename = GUIGraphicsContext.GetThemedSkinFile(filename);
                    _animation.Filenames.Add(Path.GetFileName(themedFilename));
                }

                // dirty hack because the files are 96x96 - unfortunately no property gives the correct size at runtime when init is called :S
                int scaleWidth  = (GUIGraphicsContext.Width / 2) - 48;
                int scaleHeigth = (GUIGraphicsContext.Height / 2) - 48;

                _animation.SetPosition(scaleWidth, scaleHeigth);

                // broken!?
                _animation.HorizontalAlignment = HorizontalAlignment.Center;
                _animation.VerticalAlignment   = VerticalAlignment.Center;

                Log.Debug("GUIWaitCursor: init at position {0}:{1}", scaleWidth, scaleHeigth);
                _animation.AllocResources();
                _animation.Duration       = new Duration(800);
                _animation.RepeatBehavior = RepeatBehavior.Forever;
            }
        }
Exemple #11
0
        /// <summary>
        /// Allocates the control its DirectX resources.
        /// </summary>
        public override void AllocResources()
        {
            base.AllocResources();
            _frameCounter = 0;
            _imageFocused.AllocResources();
            _imageNonFocused.AllocResources();
            _width  = _imageFocused.Width;
            _height = _imageFocused.Height;
            _imageBackground.AllocResources();

            _imageLeft.AllocResources();
            _imageLeftFocus.AllocResources();

            _imageRight.AllocResources();
            _imageRightFocus.AllocResources();

            _font = GUIFontManager.GetFont(_fontName);

            PositionLeftAndRightImages();

            _labelControl.AllocResources();
        }
Exemple #12
0
 /// <summary>
 /// Allocates the control its DirectX resources.
 /// </summary>
 public override void AllocResources()
 {
     base.AllocResources();
     _imageFocused.AllocResources();
     _imageNonFocused.AllocResources();
 }
Exemple #13
0
    public override void FinalizeConstruction()
    {
      base.FinalizeConstruction();

      HasCamera = _hasCamera;
      Camera = new System.Drawing.Point(_cameraXPos, _cameraYPos);

      _font1 = GUIFontManager.GetFont(_fontName1);
      _font2 = GUIFontManager.GetFont(_fontName2);

      // Create the background.
      _imageBackground = LoadAnimationControl(_controlId, 0, _backgroundPositionX, _backgroundPositionY,
                                              _backgroundWidth, _backgroundHeight, _backgroundTextureName);
      _imageBackground.ParentControl = this;
      _imageBackground.DimColor = DimColor;

      // Create the foreground.
      _imageForeground = LoadAnimationControl(_controlId, 0, _foregroundPositionX, _foregroundPositionY,
                                              _foregroundWidth, _foregroundHeight, _foregroundTextureName);
      _imageForeground.ParentControl = this;
      _imageForeground.DimColor = DimColor;

      // Create a single focus frame for the card that is in focus.
      _frameFocus = LoadAnimationControl(0, 0,
                                         0, 0,
                                         _cardWidth, _cardHeight,
                                         _frameFocusName);
      _frameFocus.ParentControl = null;
      _frameFocus.DimColor = DimColor;
      _frameFocus.FlipY = _flipY;
      _frameFocus.DiffuseFileName = _diffuseFilename;
      _frameFocus.MaskFileName = _maskFilename;
      _frameFocus.AllocResources();

      // Create the card labels.
      int y = _positionY + _label1OffsetY;
      _label1 = new GUILabelControl(_controlId, 0,
                                    0, y,
                                    Width, 0,
                                    _fontName1, "", 0x0,
                                    Alignment.ALIGN_CENTER, VAlignment.ALIGN_TOP,
                                    false,
                                    _shadowAngle, _shadowDistance, _shadowColor);

      y = _positionY + _label2OffsetY;
      _label2 = new GUILabelControl(_controlId, 0,
                                    0, y,
                                    Width, 0,
                                    _fontName2, "", 0x0,
                                    Alignment.ALIGN_CENTER, VAlignment.ALIGN_TOP,
                                    false,
                                    _shadowAngle, _shadowDistance, _shadowColor);

      // Create the horizontal scrollbar.
      int scrollbarWidth = _scrollbarWidth;
      int scrollbarHeight = _scrollbarHeight;
      GUIGraphicsContext.ScaleHorizontal(ref scrollbarWidth);
      GUIGraphicsContext.ScaleVertical(ref scrollbarHeight);
      int scrollbarPosX = _positionX + (_width / 2) - (scrollbarWidth / 2);

      _horizontalScrollbar = new GUIHorizontalScrollbar(_controlId, 0,
                                                        scrollbarPosX, _positionY + _scrollbarOffsetY,
                                                        scrollbarWidth, scrollbarHeight,
                                                        _scrollbarBackgroundTextureName, _scrollbarLeftTextureName,
                                                        _scrollbarRightTextureName);
      _horizontalScrollbar.ParentControl = this;
      _horizontalScrollbar.DimColor = DimColor;

      // Create controls for the back of the selected card.  All of the controls are provided as a single subitem.      
      XmlDocument doc = new XmlDocument();

      if (SubItemCount > 0) // avoid exception when no SubItems are available
      {
        doc.LoadXml((string)GetSubItem(0));
        XmlNodeList nodeList = doc.DocumentElement.SelectNodes("/controls/*");
        IDictionary<string, string> defines = new Dictionary<string, string>(); // An empty set of defines.
        foreach (XmlNode node in nodeList)
        {
          try
          {
            GUIControl newControl = GUIControlFactory.Create(_windowId, node, defines, null);
            _cardBackControls.Add(newControl);
          }
          catch (Exception ex)
          {
            Log.Error("GUICoverFlow: Unable to load control. exception:{0}", ex.ToString());
          }
        }
      }
    }
Exemple #14
0
    internal static void SetProcessAnimationStatus(bool enable, GUIAnimation guiSearchAnimation)
    {
      try
      {
        if (guiSearchAnimation != null)
        {
          if (enable)
            guiSearchAnimation.AllocResources();
          else
            guiSearchAnimation.Dispose();

          guiSearchAnimation.Visible = enable;
        }
        else
        {
          LogMyFilms.Warn("SetProcessAnimationStatus '" + enable + "' - skin control missing? - falling back to MP GUIWaitCursor()");
          if (enable && !MyFilms.animationStatus)
          {
            MyFilms.animationStatus = true;
            GUIWaitCursor.Init();
            GUIWaitCursor.Show();
          }
          else if (!enable && MyFilms.animationStatus)
          {
            MyFilms.animationStatus = false;
            GUIWaitCursor.Hide();
          }
        }
      }
      catch (Exception ex)
      {
        LogMyFilms.Error("SetProcessAnimationStatus() -  '" + enable + "' - skin control missing? : " + ex.Message);
      }
    }
    public static void Init()
    {
      if (_countLabel == null)
      {
        _countLabel = new GUILabelControl(0);
        _countLabel.FontName = "waitcursor";
        _countLabel.TextColor = 0x66ffffff;
        _countLabel.TextAlignment = Alignment.ALIGN_CENTER;
        _countLabel.TextVAlignment = VAlignment.ALIGN_MIDDLE;
        _countLabel.Width = 96;
        _countLabel.Height = 96;
      }

      if (_animation == null)
      {
        _animation = new GUIAnimation();

        string themedFilename;
        foreach (string filename in Directory.GetFiles(GUIGraphicsContext.Skin + @"\media\", "common.waiting.*.png"))
        {
          themedFilename = GUIGraphicsContext.GetThemedSkinFile(filename);
          _animation.Filenames.Add(Path.GetFileName(themedFilename));
        }

        // dirty hack because the files are 96x96 - unfortunately no property gives the correct size at runtime when init is called :S
        int scaleWidth = (GUIGraphicsContext.Width / 2) - 48;
        int scaleHeigth = (GUIGraphicsContext.Height / 2) - 48;

        _animation.SetPosition(scaleWidth, scaleHeigth);

        // broken!?
        _animation.HorizontalAlignment = HorizontalAlignment.Center;
        _animation.VerticalAlignment = VerticalAlignment.Center;

        Log.Debug("GUIWaitCursor: init at position {0}:{1}", scaleWidth, scaleHeigth);
        _animation.AllocResources();
        _animation.Duration = new Duration(800);
        _animation.RepeatBehavior = RepeatBehavior.Forever;
      }
    }