本文整理汇总了C++中CGUIMessage::GetPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIMessage::GetPointer方法的具体用法?C++ CGUIMessage::GetPointer怎么用?C++ CGUIMessage::GetPointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIMessage
的用法示例。
在下文中一共展示了CGUIMessage::GetPointer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMessage
bool CGUIDialogBoxeeLiveTvInfo::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_LABEL_BIND:
{
if (message.GetPointer() && message.GetControlId() == 0)
{
CFileItemList *items = (CFileItemList *)message.GetPointer();
delete items;
return true;
}
}
break;
case GUI_MSG_CLICKED:
{
if (message.GetSenderId() == CONTROL_TUNE_BUTTON)
{
m_requestTune = true;
Close();
}
}
break;
default:
break;
}
return CGUIDialog::OnMessage(message);
}
示例2: OnMessage
bool CGUIDialogVisualisationPresetList::OnMessage(CGUIMessage &message)
{
switch (message.GetMessage())
{
case GUI_MSG_CLICKED:
{
if (message.GetSenderId() == CONTROL_LIST && (message.GetParam1() == ACTION_SELECT_ITEM ||
message.GetParam1() == ACTION_MOUSE_LEFT_CLICK))
{
//clicked - ask for the preset to be changed to the new one
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_LIST);
if (OnMessage(msg))
{
int iItem = (int)msg.GetParam1();
if (m_viz)
m_viz->OnAction(VIS_ACTION_LOAD_PRESET, (void *)&iItem);
}
return true;
}
}
break;
case GUI_MSG_VISUALISATION_UNLOADING:
{
m_viz = NULL;
Update();
}
break;
case GUI_MSG_VISUALISATION_LOADED:
{
SetVisualisation((CVisualisation*)message.GetPointer());
}
break;
}
return CGUIDialog::OnMessage(message);
}
示例3: OnMessage
bool CGUIWindowBoxeeMediaMain::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
Cleanup();
CGUIWindow::OnMessage(message);
return true;
case MSG_ITEM_LOADED:
{
CFileItem *pItem = (CFileItem *)message.GetPointer();
message.SetPointer(NULL);
if (!pItem)
return true;
UpdateItemInList(pItem, m_listMediaItems);
UpdateItemInList(pItem, m_listMediaItemsSmall);
UpdateItemInList(pItem, m_listApps);
UpdateItemInList(pItem, m_listAppsSmall);
delete pItem;
}
return true;
case GUI_MSG_CLICKED:
{
CGUIWindow::OnMessage(message);
int iControl = message.GetSenderId();
int iAction = message.GetParam1();
if (iControl == TAB_BUTTON_BROWSE)
OnMoreMedia();
else if (iControl == TAB_BUTTON_APPS)
OnMoreApps();
else
OnClick(iControl, iAction);
return true;
}
break;
case GUI_MSG_REFRESH_APPS:
{
LoadMediaItems();
return true;
}
break;
default:
break;
}
return CGUIWindow::OnMessage(message);
}
示例4: OnMessage
bool CGUIDialogVisualisationPresetList::OnMessage(CGUIMessage &message)
{
switch (message.GetMessage())
{
case GUI_MSG_CLICKED:
{
if (message.GetSenderId() == CONTROL_LIST && (message.GetParam1() == ACTION_SELECT_ITEM ||
message.GetParam1() == ACTION_MOUSE_LEFT_CLICK))
{
//clicked - ask for the preset to be changed to the new one
CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_LIST);
if (pList)
{
int iItem = pList->GetSelectedItem();
if (m_viz)
m_viz->OnAction(VIS_ACTION_LOAD_PRESET, (void *)&iItem);
}
return true;
}
}
break;
case GUI_MSG_WINDOW_INIT:
{
CGUIDialog::OnMessage(message);
CGUIMessage msg(GUI_MSG_GET_VISUALISATION, 0, 0);
g_windowManager.SendMessage(msg);
SetVisualisation((CVisualisation*)msg.GetPointer());
return true;
}
break;
case GUI_MSG_WINDOW_DEINIT:
case GUI_MSG_VISUALISATION_UNLOADING:
{
m_viz = NULL;
CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_LIST);
OnMessage(msg);
Update();
}
break;
case GUI_MSG_VISUALISATION_LOADED:
{
SetVisualisation((CVisualisation*)message.GetPointer());
}
break;
}
return CGUIDialog::OnMessage(message);
}
示例5: OnMessage
bool CGUISpinControl::OnMessage(CGUIMessage& message)
{
if (CGUIControl::OnMessage(message) )
return true;
if (message.GetControlId() == GetID() )
{
switch (message.GetMessage())
{
case GUI_MSG_ITEM_SELECT:
if (SPIN_CONTROL_TYPE_PAGE == m_iType)
{
m_currentItem = message.GetParam1();
return true;
}
SetValue( message.GetParam1());
if (message.GetParam2() == SPIN_BUTTON_DOWN || message.GetParam2() == SPIN_BUTTON_UP)
m_iSelect = message.GetParam2();
return true;
break;
case GUI_MSG_LABEL_RESET:
if (SPIN_CONTROL_TYPE_PAGE == m_iType)
{
m_itemsPerPage = message.GetParam1();
m_numItems = message.GetParam2();
return true;
}
{
Clear();
return true;
}
break;
case GUI_MSG_SHOWRANGE:
if (message.GetParam1() )
m_bShowRange = true;
else
m_bShowRange = false;
break;
case GUI_MSG_SET_LABELS:
if (message.GetPointer())
{
const vector< pair<string, int> > *labels = (const vector< pair<string, int> > *)message.GetPointer();
Clear();
for (vector< pair<string, int> >::const_iterator i = labels->begin(); i != labels->end(); ++i)
AddLabel(i->first, i->second);
SetValue( message.GetParam1());
}
break;
case GUI_MSG_LABEL_ADD:
{
AddLabel(message.GetLabel(), message.GetParam1());
return true;
}
break;
case GUI_MSG_ITEM_SELECTED:
{
message.SetParam1( GetValue() );
message.SetParam2(m_iSelect);
if (m_iType == SPIN_CONTROL_TYPE_TEXT)
{
if ( m_iValue >= 0 && m_iValue < (int)m_vecLabels.size() )
message.SetLabel( m_vecLabels[m_iValue]);
}
return true;
}
case GUI_MSG_PAGE_UP:
if (CanMoveUp())
MoveUp();
return true;
case GUI_MSG_PAGE_DOWN:
if (CanMoveDown())
MoveDown();
return true;
case GUI_MSG_MOVE_OFFSET:
{
int count = (int)message.GetParam1();
while (count < 0)
{
MoveUp();
count++;
}
while (count > 0)
{
MoveDown();
count--;
}
return true;
}
}
}
return false;
//.........这里部分代码省略.........
示例6: OnMessage
//.........这里部分代码省略.........
return true;
}
break;
}
case GUI_MSG_LOSTFOCUS:
{
// nothing to do at the window level when we lose focus
return true;
}
case GUI_MSG_MOVE:
{
if (HasID(message.GetSenderId()))
return OnMove(message.GetControlId(), message.GetParam1());
break;
}
case GUI_MSG_SETFOCUS:
{
// CLog::Log(LOGDEBUG,"set focus to control:%i window:%i (%i)\n", message.GetControlId(),message.GetSenderId(), GetID());
if ( message.GetControlId() )
{
// first unfocus the current control
CGUIControl *control = GetFocusedControl();
if (control)
{
CGUIMessage msgLostFocus(GUI_MSG_LOSTFOCUS, GetID(), control->GetID(), message.GetControlId());
control->OnMessage(msgLostFocus);
}
// get the control to focus
CGUIControl* pFocusedControl = GetFirstFocusableControl(message.GetControlId());
if (!pFocusedControl) pFocusedControl = GetControl(message.GetControlId());
// and focus it
if (pFocusedControl)
return pFocusedControl->OnMessage(message);
}
return true;
}
break;
case GUI_MSG_EXCLUSIVE_MOUSE:
{
m_exclusiveMouseControl = message.GetSenderId();
return true;
}
break;
case GUI_MSG_GESTURE_NOTIFY:
{
CAction action(ACTION_GESTURE_NOTIFY, 0, static_cast<float>(message.GetParam1()), static_cast<float>(message.GetParam2()), 0, 0);
EVENT_RESULT result = OnMouseAction(action);
auto res = new int(result);
message.SetPointer(static_cast<void*>(res));
return result != EVENT_RESULT_UNHANDLED;
}
case GUI_MSG_ADD_CONTROL:
{
if (message.GetPointer())
{
CGUIControl *control = static_cast<CGUIControl*>(message.GetPointer());
control->AllocResources();
AddControl(control);
}
return true;
}
case GUI_MSG_REMOVE_CONTROL:
{
if (message.GetPointer())
{
CGUIControl *control = static_cast<CGUIControl*>(message.GetPointer());
RemoveControl(control);
control->FreeResources(true);
delete control;
}
return true;
}
case GUI_MSG_NOTIFY_ALL:
{
// only process those notifications that come from this window, or those intended for every window
if (HasID(message.GetSenderId()) || !message.GetSenderId())
{
if (message.GetParam1() == GUI_MSG_PAGE_CHANGE ||
message.GetParam1() == GUI_MSG_REFRESH_THUMBS ||
message.GetParam1() == GUI_MSG_REFRESH_LIST ||
message.GetParam1() == GUI_MSG_WINDOW_RESIZE)
{ // alter the message accordingly, and send to all controls
for (iControls it = m_children.begin(); it != m_children.end(); ++it)
{
CGUIControl *control = *it;
CGUIMessage msg(message.GetParam1(), message.GetControlId(), control->GetID(), message.GetParam2());
control->OnMessage(msg);
}
}
else if (message.GetParam1() == GUI_MSG_STATE_CHANGED)
MarkDirtyRegion(DIRTY_STATE_CHILD); //Don't force an dirtyRect, we don't know if / what has changed.
}
}
break;
}
return CGUIControlGroup::OnMessage(message);
}
示例7: OnMessage
bool CGUIDialogBoxeeCtx::OnMessage(CGUIMessage &message)
{
switch (message.GetMessage())
{
case GUI_MSG_ITEM_LOADED:
{
// New data received from the item loader, update existing item
CFileItemPtr pItem ((CFileItem *)message.GetPointer());
message.SetPointer(NULL);
if (pItem) {
m_item = *pItem;
CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), INFO_HIDDEN_LIST, 0);
OnMessage(msg);
CGUIMessage winmsg(GUI_MSG_LABEL_ADD, GetID(), INFO_HIDDEN_LIST, 0, 0, pItem);
OnMessage(winmsg);
CGUIMessage ref1(GUI_MSG_REFRESH_THUMBS, GetID(), IMG1);
OnMessage(ref1);
CGUIMessage ref2(GUI_MSG_REFRESH_THUMBS, GetID(), IMG2);
OnMessage(ref2);
CGUIMessage ref3(GUI_MSG_REFRESH_THUMBS, GetID(), IMG3);
OnMessage(ref3);
CGUIMessage ref4(GUI_MSG_REFRESH_THUMBS, GetID(), IMG4);
OnMessage(ref4);
}
return true;
}
case GUI_MSG_CLICKED:
{
unsigned int iControl = message.GetSenderId();
if (iControl == BTN_MORE_INFO)
{
OnMoreInfo();
return true;
}
else if (iControl == BTN_RATE)
{
bool bLike;
if (CGUIDialogBoxeeRate::ShowAndGetInput(bLike))
{
BoxeeUtils::Rate(&m_item, bLike);
g_application.m_guiDialogKaiToast.QueueNotification(CGUIDialogKaiToast::ICON_STAR, "", g_localizeStrings.Get(51034), 5000 , KAI_YELLOW_COLOR, KAI_GREY_COLOR);
}
}
else if (iControl == BTN_SHARE)
{
CGUIDialogBoxeeShare *pShare = (CGUIDialogBoxeeShare *)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_SHARE);
if (pShare)
{
pShare->SetItem(&m_item);
pShare->DoModal();
}
else
{
CLog::Log(LOGERROR,"CGUIDialogBoxeeCtx::OnMessage - GUI_MSG_CLICKED - BTN_SHARE - FAILED to get WINDOW_DIALOG_BOXEE_SHARE (share)");
}
}
else if (iControl == BTN_PRESET)
{
if (m_item.GetPropertyBOOL("IsPreset"))
{
CGUIDialogYesNo* dlgYesNo = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (dlgYesNo)
{
dlgYesNo->SetHeading(51020);
dlgYesNo->SetLine(0, 51021);
dlgYesNo->SetLine(1, m_item.GetLabel() + "?");
dlgYesNo->SetLine(2, "");
dlgYesNo->DoModal();
if (dlgYesNo->IsConfirmed())
{
g_settings.DeleteSource(GetItemShareType(), m_item.GetProperty("ShareName"), m_item.m_strPath);
CGUIWindow *pWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow());
if (pWindow)
{
CGUIMessage msg(GUI_MSG_REFRESH_APPS, 0, 0);
pWindow->OnMessage(msg);
}
}
}
}
else
{
CMediaSource newShare;
newShare.strPath = m_item.m_strPath;
newShare.strName = m_item.GetLabel();
if (m_item.HasProperty("OriginalThumb") && !m_item.GetProperty("OriginalThumb").IsEmpty())
newShare.m_strThumbnailImage = m_item.GetProperty("OriginalThumb");
else
newShare.m_strThumbnailImage = m_item.GetThumbnailImage();
newShare.vecPaths.push_back(m_item.m_strPath);
g_settings.AddShare(GetItemShareType(), newShare);
//.........这里部分代码省略.........