aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander <alex@cogarr.net>2019-02-10 18:12:16 -0500
committerAlexander <alex@cogarr.net>2019-02-10 18:12:16 -0500
commit903f857ab0b10d9093aa89feb34827f4a0dd5f6f (patch)
tree5e590c653a46d845dfe5f971eb24e0db770e0317
parent5478f357b62062ffccfecb4c7b5fc607f0e7a518 (diff)
downloadbrokengine-903f857ab0b10d9093aa89feb34827f4a0dd5f6f.tar.gz
brokengine-903f857ab0b10d9093aa89feb34827f4a0dd5f6f.tar.bz2
brokengine-903f857ab0b10d9093aa89feb34827f4a0dd5f6f.zip
Corrected callback and added function for editbox
Corrected the callback "onChanged" for edit boxes Also added a set_multiline(boolean) function, which sets if the textbox is multiline or not.
-rw-r--r--src/client/lua_api/gui/iguieditbox.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client/lua_api/gui/iguieditbox.cpp b/src/client/lua_api/gui/iguieditbox.cpp
index 6e4efa9..7de3f37 100644
--- a/src/client/lua_api/gui/iguieditbox.cpp
+++ b/src/client/lua_api/gui/iguieditbox.cpp
@@ -65,7 +65,7 @@ static int newiguieditbox(lua_State* L){
lua_setmetatable(L,-2);//{editbox}
setelementcallback(L,EGET_EDITBOX_ENTER,"onEnter");
- setelementcallback(L,EGET_EDITBOX_CHANGED,"onChanged");
+ setelementcallback(L,EGET_EDITBOX_CHANGED,"onChange");
setelementcallback(L,EGET_EDITBOX_MARKING_CHANGED,"onMarkChange");
printf("Done creating editbox\n");
@@ -73,6 +73,16 @@ static int newiguieditbox(lua_State* L){
return 1;
}
+//self:setmultiline(bool_enabled)
+int set_multiline(lua_State *L){
+ int should = lua_toboolean(L,-1);
+ lua_pop(L,1);
+ lua_getfield(L,-1,"guielement");
+ IGUIEditBox *e = (IGUIEditBox*)lua_touserdata(L,-1);
+ lua_pop(L,2);
+ e->setMultiLine(should == 1);
+ return 0;
+}
static const luaL_reg iguieditbox_f[] = {
{"neweditbox",newiguieditbox},
@@ -80,6 +90,7 @@ static const luaL_reg iguieditbox_f[] = {
};
static const luaL_reg iguieditbox_m[] = {
+ {"set_multiline",set_multiline},
{0,0},
};