kodi
GUISpinControlEx.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
16 #include "GUIButtonControl.h"
17 #include "GUISpinControl.h"
18 
24 {
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); }
29 
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);
49 
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;
56 };
57 
Definition: GUIListItem.h:29
Definition: GUIButtonControl.h:27
Definition: GUISpinControl.h:31
Definition: GUITexture.h:51
bool HitTest(const CPoint &point) const override
Used to test whether the point is inside a control.
Definition: GUISpinControlEx.h:47
Definition: GUILabel.h:22
Definition: GUISpinControlEx.h:23
virtual bool HitTest(const CPoint &point) const
Used to test whether the point is inside a control.
Definition: GUIControl.cpp:578
void RenderText(float posX, float posY, float width, float height) override
Render the spinner text.
Definition: GUISpinControlEx.cpp:136