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);
56 void SetPageControl(int pageControl);
58 virtual bool CanFocus() const;
59 void SetInfo(const CGUIInfoLabel &info);
60 void SetAutoScrolling(const TiXmlNode *node);
61 void ResetAutoScrolling();
62 CStdString GetLabel(int info) const;
64 void Scroll(unsigned int offset);
67 virtual void UpdateVisibility(const CGUIListItem *item = NULL);
68 virtual bool UpdateColors();
69 virtual void UpdateInfo(const CGUIListItem *item = NULL);
70 void UpdatePageControl();
71 void ScrollToOffset(int offset, bool autoScroll = false);
72 unsigned int GetRows() const;
73 int GetCurrentPage() const;
75 // offset of text in the control for scrolling
76 unsigned int m_offset;
80 unsigned int m_itemsPerPage;
82 unsigned int m_lastRenderTime;
86 TransformMatrix m_cachedTextMatrix;
89 INFO::InfoPtr m_autoScrollCondition;
90 int m_autoScrollTime; // time to scroll 1 line (ms)
91 int m_autoScrollDelay; // delay before scroll (ms)
92 unsigned int m_autoScrollDelayTime; // current offset into the delay
93 CAnimation *m_autoScrollRepeatAnim;