Skip to content
Snippets Groups Projects
Commit 4f1c3ac3 authored by Joakim Hunskaar's avatar Joakim Hunskaar
Browse files

added multiline option to textbox and textinput

parent bc564132
No related branches found
No related tags found
1 merge request!17added multiline option to textbox and textinput
......@@ -5,7 +5,7 @@ void TDT4102::TextBox::update(nk_context *context) {
nk_style_push_color(context, &s->edit.text_normal, textColor);
nk_style_push_color(context, &s->edit.border_color, borderColor);
nk_style_push_style_item(context, &s->edit.normal, nk_style_item_color(boxColor));
nk_edit_string_zero_terminated(context, NK_EDIT_READ_ONLY, const_cast<char*>(contents.data()), internal::TEXT_BOX_CHARACTER_LIMIT, nk_filter_ascii);
nk_edit_string_zero_terminated(context, NK_EDIT_READ_ONLY | NK_EDIT_MULTILINE, const_cast<char*>(contents.data()), internal::TEXT_BOX_CHARACTER_LIMIT, nk_filter_ascii);
nk_style_pop_color(context);
nk_style_pop_color(context);
nk_style_pop_style_item(context);
......
#include "widgets/TextInput.h"
void TDT4102::TextInput::update(nk_context *context) {
nk_edit_string_zero_terminated(context, NK_EDIT_SELECTABLE | NK_EDIT_ALWAYS_INSERT_MODE | NK_EDIT_BOX | NK_EDIT_SIMPLE, const_cast<char*>(contents.data()), internal::TEXT_INPUT_CHARACTER_LIMIT, nk_filter_ascii);
nk_edit_string_zero_terminated(context, NK_EDIT_SELECTABLE | NK_EDIT_ALWAYS_INSERT_MODE | NK_EDIT_BOX | NK_EDIT_SIMPLE | NK_EDIT_MULTILINE, const_cast<char*>(contents.data()), internal::TEXT_INPUT_CHARACTER_LIMIT, nk_filter_ascii);
// Detect whether any editing of the string has occurred
// Nuklear only reports whether the text box has lost focus
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment