예제 #1
0
파일: LuaUtils.cpp 프로젝트: Arkazon/spring
static bool RestoreTable(const LuaUtils::DataDump &d, lua_State* dst, int depth) {
	if (depth++ > maxDepth) {
		lua_pushnil(dst);
		return false;
	}

	lua_newtable(dst);
	for (std::vector<std::pair<LuaUtils::DataDump, LuaUtils::DataDump> >::const_iterator i = d.table.begin(); i != d.table.end(); ++i) {
		RestoreData((*i).first, dst, depth);
		RestoreData((*i).second, dst, depth);
		lua_rawset(dst, -3);
	}

	return true;
}
예제 #2
0
/* Get the next record from the history */
const UInt16 GetHistoryNext( void )
{
    if ( history.currentRecord == history.lastRecord )
        return NO_RECORD;

    RollHistoryIndex( &history.currentRecord );

    RestoreData();

    return history.records[ history.currentRecord ].recordId;
}
예제 #3
0
파일: LuaUtils.cpp 프로젝트: Arkazon/spring
int LuaUtils::Restore(const std::vector<LuaUtils::DataDump> &backup, lua_State* dst) {
	const int dstTop = lua_gettop(dst);
	int count = backup.size();
	lua_checkstack(dst, count); // FIXME: not enough for table chains

	for (std::vector<DataDump>::const_iterator i = backup.begin(); i != backup.end(); ++i) {
		RestoreData(*i, dst, 0);
	}
	lua_settop(dst, dstTop + count);

	return count;
}
예제 #4
0
/* Get the previous record from the history */
const UInt16 GetHistoryPrev( void )
{
    if ( history.currentRecord == history.firstRecord )
        return NO_RECORD;

    if ( --history.currentRecord < 0 )
        history.currentRecord = HISTORYSIZE - 1;

    RestoreData();

    return history.records[ history.currentRecord ].recordId;
}
예제 #5
0
파일: EditPage7.cpp 프로젝트: hkaiser/TRiAS
void CEditPage7::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CEditPage7)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
	DDX_Text(pDX, IDC_ETXT1, m_strEig[0]);
	DDX_Text(pDX, IDC_ETXT2, m_strEig[1]);
	DDX_Text(pDX, IDC_ETXT3, m_strEig[2]);
	DDX_Text(pDX, IDC_ETXT4, m_strEig[3]);
	short	i = m_iEigZahl - m_iOffset;

	if ( i > 0 )
	{	SpecialDDX_Text(pDX, IDC_NTXT1, m_strName[0]);
		SpecialDDX_Text(pDX, IDC_STXT1, m_strStr[0]);
		SpecialDDX_Text(pDX, IDC_PTXT1, m_strPLZ[0]);
		SpecialDDX_Text(pDX, IDC_EDIT1, m_strOrt[0]);
		SpecialDDX_Text(pDX, IDC_EDIT2, m_lZaehl[0]);
		SpecialDDX_Text(pDX, IDC_EDIT3, m_lNenn[0]);
		SpecialDDX_Text(pDX, IDC_EDIT4, m_strTeil[0]);
		SpecialDDX_Check(pDX, IDC_CHK1, m_bHer[0]);
		ShowControl(pDX, IDC_FRAME1);
	}
	else
	{	ShowControl(pDX, IDC_NTXT1, FALSE);
		ShowControl(pDX, IDC_STXT1, FALSE);
		ShowControl(pDX, IDC_PTXT1, FALSE);
		ShowControl(pDX, IDC_EDIT1, FALSE);
		ShowControl(pDX, IDC_EDIT2, FALSE);
		ShowControl(pDX, IDC_EDIT3, FALSE);
		ShowControl(pDX, IDC_EDIT4, FALSE);
		ShowControl(pDX, IDC_CHK1, FALSE);
		ShowControl(pDX, IDC_FRAME1, FALSE);
	}
	

	if ( i > 1 )
	{	SpecialDDX_Text(pDX, IDC_NTXT2, m_strName[1]);
		SpecialDDX_Text(pDX, IDC_STXT2, m_strStr[1]);
		SpecialDDX_Text(pDX, IDC_PTXT2, m_strPLZ[1]);
		SpecialDDX_Text(pDX, IDC_EDIT5, m_strOrt[1]);
		SpecialDDX_Text(pDX, IDC_EDIT6, m_lZaehl[1]);
		SpecialDDX_Text(pDX, IDC_EDIT7, m_lNenn[1]);
		SpecialDDX_Text(pDX, IDC_EDIT8, m_strTeil[1]);
		SpecialDDX_Check(pDX, IDC_CHK2, m_bHer[1]);
		ShowControl(pDX, IDC_FRAME2);
	}
	else
	{	ShowControl(pDX, IDC_NTXT2, FALSE);
		ShowControl(pDX, IDC_STXT2, FALSE);
		ShowControl(pDX, IDC_PTXT2, FALSE);
		ShowControl(pDX, IDC_EDIT5, FALSE);
		ShowControl(pDX, IDC_EDIT6, FALSE);
		ShowControl(pDX, IDC_EDIT7, FALSE);
		ShowControl(pDX, IDC_EDIT8, FALSE);
		ShowControl(pDX, IDC_CHK2, FALSE);
		ShowControl(pDX, IDC_FRAME2, FALSE);
	}

	if ( i > 2 )
	{	SpecialDDX_Text(pDX, IDC_NTXT3, m_strName[2]);
		SpecialDDX_Text(pDX, IDC_STXT3, m_strStr[2]);
		SpecialDDX_Text(pDX, IDC_PTXT3, m_strPLZ[2]);
		SpecialDDX_Text(pDX, IDC_EDIT53, m_strOrt[2]);
		SpecialDDX_Text(pDX, IDC_EDIT9, m_lZaehl[2]);
		SpecialDDX_Text(pDX, IDC_EDIT10, m_lNenn[2]);
		SpecialDDX_Text(pDX, IDC_EDIT11, m_strTeil[2]);
		SpecialDDX_Check(pDX, IDC_CHK3, m_bHer[2]);
		ShowControl(pDX, IDC_FRAME3);
	}
	else
	{	ShowControl(pDX, IDC_NTXT3, FALSE);
		ShowControl(pDX, IDC_STXT3, FALSE);
		ShowControl(pDX, IDC_PTXT3, FALSE);
		ShowControl(pDX, IDC_EDIT53, FALSE);
		ShowControl(pDX, IDC_EDIT9, FALSE);
		ShowControl(pDX, IDC_EDIT10, FALSE);
		ShowControl(pDX, IDC_EDIT11, FALSE);
		ShowControl(pDX, IDC_CHK3, FALSE);
		ShowControl(pDX, IDC_FRAME3, FALSE);
	}

	if ( i > 3 )
	{	SpecialDDX_Text(pDX, IDC_NTXT4, m_strName[3]);
		SpecialDDX_Text(pDX, IDC_STXT4, m_strStr[3]);
		SpecialDDX_Text(pDX, IDC_PTXT4, m_strPLZ[3]);
		SpecialDDX_Text(pDX, IDC_EDIT12, m_strOrt[3]);
		SpecialDDX_Text(pDX, IDC_EDIT13, m_lZaehl[3]);
		SpecialDDX_Text(pDX, IDC_EDIT14, m_lNenn[3]);
		SpecialDDX_Text(pDX, IDC_EDIT15, m_strTeil[3]);
		SpecialDDX_Check(pDX, IDC_CHK4, m_bHer[3]);
		ShowControl(pDX, IDC_FRAME4);
	}
	else
	{	ShowControl(pDX, IDC_NTXT4, FALSE);
		ShowControl(pDX, IDC_STXT4, FALSE);
		ShowControl(pDX, IDC_PTXT4, FALSE);
		ShowControl(pDX, IDC_EDIT12, FALSE);
		ShowControl(pDX, IDC_EDIT13, FALSE);
		ShowControl(pDX, IDC_EDIT14, FALSE);
		ShowControl(pDX, IDC_EDIT15, FALSE);
		ShowControl(pDX, IDC_CHK4, FALSE);
		ShowControl(pDX, IDC_FRAME4, FALSE);
	}

	if ( pDX -> m_bSaveAndValidate )		RestoreData();
}