本文整理汇总了C++中CGUIWindow::GetElementById方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIWindow::GetElementById方法的具体用法?C++ CGUIWindow::GetElementById怎么用?C++ CGUIWindow::GetElementById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIWindow
的用法示例。
在下文中一共展示了CGUIWindow::GetElementById方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMoveToBack
void CMyPicture::OnMoveToBack()
{
//Se selecciona un elemento
std::string name_window = CORE->GetGUIManager()->GetCurrentWindow();
CGUIWindow *window = CORE->GetGUIManager()->GetWindow(name_window);
CGuiElement *element = NULL;
//Mira sobre qué elemento está el mouse
uint16 count = window->GetNumElements();
for( uint16 i = count; i > 0; --i)
{
element = window->GetElementById(i-1);
Vect2i mousePosition;
CORE->GetInputManager()->GetPosition(IDV_MOUSE, mousePosition);
element->CalculatePosMouse(mousePosition);
if( element->IsInside() )
{
//Está adentro
window->MoveElementToBack(element);
break;
}
}
}
示例2: OnLButtonUp
void CMyPicture::OnLButtonUp(UINT nFlags, CPoint point)
{
if( m_bIsLMouseDown )
{
//Se selecciona un elemento
std::string name_window = CORE->GetGUIManager()->GetCurrentWindow();
CGUIWindow *window = CORE->GetGUIManager()->GetWindow(name_window);
CGuiElement *element = NULL;
//hace reset de todos los controles
uint32 count = window->GetNumElements();
for( uint32 i = 0; i < count; ++i)
{
element = window->GetElementById(i);
element->SetIsSelected(false);
}
bool isElementSelected = false;
//Mira sobre qué elemento está el mouse
for( uint32 i = count; i > 0; --i)
{
element = window->GetElementById(i-1);
Vect2i mousePosition;
CORE->GetInputManager()->GetPosition(IDV_MOUSE, mousePosition);
element->CalculatePosMouse(mousePosition);
if( element->IsInside() )
{
element->SetIsSelected(true);
CElementProperties::ElementProperties(element);
isElementSelected = true;
break;
}
}
//No hay nada seleccionado y ponemos las propiedades de la window
if( !isElementSelected )
{
CElementProperties::WindowProperties(window);
}
}
else
{
//Se hace Drag & drop
CElementManager *l_pElementManager = CElementManager::GetInstance();
TElement element = l_pElementManager->GetElementToAdd();
std::string window = l_pElementManager->GetWindowToAdd();
if( element != NONE )
{
l_pElementManager->SetElementToAdd(NONE);
AddElementToActiveWindow(element);
}
else if( window != "" )
{
std::string current_window = CORE->GetGUIManager()->GetCurrentWindow();
current_window = current_window;
CGUIWindow *windowcurrent = CORE->GetGUIManager()->GetWindow( current_window );
windowcurrent->ClearSelectElements();
window = window;
CORE->GetGUIManager()->ActiveWindows( window );
CORE->GetGUIManager()->GetWindow( window )->ClearSelectElements();
CElementProperties::WindowProperties( CORE->GetGUIManager()->GetWindow( window ) );
}
}
m_bIsLMouseDown = false;
CStatic::OnLButtonUp(nFlags, point);
}