os_textarea
|
 |
An input text area within a form.
An os_textarea
is a multiline text entry field within an os_form ,
and is identified by a name. This name is specified in a constructor and can be
modified through the name() member function. An
initial value, or content, for the os_input_text
can be specified either in a constructor or through the content()
member function. An os_textarea typically is
rendered in a fixed-width font.
The number of rows and columns
displayed on the screen for the os_textarea are
specified in a constructor and can be modified through the rows()
and cols() member functions. An os_textarea
can accept an unlimited number of characters, regardless of the number of rows
and columns specified. Word-wrapping characteristics, and the preservation of
carriage return and line feed characters within the text, can be specified
through the wrap() member function.
Declaration
#include <ospace/web/textarea.h>
class os_textarea : public os_element
Enums
enum os_textarea::word_wrap
{
no_wrap, // Disables word-wrapping completely.
virtual_wrap, // Inserts new line characters to fit text but does not include them when text area data is submitted.
physical_wrap // Inserts new line characters to fit text and includes them when text area data is submitted.
};
Interface
Constructor
os_textarea(
const string& name ,
_int rows ,
int cols )
Constructs an input text
area with name name , rows
rows, and cols columns.
Constructor
os_textarea(
const string& name ,
int rows ,
int cols ,
const string& content )
Constructs an input text
area with name name , rows
rows, and cols columns.
Constructor
os_textarea(
const os_textarea& rhs )
Constructs an input text
area that is a copy of rhs .
Destructor
/*
virtual */ ~os_textarea()
Destroys the input text
area.
=
os_textarea&
operator=( const os_textarea& rhs )
Replaces the input text
area contents with a copy of rhs .
=
os_textarea&
operator=( const string& content )
Replaces the initial
content string of the input text area with content
.
clone
/*
virtual */ os_element* clone() const
Returns a base class
pointer to a heap-based deep copy of the input text area.
cols
int
cols() const
Returns the number of
columns, or 0 if not set.
cols
os_textarea&
cols( int cols )
Sets the number of columns
to cols and returns a reference to the input text
area.
content
string
content() const
Returns the initial
content of the input text area.
content
os_textarea&
content( const string& content )
Sets the initial content
to content and returns a reference to the input
text area.
name
string
name() const
Returns the name.
name
os_textarea&
name( const string& name )
Sets the name to name
and returns a reference to the input text area.
print
/*
virtual */ void print( ostream& os )
const
Prints the input text area
to os .
rows
os_textarea&
rows( int rows )
Sets the number of rows to
rows and returns a reference to the input text
area.
rows
int
rows() const
Returns the number of
rows, or 0 if not set.
wrap
int
wrap() const
Returns the word-wrapping
setting, or os_element::use_default if not set.
wrap
os_textarea&
wrap( word_wrap wrap )
Sets the word-wrapping to wrap
and returns a reference to the input text area.
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved