本文整理汇总了C++中CGUIMessage::GetLPVOID方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIMessage::GetLPVOID方法的具体用法?C++ CGUIMessage::GetLPVOID怎么用?C++ CGUIMessage::GetLPVOID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIMessage
的用法示例。
在下文中一共展示了CGUIMessage::GetLPVOID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMessage
bool CGUIBaseContainer::OnMessage(CGUIMessage& message)
{
if (message.GetControlId() == GetID() )
{
if (!m_staticContent)
{
if (message.GetMessage() == GUI_MSG_LABEL_BIND && message.GetLPVOID())
{ // bind our items
Reset();
CFileItemList *items = (CFileItemList *)message.GetLPVOID();
for (int i = 0; i < items->Size(); i++)
m_items.push_back(items->Get(i));
UpdateLayout(true); // true to refresh all items
UpdateScrollByLetter();
SelectItem(message.GetParam1());
return true;
}
if (message.GetMessage() == GUI_MSG_LABEL_ADD && message.GetItem())
{
CGUIListItemPtr item = message.GetItem();
m_items.push_back(item);
UpdateScrollByLetter();
SetPageControlRange();
return true;
}
else if (message.GetMessage() == GUI_MSG_LABEL_RESET)
{
Reset();
SetPageControlRange();
return true;
}
}
if (message.GetMessage() == GUI_MSG_ITEM_SELECTED)
{
message.SetParam1(GetSelectedItem());
return true;
}
else if (message.GetMessage() == GUI_MSG_PAGE_CHANGE)
{
if (message.GetSenderId() == m_pageControl && IsVisible())
{ // update our page if we're visible - not much point otherwise
if ((int)message.GetParam1() != m_offset)
m_pageChangeTimer.StartZero();
ScrollToOffset(message.GetParam1());
return true;
}
}
else if (message.GetMessage() == GUI_MSG_REFRESH_LIST)
{ // update our list contents
for (unsigned int i = 0; i < m_items.size(); ++i)
m_items[i]->SetInvalid();
}
else if (message.GetMessage() == GUI_MSG_MOVE_OFFSET)
{
int count = (int)message.GetParam1();
while (count < 0)
{
MoveUp(true);
count++;
}
while (count > 0)
{
MoveDown(true);
count--;
}
return true;
}
}
return CGUIControl::OnMessage(message);
}