当前位置: 首页>>代码示例>>C++>>正文


C++ CGUIMessage::SetLabel方法代码示例

本文整理汇总了C++中CGUIMessage::SetLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIMessage::SetLabel方法的具体用法?C++ CGUIMessage::SetLabel怎么用?C++ CGUIMessage::SetLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGUIMessage的用法示例。


在下文中一共展示了CGUIMessage::SetLabel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnMessage

bool CGUIEditControl::OnMessage(CGUIMessage &message)
{
    if (message.GetMessage() == GUI_MSG_SET_TYPE)
    {
        SetInputType((INPUT_TYPE)message.GetParam1(), (int)message.GetParam2());
        return true;
    }
    else if (message.GetMessage() == GUI_MSG_ITEM_SELECTED)
    {
        message.SetLabel(GetLabel2());
        return true;
    }
    else if (message.GetMessage() == GUI_MSG_SET_TEXT &&
             ((message.GetControlId() <= 0 && HasFocus()) || (message.GetControlId() == GetID())))
    {
        SetLabel2(message.GetLabel());
        UpdateText();
    }
    else if (message.GetMessage() == GUI_MSG_INPUT_TEXT_EDIT && HasFocus())
    {
        g_charsetConverter.utf8ToW(message.GetLabel(), m_edit);
        m_editOffset = message.GetParam1();
        m_editLength = message.GetParam2();
        UpdateText(false);
        return true;
    }
    return CGUIButtonControl::OnMessage(message);
}
开发者ID:rlansi,项目名称:Kodi_dualaudio,代码行数:28,代码来源:GUIEditControl.cpp

示例2: OnMessage

bool CGUIEditControl::OnMessage(CGUIMessage &message)
{
  if (message.GetMessage() == GUI_MSG_SET_TYPE)
  {
    SetInputType((INPUT_TYPE)message.GetParam1(), (int)message.GetParam2());
    return true;
  }
  else if (message.GetMessage() == GUI_MSG_ITEM_SELECTED)
  {
    message.SetLabel(GetLabel2());
    return true;
  }
  else if (message.GetMessage() == GUI_MSG_SETFOCUS ||
           message.GetMessage() == GUI_MSG_LOSTFOCUS)
  {
    m_smsTimer.Stop();
  }
  else if (message.GetMessage() == GUI_MSG_SET_TEXT &&
          ((message.GetControlId() <= 0 && HasFocus()) || (message.GetControlId() == GetID())))
  {
    SetLabel2(message.GetLabel());
    UpdateText();
  }
  return CGUIButtonControl::OnMessage(message);
}
开发者ID:AdolphHuan,项目名称:xbmc,代码行数:25,代码来源:GUIEditControl.cpp

示例3: OnMessage

bool CGUIEditControl::OnMessage(CGUIMessage &message)
{
  if (message.GetMessage() == GUI_MSG_SET_TYPE)
  {
    SetInputType((INPUT_TYPE)message.GetParam1(), (int)message.GetParam2());
    return true;
  }
  else if (message.GetMessage() == GUI_MSG_ITEM_SELECTED)
  {
    message.SetLabel(GetLabel2());
    return true;
  }
  else if (message.GetMessage() == GUI_MSG_SETFOCUS)
  {
    m_smsTimer.Stop();
    ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::AF_GUI, "xbmc", "KeyboardDisplay");
  }
  else if (message.GetMessage() == GUI_MSG_LOSTFOCUS)
  {
    m_smsTimer.Stop();
    ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::AF_GUI, "xbmc", "KeyboardHide");
  }

  return CGUIButtonControl::OnMessage(message);
}
开发者ID:DakaiTV,项目名称:DakaiBoxee,代码行数:25,代码来源:GUIEditControl.cpp

示例4: OnMessage

bool CGUIImage::OnMessage(CGUIMessage& message)
{
  if (message.GetMessage() == GUI_MSG_REFRESH_THUMBS)
  {
    if (!m_info.IsConstant())
      FreeTextures(true); // true as we want to free the texture immediately
    return true;
  }
  else if (message.GetMessage() == GUI_MSG_SET_FILENAME)
  {
    SetFileName(message.GetLabel());
    return true;
  }
  else if (message.GetMessage() == GUI_MSG_GET_FILENAME)
  {
    message.SetLabel(GetFileName());
    return true;
  }
  return CGUIControl::OnMessage(message);
}
开发者ID:Distrotech,项目名称:xbmc,代码行数:20,代码来源:GUIImage.cpp

示例5: OnMessage

bool CGUISelectButtonControl::OnMessage(CGUIMessage& message)
{
  if ( message.GetControlId() == GetID() )
  {
    if (message.GetMessage() == GUI_MSG_LABEL_ADD)
    {
      if (m_vecItems.size() <= 0)
      {
        m_iCurrentItem = 0;
        m_iDefaultItem = 0;
      }
      m_vecItems.push_back(message.GetLabel());
      return true;
    }
    else if (message.GetMessage() == GUI_MSG_LABEL_RESET)
    {
      m_vecItems.erase(m_vecItems.begin(), m_vecItems.end());
      m_iCurrentItem = -1;
      m_iDefaultItem = -1;
      return true;
    }
    else if (message.GetMessage() == GUI_MSG_ITEM_SELECTED)
    {
      message.SetParam1(m_iCurrentItem);
      if (m_iCurrentItem >= 0 && m_iCurrentItem < (int)m_vecItems.size())
        message.SetLabel(m_vecItems[m_iCurrentItem]);
      return true;
    }
    else if (message.GetMessage() == GUI_MSG_ITEM_SELECT)
    {
      m_iDefaultItem = m_iCurrentItem = message.GetParam1();
      return true;
    }
  }

  return CGUIButtonControl::OnMessage(message);
}
开发者ID:2BReality,项目名称:xbmc,代码行数:37,代码来源:GUISelectButtonControl.cpp

示例6: 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;
//.........这里部分代码省略.........
开发者ID:topfs2,项目名称:xbmc-cmake,代码行数:101,代码来源:GUISpinControl.cpp


注:本文中的CGUIMessage::SetLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。