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


C++ CGUIButtonControl::GetLabel方法代码示例

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


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

示例1: GetUserConfiguration

void CGUIWindowBoxeeWizardNetwork::GetUserConfiguration(CStdString& interfaceName, CStdString& essId, CStdString& key, EncMode& enc)
{
  // Get current settings from the GUI components
   CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_INTERFACES);
   OnMessage(msg);
   int iItem = msg.GetParam1();
   CNetworkInterface* interface = m_interfaces[iItem]; 
   interfaceName = interface->GetName();
   
   if (interface->IsWireless())
   {
      CGUIMessage msg2(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_WIRELESS);
      OnMessage(msg2);
      int iItem = msg2.GetParam1();
      essId = m_networkItems[iItem]->GetLabel();
            
      CGUIButtonControl* passwordButton = (CGUIButtonControl*) GetControl(CONTROL_PASSWORD);
      key = passwordButton->GetLabel();
       
      CGUIButtonControl* encSelectionButton = (CGUIButtonControl*) GetControl(CONTROL_ENC_SELECTION);
      CStdString encStr = encSelectionButton->GetLabel();
      for (int i = 0; i < 5; i++)
      {
         if (strcasecmp(encStr.c_str(), ENC_LABELS[i]) == 0)
         {
            enc = ENC_MODES[i];
            break;
         }
      }
   }
}
开发者ID:Kr0nZ,项目名称:boxee,代码行数:31,代码来源:GUIWindowBoxeeWizardNetwork.cpp

示例2: FrameMove

void CGUIDialogButtonMenu::FrameMove()
{
  // get the label control
  CGUILabelControl *pLabel = (CGUILabelControl *)GetControl(CONTROL_BUTTON_LABEL);
  if (pLabel)
  {
    // get the active window, and put it's label into the label control
    const CGUIControl *pControl = GetFocusedControl();
    if (pControl && (pControl->GetControlType() == CGUIControl::GUICONTROL_BUTTON || pControl->GetControlType() == CGUIControl::GUICONTROL_TOGGLEBUTTON))
    {
      CGUIButtonControl *pButton = (CGUIButtonControl *)pControl;
      pLabel->SetLabel(pButton->GetLabel());
    }
  }
  CGUIDialog::FrameMove();
}
开发者ID:OV3RDOSE,项目名称:xbmc,代码行数:16,代码来源:GUIDialogButtonMenu.cpp

示例3: GetLabel

void Interface_GUIControlButton::GetLabel(void* kodiBase, void* handle, char &label, unsigned int &iMaxStringSize)
{
  CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
  if (!addon)
  {
    CLog::Log(LOGERROR, "ADDON::Interface_GUIControlButton::%s - invalid data", __FUNCTION__);
    return;
  }

  if (!handle)
  {
    CLog::Log(LOGERROR, "ADDON::Interface_GUIControlButton::%s - invalid handler data on addon '%s'", __FUNCTION__, addon->ID().c_str());
    return;
  }

  CGUIButtonControl* pButton = static_cast<CGUIButtonControl *>(handle);
  std::string text = pButton->GetLabel();
  strncpy(&label, text.c_str(), iMaxStringSize);
  iMaxStringSize = text.length();
}
开发者ID:FernetMenta,项目名称:xbmc,代码行数:20,代码来源:ControlButton.cpp

示例4: OnAction

bool CGUIWindowBoxeeWizardNetwork::OnAction(const CAction &action)
{
   int iControl = GetFocusedControlID();

   if (action.wID == ACTION_PREVIOUS_MENU || (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_BACK))
   {
      Close();
   }
   else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_INTERFACES)
   {  
     ShowWirelessNetworksIfNeeded();
     CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_INTERFACES);
     if (pList)
       pList->SetSingleSelectedItem();

     return true;
   }
   else if (action.wID == ACTION_MOVE_LEFT && iControl == CONTROL_WIRELESS)
   {
     ShowInterfaces();
     SET_CONTROL_FOCUS(CONTROL_INTERFACES, 0);
     CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_WIRELESS);
     if (pList)
       pList->SetSingleSelectedItem();

      return true;
   }
   else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_WIRELESS)
   {      
      ShowPasswordIfNeeded();
      CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_WIRELESS);
      if (pList)
        pList->SetSingleSelectedItem();
      return true;
   }
   else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_PASSWORD)   
   {      
      CGUIButtonControl* passwordButton = (CGUIButtonControl*) GetControl(iControl);
      CStdString password = passwordButton->GetLabel();
      if (CGUIDialogKeyboard::ShowAndGetInput(password, g_localizeStrings.Get(789), false))
      {         
         passwordButton->SetLabel(password);
         CONTROL_ENABLE(CONTROL_NEXT);                        
         SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
      }
      return true;
   }
   else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_ENC)
   {      
      CGUIButtonControl* encSelectionButton = (CGUIButtonControl*) GetControl(CONTROL_ENC_SELECTION);
   
      CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_ENC);
      OnMessage(msg);
      int iItem = msg.GetParam1();
      encSelectionButton->SetLabel(ENC_LABELS[iItem]);
      
      SET_CONTROL_HIDDEN(CONTROL_ENC);
      
      if (iItem == ENC_NONE)
      {
         SET_CONTROL_HIDDEN(CONTROL_PASSWORD_GROUP);
         SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
      }
      else
      {
         SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
      }
      return true;
   }
   else if (action.wID == ACTION_MOVE_LEFT && (iControl == CONTROL_ENC_SELECTION || iControl == CONTROL_PASSWORD))
   {
      SET_CONTROL_HIDDEN(CONTROL_ENC_GROUP);
      SET_CONTROL_HIDDEN(CONTROL_PASSWORD_GROUP);
      SET_CONTROL_FOCUS(CONTROL_WIRELESS, 0);
      return true;
   }
   else if (action.wID == ACTION_MOVE_DOWN && iControl == CONTROL_ENC_SELECTION)
   {
      if (GetControl(CONTROL_PASSWORD_GROUP)->IsVisible())
      {
         SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
      }
      else if (!GetControl(CONTROL_NEXT)->IsDisabled())
      {
         SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
      }
      return true;     
   }
   else if (action.wID == ACTION_MOVE_UP && (iControl == CONTROL_NEXT || iControl == CONTROL_BACK))
   {
      if (GetControl(CONTROL_PASSWORD_GROUP)->IsVisible())
      {
         SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
      }
      else if (GetControl(CONTROL_ENC_GROUP)->IsVisible())
      {
         SET_CONTROL_FOCUS(CONTROL_ENC_SELECTION, 0);
      }
      else 
      {
//.........这里部分代码省略.........
开发者ID:Kr0nZ,项目名称:boxee,代码行数:101,代码来源:GUIWindowBoxeeWizardNetwork.cpp


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