mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
TextBox::setOnEditStart(runnable)
This commit is contained in:
parent
175613692f
commit
5669e6ebed
3 changed files with 27 additions and 1 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include "../../graphics/Batch2D.h"
|
||||
#include "../../graphics/Font.h"
|
||||
#include "../../util/stringutil.h"
|
||||
#include "GUI.h"
|
||||
|
||||
using std::string;
|
||||
using std::wstring;
|
||||
|
|
@ -194,6 +195,17 @@ bool TextBox::isValid() const {
|
|||
return valid;
|
||||
}
|
||||
|
||||
void TextBox::setOnEditStart(gui::runnable oneditstart) {
|
||||
onEditStart = oneditstart;
|
||||
}
|
||||
|
||||
void TextBox::focus(GUI* gui) {
|
||||
Panel::focus(gui);
|
||||
if (onEditStart){
|
||||
onEditStart();
|
||||
}
|
||||
}
|
||||
|
||||
void TextBox::keyPressed(int key) {
|
||||
switch (key) {
|
||||
case KEY_BACKSPACE:
|
||||
|
|
@ -241,6 +253,10 @@ wstring TextBox::text() const {
|
|||
return input;
|
||||
}
|
||||
|
||||
void TextBox::text(std::wstring value) {
|
||||
this->input = value;
|
||||
}
|
||||
|
||||
// ============================== InputBindBox ================================
|
||||
InputBindBox::InputBindBox(Binding& binding, vec4 padding)
|
||||
: Panel(vec2(100,32), padding, 0, false),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue