TextBox::setOnEditStart(runnable)
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user