summaryrefslogtreecommitdiff
path: root/client/widgets/checkbox.h
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/checkbox.h')
-rw-r--r--client/widgets/checkbox.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/client/widgets/checkbox.h b/client/widgets/checkbox.h
index 92cc4b3..ce31a62 100644
--- a/client/widgets/checkbox.h
+++ b/client/widgets/checkbox.h
@@ -30,11 +30,18 @@
#include "widget.h"
#include <QDomNode>
+#ifdef LUA_CLASS
+#undef LUA_CLASS
+#endif
+#define LUA_CLASS "CheckBox"
+
/***
* CheckBox Widget
* @tag checkbox
+ * @screenshot An example checkbox
+ * <checkbox name="example" truevalue="true" falsevalue="false" value="true"
+ * caption="A simple checkbox"/>
* @extends widget
- * @screenshot
* This widget is used to retrieve boolean values from the user. The widget can
* either be in checked state or unschecked state. The value of the widget
* depends on its state and the values of the falseval and trueval attributes.
@@ -51,6 +58,8 @@ public:
CheckBox(QDomNode &node, MacroWindow *macrowindow);
~CheckBox();
+ virtual QString luaclass() { return LUA_CLASS; }
+
QString value();
void setValue(QString value, QString source = "");
@@ -98,7 +107,7 @@ inline void register_checkbox(lua_State *L)
{
register_widget(L);
- luaL_newmetatable(L, "CheckBox");
+ luaL_newmetatable(L, LUA_CLASS);
lua_pushliteral(L, "__index");
lua_pushvalue(L, -2);
lua_rawset(L, -3);