xbmc
GUISettingsSliderControl.h
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 "GUISliderControl.h"
18 
24  public CGUISliderControl
25 {
26 public:
27  CGUISettingsSliderControl(int parentID, int controlID, float posX, float posY, float width, float height, float sliderWidth, float sliderHeight, const CTextureInfo &textureFocus, const CTextureInfo &textureNoFocus, const CTextureInfo& backGroundTexture, const CTextureInfo& nibTexture, const CTextureInfo& nibTextureFocus, const CLabelInfo &labelInfo, int iType);
28  ~CGUISettingsSliderControl() override = default;
29  CGUISettingsSliderControl *Clone() const override { return new CGUISettingsSliderControl(*this); }
30 
31  void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;
32  void Render() override;
33  bool OnAction(const CAction &action) override;
34  void OnUnFocus() override;
35  EVENT_RESULT OnMouseEvent(const CPoint& point, const CMouseEvent& event) override;
36  void SetActive();
37  bool IsActive() const override { return m_active; }
38  void AllocResources() override;
39  void FreeResources(bool immediately = false) override;
40  void DynamicResourceAlloc(bool bOnOff) override;
41  void SetInvalid() override;
42  void SetPosition(float posX, float posY) override;
43  float GetWidth() const override { return m_buttonControl.GetWidth(); }
44  void SetWidth(float width) override;
45  float GetHeight() const override { return m_buttonControl.GetHeight(); }
46  void SetHeight(float height) override;
47  void SetEnabled(bool bEnable) override;
48 
49  void SetText(const std::string& label) { m_buttonControl.SetLabel(label); }
50  float GetXPosition() const override { return m_buttonControl.GetXPosition(); }
51  float GetYPosition() const override { return m_buttonControl.GetYPosition(); }
52  std::string GetDescription() const override;
53  bool HitTest(const CPoint& point) const override { return m_buttonControl.HitTest(point); }
54 
55 protected:
56  bool UpdateColors(const CGUIListItem* item) override;
57  virtual void ProcessText();
58 
59 private:
61 
62  CGUIButtonControl m_buttonControl;
63  CGUILabel m_label;
64  bool m_active;
65 };
66 
Class for rendering text labels. Handles alignment and rendering of text within a control...
Definition: GUILabel.h:69
Definition: GUIListItem.h:30
Definition: GUIButtonControl.h:27
Definition: GUISettingsSliderControl.h:23
EVENT_RESULT
Results of OnMouseEvent() Any value not equal to EVENT_RESULT_UNHANDLED indicates that the event was ...
Definition: GUIControl.h:60
class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:22
Definition: GUITexture.h:51
EVENT_RESULT OnMouseEvent(const CPoint &point, const CMouseEvent &event) override
Perform a mouse action.
Definition: GUISettingsSliderControl.cpp:97
Definition: GUILabel.h:22
Definition: GUISliderControl.h:37
virtual bool HitTest(const CPoint &point) const
Used to test whether the point is inside a control.
Definition: GUIControl.cpp:571
bool HitTest(const CPoint &point) const override
Used to test whether the point is inside a control.
Definition: GUISettingsSliderControl.h:53
Simple class for mouse events.
Definition: Key.h:114