Gnash
0.8.10
|
An instance of a DefineEditTextTag. More...
#include <TextField.h>
Public Types | |
enum | TextAlignment { ALIGN_LEFT = 0, ALIGN_RIGHT, ALIGN_CENTER, ALIGN_JUSTIFY } |
Text alignment values. More... | |
enum | TextFormatDisplay { TEXTFORMAT_BLOCK = 0, TEXTFORMAT_INLINE = 1 } |
Text format display values. More... | |
enum | AutoSize { AUTOSIZE_NONE, AUTOSIZE_LEFT, AUTOSIZE_CENTER, AUTOSIZE_RIGHT } |
Possible autoSize values. More... | |
enum | TypeValue { typeInvalid, typeDynamic, typeInput } |
Possible type values. More... | |
typedef std::vector< size_t > | LineStarts |
Public Member Functions | |
TextField (as_object *object, DisplayObject *parent, const SWF::DefineEditTextTag &def) | |
Constructs a TextField as specified in a DefineEditText tag. | |
TextField (as_object *object, DisplayObject *parent, const SWFRect &bounds) | |
Constructs a TextField with default values and the specified bounds. | |
~TextField () | |
bool | mouseEnabled () const |
Returns true for now, TextField is always "Mouse-Enabled". | |
InteractiveObject * | topmostMouseEntity (boost::int32_t x, boost::int32_t y) |
Returns a pointer to the topmost InteractiveObject at (x,y) | |
virtual int | getDefinitionVersion () const |
Return the version of the SWF this was parsed from. | |
void | mouseEvent (const event_id &id) |
This function is called as a user-input handler. | |
void | keyInput (key::code k) |
Handle user input from a key press. | |
const std::string & | getVariableName () const |
void | set_variable_name (const std::string &newname) |
void | updateText (const std::string &s) |
Set our text to the given string by effect of an update of a. | |
std::string | get_text_value () const |
Return value of our text. | |
std::string | get_htmltext_value () const |
Return value of our htmlText. | |
bool | getTextDefined () const |
Return true if text is defined. | |
size_t | getCaretIndex () const |
const std::pair< size_t, size_t > & | getSelection () const |
Get a std::pair of size_t with start/end of selection. | |
void | replaceSelection (const std::string &replace) |
Replace the current selection with the new text. | |
void | setSelection (int start, int end) |
Set the current selection. | |
virtual void | setWidth (double width) |
Override of DisplayObject::setWidth. | |
virtual void | setHeight (double height) |
Override of DisplayObject::setHeight. | |
virtual void | display (Renderer &renderer, const Transform &xform) |
Draw the dynamic string. | |
void | add_invalidated_bounds (InvalidatedRanges &ranges, bool force) |
Add the DisplayObject's invalidated bounds *to* the given ranges list. | |
virtual SWFRect | getBounds () const |
Get bounding SWFRect of this TextField. | |
bool | pointInShape (boost::int32_t x, boost::int32_t y) const |
Return true if the given point falls in this DisplayObject's shape. | |
bool | getDrawBackground () const |
Return true if the 'background' should be drawn. | |
void | setDrawBackground (bool draw) |
Specify whether to draw the background. | |
rgba | getBackgroundColor () const |
Return color of the background. | |
void | setBackgroundColor (const rgba &col) |
Set color of the background. | |
bool | getDrawBorder () const |
Return true if this TextField should have its border visible. | |
void | setDrawBorder (bool draw) |
Specify whether to draw the border. | |
rgba | getBorderColor () const |
Return color of the border. | |
void | setBorderColor (const rgba &col) |
Set color of the border. | |
const rgba & | getTextColor () const |
Return color of the text. | |
void | setTextColor (const rgba &col) |
Set color of the text. | |
bool | getEmbedFonts () const |
Return true if this TextField should use embedded font glyphs, false if it should use device font glyphs. | |
boost::int32_t | maxChars () const |
Get the current maxChars setting of the TextField. | |
void | maxChars (boost::int32_t max) |
Set the current maxChars setting of the TextField. | |
bool | multiline () const |
Get the current multiline setting of the TextField. | |
void | multiline (bool b) |
Set the current multiline setting of the TextField. | |
bool | password () const |
Get the current password setting of the TextField. | |
void | password (bool b) |
Set the current password setting of the TextField. | |
void | setEmbedFonts (bool use) |
Set whether this TextField should use embedded font glyphs, or use device font glyphs. | |
AutoSize | getAutoSize () const |
Get autoSize value. | |
TextAlignment | getTextAlignment () |
Return text TextAlignment. | |
void | setAutoSize (AutoSize val) |
Set autoSize value. | |
void | setType (TypeValue val) |
Set type (input or dynamic) | |
TypeValue | getType () const |
Get type (input, dynamic or invalid) | |
bool | isReadOnly () const |
Return true if this TextField is read-only. | |
bool | doWordWrap () const |
Return true if text should continue to next available line when hitting end of bounding box. | |
void | setWordWrap (bool on) |
Set wordWrap parameter. | |
bool | doHtml () const |
Return true if HTML markup in text should be rendered. | |
void | setHtml (bool on) |
Set html parameter. | |
bool | isSelectable () const |
Return true if the TextField text is selectable. | |
void | setSelectable (bool v) |
Set 'selectable' parameter. | |
virtual bool | isSelectableTextField () const |
Return true if the TextField text is selectable. | |
void | removeTextField () |
Remove this textfield from the stage. | |
boost::intrusive_ptr< const Font > | setFont (boost::intrusive_ptr< const Font > newfont) |
Set our font, return previously set one. | |
const Font * | getFont () |
boost::uint16_t | getFontHeight () const |
void | setFontHeight (boost::uint16_t h) |
boost::uint16_t | getLeftMargin () const |
void | setLeftMargin (boost::uint16_t h) |
boost::uint16_t | getRightMargin () const |
void | setRightMargin (boost::uint16_t h) |
boost::uint16_t | getIndent () const |
void | setIndent (boost::uint16_t h) |
boost::uint16_t | getBlockIndent () const |
void | setBlockIndent (boost::uint16_t h) |
TextAlignment | getAlignment () const |
void | setAlignment (TextAlignment h) |
boost::int16_t | getLeading () const |
void | setLeading (boost::int16_t h) |
bool | getUnderlined () const |
TextFormatDisplay | getDisplay () const |
bool | getBullet () const |
const std::vector< int > & | getTabStops () const |
bool | isRestrict () const |
const std::string & | getRestrict () const |
size_t | getScroll () const |
size_t | getMaxScroll () const |
size_t | getHScroll () const |
size_t | getMaxHScroll () const |
size_t | getBottomScroll () const |
void | setUnderlined (bool v) |
void | setTabStops (const std::vector< int > &tabStops) |
void | setBullet (bool b) |
void | setURL (std::string url) |
void | setTarget (std::string target) |
void | setRestrict (const std::string &restrict) |
void | setDisplay (TextFormatDisplay display) |
void | setScroll (size_t scroll) |
void | setMaxScroll (size_t maxScroll) |
void | setHScroll (size_t hScroll) |
void | setMaxHScroll (size_t maxHScroll) |
void | setbottomScroll (size_t bottomScroll) |
size_t | cursorRecord () |
Returns the number of the record that the cursor is in. | |
void | setTextFormat (TextFormat_as &tf) |
const SWFRect & | getTextBoundingBox () const |
void | setTextValue (const std::wstring &wstr) |
Set our text to the given string. | |
Static Public Member Functions | |
static TypeValue | parseTypeValue (const std::string &val) |
Parse type string value. | |
static const char * | typeValueName (TypeValue val) |
Return type value as a string. |
An instance of a DefineEditTextTag.
typedef std::vector<size_t> gnash::TextField::LineStarts |
gnash::TextField::TextField | ( | as_object * | object, |
DisplayObject * | parent, | ||
const SWF::DefineEditTextTag & | def | ||
) |
Constructs a TextField as specified in a DefineEditText tag.
References assert, gnash::key::f, gnash::SWF::DefineEditTextTag::getFont(), gnash::fontlib::get_default_font(), setFont(), gnash::getSWFVersion(), setTextValue(), gnash::utf8::decodeCanonicalString(), and gnash::SWF::DefineEditTextTag::defaultText().
gnash::TextField::TextField | ( | as_object * | object, |
DisplayObject * | parent, | ||
const SWFRect & | bounds | ||
) |
Constructs a TextField with default values and the specified bounds.
Notably, the default textHeight is 12pt (240 twips).
parent | A pointer to the DisplayObject parent of this TextField |
bounds | A SWFRect specifying the bounds of this TextField |
References assert, gnash::key::f, gnash::fontlib::get_default_font(), and setFont().
gnash::TextField::~TextField | ( | ) |
void gnash::TextField::add_invalidated_bounds | ( | InvalidatedRanges & | ranges, |
bool | force | ||
) | [virtual] |
Add the DisplayObject's invalidated bounds *to* the given ranges list.
NOTE that this method should include the bounds that it covered the last time clear_invalidated() was called, as those need to be rerendered as well (to clear the region previously occupied by this DisplayObject).
That's why it returns the *union* of old_invalidated_ranges and the current bounds. The function is also used internally by set_invalidated() to update m_old_invalidated_ranges itself (you may notice some kind of circular reference), but that's no problem since old_invalidated_ranges is NULL during that call.
It is used to determine what area needs to be re-rendered. The coordinates are world coordinates (in TWIPS). Only instances with _invalidated flag set are checked unless force is set.
Implements gnash::InteractiveObject.
References gnash::DisplayObject::invalidated(), gnash::geometry::SnappingRanges2d::add(), gnash::DisplayObject::m_old_invalidated_ranges, gnash::getWorldMatrix(), getBounds(), gnash::SWFRect::expand_to_rect(), gnash::SWFMatrix::transform(), and gnash::SWFRect::getRange().
size_t gnash::TextField::cursorRecord | ( | ) |
Returns the number of the record that the cursor is in.
References gnash::key::i.
Draw the dynamic string.
Implements gnash::InteractiveObject.
References getDrawBorder(), getDrawBackground(), gnash::DisplayObject::transform(), getEmbedFonts(), gnash::Transform::colorTransform, gnash::SWFRect::is_null(), gnash::SWFRect::get_x_min(), gnash::SWFRect::get_x_max(), gnash::SWFRect::get_y_min(), gnash::SWFRect::get_y_max(), getBorderColor(), getBackgroundColor(), gnash::SWFCxForm::transform(), gnash::Renderer::draw_poly(), gnash::Transform::matrix, gnash::SWFMatrix::concatenate_translation(), getFontHeight(), PADDING_TWIPS, gnash::key::i, gnash::SWFRect::height(), gnash::SWF::TextRecord::displayRecords(), isReadOnly(), and gnash::DisplayObject::clear_invalidated().
Referenced by setDisplay().
bool gnash::TextField::doHtml | ( | ) | const [inline] |
Return true if HTML markup in text should be rendered.
bool gnash::TextField::doWordWrap | ( | ) | const [inline] |
Return true if text should continue to next available line when hitting end of bounding box.
std::string gnash::TextField::get_htmltext_value | ( | ) | const |
Return value of our htmlText.
References gnash::getSWFVersion(), gnash::getObject(), and gnash::utf8::encodeCanonicalString().
std::string gnash::TextField::get_text_value | ( | ) | const |
Return value of our text.
References gnash::getSWFVersion(), gnash::getObject(), and gnash::utf8::encodeCanonicalString().
Referenced by gnash::MovieClip::getTextFieldVariables().
TextAlignment gnash::TextField::getAlignment | ( | ) | const [inline] |
Referenced by getTextAlignment().
AutoSize gnash::TextField::getAutoSize | ( | ) | const [inline] |
Get autoSize value.
rgba gnash::TextField::getBackgroundColor | ( | ) | const |
Return color of the background.
Referenced by display().
boost::uint16_t gnash::TextField::getBlockIndent | ( | ) | const [inline] |
rgba gnash::TextField::getBorderColor | ( | ) | const |
Return color of the border.
Referenced by display().
size_t gnash::TextField::getBottomScroll | ( | ) | const [inline] |
virtual SWFRect gnash::TextField::getBounds | ( | ) | const [inline, virtual] |
Get bounding SWFRect of this TextField.
Implements gnash::InteractiveObject.
Referenced by add_invalidated_bounds(), setWidth(), and setHeight().
bool gnash::TextField::getBullet | ( | ) | const [inline] |
size_t gnash::TextField::getCaretIndex | ( | ) | const [inline] |
int gnash::TextField::getDefinitionVersion | ( | ) | const [virtual] |
Return the version of the SWF this was parsed from.
TODO: work out what this means for dynamic TextFields.
Reimplemented from gnash::DisplayObject.
References gnash::DisplayObject::get_root(), and gnash::MovieClip::getDefinitionVersion().
TextFormatDisplay gnash::TextField::getDisplay | ( | ) | const [inline] |
bool gnash::TextField::getDrawBackground | ( | ) | const |
Return true if the 'background' should be drawn.
Referenced by display().
bool gnash::TextField::getDrawBorder | ( | ) | const |
bool gnash::TextField::getEmbedFonts | ( | ) | const [inline] |
const Font* gnash::TextField::getFont | ( | ) | [inline] |
boost::uint16_t gnash::TextField::getFontHeight | ( | ) | const [inline] |
Referenced by display().
size_t gnash::TextField::getHScroll | ( | ) | const [inline] |
boost::uint16_t gnash::TextField::getIndent | ( | ) | const [inline] |
boost::int16_t gnash::TextField::getLeading | ( | ) | const [inline] |
boost::uint16_t gnash::TextField::getLeftMargin | ( | ) | const [inline] |
size_t gnash::TextField::getMaxHScroll | ( | ) | const [inline] |
size_t gnash::TextField::getMaxScroll | ( | ) | const [inline] |
const std::string& gnash::TextField::getRestrict | ( | ) | const [inline] |
boost::uint16_t gnash::TextField::getRightMargin | ( | ) | const [inline] |
size_t gnash::TextField::getScroll | ( | ) | const [inline] |
const std::pair<size_t, size_t>& gnash::TextField::getSelection | ( | ) | const [inline] |
Get a std::pair of size_t with start/end of selection.
Both start and end should invariably be within the range of the text.
const std::vector<int>& gnash::TextField::getTabStops | ( | ) | const [inline] |
TextField::TextAlignment gnash::TextField::getTextAlignment | ( | ) |
Return text TextAlignment.
References getAlignment(), AUTOSIZE_CENTER, ALIGN_CENTER, AUTOSIZE_LEFT, ALIGN_LEFT, AUTOSIZE_RIGHT, and ALIGN_RIGHT.
const SWFRect& gnash::TextField::getTextBoundingBox | ( | ) | const [inline] |
const rgba& gnash::TextField::getTextColor | ( | ) | const [inline] |
Return color of the text.
bool gnash::TextField::getTextDefined | ( | ) | const [inline] |
Return true if text is defined.
Referenced by gnash::MovieClip::getTextFieldVariables().
TypeValue gnash::TextField::getType | ( | ) | const [inline] |
Get type (input, dynamic or invalid)
bool gnash::TextField::getUnderlined | ( | ) | const [inline] |
const std::string& gnash::TextField::getVariableName | ( | ) | const [inline] |
bool gnash::TextField::isReadOnly | ( | ) | const [inline] |
Return true if this TextField is read-only.
References typeInput.
Referenced by display(), and keyInput().
bool gnash::TextField::isRestrict | ( | ) | const [inline] |
bool gnash::TextField::isSelectable | ( | ) | const [inline] |
Return true if the TextField text is selectable.
Referenced by isSelectableTextField().
virtual bool gnash::TextField::isSelectableTextField | ( | ) | const [inline, virtual] |
Return true if the TextField text is selectable.
Reimplemented from gnash::DisplayObject.
References isSelectable().
void gnash::TextField::keyInput | ( | key::code | k | ) |
Handle user input from a key press.
References setHtml(), gnash::key::s, gnash::key::BACKSPACE, isReadOnly(), setTextValue(), gnash::key::DELETEKEY, gnash::key::INSERT, gnash::key::HOME, gnash::key::PGUP, gnash::key::UP, gnash::key::END, gnash::key::PGDN, gnash::key::DOWN, gnash::key::LEFT, gnash::key::RIGHT, gnash::key::ENTER, multiline(), maxChars(), gnash::key::t, gnash::key::codeMap, gnash::key::c, gnash::key::ASCII, and gnash::DisplayObject::set_invalidated().
Referenced by gnash::movie_root::keyEvent().
boost::int32_t gnash::TextField::maxChars | ( | ) | const [inline] |
Get the current maxChars setting of the TextField.
Referenced by keyInput().
void gnash::TextField::maxChars | ( | boost::int32_t | max | ) | [inline] |
Set the current maxChars setting of the TextField.
max | The maximum number of characters that can be input by the user (Does not restrict Scripts) |
bool gnash::TextField::mouseEnabled | ( | ) | const [inline, virtual] |
Returns true for now, TextField is always "Mouse-Enabled".
Implements gnash::InteractiveObject.
void gnash::TextField::mouseEvent | ( | const event_id & | id | ) | [virtual] |
This function is called as a user-input handler.
Implements gnash::InteractiveObject.
References gnash::event_id::id(), gnash::DisplayObject::stage(), gnash::movie_root::mousePosition(), gnash::key::m, gnash::getMatrix(), gnash::SWFMatrix::get_x_translation(), gnash::SWFMatrix::get_y_translation(), gnash::key::SWF, gnash::key::i, gnash::SWF::TextRecord::getURL(), gnash::movie_root::getURL(), and gnash::SWF::TextRecord::getTarget().
bool gnash::TextField::multiline | ( | ) | const [inline] |
Get the current multiline setting of the TextField.
Referenced by keyInput().
void gnash::TextField::multiline | ( | bool | b | ) | [inline] |
Set the current multiline setting of the TextField.
b | If true "Enter" key will be recognized (Does not restrict Scripts) |
References gnash::key::b.
TextField::TypeValue gnash::TextField::parseTypeValue | ( | const std::string & | val | ) | [static] |
Parse type string value.
val | Type value as a string (one of input or dynamic) |
References typeInput, typeDynamic, and typeInvalid.
bool gnash::TextField::password | ( | ) | const [inline] |
Get the current password setting of the TextField.
void gnash::TextField::password | ( | bool | b | ) | [inline] |
Set the current password setting of the TextField.
b | If true characters in the TextField will be displayed as (*) |
References gnash::key::b.
bool gnash::TextField::pointInShape | ( | boost::int32_t | x, |
boost::int32_t | y | ||
) | const [virtual] |
Return true if the given point falls in this DisplayObject's shape.
Point coordinates are in world TWIPS
The default implementation warns about a missing override and invokes pointInBounds().
Reimplemented from gnash::InteractiveObject.
References gnash::getWorldMatrix(), gnash::SWFMatrix::invert(), gnash::SWFMatrix::transform(), gnash::SWFRect::point_test(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
void gnash::TextField::removeTextField | ( | ) |
Remove this textfield from the stage.
This is to implement TextField.removeTextField, will basically forward the request to its parent. Eventually this and MovieClip::removeMovieClip will be merged in a single function to be later used also for AS3 removeChild().
References gnash::DisplayObject::get_depth(), gnash::DisplayObject::getTarget(), gnash::key::p, gnash::DisplayObject::parent(), assert, gnash::DisplayObject::to_movie(), _, gnash::typeName(), and gnash::MovieClip::remove_display_object().
void gnash::TextField::replaceSelection | ( | const std::string & | replace | ) |
Replace the current selection with the new text.
replace | String to replace the current selection |
References gnash::getSWFVersion(), gnash::getObject(), gnash::utf8::decodeCanonicalString(), assert, start, and gnash::image::end().
void gnash::TextField::set_variable_name | ( | const std::string & | newname | ) |
Set the name of a variable associated to this TextField's displayed text. Calling this function will override any previous setting for the variable name.
References updateText().
void gnash::TextField::setAlignment | ( | TextAlignment | h | ) |
References gnash::DisplayObject::set_invalidated(), and gnash::key::h.
Referenced by setTextFormat().
void gnash::TextField::setAutoSize | ( | AutoSize | val | ) |
Set autoSize value.
val | The AutoSize to use |
References gnash::DisplayObject::set_invalidated().
void gnash::TextField::setBackgroundColor | ( | const rgba & | col | ) |
Set color of the background.
Use setDrawBackground to actually use this value.
col | RGBA Object with color information. TextField background will be drawn in this color |
References gnash::DisplayObject::set_invalidated().
void gnash::TextField::setBlockIndent | ( | boost::uint16_t | h | ) |
References gnash::DisplayObject::set_invalidated(), and gnash::key::h.
Referenced by setTextFormat().
void gnash::TextField::setBorderColor | ( | const rgba & | col | ) |
Set color of the border.
Use setDrawBorder to actually use this value.
col | RGBA Object with color information. TextField border will be drawn in this color. |
References gnash::DisplayObject::set_invalidated().
void gnash::TextField::setbottomScroll | ( | size_t | bottomScroll | ) | [inline] |
void gnash::TextField::setBullet | ( | bool | b | ) |
References gnash::key::b.
Referenced by setTextFormat().
void gnash::TextField::setDisplay | ( | TextFormatDisplay | display | ) |
References gnash::DisplayObject::set_invalidated(), and display().
Referenced by setTextFormat().
void gnash::TextField::setDrawBackground | ( | bool | draw | ) |
Specify whether to draw the background.
draw | If true the background of this TextField will be drawn |
References gnash::DisplayObject::set_invalidated().
void gnash::TextField::setDrawBorder | ( | bool | draw | ) |
Specify whether to draw the border.
draw | If true the border of this TextField will be drawn |
References gnash::DisplayObject::set_invalidated().
void gnash::TextField::setEmbedFonts | ( | bool | use | ) |
Set whether this TextField should use embedded font glyphs, or use device font glyphs.
use |
References gnash::DisplayObject::set_invalidated().
boost::intrusive_ptr< const Font > gnash::TextField::setFont | ( | boost::intrusive_ptr< const Font > | newfont | ) |
Set our font, return previously set one.
newfont | Will be stored in an intrusive_ptr |
References gnash::DisplayObject::set_invalidated().
Referenced by TextField().
void gnash::TextField::setFontHeight | ( | boost::uint16_t | h | ) |
References gnash::DisplayObject::set_invalidated(), and gnash::key::h.
Referenced by setTextFormat().
void gnash::TextField::setHeight | ( | double | height | ) | [virtual] |
Override of DisplayObject::setHeight.
TextField height currently behaves differently from MovieClip height
Reimplemented from gnash::DisplayObject.
References getBounds(), gnash::SWFRect::set_to_rect(), gnash::SWFRect::get_x_min(), gnash::SWFRect::get_y_min(), and gnash::SWFRect::get_x_max().
void gnash::TextField::setHScroll | ( | size_t | hScroll | ) | [inline] |
void gnash::TextField::setHtml | ( | bool | on | ) | [inline] |
Set html parameter.
on | If true HTML tags in the text will be parsed and rendered |
Referenced by keyInput().
void gnash::TextField::setIndent | ( | boost::uint16_t | h | ) |
References gnash::DisplayObject::set_invalidated(), and gnash::key::h.
Referenced by setTextFormat().
void gnash::TextField::setLeading | ( | boost::int16_t | h | ) |
References gnash::DisplayObject::set_invalidated(), and gnash::key::h.
Referenced by setTextFormat().
void gnash::TextField::setLeftMargin | ( | boost::uint16_t | h | ) |
References gnash::DisplayObject::set_invalidated(), and gnash::key::h.
Referenced by setTextFormat().
void gnash::TextField::setMaxHScroll | ( | size_t | maxHScroll | ) | [inline] |
void gnash::TextField::setMaxScroll | ( | size_t | maxScroll | ) | [inline] |
void gnash::TextField::setRestrict | ( | const std::string & | restrict | ) |
References gnash::key::i, _, gnash::key::q, and gnash::key::p.
void gnash::TextField::setRightMargin | ( | boost::uint16_t | h | ) |
References gnash::DisplayObject::set_invalidated(), and gnash::key::h.
Referenced by setTextFormat().
void gnash::TextField::setScroll | ( | size_t | scroll | ) | [inline] |
void gnash::TextField::setSelectable | ( | bool | v | ) | [inline] |
void gnash::TextField::setSelection | ( | int | start, |
int | end | ||
) |
Set the current selection.
start | The index of the beginning of the selection. |
end | The index of the end of the selection. If start is greater than end, the values are swapped, ensuring end is never less than start. |
References start, and gnash::image::end().
void gnash::TextField::setTabStops | ( | const std::vector< int > & | tabStops | ) |
References gnash::key::i, gnash::pixelsToTwips(), and gnash::DisplayObject::set_invalidated().
Referenced by setTextFormat().
void gnash::TextField::setTarget | ( | std::string | target | ) |
References gnash::DisplayObject::set_invalidated().
Referenced by setTextFormat().
void gnash::TextField::setTextColor | ( | const rgba & | col | ) |
Set color of the text.
col | RGBA Object with color information. Text in this TextField will be displayed in this color. |
References gnash::DisplayObject::set_invalidated(), gnash::renderer::opengl::for_each(), gnash::SWF::TextRecord::setColor(), and gnash::key::_1.
Referenced by setTextFormat().
void gnash::TextField::setTextFormat | ( | TextFormat_as & | tf | ) |
References gnash::TextFormat_as::align(), setAlignment(), gnash::TextFormat_as::size(), setFontHeight(), gnash::TextFormat_as::indent(), setIndent(), gnash::TextFormat_as::blockIndent(), setBlockIndent(), gnash::TextFormat_as::leading(), setLeading(), gnash::TextFormat_as::leftMargin(), setLeftMargin(), gnash::TextFormat_as::rightMargin(), setRightMargin(), gnash::TextFormat_as::color(), setTextColor(), gnash::TextFormat_as::underlined(), setUnderlined(), gnash::TextFormat_as::bullet(), setBullet(), setDisplay(), gnash::TextFormat_as::display(), gnash::TextFormat_as::tabStops(), setTabStops(), gnash::TextFormat_as::url(), setURL(), gnash::TextFormat_as::target(), and setTarget().
void gnash::TextField::setTextValue | ( | const std::wstring & | wstr | ) |
Set our text to the given string.
This function will also update any registered variable
References updateText(), gnash::getSWFVersion(), gnash::getObject(), gnash::as_object::set_member(), and gnash::utf8::encodeCanonicalString().
Referenced by TextField(), and keyInput().
void gnash::TextField::setType | ( | TypeValue | val | ) | [inline] |
Set type (input or dynamic)
val | The TypeValue to use, no-op if typeInvalid. |
References typeInvalid.
void gnash::TextField::setUnderlined | ( | bool | v | ) |
References gnash::DisplayObject::set_invalidated(), and test::v.
Referenced by setTextFormat().
void gnash::TextField::setURL | ( | std::string | url | ) |
References gnash::DisplayObject::set_invalidated(), and url.
Referenced by setTextFormat().
void gnash::TextField::setWidth | ( | double | width | ) | [virtual] |
Override of DisplayObject::setWidth.
TextField width currently behaves differently from MovieClip width
Reimplemented from gnash::DisplayObject.
References getBounds(), gnash::SWFRect::set_to_rect(), gnash::SWFRect::get_x_min(), gnash::SWFRect::get_y_min(), and gnash::SWFRect::get_y_max().
void gnash::TextField::setWordWrap | ( | bool | on | ) |
Set wordWrap parameter.
on | If true text hitting bounding box limits will continue to next line. If false, either text will be truncated or bounding box expanded, depending on autoSize (see getAutoSize) |
References gnash::DisplayObject::set_invalidated().
InteractiveObject * gnash::TextField::topmostMouseEntity | ( | boost::int32_t | x, |
boost::int32_t | y | ||
) | [virtual] |
Returns a pointer to the topmost InteractiveObject at (x,y)
x | x-coordinate |
y | y-coordinate |
Implements gnash::InteractiveObject.
References gnash::DisplayObject::visible(), gnash::key::m, gnash::getMatrix(), gnash::key::p, gnash::SWFMatrix::invert(), gnash::SWFMatrix::transform(), gnash::SWFRect::point_test(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
const char * gnash::TextField::typeValueName | ( | TypeValue | val | ) | [static] |
Return type value as a string.
val | Type value (enum) |
References typeInput, and typeDynamic.
void gnash::TextField::updateText | ( | const std::string & | s | ) |
Set our text to the given string by effect of an update of a.
registered variable name This call only updates the text and is only meant to be called by ourselves or by MovieClip when a registered TextVariable is updated.
References gnash::getSWFVersion(), gnash::getObject(), and gnash::utf8::decodeCanonicalString().
Referenced by setTextValue(), and set_variable_name().