DeepCover Embedded Security in IoT: Public-key Secured Data Paths
Dependencies: MaximInterface
Text Class Reference
Text graphical primitive. More...
#include <Text.hpp>
Inherits Graphic.
Public Member Functions | |
const ChildContainer & | children () const |
List of child graphics for this parent. | |
bool | focused () const |
Check if this graphic is focused. | |
void | setFocused () |
Set this graphic as the focused graphic. | |
void | move (int x, int y) |
Move graphic to a new location measured in pixels. | |
void | resize (int width, int height) |
Resize graphic to a new size measure in pixels. | |
bool | update (Bitmap *canvas) |
Update this graphic and all child graphics. | |
bool | processKey (Key key) |
Process a key-press input event. | |
Text | |
const std::string & | text () const |
void | setText (const std::string &text) |
Word wrap | |
Lines will be wrapped when they are too long to be displayed with the current width. | |
bool | wordWrap () const |
void | setWordWrap (bool wordWrap) |
Character spacing | |
int | charSpacing () const |
void | setCharSpacing (int charSpacing) |
int | lineSpacing () const |
void | setLineSpacing (int lineSpacing) |
int | preferredWidth () const |
Preferred width and height calculated after word wrapping. | |
Parent | |
Get or set the parent graphic of this graphic. Set to NULL if this graphic has no parent. | |
Graphic * | parent () |
const Graphic * | parent () const |
void | setParent (Graphic *parent) |
int | x () const |
Coordinates of this graphic in pixels. | |
int | width () const |
Displayed dimensions of this graphic in pixels. | |
void | render (Bitmap &bitmap, int xOffset, int yOffset) const |
Render this graphic onto a bitmap. | |
Protected Member Functions | |
virtual void | resized () |
Event handler for when this graphic has been resized. | |
virtual void | doRender (Bitmap &bitmap, int xOffset, int yOffset) const |
Render this graphic onto a bitmap. | |
void | invalidate () |
Mark the visual region as invalid. | |
virtual void | childrenChanged () |
Event handler for when a child is added or removed. | |
virtual void | focusChanged (bool focused) |
Event handler for when this graphic has been focused or unfocused. | |
virtual void | moved () |
Event handler for when this graphic has been moved. | |
virtual void | updated () |
Event handler for when this graphic has been updated. | |
virtual bool | doProcessKey (Key) |
Process a key-press input event. |
Detailed Description
Text graphical primitive.
Definition at line 41 of file Text.hpp.
Member Function Documentation
const ChildContainer& children | ( | ) | const [inherited] |
List of child graphics for this parent.
- Note:
- Children should be added and removed by calling setParent. Children will be removed automatically when they are destroyed.
Definition at line 73 of file Graphic.hpp.
void childrenChanged | ( | ) | [protected, virtual, inherited] |
Event handler for when a child is added or removed.
Definition at line 231 of file Graphic.cpp.
bool doProcessKey | ( | Key | ) | [protected, virtual, inherited] |
Process a key-press input event.
- Returns:
- True if the key event was handled. False if the key event should be propagated.
Reimplemented in Button, DisplayIdWindow, HardwareTestWindow, InitWindow, NormalOperationWindow, and WifiConnectWindow.
Definition at line 241 of file Graphic.cpp.
void doRender | ( | Bitmap & | bitmap, |
int | xOffset, | ||
int | yOffset | ||
) | const [protected, virtual] |
void focusChanged | ( | bool | focused ) | [protected, virtual, inherited] |
Event handler for when this graphic has been focused or unfocused.
- Parameters:
-
focused True if focused or false if unfocused.
Reimplemented in Button.
Definition at line 233 of file Graphic.cpp.
bool focused | ( | ) | const [inherited] |
Check if this graphic is focused.
- Returns:
- True if focused.
Definition at line 78 of file Graphic.cpp.
void invalidate | ( | ) | [protected, inherited] |
Mark the visual region as invalid.
- Note:
- Indicates a redraw is necessary during next update.
Definition at line 143 of file Graphic.hpp.
void move | ( | int | x, |
int | y | ||
) | [inherited] |
Move graphic to a new location measured in pixels.
Coordinates are relative to the top-left corner of the parent graphic.
- See also:
- moved
Definition at line 114 of file Graphic.cpp.
void moved | ( | ) | [protected, virtual, inherited] |
Event handler for when this graphic has been moved.
Definition at line 235 of file Graphic.cpp.
int preferredWidth | ( | ) | const |
bool processKey | ( | Key | key ) | [inherited] |
Process a key-press input event.
The event will first be directed to the focused graphic. Processing will proceed to each parent graphic until it has been handled.
- See also:
- doProcessKey
- Returns:
- True if the key event was handled.
Definition at line 216 of file Graphic.cpp.
void render | ( | Bitmap & | bitmap, |
int | xOffset, | ||
int | yOffset | ||
) | const [inherited] |
Render this graphic onto a bitmap.
Definition at line 155 of file Graphic.cpp.
void resize | ( | int | width, |
int | height | ||
) | [inherited] |
Resize graphic to a new size measure in pixels.
Minimum width and height is 1.
- See also:
- resized
Definition at line 123 of file Graphic.cpp.
void resized | ( | ) | [protected, virtual] |
void setFocused | ( | ) | [inherited] |
Set this graphic as the focused graphic.
The focused graphic is the first to receive input events such as key presses.
- See also:
- focusChanged
Definition at line 89 of file Graphic.cpp.
void setParent | ( | Graphic * | parent ) | [inherited] |
- Note:
- Adds this graphic to the parent's list of children.
- See also:
- childrenChanged
Definition at line 53 of file Graphic.cpp.
bool update | ( | Bitmap * | canvas ) | [inherited] |
Update this graphic and all child graphics.
Checks if graphic has been invalidated and should be redrawn.
- Parameters:
-
canvas Canvas used for rendering. May be set to NULL to defer redraw.
- Returns:
- True if the canvas has been updated.
- See also:
- updated
Definition at line 207 of file Graphic.cpp.
void updated | ( | ) | [protected, virtual, inherited] |
Event handler for when this graphic has been updated.
Reimplemented in HardwareTestWindow, InitWindow, NormalOperationWindow, and WifiConnectWindow.
Definition at line 239 of file Graphic.cpp.
int width | ( | ) | const [inherited] |
Displayed dimensions of this graphic in pixels.
Definition at line 99 of file Graphic.hpp.
int x | ( | ) | const [inherited] |
Coordinates of this graphic in pixels.
Coordinates are relative to the top-left corner of the parent graphic.
Definition at line 91 of file Graphic.hpp.
Generated on Tue Jul 12 2022 12:06:51 by 1.7.2