/// <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); } }