class ffw::GuiScrollableTextInput
Class List > ffw :: GuiScrollableTextInput
Create a user input text widget with a scroll bar. More...
Inherits the following classes: ffw::GuiScrollable
Classes
Type | Name |
---|---|
class | Inner |
struct | Style |
Public Functions
Type | Name |
---|---|
GuiScrollableTextInput (GuiWindow * context, bool editable = true) | |
virtual | ~GuiScrollableTextInput () = default |
const GuiTextInput * | getInner () const |
GuiTextInput * | getInner () |
void | setValue (const std::string & str) |
std::string | getValue () const |
void | appendValue (const std::string & str) |
const std::vector< std::unique_ptr< GuiTextInput::Line > > & | getLines () const |
bool | isEmpty () const |
void | setStyle (const GuiScrollableTextInput::Style * style, bool defaults = false) |
Detailed Description
auto gui = ffw::GuiWindowNanoVG(nvg);
auto root = gui.getLayout();
auto input = new ffw::GuiScrollableTextInput(&gui);
input->setSize(ffw::guiPercent(100.0f), ffw::guiPixels(100.0f));
input->setValue("Lorem ipsum dolor sit amet....");
auto text = input->getValue(); // Returns the string above
root->addWidget(text);
// Do not free the created widgets! They will be deleted by the gui window!
while(true){
// Render the gui
}
Public Functions Documentation
function GuiScrollableTextInput
ffw::GuiScrollableTextInput::GuiScrollableTextInput (
GuiWindow * context,
bool editable = true
)
function ~GuiScrollableTextInput
virtual ffw::GuiScrollableTextInput::~GuiScrollableTextInput () = default
function getInner (1/2)
const GuiTextInput * ffw::GuiScrollableTextInput::getInner () const
function getInner (2/2)
GuiTextInput * ffw::GuiScrollableTextInput::getInner ()
function setValue
void ffw::GuiScrollableTextInput::setValue (
const std::string & str
)
function getValue
std::string ffw::GuiScrollableTextInput::getValue () const
function appendValue
void ffw::GuiScrollableTextInput::appendValue (
const std::string & str
)
function getLines
const std::vector< std::unique_ptr< GuiTextInput::Line > > & ffw::GuiScrollableTextInput::getLines () const
function isEmpty
bool ffw::GuiScrollableTextInput::isEmpty () const
function setStyle
void ffw::GuiScrollableTextInput::setStyle (
const GuiScrollableTextInput::Style * style,
bool defaults = false
)
The documentation for this class was generated from the following file: include/ffw/gui/guitextedit.h