本文整理汇总了C++中ui::CWindow::SetTrashEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ CWindow::SetTrashEvent方法的具体用法?C++ CWindow::SetTrashEvent怎么用?C++ CWindow::SetTrashEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ui::CWindow
的用法示例。
在下文中一共展示了CWindow::SetTrashEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DisplayText
void CDisplayText::DisplayText(const char *text, Math::Vector goal, float height,
float dist, float time, TextType type)
{
CObject* toto;
CMotion* motion;
Ui::CWindow* pw;
Ui::CButton* button;
Ui::CGroup* group;
Ui::CLabel* label;
Math::Point pos, ppos, dim;
Sound sound;
float hLine, hBox;
int nLine, icon, i;
if ( !m_bEnable ) return;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW2));
if ( pw == 0 )
{
pos.x = 0.0f;
pos.y = 0.0f;
dim.x = 0.0f;
dim.y = 0.0f;
pw = m_interface->CreateWindows(pos, dim, 10, EVENT_WINDOW2);
}
hBox = 0.045f;
hLine = m_engine->GetText()->GetHeight(Gfx::FONT_COLOBOT, FONTSIZE);
nLine = 0;
for ( i=0 ; i<MAXDTLINE ; i++ )
{
group = static_cast<CGroup*>(pw->SearchControl(EventType(EVENT_DT_GROUP0+i)));
if ( group == 0 ) break;
nLine ++;
}
if ( nLine == MAXDTLINE )
{
ClearLastText();
nLine --;
}
pos.x = 0.10f;
pos.y = 0.92f-hBox-hBox*nLine;
dim.x = 0.80f;
dim.y = hBox;
icon = 1; // yellow
if ( type == TT_ERROR ) icon = 9; // red
if ( type == TT_WARNING ) icon = 10; // blue
if ( type == TT_INFO ) icon = 8; // green
if ( type == TT_MESSAGE ) icon = 11; // yellow
pw->CreateGroup(pos, dim, icon, EventType(EVENT_DT_GROUP0+nLine));
pw->SetTrashEvent(false);
ppos = pos;
ppos.y -= hLine/2.0f;
label = pw->CreateLabel(ppos, dim, -1, EventType(EVENT_DT_LABEL0+nLine), text);
if ( label != 0 )
{
label->SetFontSize(FONTSIZE);
}
dim.x = dim.y*0.75f;
pos.x -= dim.x;
button = pw->CreateButton(pos, dim, 14, EventType(EVENT_DT_VISIT0+nLine));
if ( goal.x == 0.0f &&
goal.y == 0.0f &&
goal.z == 0.0f )
{
button->ClearState(STATE_ENABLE);
}
m_bExist[nLine] = true;
m_visitGoal[nLine] = goal;
m_visitDist[nLine] = dist;
m_visitHeight[nLine] = height;
m_time[nLine] = time*m_delayFactor;
toto = SearchToto();
if ( toto != 0 )
{
motion = toto->GetMotion();
if ( motion != 0 )
{
if ( type == TT_ERROR )
{
motion->SetAction(MT_ERROR, 4.0f);
}
if ( type == TT_WARNING )
{
motion->SetAction(MT_WARNING, 4.0f);
}
if ( type == TT_INFO )
{
motion->SetAction(MT_INFO, 4.0f);
}
//.........这里部分代码省略.........