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,
28  int controlID,
29  float posX,
30  float posY,
31  float width,
32  float height,
33  float sliderWidth,
34  float sliderHeight,
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,
43  int iType);
44  ~CGUISettingsSliderControl() override = default;
45  CGUISettingsSliderControl *Clone() const override { return new CGUISettingsSliderControl(*this); }
46 
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 CMouseEvent& event) override;
52  void SetActive();
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;
64 
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); }
70 
71 protected:
72  bool UpdateColors(const CGUIListItem* item) override;
73  virtual void ProcessText();
74 
75 private:
77 
78  CGUIButtonControl m_buttonControl;
79  CGUILabel m_label;
80  bool m_active;
81 };
82 
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:126
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:69
Simple class for mouse events.
Definition: Key.h:114