|
|
@@ -45,28 +45,36 @@ template<> void ExtraInit<Document>(lua_State* L, int metatable_index)
|
|
|
AddTypeToElementAsTable<Document>(L);
|
|
|
|
|
|
//create the DocumentFocus table
|
|
|
- lua_getglobal(L,"DocumentFocus");
|
|
|
+ lua_getglobal(L,"DocumentModal");
|
|
|
if(lua_isnoneornil(L,-1))
|
|
|
{
|
|
|
lua_pop(L,1); //pop unsucessful getglobal
|
|
|
lua_newtable(L); //create a table for holding the enum
|
|
|
- lua_pushinteger(L,(int)FocusFlag::None);
|
|
|
+ lua_pushinteger(L,(int)ModalFlag::None);
|
|
|
lua_setfield(L,-2,"None");
|
|
|
- lua_pushinteger(L,(int)FocusFlag::Focus);
|
|
|
- lua_setfield(L,-2,"Focus");
|
|
|
- lua_pushinteger(L, (int)FocusFlag::Modal);
|
|
|
+ lua_pushinteger(L,(int)ModalFlag::Modal);
|
|
|
lua_setfield(L,-2,"Modal");
|
|
|
- lua_pushinteger(L, (int)FocusFlag::FocusPrevious);
|
|
|
- lua_setfield(L, -2, "FocusPrevious");
|
|
|
- lua_pushinteger(L, (int)FocusFlag::ModalPrevious);
|
|
|
- lua_setfield(L, -2, "ModalPrevious");
|
|
|
- lua_pushinteger(L, (int)FocusFlag::FocusDocument);
|
|
|
- lua_setfield(L, -2, "FocusDocument");
|
|
|
- lua_pushinteger(L, (int)FocusFlag::ModalDocument);
|
|
|
- lua_setfield(L, -2, "ModalDocument");
|
|
|
- lua_setglobal(L,"DocumentFocus");
|
|
|
-
|
|
|
+ lua_pushinteger(L, (int)ModalFlag::Previous);
|
|
|
+ lua_setfield(L,-2,"Previous");
|
|
|
+ lua_setglobal(L,"DocumentModal");
|
|
|
}
|
|
|
+
|
|
|
+ //create the DocumentFocus table
|
|
|
+ lua_getglobal(L, "DocumentFocus");
|
|
|
+ if (lua_isnoneornil(L, -1))
|
|
|
+ {
|
|
|
+ lua_pop(L, 1); //pop unsucessful getglobal
|
|
|
+ lua_newtable(L); //create a table for holding the enum
|
|
|
+ lua_pushinteger(L, (int)FocusFlag::None);
|
|
|
+ lua_setfield(L, -2, "None");
|
|
|
+ lua_pushinteger(L, (int)FocusFlag::Document);
|
|
|
+ lua_setfield(L, -2, "Document");
|
|
|
+ lua_pushinteger(L, (int)FocusFlag::Previous);
|
|
|
+ lua_setfield(L, -2, "Modal");
|
|
|
+ lua_pushinteger(L, (int)FocusFlag::Auto);
|
|
|
+ lua_setfield(L, -2, "Auto");
|
|
|
+ lua_setglobal(L, "DocumentFocus");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//methods
|
|
|
@@ -87,11 +95,17 @@ int DocumentShow(lua_State* L, Document* obj)
|
|
|
int top = lua_gettop(L);
|
|
|
if(top == 0)
|
|
|
obj->Show();
|
|
|
- else
|
|
|
+ else if(top == 1)
|
|
|
{
|
|
|
- FocusFlag flag = (FocusFlag)luaL_checkinteger(L,1);
|
|
|
- obj->Show(flag);
|
|
|
+ ModalFlag modal = (ModalFlag)luaL_checkinteger(L,1);
|
|
|
+ obj->Show(modal);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ModalFlag modal = (ModalFlag)luaL_checkinteger(L,1);
|
|
|
+ FocusFlag focus = (FocusFlag)luaL_checkinteger(L,2);
|
|
|
+ obj->Show(modal, focus);
|
|
|
+ }
|
|
|
return 0;
|
|
|
}
|
|
|
|