summaryrefslogtreecommitdiff
path: root/iup/srclua5/olecontrol.lua
diff options
context:
space:
mode:
Diffstat (limited to 'iup/srclua5/olecontrol.lua')
-rwxr-xr-xiup/srclua5/olecontrol.lua54
1 files changed, 54 insertions, 0 deletions
diff --git a/iup/srclua5/olecontrol.lua b/iup/srclua5/olecontrol.lua
new file mode 100755
index 0000000..902977b
--- /dev/null
+++ b/iup/srclua5/olecontrol.lua
@@ -0,0 +1,54 @@
+------------------------------------------------------------------------------
+-- OleControl class
+------------------------------------------------------------------------------
+local ctrl = {
+ nick = "olecontrol",
+ parent = WIDGET,
+ creation = "s",
+ funcname = "OleControl",
+ callback = {},
+ include = "iupole.h",
+ extracode = [[
+int iupolelua_open(lua_State* L)
+{
+ if (iuplua_opencall_internal(L))
+ IupOleControlOpen();
+
+ iuplua_changeEnv(L);
+ iupolecontrollua_open(L);
+ iuplua_returnEnv(L);
+ return 0;
+}
+
+/* obligatory to use require"iupluaole" */
+int luaopen_iupluaole(lua_State* L)
+{
+ return iupolelua_open(L);
+}
+
+/* obligatory to use require"iupluaole51" */
+int luaopen_iupluaole51(lua_State* L)
+{
+ return iupolelua_open(L);
+}
+
+]]
+}
+
+function ctrl.createElement(class, arg)
+ return OleControl(arg[1])
+end
+
+function ctrl.CreateLuaCOM(handle)
+ -- if luacom is loaded, use it to access methods and properties
+ -- of the control
+ if luacom then
+ local punk = handle.iunknown
+ if punk then
+ handle.com = luacom.CreateLuaCOM(luacom.ImportIUnknown(punk))
+ end
+ end
+end
+
+iupRegisterWidget(ctrl)
+iupSetClass(ctrl, "iup widget")