forked from Kolyah35/minecraft-pe-0.6.1
the whole game
This commit is contained in:
37
src/client/gui/components/TextBox.cpp
Executable file
37
src/client/gui/components/TextBox.cpp
Executable file
@@ -0,0 +1,37 @@
|
||||
#include "TextBox.h"
|
||||
#include "../../Minecraft.h"
|
||||
#include "../../../AppPlatform.h"
|
||||
TextBox::TextBox( int id, const std::string& msg )
|
||||
: id(0), w(0), h(0), x(0), y(0), text(msg), focused(false) {
|
||||
|
||||
}
|
||||
|
||||
TextBox::TextBox( int id, int x, int y, const std::string& msg )
|
||||
: id(id), w(0), h(0), x(x), y(y), text(msg), focused(false) {
|
||||
|
||||
}
|
||||
|
||||
TextBox::TextBox( int id, int x, int y, int w, int h, const std::string& msg )
|
||||
: id(id), w(w), h(h), x(x), y(y), text(msg) {
|
||||
|
||||
}
|
||||
|
||||
void TextBox::setFocus(Minecraft* minecraft) {
|
||||
if(!focused) {
|
||||
minecraft->platform()->showKeyboard();
|
||||
focused = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool TextBox::loseFocus(Minecraft* minecraft) {
|
||||
if(focused) {
|
||||
minecraft->platform()->showKeyboard();
|
||||
focused = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void TextBox::render( Minecraft* minecraft, int xm, int ym ) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user