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.
12 \file GUISliderControl.h
16 #include "GUIButtonControl.h"
17 #include "GUISliderControl.h"
23 class CGUISettingsSliderControl
:
24 public CGUISliderControl
27 CGUISettingsSliderControl(int parentID
,
35 const CTextureInfo
& textureFocus
,
36 const CTextureInfo
& textureNoFocus
,
37 const CTextureInfo
& backGroundTexture
,
38 const CTextureInfo
& backGroundTextureDisabled
,
39 const CTextureInfo
& nibTexture
,
40 const CTextureInfo
& nibTextureFocus
,
41 const CTextureInfo
& nibTextureDisabled
,
42 const CLabelInfo
& labelInfo
,
44 ~CGUISettingsSliderControl() override
= default;
45 CGUISettingsSliderControl
*Clone() const override
{ return new CGUISettingsSliderControl(*this); }
47 void Process(unsigned int currentTime
, CDirtyRegionList
&dirtyregions
) override
;
48 void Render() override
;
49 bool OnAction(const CAction
&action
) override
;
50 void OnUnFocus() override
;
51 EVENT_RESULT
OnMouseEvent(const CPoint
& point
, const KODI::MOUSE::CMouseEvent
& event
) override
;
53 bool IsActive() const override
{ return m_active
; }
54 void AllocResources() override
;
55 void FreeResources(bool immediately
= false) override
;
56 void DynamicResourceAlloc(bool bOnOff
) override
;
57 void SetInvalid() override
;
58 void SetPosition(float posX
, float posY
) override
;
59 float GetWidth() const override
{ return m_buttonControl
.GetWidth(); }
60 void SetWidth(float width
) override
;
61 float GetHeight() const override
{ return m_buttonControl
.GetHeight(); }
62 void SetHeight(float height
) override
;
63 void SetEnabled(bool bEnable
) override
;
65 void SetText(const std::string
& label
) { m_buttonControl
.SetLabel(label
); }
66 float GetXPosition() const override
{ return m_buttonControl
.GetXPosition(); }
67 float GetYPosition() const override
{ return m_buttonControl
.GetYPosition(); }
68 std::string
GetDescription() const override
;
69 bool HitTest(const CPoint
& point
) const override
{ return m_buttonControl
.HitTest(point
); }
72 bool UpdateColors(const CGUIListItem
* item
) override
;
73 virtual void ProcessText();
76 CGUISettingsSliderControl(const CGUISettingsSliderControl
& control
);
78 CGUIButtonControl m_buttonControl
;
80 bool m_active
; ///< Whether the slider has been activated by a click.