Hi Les,
im trying following Code at SIM and cant change the Layer.
void OnEnter(void)
{
SetDisplayMode(scDISPLAY_FULL);
m_parent->NotifyLua(notifySHOW);
((cSim *)m_parent)->CreateTool(toolPARALLEL);
((cSim *)m_parent)->m_active = true;
m_parent->GlRedraw();
// Begin Inserted ------------------------------------------------------
for( ; ; )
{
if (m_parent->Lock(L"Test") == true) break;
else
{
m_parent->Debug(L"SC-Lock failed");
m_parent->Unlock();
}
}
m_parent->Debug(L"SC-Locked");
// SC crashes
// if(m_parent->SetLayer(L"A new layer1") == true) m_parent->Debug(L"Layer changed");
// else m_parent->Debug(L"Layer not changed");
m_parent->StartTempOutline();
// Set Layer doesnt change Layer, returns false
if(m_parent->SetLayer(L"A new layer1") == true) m_parent->Debug(L"Layer changed");
else m_parent->Debug(L"Layer not changed");
own_scSEGMENT.type = scSEGMENT_LINE;
own_scSEGMENT.start.x = 50;
own_scSEGMENT.start.y = 100;
own_scSEGMENT.end.x = 20;
own_scSEGMENT.end.y = 100;
// AddSegment returns true and will be displayed
if (m_parent->AddSegment( &own_scSEGMENT)== true) m_parent->Debug(L"Add Segment OK");
else m_parent->Debug(L"Add Segment failed");
// also returns false
if(m_parent->SetLayer(L"A new layer1") == true) m_parent->Debug(L"Layer changed");
else m_parent->Debug(L"Layer not changed");
// CopyTempOutline returns false
if (m_parent->CopyTempOutline()== true) m_parent->Debug(L"Copy Temp Outline OK");
else m_parent->Debug(L"Copy Temp Outline failed");
m_parent->EndTempOutline();
for(i=1; i< 65550;i++) // only delay for test
{
for(i1=1; i1 < 5550;i1++)
{}
}
m_parent->Unlock();
m_parent->Debug(L"SC-UnLocked");
// End: Inserted ------------------------------------------------------
}
do you have any idea what is wrong ?
Thank you in advance,
Bernd