Merge pull request #26350 from jjd-uk/estuary_media_align
[xbmc.git] / xbmc / guilib / GUISpinControlEx.h
blob75c39636a8a18fc0748c08dae15082b42db61f68
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 /*!
12 \file GUISpinControlEx.h
13 \brief
16 #include "GUIButtonControl.h"
17 #include "GUISpinControl.h"
19 /*!
20 \ingroup controls
21 \brief
23 class CGUISpinControlEx : public CGUISpinControl
25 public:
26 CGUISpinControlEx(int parentID, int controlID, float posX, float posY, float width, float height, float spinWidth, float spinHeight, const CLabelInfo& spinInfo, const CTextureInfo &textureFocus, const CTextureInfo &textureNoFocus, const CTextureInfo& textureUp, const CTextureInfo& textureDown, const CTextureInfo& textureUpFocus, const CTextureInfo& textureDownFocus, const CTextureInfo& textureUpDisabled, const CTextureInfo& textureDownDisabled, const CLabelInfo& labelInfo, int iType);
27 ~CGUISpinControlEx(void) override;
28 CGUISpinControlEx* Clone() const override { return new CGUISpinControlEx(*this); }
30 void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;
31 void Render() override;
32 void SetPosition(float posX, float posY) override;
33 float GetWidth() const override { return m_buttonControl.GetWidth(); }
34 void SetWidth(float width) override;
35 float GetHeight() const override { return m_buttonControl.GetHeight(); }
36 void SetHeight(float height) override;
37 void AllocResources() override;
38 void FreeResources(bool immediately = false) override;
39 void DynamicResourceAlloc(bool bOnOff) override;
40 void SetInvalid() override;
41 const std::string GetCurrentLabel() const;
42 void SetText(const std::string& aLabel) { m_buttonControl.SetLabel(aLabel); }
43 void SetEnabled(bool bEnable) override;
44 float GetXPosition() const override { return m_buttonControl.GetXPosition(); }
45 float GetYPosition() const override { return m_buttonControl.GetYPosition(); }
46 std::string GetDescription() const override;
47 bool HitTest(const CPoint& point) const override { return m_buttonControl.HitTest(point); }
48 void SetSpinPosition(float spinPosX);
50 void SetItemInvalid(bool invalid);
51 protected:
52 void RenderText(float posX, float posY, float width, float height) override;
53 bool UpdateColors(const CGUIListItem* item) override;
54 CGUIButtonControl m_buttonControl;
55 float m_spinPosX;