32 #ifndef TBX_TEXTAREA_H_
33 #define TBX_TEXTAREA_H_
49 enum {TOOLBOX_CLASS = 0x4018};
251 void font(
const std::string &name,
int width,
int height);
void wordwrap(bool value)
Set word wrapping in the text area.
Definition: textarea.h:166
std::string string_property(int property_id) const
Get a string property from the toolbox object.
Definition: component.cc:261
bool auto_scroll() const
Check if text area will auto scroll.
Definition: textarea.h:218
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
int text_length() const
Get the length of the text.
Definition: textarea.h:241
ObjectId handle() const
Return the object handle for his component.
Definition: component.h:95
Class to represent a standard desktop WIMP colour.
Definition: colour.h:147
void border_size(int value)
Set the size of the border for the text area.
Definition: textarea.h:263
std::string text() const
Get the text from the text area.
Definition: textarea.h:237
TextArea()
Construct an uninitialised text area.
Definition: textarea.h:51
void clipboard(bool value)
Set if clipboard support is used the text area.
Definition: textarea.h:214
bool has_horizontal_scrollbar() const
Check if text area has a horizontal scroll bar.
Definition: textarea.h:149
The Window object represents a toolbox window.
Definition: window.h:70
TextArea(const TextArea &other)
Construct a text area from another text area.
Definition: textarea.h:64
int int_property(int property_id) const
Get an integer property from the toolbox Component.
Definition: component.cc:165
bool allow_save() const
Check if saving from the text area is allowed.
Definition: textarea.h:184
void replace_text(int start, int end, const std::string &text)
Rpelace text in the text area.
Definition: textarea.cc:64
void system_font(int width, int height)
Set the scroll list to use the system font to display the text.
Definition: textarea.cc:192
bool operator!=(const Gadget &other) const
Check if this text area refers to the same underlying toolbox gadget as another gadget.
Definition: textarea.h:120
Base class for components in an object.
Definition: component.h:42
void get_colour(Colour &foreground, Colour &background) const
Get the colours used in the text area.
Definition: textarea.cc:247
TextArea & operator=(const TextArea &other)
Assign a text area to refer to the same underlying toolbox gadget as another.
Definition: textarea.h:89
~TextArea()
Destroy a text area gadget.
Definition: textarea.h:57
ObjectId _handle
Underlying toolbox handle.
Definition: component.h:45
TextArea & operator=(const Gadget &other)
Assign a text area to refer to the same underlying toolbox gadget as an existing Gadget.
Definition: textarea.h:97
ComponentId id() const
Get the component ID of this component.
Definition: component.h:103
bool operator==(const Gadget &other) const
Check if this text area refers to the same underlying toolbox gadget as another gadget.
Definition: textarea.h:113
void get_selecton(int &start, int &end) const
Get location of selection.
Definition: textarea.cc:84
void allow_save(bool value)
Set if saving is allowed in the text area.
Definition: textarea.h:190
void font(const std::string &name, int width, int height)
Set the font used for the scroll list items.
Definition: textarea.cc:172
int selection_length() const
Get the length of the selection.
Definition: textarea.cc:117
void has_horizontal_scrollbar(bool value)
Set if text area has a horizontal scroll bar.
Definition: textarea.h:154
Class to represent a RGB colour.
Definition: colour.h:44
void state(int state)
Set all state flags.
Definition: textarea.h:131
bool allow_load() const
Check if loading from the text area is allowed.
Definition: textarea.h:196
bool wordwrap() const
Check if text area is wrapping words.
Definition: textarea.h:160
int state() const
Return all state flags.
Definition: textarea.h:126
bool clipboard() const
Check if this text area supports the clipboard.
Definition: textarea.h:208
void text(const std::string &text)
Set the text in the text area.
Definition: textarea.h:231
bool allow_selection() const
Check if text area allows a selection to be made.
Definition: textarea.h:172
void allow_load(bool value)
Set if loading is allowed in the text area.
Definition: textarea.h:202
void auto_scroll(bool value)
Set if text area will auto scroll.
Definition: textarea.h:224
TextArea(const Gadget &other)
Construct a text area from another gadget.
Definition: textarea.h:75
std::string selection_text() const
Get the text of the selection.
Definition: textarea.cc:134
int _id
Underlying toolbox component id.
Definition: component.h:46
int string_property_length(int property_id) const
Get a the length of a string property from the toolbox object.
Definition: component.cc:302
Class to manipulate a toolbox TextArea gadget.
Definition: textarea.h:47
void insert_text(int where, const std::string &text)
Insert text into the text area.
Definition: textarea.cc:45
This is the base class for all Gadgets.
Definition: gadget.h:49
TextArea & operator=(const Component &other)
Assign a text area to refer to the same underlying toolbox component as an existing Gadget.
Definition: textarea.h:106
bool flag_property(int property_id, int flag) const
Check if a particular flag is set in a property.
Definition: component.cc:351
void has_vertical_scrollbar(bool value)
Set if text area has a vertical scroll bar.
Definition: textarea.h:143
void check_toolbox_class(int class_id) const
Check the underlying gadget class for this object has the given class id.
Definition: gadget.cc:47
TextArea(const Component &other)
Construct a text area from a gadget.
Definition: textarea.h:83
void allow_selection(bool value)
Set if text can be selected in the text area.
Definition: textarea.h:178
bool has_vertical_scrollbar() const
Check if text area has a vertical scroll bar.
Definition: textarea.h:138
void set_colour(WimpColour foreground, WimpColour background)
Set the colours of the text area using WIMP colours.
Definition: textarea.cc:211
void set_selection(int start, int end)
Set the selection.
Definition: textarea.cc:102