xbmc
GUIListLabel.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 "GUIControl.h"
17 #include "GUILabel.h"
19 
25  public CGUIControl
26 {
27 public:
28  CGUIListLabel(int parentID, int controlID, float posX, float posY, float width, float height,
29  const CLabelInfo& labelInfo, const KODI::GUILIB::GUIINFO::CGUIInfoLabel &label, CGUIControl::GUISCROLLVALUE scroll);
30  ~CGUIListLabel(void) override;
31  CGUIListLabel* Clone() const override { return new CGUIListLabel(*this); }
32 
33  void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;
34  void Render() override;
35  bool CanFocus() const override { return false; }
36  void UpdateInfo(const CGUIListItem *item = NULL) override;
37  void SetFocus(bool focus) override;
38  void SetInvalid() override;
39  void SetWidth(float width) override;
40 
41  void SetLabel(const std::string &label);
42  void SetSelected(bool selected);
43 
44  static void CheckAndCorrectOverlap(CGUIListLabel &label1, CGUIListLabel &label2)
45  {
46  CGUILabel::CheckAndCorrectOverlap(label1.m_label, label2.m_label);
47  }
48 
49  CRect CalcRenderRegion() const override;
50 
51 protected:
52  bool UpdateColors(const CGUIListItem* item) override;
53 
54  CGUILabel m_label;
56  CGUIControl::GUISCROLLVALUE m_scroll;
57 };
Definition: GUIListLabel.h:24
static bool CheckAndCorrectOverlap(CGUILabel &label1, CGUILabel &label2)
Check a left aligned and right aligned label for overlap and cut the labels off so that no overlap oc...
Definition: GUILabel.cpp:225
Class for rendering text labels. Handles alignment and rendering of text within a control...
Definition: GUILabel.h:69
Definition: GUIListItem.h:30
CRect CalcRenderRegion() const override
calculate the render region in parentcontrol coordinates of this control Called during process to upd...
Definition: GUIListLabel.cpp:47
Definition: GUIInfoLabel.h:31
Base class for controls.
Definition: GUIControl.h:75
Definition: GUILabel.h:22