SetPosition() public method

public SetPosition ( int dwPosX, int dwPosY ) : void
dwPosX int
dwPosY int
return void
    /// <summary>
    /// Method to render a single item of the filmstrip
    /// </summary>
    /// <param name="bFocus">true if item shown be drawn focused, false for normal mode</param>
    /// <param name="dwPosX">x-coordinate of the item</param>
    /// <param name="dwPosY">y-coordinate of the item</param>
    /// <param name="pItem">item itself</param>
    private void RenderItem(int itemNumber, float timePassed, bool bFocus, int dwPosX, int dwPosY, GUIListItem pItem)
    {
      if (_font == null)
      {
        return;
      }
      if (pItem == null)
      {
        return;
      }
      if (dwPosY < 0)
      {
        return;
      }

      bool itemFocused = bFocus == true && Focus && _listType == GUIListControl.ListType.CONTROL_LIST;

      float fTextHeight = 0, fTextWidth = 0;
      _font.GetTextExtent("W", ref fTextWidth, ref fTextHeight);

      float fTextPosY = (float)dwPosY + (float)_textureHeight;

      TransformMatrix tm = null;
      long dwColor = _textColor;
      if (pItem.Selected)
      {
        dwColor = _selectedColor;
      }
      if (pItem.IsPlayed)
      {
        dwColor = _playedColor;
      }
      if (!bFocus && Focus)
      {
        dwColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();
      }
      if (pItem.IsRemote)
      {
        dwColor = _remoteColor;
        if (pItem.IsDownloading)
        {
          dwColor = _downloadColor;
        }
      }
      if (pItem.IsBdDvdFolder)
      {
        dwColor = _bdDvdDirectoryColor;
      }
      if (!Focus)
      {
        dwColor &= DimColor;
      }

      //uint currentTime = (uint) (DXUtil.Timer(DirectXTimer.GetAbsoluteTime)*1000.0);
      uint currentTime = (uint)System.Windows.Media.Animation.AnimationTimer.TickCount;
      // Set oversized value
      int iOverSized = 0;

      if (itemFocused && _enableFocusZoom)
      {
        iOverSized = (_thumbNailWidth + _thumbNailHeight) / THUMBNAIL_OVERSIZED_DIVIDER;
      }
      GUIImage pImage = null;

      if (pItem.HasThumbnail)
      {
        pImage = pItem.Thumbnail;
        if (null == pImage && _sleeper == 0 && !IsAnimating)
        {
          pImage = new GUIImage(0, 0, _thumbNailPositionX - iOverSized + dwPosX,
                                _thumbNailPositionY - iOverSized + dwPosY, _thumbNailWidth + 2 * iOverSized,
                                _thumbNailHeight + 2 * iOverSized, pItem.ThumbnailImage, 0x0);
          pImage.ParentControl = this;
          pImage.KeepAspectRatio = _keepAspectRatio;
          pImage.ZoomFromTop = !pItem.IsFolder && _zoom;
          pImage.ImageAlignment = _imageAlignment;
          pImage.ImageVAlignment = _imageVAlignment;
          pImage.FlipX = _flipX;
          pImage.FlipY = _flipY;
          pImage.DiffuseFileName = _diffuseFileName;
          pImage.MaskFileName = _textureMask;
          pImage.SetAnimations(_allThumbAnimations);
          pImage.AllocResources();

          pItem.Thumbnail = pImage;
          pImage.SetPosition(_thumbNailPositionX - iOverSized + dwPosX, _thumbNailPositionY - iOverSized + dwPosY);
          pImage.DimColor = DimColor;
          _sleeper += SLEEP_FRAME_COUNT;
        }
        if (null != pImage)
        {
          if (pImage.TextureHeight == 0 && pImage.TextureWidth == 0)
          {
            pImage.SafeDispose();
            pImage.AllocResources();
          }
          pImage.ZoomFromTop = !pItem.IsFolder && _zoom;
          pImage.ImageAlignment = _imageAlignment;
          pImage.ImageVAlignment = _imageVAlignment;
          pImage.Width = _thumbNailWidth + 2 * iOverSized;
          pImage.Height = _thumbNailHeight + 2 * iOverSized;
          pImage.SetPosition(_thumbNailPositionX + dwPosX - iOverSized, _thumbNailPositionY - iOverSized + dwPosY);
          pImage.DimColor = DimColor;
          if (pImage.Focus != itemFocused)
          {
            _imageFolderFocus[itemNumber].Focus = !itemFocused; // ensure that _imageFolderFocus is in sync with pImage 
            _imageFolder[itemNumber].Focus = !itemFocused;
            _frameFocusControl[itemNumber].Focus = !itemFocused;
            _frameControl[itemNumber].Focus = !itemFocused;
          }
          if (itemFocused)
          {
            pImage.ColourDiffuse = 0xffffffff;
            pImage.Focus = true;
          }
          else
          {
            pImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
            pImage.Focus = false;
          }
          TransformMatrix matrix = GUIGraphicsContext.ControlTransform;
          GUIGraphicsContext.ControlTransform = new TransformMatrix();
          pImage.UpdateVisibility();
          pImage.DoRender(timePassed, currentTime);
          tm = pImage.getTransformMatrix(currentTime);
          GUIGraphicsContext.ControlTransform = matrix;
        }
      }
      else
      {
        if (pItem.HasIconBig)
        {
          pImage = pItem.IconBig;
          if (null == pImage && _sleeper == 0 && !IsAnimating)
          {
            pImage = new GUIImage(0, 0, _thumbNailPositionX - iOverSized + dwPosX,
                                  _thumbNailPositionY - iOverSized + dwPosY, _thumbNailWidth + 2 * iOverSized,
                                  _thumbNailHeight + 2 * iOverSized, pItem.IconImageBig, 0x0);
            pImage.ParentControl = this;
            pImage.KeepAspectRatio = _keepAspectRatio;
            pImage.ZoomFromTop = !pItem.IsFolder && _zoom;
            pImage.ImageAlignment = _imageAlignment;
            pImage.ImageVAlignment = _imageVAlignment;
            pImage.AllocResources();
            pImage.FlipX = _flipX;
            pImage.FlipY = _flipY;
            pImage.DiffuseFileName = _diffuseFileName;
            pImage.SetAnimations(_allThumbAnimations);
            pItem.IconBig = pImage;
            pImage.SetPosition(_thumbNailPositionX + dwPosX - iOverSized, _thumbNailPositionY - iOverSized + dwPosY);
            pImage.DimColor = DimColor;
            pImage.MaskFileName = _textureMask;

            if (itemFocused)
            {
              pImage.ColourDiffuse = 0xffffffff;
              pImage.Focus = Focus;
            }
            else
            {
              pImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
              pImage.Focus = false;
            }
            _sleeper += SLEEP_FRAME_COUNT;
          }
          if (null != pImage)
          {
            pImage.ZoomFromTop = !pItem.IsFolder && _zoom;
            pImage.ImageAlignment = _imageAlignment;
            pImage.ImageVAlignment = _imageVAlignment;
            pImage.Width = _thumbNailWidth + 2 * iOverSized;
            pImage.Height = _thumbNailHeight + 2 * iOverSized;
            pImage.SetPosition(_thumbNailPositionX - iOverSized + dwPosX, _thumbNailPositionY - iOverSized + dwPosY);
            pImage.DimColor = DimColor;

            if (itemFocused)
            {
              pImage.ColourDiffuse = 0xffffffff;
            }
            else
            {
              pImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
            }
            if (pImage.Focus != itemFocused)
            {
              _imageFolderFocus[itemNumber].Focus = !itemFocused;
              // ensure that _imageFolderFocus is in sync with pImage  }
              _imageFolder[itemNumber].Focus = !itemFocused;
              _frameFocusControl[itemNumber].Focus = !itemFocused;
              _frameControl[itemNumber].Focus = !itemFocused;
            }
            pImage.Focus = itemFocused;


            TransformMatrix matrix = GUIGraphicsContext.ControlTransform;
            GUIGraphicsContext.ControlTransform = new TransformMatrix();

            pImage.UpdateVisibility();
            pImage.DoRender(timePassed, currentTime);
            tm = pImage.getTransformMatrix(currentTime);
            GUIGraphicsContext.ControlTransform = matrix;
          }
        }
      }

      if (bFocus == true && Focus && _listType == GUIListControl.ListType.CONTROL_LIST)
      {
        TransformMatrix matrix = GUIGraphicsContext.ControlTransform;
        GUIGraphicsContext.ControlTransform = new TransformMatrix();
        //doesn't render items when scrolling left if this "if" clause is uncommented - should be fixed later
        if (!_scrollingLeft)
        {
          if (_showFolder)
          {
            _imageFolderFocus[itemNumber].SetPosition(dwPosX, dwPosY);
            _imageFolder[itemNumber].Focus = true;
            _imageFolderFocus[itemNumber].Focus = true;

            if (true == _showTexture)
            {
              _imageFolderFocus[itemNumber].UpdateVisibility();
              _imageFolderFocus[itemNumber].DoRender(timePassed, currentTime);
            }
            for (int i = 0; i < _imageFolderFocus.Count; ++i)
            {
              if (i != itemNumber)
              {
                _imageFolder[i].Focus = false;
                _imageFolderFocus[i].Focus = false;
              }
            }
          }

          if (_showFrame)
          {
            _frameFocusControl[itemNumber].Focus = true;
            _frameFocusControl[itemNumber].SetPosition(dwPosX, dwPosY);
            _frameFocusControl[itemNumber].UpdateVisibility();
            _frameFocusControl[itemNumber].DoRender(timePassed, currentTime);
            for (int i = 0; i < _frameFocusControl.Count; ++i)
            {
              if (i != itemNumber)
              {
                _frameControl[i].Focus = false;
                _frameFocusControl[i].Focus = false;
              }
            }
          }
        }

        if (tm != null)
        {
          GUIGraphicsContext.AddTransform(tm);
        }

        _listLabels[itemNumber].XPosition = dwPosX + _textXOff;
        _listLabels[itemNumber].YPosition = (int)Math.Truncate(fTextPosY + _textYOff);
        _listLabels[itemNumber].Width = _textureWidth;
        _listLabels[itemNumber].Height = _textureHeight;
        _listLabels[itemNumber].TextColor = dwColor;
        _listLabels[itemNumber].Label = pItem.Label;
        _listLabels[itemNumber].AllowScrolling = true;
        _listLabels[itemNumber].Render(timePassed);

        if (tm != null)
        {
          GUIGraphicsContext.RemoveTransform();
        }
        GUIGraphicsContext.ControlTransform = matrix;
      }
      else
      {
        TransformMatrix matrix = GUIGraphicsContext.ControlTransform;
        GUIGraphicsContext.ControlTransform = new TransformMatrix();
        //doesn't render items when scrolling left if this "if" clause is uncommented - should be fixed later
        if (!_scrollingLeft)
        {
          if (_showFolder)
          {
            _imageFolder[itemNumber].SetPosition(dwPosX, dwPosY);
            _imageFolder[itemNumber].Focus = false;
            _imageFolderFocus[itemNumber].Focus = false;
            if (true == _showTexture)
            {
              _imageFolder[itemNumber].UpdateVisibility();
              _imageFolder[itemNumber].DoRender(timePassed, currentTime);
            }
          }

          if (_showFrame)
          {
            _frameControl[itemNumber].Focus = false;
            _frameFocusControl[itemNumber].Focus = false;
            _frameControl[itemNumber].SetPosition(dwPosX, dwPosY);
            _frameControl[itemNumber].UpdateVisibility();
            _frameControl[itemNumber].DoRender(timePassed, currentTime);
          }
        }

        if (tm != null)
        {
          GUIGraphicsContext.AddTransform(tm);
        }
        _listLabels[itemNumber].XPosition = dwPosX + _textXOff;
        _listLabels[itemNumber].YPosition = (int)Math.Truncate(fTextPosY + _textYOff);
        _listLabels[itemNumber].Width = _textureWidth;
        _listLabels[itemNumber].Height = _textureHeight;
        _listLabels[itemNumber].TextColor = dwColor;
        _listLabels[itemNumber].Label = pItem.Label;
        _listLabels[itemNumber].AllowScrolling = false;
        _listLabels[itemNumber].Render(timePassed);
        if (tm != null)
        {
          GUIGraphicsContext.RemoveTransform();
        }
        GUIGraphicsContext.ControlTransform = matrix;
      }
    }
    private void RenderItem(float timePassed, int iButton, bool bFocus, int dwPosX, int dwPosY, GUIListItem pItem,
                            bool buttonOnly)
    {
      if (_listButtons == null)
      {
        return;
      }
      if (iButton < 0 || iButton >= _listButtons.Count)
      {
        return;
      }
      GUIButtonControl btn = _listButtons[iButton];
      if (btn == null)
      {
        return;
      }

      btn.Width = _textureWidth;
      btn.Height = _textureHeight;

      bool clipping = false;
      if (bFocus && Focus)
      {
        Rectangle clipRect = new Rectangle();
        clipRect.X = _positionX - _zoomXPixels / 2;
        clipRect.Y = _positionY - _zoomYPixels / 2;
        clipRect.Width = (_columnCount * _itemWidth) + _zoomXPixels + (_zoomXPixels / 2);
        clipRect.Height = (_rowCount * _itemHeight) + _zoomYPixels + (_zoomYPixels / 2);
        if (clipRect.X < 0)
        {
          clipRect.X = 0;
        }
        if (clipRect.Y < 0)
        {
          clipRect.Y = 0;
        }
        GUIGraphicsContext.BeginClip(clipRect, false);
        clipping = true;
      }

      float fTextPosY = (float)dwPosY + (float)_textureHeight;

      long dwColor = _textColor;
      if (pItem.Selected)
      {
        dwColor = _selectedColor;
      }
      if (pItem.IsPlayed)
      {
        dwColor = _playedColor;
      }
      if (!bFocus && Focus)
      {
        dwColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();
      }

      if (pItem.IsRemote)
      {
        dwColor = _remoteColor;
        if (pItem.IsDownloading)
        {
          dwColor = _downloadColor;
        }
      }

      if (pItem.IsBdDvdFolder)
      {
        dwColor = _bdDvdDirectoryColor;
      }

      if (!Focus)
      {
        dwColor &= DimColor;
      }

      if (bFocus == true && Focus && m_iSelect == GUIListControl.ListType.CONTROL_LIST)
      {
        if (buttonOnly)
        {
          btn.ColourDiffuse = 0xffffffff;
          btn.Focus = true;
          btn.SetPosition(dwPosX, dwPosY);
          //if (true == _showTexture) btn.Render(timePassed);

          if (clipping)
          {
            GUIGraphicsContext.EndClip();
          }
          return;
        }
        if (fTextPosY >= _positionY && _renderFocusText)
        {
          _listLabels[iButton].XPosition = dwPosX + _textXOff;
          _listLabels[iButton].YPosition = (int)Math.Truncate(fTextPosY + _textYOff + _zoomYPixels);
          _listLabels[iButton].Width = _textureWidth;
          _listLabels[iButton].Height = _textureHeight;
          _listLabels[iButton].TextColor = dwColor;
          _listLabels[iButton].Label = pItem.Label;
          _listLabels[iButton].AllowScrolling = true;
          _listLabels[iButton].Render(timePassed);
        }
      }
      else
      {
        if (buttonOnly)
        {
          btn.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
          if (!btn.Focus)
          {
            btn.SetPosition(dwPosX, dwPosY);
          }
          btn.Focus = false;
          if (!_hideUnfocusTexture)
          {
            btn.Render(timePassed);
          }
          if (_showFrame)
          {
            _frameFocusControl.Focus = btn.Focus;
            _frameFocusControl.SetPosition(btn._positionX, btn._positionY);
            _frameFocusControl.Width = btn.Width;
            _frameFocusControl.Height = btn.Height;
            _frameFocusControl.Render(timePassed);
          }

          if (clipping)
          {
            GUIGraphicsContext.EndClip();
          }
          return;
        }
        if (fTextPosY >= _positionY && _renderUnfocusText)
        {
          _listLabels[iButton].XPosition = dwPosX + _textXOff;
          _listLabels[iButton].YPosition = (int)Math.Truncate(fTextPosY + _textYOff);
          _listLabels[iButton].Width = _textureWidth;
          _listLabels[iButton].Height = _textureHeight;
          _listLabels[iButton].TextColor = dwColor;
          _listLabels[iButton].Label = pItem.Label;
          _listLabels[iButton].AllowScrolling = false;
          _listLabels[iButton].Render(timePassed);
        }
      }

      // Set oversized value
      int iOverSized = 0;
      if (bFocus && Focus && _enableFocusZoom && _zoomXPixels == 0 && _zoomYPixels == 0)
      {
        iOverSized = (_thumbNailWidth + _thumbNailHeight) / THUMBNAIL_OVERSIZED_DIVIDER;
      }

      GUIImage pFocusImage = null;
      if (pItem.HasThumbnail)
      {
        GUIImage pImage = pItem.Thumbnail;
        pFocusImage = pImage;
        if (null == pImage /*&& _sleeper==0 */&& !IsAnimating)
        {
          pImage = new GUIImage(0, 0, _xPositionThumbNail - iOverSized + dwPosX,
                                _yPositionThumbNail - iOverSized + dwPosY, _thumbNailWidth + 2 * iOverSized,
                                _thumbNailHeight + 2 * iOverSized, pItem.ThumbnailImage, 0x0);

          if (pImage != null)
          {
            pImage.ParentControl = this;
            pImage.KeepAspectRatio = _keepAspectRatio;
            pImage.ImageAlignment = Alignment.ALIGN_CENTER;
            pImage.ImageVAlignment = VAlignment.ALIGN_MIDDLE;
            pImage.MaskFileName = _textureMask;
            pImage.ZoomFromTop = !pItem.IsFolder && _zoom;
            pImage.AllocResources();
            pItem.Thumbnail = pImage;
            pImage.SetPosition(_xPositionThumbNail - iOverSized + dwPosX, _yPositionThumbNail - iOverSized + dwPosY);
            pImage.DimColor = DimColor;
            if (bFocus || !Focus)
            {
              pImage.ColourDiffuse = 0xffffffff;
            }
            else
            {
              pImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
            }
            if (bFocus && (_zoomXPixels != 0 || _zoomYPixels != 0))
            {
              pImage.Width = _textureWidth + _zoomXPixels;
              pImage.Height = _textureHeight + _zoomYPixels;
              pImage.SetPosition(dwPosX - (_zoomXPixels / 2), dwPosY - (_zoomYPixels / 2));
            }
            pImage.Render(timePassed);
            _sleeper += SLEEP_FRAME_COUNT;
          }
        }
        if (null != pImage)
        {
          if (pImage.TextureHeight == 0 && pImage.TextureWidth == 0)
          {
            pImage.SafeDispose();
            pImage.AllocResources();
          }
          pImage.ZoomFromTop = !pItem.IsFolder && _zoom;
          pImage.Width = _thumbNailWidth + 2 * iOverSized;
          pImage.Height = _thumbNailHeight + 2 * iOverSized;
          pImage.ImageAlignment = Alignment.ALIGN_CENTER;
          pImage.ImageVAlignment = VAlignment.ALIGN_MIDDLE;
          pImage.MaskFileName = _textureMask;
          pImage.SetPosition(_xPositionThumbNail + dwPosX - iOverSized, _yPositionThumbNail - iOverSized + dwPosY);
          pImage.DimColor = DimColor;
          if (bFocus || !Focus)
          {
            pImage.ColourDiffuse = 0xffffffff;
          }
          else
          {
            pImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
          }
          if (bFocus && (_zoomXPixels != 0 || _zoomYPixels != 0))
          {
            pImage.Width = _textureWidth + _zoomXPixels;
            pImage.Height = _textureHeight + _zoomYPixels;
            pImage.SetPosition(dwPosX - (_zoomXPixels / 2), dwPosY - (_zoomYPixels / 2));
          }
          pImage.Render(timePassed);
        }
      }
      else
      {
        if (pItem.HasIconBig)
        {
          GUIImage pImage = pItem.IconBig;
          pFocusImage = pImage;
          if (null == pImage /*&& _sleeper==0 */&& !IsAnimating)
          {
            pImage = new GUIImage(0, 0, _xPositionThumbNail - iOverSized + dwPosX,
                                  _yPositionThumbNail - iOverSized + dwPosY, _thumbNailWidth + 2 * iOverSized,
                                  _thumbNailHeight + 2 * iOverSized, pItem.IconImageBig, 0x0);
            pImage.ParentControl = this;
            pImage.KeepAspectRatio = _keepAspectRatio;
            pImage.ImageAlignment = Alignment.ALIGN_CENTER;
            pImage.ImageVAlignment = VAlignment.ALIGN_MIDDLE;
            pImage.MaskFileName = _textureMask;
            pImage.ZoomFromTop = !pItem.IsFolder && _zoom;

            pImage.AllocResources();
            pItem.IconBig = pImage;
            pImage.SetPosition(_xPositionThumbNail + dwPosX - iOverSized, _yPositionThumbNail - iOverSized + dwPosY);
            pImage.DimColor = DimColor;
            if (bFocus || !Focus)
            {
              pImage.ColourDiffuse = 0xffffffff;
            }
            else
            {
              pImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
            }
            if (bFocus && (_zoomXPixels != 0 || _zoomYPixels != 0))
            {
              pImage.Width = _textureWidth + _zoomXPixels;
              pImage.Height = _textureHeight + _zoomYPixels;
              pImage.SetPosition(dwPosX - (_zoomXPixels / 2), dwPosY - (_zoomYPixels / 2));
            }
            pImage.Render(timePassed);
            _sleeper += SLEEP_FRAME_COUNT;
          }
          else if (null != pImage)
          {
            if (pImage.TextureHeight == 0 && pImage.TextureWidth == 0)
            {
              pImage.SafeDispose();
              pImage.AllocResources();
            }
            pImage.ZoomFromTop = !pItem.IsFolder && _zoom;
            pImage.ImageAlignment = Alignment.ALIGN_CENTER;
            pImage.ImageVAlignment = VAlignment.ALIGN_MIDDLE;
            pImage.MaskFileName = _textureMask;
            pImage.Width = _thumbNailWidth + 2 * iOverSized;
            pImage.Height = _thumbNailHeight + 2 * iOverSized;
            pImage.SetPosition(_xPositionThumbNail - iOverSized + dwPosX, _yPositionThumbNail - iOverSized + dwPosY);
            pImage.DimColor = DimColor;
            if (bFocus || !Focus)
            {
              pImage.ColourDiffuse = 0xffffffff;
            }
            else
            {
              pImage.ColourDiffuse = Color.FromArgb(_unfocusedAlpha, Color.White).ToArgb();
            }
            if (bFocus && (_zoomXPixels != 0 || _zoomYPixels != 0))
            {
              pImage.Width = _textureWidth + _zoomXPixels;
              pImage.Height = _textureHeight + _zoomYPixels;
              pImage.SetPosition(dwPosX - (_zoomXPixels / 2), dwPosY - (_zoomYPixels / 2));
            }
            pImage.Render(timePassed);
          }
        }
      }
      if (bFocus && Focus)
      {
        btn.Width = _textureWidth + _zoomXPixels;
        btn.Height = _textureHeight + _zoomYPixels;
        btn.SetPosition(dwPosX - (_zoomXPixels / 2), dwPosY - (_zoomYPixels / 2));
        btn.Render(timePassed);
        if (pFocusImage != null/* && _zoomXPixels == 0 && _zoomYPixels == 0*/)
        {
          pFocusImage.ImageAlignment = Alignment.ALIGN_CENTER;
          pFocusImage.ImageVAlignment = VAlignment.ALIGN_MIDDLE;
          pFocusImage.Render(timePassed);
        }
        if (_showFrame)
        {
          //_frameFocusControl.Focus = btn.Focus;
          _frameFocusControl.SetPosition(btn._positionX, btn._positionY);
          _frameFocusControl.Width = btn.Width;
          _frameFocusControl.Height = btn.Height;
          _frameFocusControl.Render(timePassed);
        }
      }
      else
      {
        if (_showFrame)
        {
          //_frameNoFocusControl.Focus = btn.Focus;
          _frameNoFocusControl.SetPosition(dwPosX, dwPosY);
          _frameNoFocusControl.Width = btn.Width + 2 * iOverSized;
          _frameNoFocusControl.Height = btn.Height + 2 * iOverSized;
          _frameNoFocusControl.Render(timePassed);
        }
        btn.Width = _textureWidth;
        btn.Height = _textureHeight;
      }

      if (clipping)
      {
        GUIGraphicsContext.EndClip();
      }
    }