Merge pull request #4687 from ruuk/textboxgettext
[vuplus_xbmc] / xbmc / guilib / GUIRadioButtonControl.h
1 /*!
2 \file GUIRadioButtonControl.h
3 \brief
4 */
5
6 #pragma once
7
8 /*
9  *      Copyright (C) 2005-2013 Team XBMC
10  *      http://xbmc.org
11  *
12  *  This Program is free software; you can redistribute it and/or modify
13  *  it under the terms of the GNU General Public License as published by
14  *  the Free Software Foundation; either version 2, or (at your option)
15  *  any later version.
16  *
17  *  This Program is distributed in the hope that it will be useful,
18  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  *  GNU General Public License for more details.
21  *
22  *  You should have received a copy of the GNU General Public License
23  *  along with XBMC; see the file COPYING.  If not, see
24  *  <http://www.gnu.org/licenses/>.
25  *
26  */
27
28 #include "GUIButtonControl.h"
29
30 /*!
31  \ingroup controls
32  \brief
33  */
34 class CGUIRadioButtonControl :
35       public CGUIButtonControl
36 {
37 public:
38   CGUIRadioButtonControl(int parentID, int controlID,
39                          float posX, float posY, float width, float height,
40                          const CTextureInfo& textureFocus, const CTextureInfo& textureNoFocus,
41                          const CLabelInfo& labelInfo,
42                          const CTextureInfo& radioOnFocus, const CTextureInfo& radioOnNoFocus,
43                          const CTextureInfo& radioOffFocus, const CTextureInfo& radioOffNoFocus);
44
45   virtual ~CGUIRadioButtonControl(void);
46   virtual CGUIRadioButtonControl *Clone() const { return new CGUIRadioButtonControl(*this); };
47
48   virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
49   virtual void Render();
50   virtual bool OnAction(const CAction &action) ;
51   virtual bool OnMessage(CGUIMessage& message);
52   virtual void AllocResources();
53   virtual void FreeResources(bool immediately = false);
54   virtual void DynamicResourceAlloc(bool bOnOff);
55   virtual void SetInvalid();
56   virtual void SetPosition(float posX, float posY);
57   virtual void SetWidth(float width);
58   virtual void SetHeight(float height);
59   virtual CStdString GetDescription() const;
60   void SetRadioDimensions(float posX, float posY, float width, float height);
61   void SetToggleSelect(const CStdString &toggleSelect);
62   bool IsSelected() const { return m_bSelected; };
63 protected:
64   virtual bool UpdateColors();
65   CGUITexture m_imgRadioOnFocus;
66   CGUITexture m_imgRadioOnNoFocus;
67   CGUITexture m_imgRadioOffFocus;
68   CGUITexture m_imgRadioOffNoFocus;
69   float m_radioPosX;
70   float m_radioPosY;
71   INFO::InfoPtr m_toggleSelect;
72 };