xbmc
GUIRadioButtonControl.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 
23  public CGUIButtonControl
24 {
25 public:
26  CGUIRadioButtonControl(int parentID, int controlID,
27  float posX, float posY, float width, float height,
28  const CTextureInfo& textureFocus, const CTextureInfo& textureNoFocus,
29  const CLabelInfo& labelInfo,
30  const CTextureInfo& radioOnFocus, const CTextureInfo& radioOnNoFocus,
31  const CTextureInfo& radioOffFocus, const CTextureInfo& radioOffNoFocus,
32  const CTextureInfo& radioOnDisabled, const CTextureInfo& radioOffDisabled);
33 
34  ~CGUIRadioButtonControl() override = default;
35  CGUIRadioButtonControl* Clone() const override { return new CGUIRadioButtonControl(*this); }
36 
37  void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;
38  void Render() override;
39  bool OnAction(const CAction &action) override ;
40  bool OnMessage(CGUIMessage& message) override;
41  void AllocResources() override;
42  void FreeResources(bool immediately = false) override;
43  void DynamicResourceAlloc(bool bOnOff) override;
44  void SetInvalid() override;
45  void SetPosition(float posX, float posY) override;
46  void SetWidth(float width) override;
47  void SetHeight(float height) override;
48  std::string GetDescription() const override;
49  void SetRadioDimensions(float posX, float posY, float width, float height);
50  void SetToggleSelect(const std::string &toggleSelect);
51  bool IsSelected() const { return m_bSelected; }
52 
53 protected:
54  bool UpdateColors(const CGUIListItem* item) override;
55  std::unique_ptr<CGUITexture> m_imgRadioOnFocus;
56  std::unique_ptr<CGUITexture> m_imgRadioOnNoFocus;
57  std::unique_ptr<CGUITexture> m_imgRadioOffFocus;
58  std::unique_ptr<CGUITexture> m_imgRadioOffNoFocus;
59  std::unique_ptr<CGUITexture> m_imgRadioOnDisabled;
60  std::unique_ptr<CGUITexture> m_imgRadioOffDisabled;
61  float m_radioPosX;
62  float m_radioPosY;
63  INFO::InfoPtr m_toggleSelect;
64  bool m_useLabel2;
65 
66 private:
68 };
Definition: GUIListItem.h:30
Definition: GUIButtonControl.h:27
class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:22
Definition: GUITexture.h:51
Definition: GUIMessage.h:365
Definition: GUILabel.h:22
Definition: GUIRadioButtonControl.h:22