Esempio n. 1
0
        /// <summary>
        /// This method gets called when the control is created and all properties has been set
        /// It allows the control to do any initialization
        /// </summary>
        public override sealed void FinalizeConstruction()
        {
            base.FinalizeConstruction();
            _imageFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                                 _focusedTextureName);
            _imageFocused.ParentControl = this;
            _imageFocused.Filtering     = false;
            _imageFocused.DimColor      = DimColor;
            _imageFocused.SetBorder(_strBorderTF, _borderPositionTF, _borderTextureRepeatTF, _borderTextureRotateTF,
                                    _borderTextureFileNameTF, _borderColorKeyTF, _borderHasCornersTF,
                                    _borderCornerTextureRotateTF);

            _imageNonFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                                    _nonFocusedTextureName);
            _imageNonFocused.ParentControl = this;
            _imageNonFocused.Filtering     = false;
            _imageNonFocused.DimColor      = DimColor;
            _imageNonFocused.SetBorder(_strBorderTNF, _borderPositionTNF, _borderTextureRepeatTNF, _borderTextureRotateTNF,
                                       _borderTextureFileNameTNF, _borderColorKeyTNF, _borderHasCornersTNF,
                                       _borderCornerTextureRotateTNF);
            GUILocalizeStrings.LocalizeLabel(ref _label);

            if (_scrollStartDelay < 0)
            {
                _labelControl = new GUILabelControl(_parentControlId, 0, _positionX, _positionY, _width, _height, _fontName,
                                                    _label, _textColor, Alignment.ALIGN_LEFT, VAlignment.ALIGN_TOP, false,
                                                    _shadowAngle, _shadowDistance, _shadowColor);
                ((GUILabelControl)_labelControl).TextAlignment  = _textAlignment;
                ((GUILabelControl)_labelControl).TextVAlignment = _textVAlignment;
            }
            else
            {
                _labelControl = new GUIFadeLabel(_parentControlId, 0, _positionX, _positionY, _width, _height, _fontName,
                                                 _textColor, Alignment.ALIGN_LEFT, VAlignment.ALIGN_TOP,
                                                 _shadowAngle, _shadowDistance, _shadowColor,
                                                 _userWrapString);
                ((GUIFadeLabel)_labelControl).TextAlignment  = _textAlignment;
                ((GUIFadeLabel)_labelControl).TextVAlignment = _textVAlignment;
                ((GUIFadeLabel)_labelControl).AllowScrolling = false;
                ((GUIFadeLabel)_labelControl).AllowFadeIn    = false;
            }
            _labelControl.ParentControl = this;
            _labelControl.DimColor      = DimColor;

            checkMark = new GUICheckMarkControl(0, 0, _positionX + _width - _checkMarkWidth, _positionY, _checkMarkWidth,
                                                _checkMarkHeight, _checkMarkFocusTextureName, _checkMarkNoFocusTextureName,
                                                _checkMarkWidth, _checkMarkHeight, Alignment.ALIGN_LEFT)
            {
                ParentControl = this,
                DimColor      = DimColor
            };
        }
Esempio n. 2
0
        /// <summary>
        /// This method gets called when the control is created and all properties has been set
        /// It allows the control todo any initialization
        /// </summary>
        public override void FinalizeConstruction()
        {
            base.FinalizeConstruction();
            _imageFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                                 _focusedTextureName);
            _imageFocused.ParentControl = this;
            _imageFocused.Filtering     = false;
            _imageFocused.DimColor      = DimColor;
            _imageFocused.SetBorder(_strBorderTF, _borderPositionTF, _borderTextureRepeatTF, _borderTextureRotateTF,
                                    _borderTextureFileNameTF, _borderColorKeyTF, _borderHasCornersTF,
                                    _borderCornerTextureRotateTF);

            _imageNonFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                                    _nonFocusedTextureName);
            _imageNonFocused.ParentControl = this;
            _imageNonFocused.Filtering     = false;
            _imageNonFocused.DimColor      = DimColor;
            _imageNonFocused.SetBorder(_strBorderTNF, _borderPositionTNF, _borderTextureRepeatTNF, _borderTextureRotateTNF,
                                       _borderTextureFileNameTNF, _borderColorKeyTNF, _borderHasCornersTNF,
                                       _borderCornerTextureRotateTNF);
            GUILocalizeStrings.LocalizeLabel(ref _label);

            _labelControl = new GUILabelControl(_parentControlId, 0, _positionX, _positionY, _width, _height, _fontName,
                                                _label, _textColor, Alignment.ALIGN_LEFT, VAlignment.ALIGN_TOP, false,
                                                _shadowAngle, _shadowDistance, _shadowColor);
            _labelControl.ParentControl  = this;
            _labelControl.DimColor       = DimColor;
            _labelControl.TextAlignment  = _textAlignment;
            _labelControl.TextVAlignment = _textVAlignment;

            checkMark = new GUICheckMarkControl(0, 0, _positionX + _width - _checkMarkWidth, _positionY, _checkMarkWidth,
                                                _checkMarkHeight, _checkMarkFocusTextureName, _checkMarkNoFocusTextureName,
                                                _checkMarkWidth, _checkMarkWidth, Alignment.ALIGN_LEFT);
            checkMark.ParentControl = this;
            checkMark.DimColor      = DimColor;
        }
        private void UpdateRating()
        {
            if (btnUnRate != null)
            {
                btnUnRate.Selected = (Rated == TraktRateValue.unrate);
                btnUnRate.Focus = (Rated == TraktRateValue.unrate);
            }

            // Update button states
            GUICheckMarkControl[] btnHearts = new GUICheckMarkControl[10]
            {
                btnOneHeart, btnTwoHeart, btnThreeHeart, btnFourHeart, btnFiveHeart,
                btnSixHeart, btnSevenHeart, btnEightHeart, btnNineHeart, btnTenHeart
            };

            for (int i = 0; i < 10; i++)
            {
                btnHearts[i].Label = string.Empty;
                btnHearts[i].Selected = ((int)Rated > i);
            }
            if ((int)Rated >= 1)
                btnHearts[(int)Rated - 1].Focus = true;

            // Update Rating Description
            lblRatingAdvanced.Label = Rated == TraktRateValue.unrate ? GetRatingDescription() : string.Format("({0}) {1} / 10", GetRatingDescription(), (int)Rated);
        }
        private void UpdateRating()
        {
            GUICheckMarkControl[] btnStars;
            if (DisplayStars == StarDisplay.FIVE_STARS) {
                btnStars = new GUICheckMarkControl[5] {
                    btnStar1, btnStar2, btnStar3, btnStar4, btnStar5
                };
            }
            else {
                btnStars = new GUICheckMarkControl[10] {
                    btnStar1, btnStar2, btnStar3, btnStar4, btnStar5,
                    btnStar6, btnStar7, btnStar8, btnStar9, btnStar10
                };
            }

            for (int i = 0; i < (int)DisplayStars; i++) {
                btnStars[i].Label = string.Empty;
                btnStars[i].Selected = (Rating >= i + 1);
            }
            btnStars[Rating - 1].Focus = true;

            // Display Rating Description
            if (lblRating != null) {
                lblRating.Label = string.Format("({0}) {1} / {2}", GetRatingDescription(), Rating.ToString(), (int)DisplayStars);
            }
        }
Esempio n. 5
0
 /// <summary>
 /// Creates the element and retrieves all information from the control
 /// </summary>
 /// <param name="control">GUIControl</param>
 public CheckMarkElement(GUIControl control)
     : base(control)
 {
     _checkMark = control as GUICheckMarkControl;
       if (_checkMark != null)
       {
     _checkFocusBitmap = LoadBitmap(_checkMark.CheckMarkTextureName);
     _checkNoFocusBitmap = LoadBitmap(_checkMark.CheckMarkTextureNameNF);
     _font = GetFont(_checkMark.FontName);
     _disabledColor = GetColor(_checkMark.DisabledColor);
     _textColor = GetColor(_checkMark.TextColor);
     _focus = _checkMark.Focus;
     _selected = _checkMark.Selected;
     _disabled = _checkMark.Disabled;
     _label = _checkMark.Label;
       }
 }
Esempio n. 6
0
    /// <summary>
    /// This method gets called when the control is created and all properties has been set
    /// It allows the control todo any initialization
    /// </summary>
    public override void FinalizeConstruction()
    {
      base.FinalizeConstruction();
      _imageFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                           _focusedTextureName);
      _imageFocused.ParentControl = this;
      _imageFocused.Filtering = false;
      _imageFocused.DimColor = DimColor;
      _imageFocused.SetBorder(_strBorderTF, _borderPositionTF, _borderTextureRepeatTF, _borderTextureRotateTF,
                              _borderTextureFileNameTF, _borderColorKeyTF, _borderHasCornersTF,
                              _borderCornerTextureRotateTF);

      _imageNonFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                              _nonFocusedTextureName);
      _imageNonFocused.ParentControl = this;
      _imageNonFocused.Filtering = false;
      _imageNonFocused.DimColor = DimColor;
      _imageNonFocused.SetBorder(_strBorderTNF, _borderPositionTNF, _borderTextureRepeatTNF, _borderTextureRotateTNF,
                                 _borderTextureFileNameTNF, _borderColorKeyTNF, _borderHasCornersTNF,
                                 _borderCornerTextureRotateTNF);
      GUILocalizeStrings.LocalizeLabel(ref _label);

      _labelControl = new GUILabelControl(_parentControlId, 0, _positionX, _positionY, _width, _height, _fontName,
                                          _label, _textColor, Alignment.ALIGN_LEFT, VAlignment.ALIGN_TOP, false,
                                          _shadowAngle, _shadowDistance, _shadowColor);
      _labelControl.ParentControl = this;
      _labelControl.DimColor = DimColor;
      _labelControl.TextAlignment = _textAlignment;
      _labelControl.TextVAlignment = _textVAlignment;

      checkMark = new GUICheckMarkControl(0, 0, _positionX + _width - _checkMarkWidth, _positionY, _checkMarkWidth,
                                          _checkMarkHeight, _checkMarkFocusTextureName, _checkMarkNoFocusTextureName,
                                          _checkMarkWidth, _checkMarkHeight, Alignment.ALIGN_LEFT);
      checkMark.ParentControl = this;
      checkMark.DimColor = DimColor;
    }
Esempio n. 7
0
    /// <summary>
    /// This method gets called when the control is created and all properties has been set
    /// It allows the control to do any initialization
    /// </summary>
    public override sealed void FinalizeConstruction()
    {
      base.FinalizeConstruction();
      _imageFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                           _focusedTextureName);
      _imageFocused.ParentControl = this;
      _imageFocused.Filtering = false;
      _imageFocused.DimColor = DimColor;
      _imageFocused.SetBorder(_strBorderTF, _borderPositionTF, _borderTextureRepeatTF, _borderTextureRotateTF,
                              _borderTextureFileNameTF, _borderColorKeyTF, _borderHasCornersTF,
                              _borderCornerTextureRotateTF);

      _imageNonFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                              _nonFocusedTextureName);
      _imageNonFocused.ParentControl = this;
      _imageNonFocused.Filtering = false;
      _imageNonFocused.DimColor = DimColor;
      _imageNonFocused.SetBorder(_strBorderTNF, _borderPositionTNF, _borderTextureRepeatTNF, _borderTextureRotateTNF,
                                 _borderTextureFileNameTNF, _borderColorKeyTNF, _borderHasCornersTNF,
                                 _borderCornerTextureRotateTNF);
      GUILocalizeStrings.LocalizeLabel(ref _label);

      if (_scrollStartDelay < 0)
      {
        _labelControl = new GUILabelControl(_parentControlId, 0, _positionX, _positionY, _width, _height, _fontName,
                                            _label, _textColor, Alignment.ALIGN_LEFT, VAlignment.ALIGN_TOP, false,
                                            _shadowAngle, _shadowDistance, _shadowColor);
        ((GUILabelControl)_labelControl).TextAlignment = _textAlignment;
        ((GUILabelControl)_labelControl).TextVAlignment = _textVAlignment;
      }
      else
      {
        _labelControl = new GUIFadeLabel(_parentControlId, 0, _positionX, _positionY, _width, _height, _fontName,
                                         _textColor, Alignment.ALIGN_LEFT, VAlignment.ALIGN_TOP,
                                         _shadowAngle, _shadowDistance, _shadowColor,
                                         _userWrapString);
        ((GUIFadeLabel)_labelControl).TextAlignment = _textAlignment;
        ((GUIFadeLabel)_labelControl).TextVAlignment = _textVAlignment;
        ((GUIFadeLabel)_labelControl).AllowScrolling = false;
        ((GUIFadeLabel)_labelControl).AllowFadeIn = false;
      }
      _labelControl.ParentControl = this;
      _labelControl.DimColor = DimColor;

      checkMark = new GUICheckMarkControl(0, 0, _positionX + _width - _checkMarkWidth, _positionY, _checkMarkWidth,
                                          _checkMarkHeight, _checkMarkFocusTextureName, _checkMarkNoFocusTextureName,
                                          _checkMarkWidth, _checkMarkHeight, Alignment.ALIGN_LEFT)
                    {
                      ParentControl = this,
                      DimColor = DimColor
                    };
    }