SetBorder() public method

public SetBorder ( string border, GUIImage position, bool textureRepeat, bool textureRotate, string textureFilename, long colorKey, bool hasCorners, bool cornerTextureRotate ) : void
border string
position GUIImage
textureRepeat bool
textureRotate bool
textureFilename string
colorKey long
hasCorners bool
cornerTextureRotate bool
return void
Exemplo 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
            };
        }
Exemplo n.º 2
0
 public void SetBorderH(string border, GUIImage.BorderPosition position, bool repeat, bool rotate,
                        string texture, long colorKey, bool hasCorners, bool cornerRotate)
 {
     _strBorderH                 = border;
     _borderPositionH            = position;
     _borderTextureRepeatH       = repeat;
     _borderTextureRotateH       = rotate;
     _borderTextureFileNameH     = texture;
     _borderColorKeyH            = colorKey;
     _borderHasCornersH          = hasCorners;
     _borderCornerTextureRotateH = cornerRotate;
     _hoverImage.SetBorder(_strBorderH, _borderPositionH, _borderTextureRepeatH, _borderTextureRotateH,
                           _borderTextureFileNameH, _borderColorKeyH, _borderHasCornersH, _borderCornerTextureRotateH);
 }
Exemplo n.º 3
0
 public void SetBorderTNF(string border, GUIImage.BorderPosition position, bool repeat, bool rotate,
                          string texture, long colorKey, bool hasCorners, bool cornerRotate)
 {
     _strBorderTNF                 = border;
     _borderPositionTNF            = position;
     _borderTextureRepeatTNF       = repeat;
     _borderTextureRotateTNF       = rotate;
     _borderTextureFileNameTNF     = texture;
     _borderColorKeyTNF            = colorKey;
     _borderHasCornersTNF          = hasCorners;
     _borderCornerTextureRotateTNF = cornerRotate;
     _imageNonFocused.SetBorder(_strBorderTNF, _borderPositionTNF, _borderTextureRepeatTNF, _borderTextureRotateTNF,
                                _borderTextureFileNameTNF, _borderColorKeyTNF, _borderHasCornersTNF,
                                _borderCornerTextureRotateTNF);
 }
Exemplo n.º 4
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;
        }
Exemplo n.º 5
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.ColourDiffuse = ColourDiffuse;
      _imageFocused.SetBorder(_strBorderTF, _borderPositionTF, _borderTextureRepeatTF, _borderTextureRotateTF,
                              _borderTextureFileNameTF, _borderColorKeyTF, _borderHasCornersTF,
                              _borderCornerTextureRotateTF);
      TileFillTF = _textureFocusTileFill;
      _imageFocused.MaskFileName = _focusedTextureMask;
      _imageFocused.OverlayFileName = _overlayTF;

      _imageNonFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                              _nonFocusedTextureName);
      _imageNonFocused.ParentControl = this;
      _imageNonFocused.Filtering = false;
      _imageNonFocused.DimColor = DimColor;
      _imageNonFocused.ColourDiffuse = ColourDiffuse;
      _imageNonFocused.SetBorder(_strBorderTNF, _borderPositionTNF, _borderTextureRepeatTNF, _borderTextureRotateTNF,
                                 _borderTextureFileNameTNF, _borderColorKeyTNF, _borderHasCornersTNF,
                                 _borderCornerTextureRotateTNF);
      TileFillTNF = _textureNoFocusTileFill;
      _imageNonFocused.MaskFileName = _nonFocusedTextureMask;
      _imageNonFocused.OverlayFileName = _overlayTNF;

      if (_hoverFilename != string.Empty)
      {
        GUIGraphicsContext.ScaleRectToScreenResolution(ref _hoverX, ref _hoverY, ref _hoverWidth, ref _hoverHeight);
        _hoverImage = LoadAnimationControl(_parentControlId, _controlId, _hoverX, _hoverY, _hoverWidth, _hoverHeight,
                                           _hoverFilename);
        _hoverImage.ParentControl = this;
        _hoverImage.DimColor = DimColor;
        _hoverImage.ColourDiffuse = ColourDiffuse;
        _hoverImage.SetBorder(_strBorderH, _borderPositionH, _borderTextureRepeatH, _borderTextureRotateH,
                              _borderTextureFileNameH, _borderColorKeyH, _borderHasCornersH, _borderCornerTextureRotateH);
        TileFillH = _hoverTileFill;
        _hoverImage.MaskFileName = _hoverMask;
        _hoverImage.OverlayFileName = _overlayH;
      }

      GUILocalizeStrings.LocalizeLabel(ref _label);

      // Use a GUIFadeLabel if a valid scrollStartDelay is specified, otherwise use a GUILabelControl (default)
      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.DimColor = DimColor;
      _labelControl.ParentControl = this;
    }
Exemplo 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);


      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).ParentControl = this;
        ((GUILabelControl)_labelControl).DimColor = DimColor;
        ((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;
      }

      string spinFontName = _fontName;
      if (_spinTextInButton)
      {
        // When the spin control font name is null the spin control will not render the text.
        // _spinTextInButton will render the spin control text in the button label.
        spinFontName = null;
      }

      _spinControl = new GUISpinControl(GetID, 0, _positionX + _width - _spinWidth, _positionY, _spinWidth,
                                        _spinHeight, _upTextureName, _downTextureName,
                                        _upTextureNameFocus, _downTextureNameFocus,
                                        spinFontName, _textColor, _spinType, _spinAlignment);
      _spinControl.ParentControl = this;
      _spinControl.DimColor = DimColor;
      _spinControl.ShowRange = _showRange;
      _spinControl.Digits = _digits;
      _spinControl.SetReverse(_reverse);
      _spinControl.Orientation = _orientation;
      _spinControl.CycleItems = _cycleItems;
      _spinControl.SetShadow(_shadowAngle, _shadowDistance, _shadowColor);
      _spinControl.PrefixText = _prefixText;
      _spinControl.SuffixText = _suffixText;
      _spinControl.TextOffsetX = _spinTextOffsetX;
      _spinControl.TextOffsetY = _spinTextOffsetY;

      // Pass all of the subitems to the spin control.
      for (int i = 0; i < SubItemCount; ++i)
      {
        _spinControl.AddSubItem(GetSubItem(i));
      }
      for (int i = 0; i < SubItemCount; ++i)
      {
        RemoveSubItem(i);
      }
    }
Exemplo 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 void FinalizeConstruction()
        {
            base.FinalizeConstruction();
            _imageFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                                 _focusedTextureName);
            _imageFocused.ParentControl = this;
            _imageFocused.Filtering     = false;
            _imageFocused.DimColor      = DimColor;
            _imageFocused.ColourDiffuse = ColourDiffuse;
            _imageFocused.SetBorder(_strBorderTF, _borderPositionTF, _borderTextureRepeatTF, _borderTextureRotateTF,
                                    _borderTextureFileNameTF, _borderColorKeyTF, _borderHasCornersTF,
                                    _borderCornerTextureRotateTF);
            TileFillTF = _textureFocusTileFill;
            _imageFocused.MaskFileName    = _focusedTextureMask;
            _imageFocused.OverlayFileName = _overlayTF;

            _imageNonFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                                    _nonFocusedTextureName);
            _imageNonFocused.ParentControl = this;
            _imageNonFocused.Filtering     = false;
            _imageNonFocused.DimColor      = DimColor;
            _imageNonFocused.ColourDiffuse = ColourDiffuse;
            _imageNonFocused.SetBorder(_strBorderTNF, _borderPositionTNF, _borderTextureRepeatTNF, _borderTextureRotateTNF,
                                       _borderTextureFileNameTNF, _borderColorKeyTNF, _borderHasCornersTNF,
                                       _borderCornerTextureRotateTNF);
            TileFillTNF = _textureNoFocusTileFill;
            _imageNonFocused.MaskFileName    = _nonFocusedTextureMask;
            _imageNonFocused.OverlayFileName = _overlayTNF;

            if (_hoverFilename != string.Empty)
            {
                GUIGraphicsContext.ScaleRectToScreenResolution(ref _hoverX, ref _hoverY, ref _hoverWidth, ref _hoverHeight);
                _hoverImage = LoadAnimationControl(_parentControlId, _controlId, _hoverX, _hoverY, _hoverWidth, _hoverHeight,
                                                   _hoverFilename);
                _hoverImage.ParentControl = this;
                _hoverImage.DimColor      = DimColor;
                _hoverImage.ColourDiffuse = ColourDiffuse;
                _hoverImage.SetBorder(_strBorderH, _borderPositionH, _borderTextureRepeatH, _borderTextureRotateH,
                                      _borderTextureFileNameH, _borderColorKeyH, _borderHasCornersH, _borderCornerTextureRotateH);
                TileFillH = _hoverTileFill;
                _hoverImage.MaskFileName    = _hoverMask;
                _hoverImage.OverlayFileName = _overlayH;
            }

            GUILocalizeStrings.LocalizeLabel(ref _label);

            // Use a GUIFadeLabel if a valid scrollStartDelay is specified, otherwise use a GUILabelControl (default)
            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.DimColor      = DimColor;
            _labelControl.ParentControl = this;
        }
Exemplo n.º 8
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);
      TileFillTF = _textureFocusTileFill;
      _imageFocused.MaskFileName = _strMaskTF;

      _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);
      TileFillTNF = _textureNoFocusTileFill;
      _imageNonFocused.MaskFileName = _strMaskTNF;

      _prefixText = _prefixText + _prefixTextJoin;
      _suffixText = _suffixTextJoin + _suffixText;

      GUILocalizeStrings.LocalizeLabel(ref _label);
      GUILocalizeStrings.LocalizeLabel(ref _prefixText);
      GUILocalizeStrings.LocalizeLabel(ref _suffixText);
      GUILocalizeStrings.LocalizeLabel(ref _dialogTitle);

      if (_hoverFilename != string.Empty)
      {
        GUIGraphicsContext.ScaleRectToScreenResolution(ref _hoverX, ref _hoverY, ref _hoverWidth, ref _hoverHeight);
        _hoverImage = LoadAnimationControl(_parentControlId, _controlId, _hoverX, _hoverY, _hoverWidth, _hoverHeight,
                                           _hoverFilename);
        _hoverImage.ParentControl = this;
        _hoverImage.DimColor = DimColor;
        _hoverImage.ColourDiffuse = ColourDiffuse;
        _hoverImage.SetBorder(_strBorderH, _borderPositionH, _borderTextureRepeatH, _borderTextureRotateH,
          _borderTextureFileNameH, _borderColorKeyH, _borderHasCornersH, _borderCornerTextureRotateH);
        TileFillH = _hoverTileFill;
        _hoverImage.MaskFileName = _strMaskH;
      }

      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).ParentControl = this;
        ((GUILabelControl)_labelControl).DimColor = DimColor;
        ((GUILabelControl)_labelControl).TextAlignment = _textAlignment;
        ((GUILabelControl)_labelControl).TextVAlignment = _textVAlignment;

        // If the value should be displayed in the button but the alignment is not left then we need another control to display the right aligned
        // button value.
        if (_valueTextInButtonAlignment == Alignment.ALIGN_RIGHT)
        {
          _valueLabelControl = new GUILabelControl(_parentControlId, 0, _positionX, _positionY, _width, _height, _fontName,
                                                   _label, _textColor, Alignment.ALIGN_RIGHT, VAlignment.ALIGN_TOP, false,
                                                   _shadowAngle, _shadowDistance, _shadowColor);
          ((GUILabelControl)_valueLabelControl).ParentControl = this;
          ((GUILabelControl)_valueLabelControl).DimColor = DimColor;
          ((GUILabelControl)_valueLabelControl).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;

        // If the value should be displayed in the button but the alignment is not left then we need another control to display the right aligned
        // button value.
        if (_valueTextInButtonAlignment == Alignment.ALIGN_RIGHT)
        {
          _valueLabelControl = new GUIFadeLabel(_parentControlId, 0, _positionX, _positionY, _width, _height, _fontName,
                                                _textColor, Alignment.ALIGN_RIGHT, VAlignment.ALIGN_TOP,
                                                _shadowAngle, _shadowDistance, _shadowColor,
                                                _userWrapString);
          ((GUIFadeLabel)_valueLabelControl).ParentControl = this;
          ((GUIFadeLabel)_valueLabelControl).DimColor = DimColor;
          ((GUIFadeLabel)_valueLabelControl).TextVAlignment = _textVAlignment;
          ((GUIFadeLabel)_valueLabelControl).AllowScrolling = false;
          ((GUIFadeLabel)_valueLabelControl).AllowFadeIn = false;
        }
      }

      // Build elements for the specified button mode.
      switch (_buttonMode)
      {
        case ButtonMode.BUTTON_MODE_SPIN_LIST:

          string spinFontName = _fontName;
          if (_valueTextInButton)
          {
            // When the spin control font name is null the spin control will not render the text.
            // _valueTextInButton will render the spin control text in the button label.
            spinFontName = null;
          }

          _spinControl = new GUISpinControl(GetID, 0, _positionX + _width - _spinWidth, _positionY, _spinWidth,
                                              _spinHeight, _upTextureName, _downTextureName,
                                              _upTextureNameFocus, _downTextureNameFocus,
                                              spinFontName, _textColor, _spinType, _spinAlignment);
          _spinControl.ParentControl = this;
          _spinControl.DimColor = DimColor;
          _spinControl.ShowRange = _showRange;
          _spinControl.Digits = _digits;
          _spinControl.SetReverse(_reverse);
          _spinControl.Orientation = _orientation;
          _spinControl.CycleItems = _cycleItems;
          _spinControl.SetShadow(_shadowAngle, _shadowDistance, _shadowColor);
          _spinControl.PrefixText = _prefixText;
          _spinControl.SuffixText = _suffixText;
          _spinControl.TextOffsetX = _spinTextOffsetX;
          _spinControl.TextOffsetY = _spinTextOffsetY;
          break;

        case ButtonMode.BUTTON_MODE_DIALOG_LIST:
          break;
      }

      // Add subitems to the menu.
      int value = 0;
      for (int i = 0; i < SubItemCount; ++i)
      {
        string strItem = GUIPropertyManager.GetProperty((string)GetSubItem(i));
        if (strItem == null || strItem == "")
        {
          // Refetch the subitem if a property value was not returned.
          strItem = (string)GetSubItem(i);
        }

        // Allow for the subitem to be a CSV list of values.  If it is then add each item in the CSV list.
        ArrayList items = new ArrayList(strItem.Split(new char[] { ',' }));
        for (int j=0; j < items.Count; j++)
        {
          AddItem(items[j].ToString(), value++);
        }
      }

      for (int i = 0; i < SubItemCount; ++i)
      {
        RemoveSubItem(i);
      }

      // If specified, bind the selection.
      if (_binding.Length > 0)
      {
        bindToValue(_binding);
      }

      // Initialize the controls properties.
      SetProperties();
    }
        /// <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);


            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).ParentControl  = this;
                ((GUILabelControl)_labelControl).DimColor       = DimColor;
                ((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;
            }

            string spinFontName = _fontName;

            if (_spinTextInButton)
            {
                // When the spin control font name is null the spin control will not render the text.
                // _spinTextInButton will render the spin control text in the button label.
                spinFontName = null;
            }

            _spinControl = new GUISpinControl(GetID, 0, _positionX + _width - _spinWidth, _positionY, _spinWidth,
                                              _spinHeight, _upTextureName, _downTextureName,
                                              _upTextureNameFocus, _downTextureNameFocus,
                                              spinFontName, _textColor, _spinType, _spinAlignment);
            _spinControl.ParentControl = this;
            _spinControl.DimColor      = DimColor;
            _spinControl.ShowRange     = _showRange;
            _spinControl.Digits        = _digits;
            _spinControl.SetReverse(_reverse);
            _spinControl.Orientation = _orientation;
            _spinControl.CycleItems  = _cycleItems;
            _spinControl.SetShadow(_shadowAngle, _shadowDistance, _shadowColor);
            _spinControl.PrefixText  = _prefixText;
            _spinControl.SuffixText  = _suffixText;
            _spinControl.TextOffsetX = _spinTextOffsetX;
            _spinControl.TextOffsetY = _spinTextOffsetY;

            // Pass all of the subitems to the spin control.
            for (int i = 0; i < SubItemCount; ++i)
            {
                _spinControl.AddSubItem(GetSubItem(i));
            }
            for (int i = 0; i < SubItemCount; ++i)
            {
                RemoveSubItem(i);
            }
        }
Exemplo n.º 10
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;
    }
Exemplo n.º 11
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
                    };
    }