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;}
94 void text(
const std::string &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:34
virtual void redraw(const tbx::RedrawEvent &event)
Redraw the window.
Definition: textview.cc:216
Helper classes to display and edit data.
void refresh()
Refresh the whole report view.
Definition: textview.cc:204
Class to represent a two dimensional bounding box.
Definition: bbox.h:37
tbx::Colour background() const
Get current background colour for the text.
Definition: textview.h:108
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
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
const char * text() const
Get a pointer to the text.
Definition: textview.h:92
virtual void open_window(tbx::OpenWindowEvent &event)
Window has been opened or resized, so re do layout.
Definition: textview.cc:257
unsigned int size() const
Get the current size of the text.
Definition: textview.h:101
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
const tbx::Margin & margin() const
Get the margin between the text view contents and the edge of the Window.
Definition: textview.h:84
Redraw event listener.
Definition: redrawlistener.h:75
Class to display text in a window.
Definition: textview.h:49
Class to represent a RGB colour.
Definition: colour.h:43
bool wrap() const
Check it text view is set to wrap text.
Definition: textview.h:136
Listener for Wimp Open Window Request events.
Definition: openwindowlistener.h:97
Event data for open window request listener.
Definition: openwindowlistener.h:39
tbx::Colour foreground() const
Get current foreground colour for the text.
Definition: textview.h:120
virtual ~TextView()
Destructor removes listeners from window and deletes the text.
Definition: textview.cc:68