/// <summary> /// Creates the element and retrieves all information from the control /// </summary> /// <param name="control">GUIControl</param> public VerticalScrollBarElement(GUIControl control) : base(control) { _verticalScrollBar = control as GUIVerticalScrollbar; if (_verticalScrollBar != null) { _scrollBarBackground = loadBitmap(_verticalScrollBar.BackGroundTextureName); _scrollBarTop = loadBitmap(_verticalScrollBar.BackTextureTopName); _scrollBarBottom = loadBitmap(_verticalScrollBar.BackTextureBottomName); _percentage = _verticalScrollBar.Percentage; } }
public override void FinalizeConstruction() { base.FinalizeConstruction(); _lowItemHeight = _itemHeight; _lowItemWidth = _itemWidth; _lowTextureWidth = _textureWidth; _lowTextureHeight = _textureHeight; _controlUpDown = new GUISpinControl(GetID, 0, _spinControlPositionX, _spinControlPositionY, _spinControlWidth, _spinControlHeight, _upTextureName, _downTextureName, _upTextureNameFocus, _downTextureNameFocus, _fontName, _spinControlColor, GUISpinControl.SpinType.SPIN_CONTROL_TYPE_INT, _spinControlAlignment); _controlUpDown.ParentControl = this; _controlUpDown.DimColor = DimColor; int xpos = 5 + _positionX + _width; if (xpos + 15 > GUIGraphicsContext.Width) { xpos = GUIGraphicsContext.Width - 15; } _verticalScrollBar = new GUIVerticalScrollbar(_controlId, 0, 5 + _positionX + _width + _scrollbarXOff, _positionY, _scrollbarWidth, _height, _scrollbarBackGroundTextureName, _scrollbarTopTextureName, _scrollbarBottomTextureName); _verticalScrollBar.ParentControl = this; _verticalScrollBar.SendNotifies = false; _verticalScrollBar.DimColor = DimColor; _font = GUIFontManager.GetFont(_fontName); SetTextureDimensions(_textureWidth, _textureHeight); SetThumbDimensionsLow(_xPositionThumbNail, _yPositionThumbNail, _thumbNailWidth, _thumbNailHeight); _frameNoFocusControl = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _itemWidth, _itemHeight, _frameNoFocusName); _frameNoFocusControl.ParentControl = this; _frameNoFocusControl.DimColor = DimColor; _frameNoFocusControl.MaskFileName = _frameNoFocusMask; _frameNoFocusControl.SetAnimations(_allThumbAnimations); _frameFocusControl = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _itemWidth, _itemHeight, _frameFocusName); _frameFocusControl.ParentControl = this; _frameFocusControl.DimColor = DimColor; _frameFocusControl.MaskFileName = _frameFocusMask; _frameFocusControl.SetAnimations(_allThumbAnimations); using (Settings xmlreader = new MPSettings()) { _loopDelay = xmlreader.GetValueAsInt("gui", "listLoopDelay", 100); } }
public override sealed void FinalizeConstruction() { base.FinalizeConstruction(); _font = GUIFontManager.GetFont(_fontName); if (_fontName2Name == string.Empty) { _fontName2Name = _fontName; } if (_fontName3Name == string.Empty) { _fontName3Name = _fontName2Name; } Font2 = _fontName2Name; Font3 = _fontName3Name; _upDownControl = new GUISpinControl(_controlId, 0, _spinControlPositionX, _spinControlPositionY, _spinControlWidth, _spinControlHeight, _upTextureName, _downTextureName, _upTextureNameFocus, _downTextureNameFocus, _fontName, _spinControlColor, GUISpinControl.SpinType.SPIN_CONTROL_TYPE_INT, _spinControlAlignment) { ParentControl = this, DimColor = DimColor }; _verticalScrollbar = new GUIVerticalScrollbar(_controlId, 0, 5 + _positionX + _width + _scrollbarXOff, _positionY, _scrollbarWidth, _height, _scrollbarBackgroundName, _scrollbarTopName, _scrollbarBottomName) { ParentControl = this, SendNotifies = false, DimColor =DimColor }; _upDownControl.WindowId = WindowId; using (Settings xmlreader = new MPSettings()) { _loopDelay = xmlreader.GetValueAsInt("gui", "listLoopDelay", 100); } }