tbx  0.7.3
Public Types | Public Member Functions | List of all members
tbx::res::ResTextArea Class Reference

Class for TextArea gadget template. More...

#include <restextarea.h>

Inheritance diagram for tbx::res::ResTextArea:
tbx::res::ResGadget tbx::res::ResBase

Public Types

enum  { TYPE_ID = 0x4018 }
 

Public Member Functions

 ResTextArea (const ResGadget &other)
 Construct an text area gadget resource. More...
 
 ResTextArea (const ResTextArea &other)
 Construct an text area gadget resource. More...
 
ResTextAreaoperator= (const ResGadget &other)
 Assign from a ResGadget. More...
 
ResTextAreaoperator= (const ResTextArea &other)
 Assign from another text area gadget resource. More...
 
 ResTextArea ()
 Construct a text area gadget resource. More...
 
bool has_vertical_scrollbar () const
 Check if text area has a vertical scroll bar. More...
 
void has_vertical_scrollbar (bool value)
 Set if text area has a vertical scroll bar. More...
 
bool has_horizontal_scrollbar () const
 Check if text area has a horizontal scroll bar. More...
 
void has_horizontal_scrollbar (bool value)
 Set if text area has a horizontal scroll bar. More...
 
bool wordwrap () const
 Check if text will be word wrapped. More...
 
void wordwrap (bool value)
 Set if text will be word wrapped. More...
 
bool allow_selection () const
 Check if text can be selected by the mouse. More...
 
void allow_selection (bool value)
 Set if text can be selected by the mouse. More...
 
bool allow_save () const
 Check if text can be saved. More...
 
void allow_save (bool value)
 Set if text can be saved. More...
 
bool allow_load () const
 Check if text can be loaded by dragging it to the text area. More...
 
void allow_load (bool value)
 Set if text can be loaded by dragging it to the text area. More...
 
bool clipboard () const
 Check if clipboard support is enabled. More...
 
void clipboard (bool value)
 Set if clipboard support is enabled. More...
 
bool auto_scroll () const
 Check if the text field will automatically scroll as text is entered. More...
 
void auto_scroll (bool value)
 Set if the text field will automatically scroll as text is entered. More...
 
int type () const
 Get the type of the text area gadget. More...
 
void type (int value)
 Set the type of the text area gadget. More...
 
int event () const
 Get the event for the text area gadget. More...
 
void event (int value)
 Set the event for the text area gadget. More...
 
const char * text () const
 Get the initial text for the text area. More...
 
void text (const char *value)
 Set the initial text for the text area. More...
 
void text (const std::string &value)
 Set the initial text for the text area. More...
 
int foreground () const
 Get foreground/text colour for the text area. More...
 
void foreground (int value)
 Set foreground/text colour for the text area. More...
 
int background () const
 Get background colour for the text area. More...
 
void background (int value)
 Set background colour for the text area. More...
 
- Public Member Functions inherited from tbx::res::ResGadget
 ResGadget (const ResGadget &other)
 Construct a resource gadget as a copy of another. More...
 
ResGadgetoperator= (const ResGadget &other)
 Assign a resource gadget as a copy of another. More...
 
 ResGadget (int type, int size)
 Construct an empty gadget of the given type and size. More...
 
void check_type (int type) const
 Check if this gadgets type is as specified. More...
 
unsigned int flags () const
 Get all flags as a word raw access. More...
 
void flags (unsigned int value)
 Set all flags as a word. More...
 
bool back () const
 Check if gadget is at the back (created first) More...
 
void back (bool value)
 Set if gadget should be at the back. More...
 
bool faded () const
 Check if the gadget is faded. More...
 
void faded (bool value)
 Set if the gadget is faded. More...
 
unsigned short type () const
 Get the gadget type. More...
 
unsigned short stored_size () const
 Get the size stored in template. More...
 
int size () const
 Size of gadget (including header). More...
 
int xmin () const
 Get the minimum x coordinate of the gadget's bounding box. More...
 
void xmin (int x)
 Set the minimum x coordinate of the gadget's bounding box. More...
 
int ymin () const
 Get the minimum y coordinate of the gadget's bounding box. More...
 
void ymin (int y)
 Set the minimum y coordinate of the gadget's bounding box. More...
 
int xmax () const
 Get the maximum x coordinate of the gadget's bounding box. More...
 
void xmax (int x)
 Set the maximum x coordinate of the gadget's bounding box. More...
 
int ymax () const
 Get the maximum y coordinate of the gadget's bounding box. More...
 
void ymax (int y)
 Set the maximum y coordinate of the gadget's bounding box. More...
 
ComponentId component_id () const
 Get the Component ID. More...
 
void component_id (ComponentId value)
 Set the Component ID. More...
 
const char * help_message () const
 Get the help message for the gadget. More...
 
void help_message (const char *msg, int max_length=-1)
 Set the help message for the gadget. More...
 
void help_message (const std::string &msg, int max_length=-1)
 Set the help message for the gadget. More...
 
int max_help () const
 Max size of message.
 
- Public Member Functions inherited from tbx::res::ResBase
 ResBase (const ResBase &other)
 Copy constructor. More...
 
virtual ~ResBase ()
 Destructor.
 
ResBaseoperator= (const ResBase &other)
 Assignment. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from tbx::res::ResGadget
static int gadget_size (unsigned int type_and_size)
 Get gadget size given its type and size value. More...
 
- Protected Member Functions inherited from tbx::res::ResGadget
void make_writeable ()
 Make item writeable.
 
- Protected Member Functions inherited from tbx::res::ResBase
 ResBase (ResImpl *impl)
 Create from internal resource implementation. More...
 
const char * string (int offset) const
 Return a string at the given offset. More...
 
void string (int offset, const char *value)
 Set a string at the given offset. More...
 
void string (int offset, std::string value)
 Set a string at the given offset. More...
 
void string_with_length (int offset, const char *value, int length=-1)
 Assign a string where the length is at offset+4. More...
 
void string_with_length (int offset, const std::string &value, int length=-1)
 Assign a string where the length is at offset+4. More...
 
const char * message (int offset) const
 Get the message string at the given offset. More...
 
void message (int offset, const char *value)
 Set a message at the given offset. More...
 
void message (int offset, std::string value)
 Set a message at the given offset. More...
 
void message_with_length (int offset, const char *value, int length=-1)
 Assign a message where the length is at offset+4. More...
 
void message_with_length (int offset, const std::string &value, int length=-1)
 Assign a message where the length is at offset+4. More...
 
int int_value (int offset) const
 Get an integer value. More...
 
void int_value (int offset, int value)
 Set a number at the specified offset. More...
 
unsigned int uint_value (int offset) const
 Get an unsigned integer value. More...
 
void uint_value (int offset, unsigned int value)
 Set an unsigned number at the specified offset. More...
 
unsigned char byte_value (int offset) const
 Get a byte value. More...
 
void byte_value (int offset, unsigned char value)
 Set an unsigned byte (8 bit value) at the specified offset. More...
 
unsigned short ushort_value (int offset) const
 Get a unsigned short value. More...
 
void ushort_value (int offset, unsigned short value)
 Set an unsigned short (16 bit value) at the specified offset. More...
 
bool flag (int offset, int mask) const
 Check if any of the bits in a mask are set. More...
 
void flag (int offset, int mask, bool on)
 Set/clear the bits in mask. More...
 
int flag_value (int offset, int mask) const
 Get the bits for the given mask. More...
 
void flag_value (int offset, int mask, int value)
 Set bits in given mask clearing others. More...
 
void init_string (int offset, const char *value)
 Initialise a string in a constructor helper. More...
 
void init_message (int offset, const char *value)
 Initialise a message in a constructor helper. More...
 
void init_sprite_area_ref (int offset)
 Initialise a sprite area reference. More...
 
void init_object_ref (int offset)
 Initialise an object reference. More...
 
- Protected Attributes inherited from tbx::res::ResBase
ResImpl * _impl
 Internal Resource implementation.
 

Detailed Description

Class for TextArea gadget template.

Constructor & Destructor Documentation

tbx::res::ResTextArea::ResTextArea ( const ResGadget other)
inline

Construct an text area gadget resource.

Parameters
otherResGadget to copy resource from
Exceptions
ResGadgetTypeMismatchif the ResGadget is not an text area
tbx::res::ResTextArea::ResTextArea ( const ResTextArea other)
inline

Construct an text area gadget resource.

Parameters
othertext area to copy resource from
tbx::res::ResTextArea::ResTextArea ( )
inline

Construct a text area gadget resource.

All options are false, events unset and messages are null.

Member Function Documentation

bool tbx::res::ResTextArea::allow_load ( ) const
inline

Check if text can be loaded by dragging it to the text area.

Returns
true if text can be loaded
void tbx::res::ResTextArea::allow_load ( bool  value)
inline

Set if text can be loaded by dragging it to the text area.

Parameters
valueset to true to allow text to be loaded
bool tbx::res::ResTextArea::allow_save ( ) const
inline

Check if text can be saved.

Text is saved by selecting some text and dragging it to another application or the filer.

Returns
true if text can be saved
void tbx::res::ResTextArea::allow_save ( bool  value)
inline

Set if text can be saved.

Text is saved by selecting some text and dragging it to another application or the filer.

Parameters
valueset to true if text can be saved
bool tbx::res::ResTextArea::allow_selection ( ) const
inline

Check if text can be selected by the mouse.

Returns
true if text can be selected
void tbx::res::ResTextArea::allow_selection ( bool  value)
inline

Set if text can be selected by the mouse.

Parameters
valueset to true to allow text to be selected
bool tbx::res::ResTextArea::auto_scroll ( ) const
inline

Check if the text field will automatically scroll as text is entered.

Returns
true if auto scroll is enabled
void tbx::res::ResTextArea::auto_scroll ( bool  value)
inline

Set if the text field will automatically scroll as text is entered.

Parameters
valueset to true to enable auto scroll
int tbx::res::ResTextArea::background ( ) const
inline

Get background colour for the text area.

Returns
background
void tbx::res::ResTextArea::background ( int  value)
inline

Set background colour for the text area.

Parameters
valuebackground colour
bool tbx::res::ResTextArea::clipboard ( ) const
inline

Check if clipboard support is enabled.

Returns
true if clipboard support is enabled
void tbx::res::ResTextArea::clipboard ( bool  value)
inline

Set if clipboard support is enabled.

Parameters
valueset to true to enable clipboard support
int tbx::res::ResTextArea::event ( ) const
inline

Get the event for the text area gadget.

Returns
ID of event.
void tbx::res::ResTextArea::event ( int  value)
inline

Set the event for the text area gadget.

Parameters
valuenew event ID
int tbx::res::ResTextArea::foreground ( ) const
inline

Get foreground/text colour for the text area.

Returns
foreground/text colour
void tbx::res::ResTextArea::foreground ( int  value)
inline

Set foreground/text colour for the text area.

Parameters
valueforeground/text colour
bool tbx::res::ResTextArea::has_horizontal_scrollbar ( ) const
inline

Check if text area has a horizontal scroll bar.

Returns
true if there is a horizontal scroll bar
void tbx::res::ResTextArea::has_horizontal_scrollbar ( bool  value)
inline

Set if text area has a horizontal scroll bar.

Parameters
valueset to true to include a horizontal scroll bar
bool tbx::res::ResTextArea::has_vertical_scrollbar ( ) const
inline

Check if text area has a vertical scroll bar.

Returns
true if there is a vertical scroll bar
void tbx::res::ResTextArea::has_vertical_scrollbar ( bool  value)
inline

Set if text area has a vertical scroll bar.

Parameters
valueset to true to include a vertical scroll bar
ResTextArea& tbx::res::ResTextArea::operator= ( const ResGadget other)
inline

Assign from a ResGadget.

Parameters
otherResGadget to copy
Exceptions
ResGadgetTypeMismatchif the ResGadget is not an text area
ResTextArea& tbx::res::ResTextArea::operator= ( const ResTextArea other)
inline

Assign from another text area gadget resource.

Parameters
othertext area gadget resource to copy
const char* tbx::res::ResTextArea::text ( ) const
inline

Get the initial text for the text area.

Returns
pointer to zero terminated string or 0 if none
void tbx::res::ResTextArea::text ( const char *  value)
inline

Set the initial text for the text area.

Parameters
valuepointer to zero terminated string or 0 if none
void tbx::res::ResTextArea::text ( const std::string &  value)
inline

Set the initial text for the text area.

Parameters
valueinitial text
int tbx::res::ResTextArea::type ( ) const
inline

Get the type of the text area gadget.

Returns
type of the text area gadget
void tbx::res::ResTextArea::type ( int  value)
inline

Set the type of the text area gadget.

Parameters
valuetype of the text area gadget
bool tbx::res::ResTextArea::wordwrap ( ) const
inline

Check if text will be word wrapped.

Returns
true if the text will be word wrapped
void tbx::res::ResTextArea::wordwrap ( bool  value)
inline

Set if text will be word wrapped.

Parameters
valueset to true to word wrap the text

The documentation for this class was generated from the following file: