6 #ifndef GUILIB_GUITEXTBOX_H
7 #define GUILIB_GUITEXTBOX_H
12 * Copyright (C) 2005-2013 Team XBMC
15 * This Program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
20 * This Program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with XBMC; see the file COPYING. If not, see
27 * <http://www.gnu.org/licenses/>.
31 #include "GUITextLayout.h"
32 #include "GUIControl.h"
42 class CGUITextBox : public CGUIControl, public CGUITextLayout
45 CGUITextBox(int parentID, int controlID, float posX, float posY, float width, float height,
46 const CLabelInfo &labelInfo, int scrollTime = 200);
47 CGUITextBox(const CGUITextBox &from);
48 virtual ~CGUITextBox(void);
49 virtual CGUITextBox *Clone() const { return new CGUITextBox(*this); };
51 virtual void DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions);
52 virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
53 virtual void Render();
54 virtual bool OnMessage(CGUIMessage& message);
55 virtual float GetHeight() const;
56 void SetMinHeight(float minHeight);
58 void SetPageControl(int pageControl);
60 virtual bool CanFocus() const;
61 void SetInfo(const CGUIInfoLabel &info);
62 void SetAutoScrolling(const TiXmlNode *node);
63 void ResetAutoScrolling();
64 CStdString GetLabel(int info) const;
66 void Scroll(unsigned int offset);
69 virtual void UpdateVisibility(const CGUIListItem *item = NULL);
70 virtual bool UpdateColors();
71 virtual void UpdateInfo(const CGUIListItem *item = NULL);
72 void UpdatePageControl();
73 void ScrollToOffset(int offset, bool autoScroll = false);
74 unsigned int GetRows() const;
75 int GetCurrentPage() const;
81 // offset of text in the control for scrolling
82 unsigned int m_offset;
86 unsigned int m_itemsPerPage;
88 unsigned int m_lastRenderTime;
92 TransformMatrix m_cachedTextMatrix;
95 INFO::InfoPtr m_autoScrollCondition;
96 int m_autoScrollTime; // time to scroll 1 line (ms)
97 int m_autoScrollDelay; // delay before scroll (ms)
98 unsigned int m_autoScrollDelayTime; // current offset into the delay
99 CAnimation *m_autoScrollRepeatAnim;
103 CGUIInfoLabel m_info;