Esempio n. 1
0
IMPL_LUA_FUNC(LuaWindowExport, ExistsSkinFile)
{
    try
    {
        CLuaWindow* self;
        self = static_cast<CLuaWindow*>(LuaStatic::CheckUserData(l, 1));
        STRINGorID xml(_T(""));
        if (lua_isnumber(l, 2))
            xml = STRINGorID(lua_tointeger(l, 2));
        else if (lua_isstring(l, 2))
        {
            CDuiString pstrText;
            lua_op_t<CDuiString>::lua_to_value(l, 2, pstrText);
            xml = STRINGorID(pstrText.GetData());
        }
        LPCTSTR type = NULL;
        if (lua_isstring(l, 3))
        {
            CDuiString pstrText;
            lua_op_t<CDuiString>::lua_to_value(l, 3, pstrText);
            type = pstrText.GetData();
        }
        lua_pushboolean(l, self->ExistsSkinFile(xml,type) ? 1 : 0);
        return 1;
    }
    catch (...)
    {
        DuiException(_T("LuaWindowExport::ExistsSkinFile"));
        return 0;
    }
}
Esempio n. 2
0
IMPL_LUA_FUNC(LuaWindowExport, RegisterSkin)
{
    try
    {
        CLuaWindow* self;
        self = static_cast<CLuaWindow*>(LuaStatic::CheckUserData(l, 1));
        STRINGorID xml(_T(""));
        if (lua_isnumber(l, 2))
            xml = STRINGorID(lua_tointeger(l, 2));
        else if (lua_isstring(l, 2))
        {
            CDuiString pstrText;
            lua_op_t<CDuiString>::lua_to_value(l, 2, pstrText);
            xml = STRINGorID(pstrText.GetData());
        }
        LPCTSTR type = NULL;
        if (lua_isstring(l, 3))
        {
            CDuiString pstrText;
            lua_op_t<CDuiString>::lua_to_value(l, 3, pstrText);
            type = pstrText.GetData();
        }
        IDialogBuilderCallback* pCallBack = static_cast<IDialogBuilderCallback*>(self);
        CControlUI* pParent = NULL;
        if (lua_isuserdata(l,5))
            pParent = static_cast<CControlUI*>(LuaStatic::CheckUserData(l, 5));
        lua_pushboolean(l, self->RegisterSkin(xml, type, pCallBack, pParent) ? 1 : 0);
        return 1;
    }
    catch(...)
    {
        DuiException(_T("LuaWindowExport::MapWindowPoints2"));
        return 0;
    }
}
	IMPL_LUA_FUNC(LuaCDialogBuilder, Create)
	{
		try
		{
			CDialogBuilder* self;
			self = static_cast<CDialogBuilder*>(LuaStatic::CheckUserData(l, 1));
			STRINGorID xml("");
			if (lua_isnumber(l,2))
				xml = STRINGorID(lua_tointeger(l, 2));
			else{
				CDuiString pstrText;
				lua_op_t<CDuiString>::lua_to_value(l, 2, pstrText);

				xml = STRINGorID(pstrText.GetData());
			}

			CDuiString pType;
			lua_op_t<CDuiString>::lua_to_value(l, 3, pType);
			return 1;
		}
		catch (...)
		{
			DuiException(_T("LuaCDialogBuilder::Create"));
			return 0;
		}
	}
Esempio n. 4
0
		virtual void LoadGifImage()
		{
			CDuiString sImag = m_pOwer->GetBkImage();
			m_bLoadImg = true;
			m_pGifImage	=	CRenderEngine::LoadGifImageX(STRINGorID(sImag),0, 0);
			if ( NULL == m_pGifImage ) return;
			m_nFrameCount	=	m_pGifImage->GetNumFrames();
			m_nFramePosition = 0;
			m_nDelay = m_pGifImage->GetFrameDelay();
			if (m_nDelay <= 0 ) 
				m_nDelay = 100;
			if(!m_bAutoStart)
				m_bRealStop = true;
			if(m_bAutoStart && m_pOwer->IsVisible())
				StartAnim();
		}