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);
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
virtual void redraw(const tbx::RedrawEvent &event)
Redraw the window.
Definition: textview.cc:216
tbx::Colour background() const
Get current background colour for the text.
Definition: textview.h:108
The Window object represents a toolbox window.
Definition: window.h:70
void refresh()
Refresh the whole report view.
Definition: textview.cc:204
TextView(tbx::Window window, bool wrap=false)
Construct a text view.
Definition: textview.cc:52
Event data for open window request listener.
Definition: openwindowlistener.h:40
tbx::Window & window()
Get the window the text view is on.
Definition: textview.h:76
Class to represent a RGB colour.
Definition: colour.h:44
Class to represent a two dimensional bounding box.
Definition: bbox.h:38
Listener for Wimp Open Window Request events.
Definition: openwindowlistener.h:98
void update_window_extent()
Update the Window extent after a change in size of text.
Definition: textview.cc:172
Redraw event listener.
Definition: redrawlistener.h:76
virtual void open_window(tbx::OpenWindowEvent &event)
Window has been opened or resized, so re do layout.
Definition: textview.cc:257
bool wrap() const
Check it text view is set to wrap text.
Definition: textview.h:136
const char * text() const
Get a pointer to the text.
Definition: textview.h:92
unsigned int size() const
Get the current size of the text.
Definition: textview.h:101
Event passed to redraw listener to give details on the area that needs a redraw.
Definition: redrawlistener.h:44
Class to display text in a window.
Definition: textview.h:52
bool load_file(const std::string &file_name)
Load text for view from file.
Definition: textview.cc:345
const tbx::Margin & margin() const
Get the margin between the text view contents and the edge of the Window.
Definition: textview.h:84
tbx::Colour foreground() const
Get current foreground colour for the text.
Definition: textview.h:120
Class to represent a margin around an area.
Definition: margin.h:35
virtual ~TextView()
Destructor removes listeners from window and deletes the text.
Definition: textview.cc:68