本文整理汇总了C++中Container::GetControl方法的典型用法代码示例。如果您正苦于以下问题:C++ Container::GetControl方法的具体用法?C++ Container::GetControl怎么用?C++ Container::GetControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Container
的用法示例。
在下文中一共展示了Container::GetControl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleMessageQueues
void GUIHandler::HandleMessageQueues (void)
{
Control *control;
Container *container;
gui_message msg;
std::list < Uint32 >::iterator refresh_iter;
Uint32 currenttime = SDL_GetTicks ();
bool do_refresh = false;
for (refresh_iter = refresh_times.begin ();
refresh_iter != refresh_times.end ();)
{
if (*refresh_iter < currenttime)
{
std::list < Uint32 >::iterator nextiter = refresh_iter;
nextiter++;
refresh_times.erase (refresh_iter);
refresh_iter = nextiter;
do_refresh = true;
}
else
refresh_iter++;
}
if (do_refresh)
{
msg.type = MESSAGE_DOREFRESH;
msg.refresh.time = currenttime;
stack.Push (msg);
}
ControlList_t::iterator iter;
for (iter = control_root.begin (); iter != control_root.end (); iter++)
while (iter->second->stack.Pop (&msg))
stack.Push (msg);
while (stack.Pop (&msg))
switch (msg.type)
{
case MESSAGE_CLOSEGUMP:
CloseWindow (msg.windowaction.controlid);
break;
case MESSAGE_SETFOCUS:
SetFocus (msg.windowaction.controlid);
break;
case MESSAGE_RELEASEFOCUS:
ReleaseFocus (msg.windowaction.controlid);
break;
case MESSAGE_BRINGTOFRONT:
BringToFront (msg.windowaction.controlid);
break;
case MESSAGE_QUIT:
SDLEvent::KillApplication();
break;
case MESSAGE_STARTGAME:
startflag = -1;
break;
case MESSAGE_CALLBACK:
if (msg.callback.containerid)
{
control = GetControl (msg.callback.containerid);
if (control)
{
if (control->getType () == CONTROLTYPE_CONTAINER)
{
container = (Container *) control;
control = container->GetControl (msg.callback.id);
}
else
control = NULL;
}
}
else
control = GetControl (msg.callback.id);
if (control)
switch (msg.callback.callback_type)
{
case CALLBACK_ONCLICK:
if (control->getType () == CONTROLTYPE_BUTTON)
((Button *) control)->DoOnClick ();
break;
case CALLBACK_ONKEYPRESS:
if (control->getType () == CONTROLTYPE_INPUTFIELD)
((InputField *) control)->DoOnKeyPress (msg.callback.key);
break;
case CALLBACK_ONCLOSE:
control->DoOnClose ();
break;
case CALLBACK_ONMOUSEUP:
control->DoOnMouseUp ();
break;
case CALLBACK_ONMOUSEDOWN:
control->DoOnMouseDown ();
break;
}
break;
case MESSAGE_ONDRAGITEM:
if (callback_OnDrag)
callback_OnDrag (msg.dragitem.itemid, msg.dragitem.model);
//.........这里部分代码省略.........