27 #ifndef _FalStaticText_h_
28 #define _FalStaticText_h_
30 #include "CEGUI/WindowRendererSets/Core/Module.h"
31 #include "CEGUI/WindowRendererSets/Core/Static.h"
32 #include "CEGUI/falagard/Enums.h"
33 #include "CEGUI/ColourRect.h"
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
70 class COREWRSET_API FalagardStaticText :
public FalagardStatic
73 static const String TypeName;
78 static const String VertScrollbarName;
79 static const String HorzScrollbarName;
88 FalagardStaticText(
const String& type);
91 ~FalagardStaticText();
100 ColourRect getTextColours(
void)
const {
return d_textCols;}
118 void setTextColours(
const ColourRect& colours);
136 bool isVerticalScrollbarEnabled(
void)
const {
return d_enableVertScrollbar;}
142 bool isHorizontalScrollbarEnabled(
void)
const {
return d_enableHorzScrollbar;}
148 void setVerticalScrollbarEnabled(
bool setting);
154 void setHorizontalScrollbarEnabled(
bool setting);
157 float getHorizontalTextExtent()
const;
160 float getVerticalTextExtent()
const;
163 bool handleFontRenderSizeChange(
const Font*
const font);
179 float getHorizontalScrollPosition()
const;
193 float getVerticalScrollPosition()
const;
200 float getUnitIntervalHorizontalScrollPosition()
const;
207 float getUnitIntervalVerticalScrollPosition()
const;
224 void setHorizontalScrollPosition(
float position);
240 void setVerticalScrollPosition(
float position);
247 void setUnitIntervalHorizontalScrollPosition(
float position);
254 void setUnitIntervalVerticalScrollPosition(
float position);
264 void invalidateFormatting();
275 void updateFormatting()
const;
278 void updateFormatting(
const Sizef&)
const;
281 void onLookNFeelAssigned();
282 void onLookNFeelUnassigned();
285 void renderScrolledText(
void);
287 void configureScrollbars()
const;
290 void configureScrollbars(
void);
292 Scrollbar* getVertScrollbar()
const;
293 Scrollbar* getHorzScrollbar()
const;
294 Rectf getTextRenderArea()
const;
295 Sizef getDocumentSize()
const;
298 Sizef getDocumentSize(
const Rectf& renderArea)
const;
300 void setupStringFormatter()
const;
303 bool onTextChanged(
const EventArgs& e);
304 bool onSized(
const EventArgs& e);
305 bool onFontChanged(
const EventArgs& e);
306 bool onMouseWheel(
const EventArgs& e);
309 bool handleScrollbarChange(
const EventArgs& e);
316 ColourRect d_textCols;
317 bool d_enableVertScrollbar;
318 bool d_enableHorzScrollbar;
321 mutable FormattedRenderedString* d_formattedRenderedString;
323 typedef std::vector<Event::Connection> ConnectionList;
324 ConnectionList d_connections;
331 mutable bool d_formatValid;
334 Scrollbar* getVertScrollbarWithoutUpdate()
const;
335 Scrollbar* getHorzScrollbarWithoutUpdate()
const;
336 Rectf getTextRenderAreaWithoutUpdate()
const;
337 Sizef getDocumentSizeWithoutUpdate()
const;
342 #if defined(_MSC_VER)
343 # pragma warning(pop)
346 #endif // end of guard _FalStaticText_h_