32 #ifndef TBX_TEXTVIEW_H_
33 #define TBX_TEXTVIEW_H_
35 #include "../window.h"
36 #include "../redrawlistener.h"
37 #include "../openwindowlistener.h"
38 #include "../margin.h"
39 #include "../colour.h"
59 std::vector<unsigned int> _line_end;
92 const char *
text()
const {
return _text;}
101 unsigned int size()
const {
return _size;}
129 bool load_file(
const std::string &file_name);
136 bool wrap()
const {
return _wrap;}
145 void recalc_layout();
146 void recalc_layout(
const BBox &visible_bounds);
virtual void redraw(const tbx::RedrawEvent &event)
Redraw the window.
Definition: textview.cc:216
void refresh()
Refresh the whole report view.
Definition: textview.cc:204
Class to represent a two dimensional bounding box.
Definition: bbox.h:37
const char * text() const
Get a pointer to the text.
Definition: textview.h:92
TextView(tbx::Window window, bool wrap=false)
Construct a text view.
Definition: textview.cc:52
tbx::Window & window()
Get the window the text view is on.
Definition: textview.h:76
Class to represent a margin around an area.
Definition: margin.h:34
tbx::Colour foreground() const
Get current foreground colour for the text.
Definition: textview.h:120
Event passed to redraw listener to give details on the area that needs a redraw.
Definition: redrawlistener.h:43
void update_window_extent()
Update the Window extent after a change in size of text.
Definition: textview.cc:172
virtual void open_window(tbx::OpenWindowEvent &event)
Window has been opened or resized, so re do layout.
Definition: textview.cc:257
bool load_file(const std::string &file_name)
Load text for view from file.
Definition: textview.cc:345
The Window object represents a toolbox window.
Definition: window.h:69
Redraw event listener.
Definition: redrawlistener.h:75
bool wrap() const
Check it text view is set to wrap text.
Definition: textview.h:136
Class to display text in a window.
Definition: textview.h:49
const tbx::Margin & margin() const
Get the margin between the text view contents and the edge of the Window.
Definition: textview.h:84
unsigned int size() const
Get the current size of the text.
Definition: textview.h:101
Class to represent a RGB colour.
Definition: colour.h:43
Listener for Wimp Open Window Request events.
Definition: openwindowlistener.h:97
Event data for open window request listener.
Definition: openwindowlistener.h:39
virtual ~TextView()
Destructor removes listeners from window and deletes the text.
Definition: textview.cc:68
tbx::Colour background() const
Get current background colour for the text.
Definition: textview.h:108