summaryrefslogtreecommitdiff
path: root/src/cat/LuaScriptInterface.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-09-17 11:20:58 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-09-17 11:20:58 (GMT)
commit6e44ebc358d1206c147f514225373da07b43c015 (patch)
tree35e97c28991c4aff46a9e5a4182b53dedb26e7ee /src/cat/LuaScriptInterface.cpp
parente52e9ce91ccca13115fec0fdb0111e7e5d39d10d (diff)
downloadpowder-6e44ebc358d1206c147f514225373da07b43c015.zip
powder-6e44ebc358d1206c147f514225373da07b43c015.tar.gz
Checkbox, Slider and ProgressBar components for ui API
Diffstat (limited to 'src/cat/LuaScriptInterface.cpp')
-rw-r--r--src/cat/LuaScriptInterface.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp
index 98bd5ba..ff282ff 100644
--- a/src/cat/LuaScriptInterface.cpp
+++ b/src/cat/LuaScriptInterface.cpp
@@ -31,6 +31,9 @@
#include "LuaButton.h"
#include "LuaLabel.h"
#include "LuaTextbox.h"
+#include "LuaCheckbox.h"
+#include "LuaSlider.h"
+#include "LuaProgressBar.h"
#ifdef WIN
#include <direct.h>
@@ -301,6 +304,9 @@ void LuaScriptInterface::initInterfaceAPI()
Luna<LuaButton>::Register(l);
Luna<LuaLabel>::Register(l);
Luna<LuaTextbox>::Register(l);
+ Luna<LuaCheckbox>::Register(l);
+ Luna<LuaSlider>::Register(l);
+ Luna<LuaProgressBar>::Register(l);
}
int LuaScriptInterface::interface_addComponent(lua_State * l)
@@ -313,6 +319,12 @@ int LuaScriptInterface::interface_addComponent(lua_State * l)
component = Luna<LuaLabel>::get(luaComponent)->GetComponent();
else if(luaComponent = Luna<LuaTextbox>::tryGet(l, 1))
component = Luna<LuaTextbox>::get(luaComponent)->GetComponent();
+ else if(luaComponent = Luna<LuaCheckbox>::tryGet(l, 1))
+ component = Luna<LuaCheckbox>::get(luaComponent)->GetComponent();
+ else if(luaComponent = Luna<LuaSlider>::tryGet(l, 1))
+ component = Luna<LuaSlider>::get(luaComponent)->GetComponent();
+ else if(luaComponent = Luna<LuaProgressBar>::tryGet(l, 1))
+ component = Luna<LuaProgressBar>::get(luaComponent)->GetComponent();
else
luaL_typerror(l, 1, "Component");
if(luacon_ci->Window && component)