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


C++ CGUILabelControl类代码示例

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


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

示例1: UpdateLabel

void CGUIDialogKeyboardGeneric::UpdateLabel() // FIXME seems to be called twice for one USB SDL keyboard action/character
{
  CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
  if (pEdit)
  {
    CStdStringW edit = m_strEdit;
    if (m_hiddenInput)
    { // convert to *'s
      edit.Empty();
      if (m_lastRemoteClickTime + REMOTE_SMS_DELAY > CTimeUtils::GetFrameTime() && m_strEdit.size())
      { // using the remove to input, so display the last key input
        edit.append(m_strEdit.size() - 1, L'*');
        edit.append(1, m_strEdit[m_strEdit.size() - 1]);
      }
      else
        edit.append(m_strEdit.size(), L'*');
    }
    // convert back to utf8
    CStdString utf8Edit;
    g_charsetConverter.wToUTF8(edit, utf8Edit);
    pEdit->SetLabel(utf8Edit);
    // Send off a search message
    unsigned int now = CTimeUtils::GetFrameTime();
    // don't send until the REMOTE_SMS_DELAY has passed
    if (m_lastRemoteClickTime && m_lastRemoteClickTime + REMOTE_SMS_DELAY >= now)
      return;

    if (m_pCharCallback)
      m_pCharCallback(this, utf8Edit);
  }
}
开发者ID:maximuska,项目名称:xbmc,代码行数:31,代码来源:GUIDialogKeyboardGeneric.cpp

示例2: GetControl

void CGUIDialogBoxeeBrowseMenu::Render()
{
#ifdef HAS_EMBEDDED

  if (m_downloadCounter % 60 == 0)
  {
    m_downloadCounter = 0;

    if (g_boxeeVersionUpdateManager.GetBoxeeVerUpdateJob().GetVersionUpdateDownloadStatus() == VUDS_DOWNLOADING)
    {
      CDownloadInfo downloadnfo;
      g_boxeeVersionUpdateManager.GetDownloadInfo(downloadnfo);

      double percent = downloadnfo.m_CurrentDownloadProgress;

      CGUILabelControl* pControl = (CGUILabelControl*) GetControl(DOWNLOADING_LABEL);
      if (pControl)
      {
        CStdString percentStr = "%d%%";
        CStdString percentLabel;
        percentLabel.Format(percentStr.c_str(),(int)percent);
        pControl->SetLabel(percentLabel);
      }
    }
  }
  m_downloadCounter++;
#endif

  CGUIDialog::Render();
}
开发者ID:marksuman,项目名称:boxee,代码行数:30,代码来源:GUIDialogBoxeeBrowseMenu.cpp

示例3: UpdateButtons

void CGUIDialogKeyboardGeneric::OnInitWindow()
{
  CGUIDialog::OnInitWindow();

  m_bIsConfirmed = false;

  // set alphabetic (capitals)
  UpdateButtons();

  CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
  if (pEdit)
  {
    pEdit->ShowCursor();
  }

  // set heading
  if (!m_strHeading.empty())
  {
    SET_CONTROL_LABEL(CTL_LABEL_HEADING, m_strHeading);
    SET_CONTROL_VISIBLE(CTL_LABEL_HEADING);
  }
  else
  {
    SET_CONTROL_HIDDEN(CTL_LABEL_HEADING);
  }

  CVariant data;
  data["title"] = m_strHeading;
  data["type"] = !m_hiddenInput ? "keyboard" : "password";
  data["value"] = GetText();
  ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::Input, "xbmc", "OnInputRequested", data);
}
开发者ID:maximuska,项目名称:xbmc,代码行数:32,代码来源:GUIDialogKeyboardGeneric.cpp

示例4: UpdateButtons

void CGUIDialogKeyboard::OnInitWindow()
{
#ifdef __APPLE__
  // Override skin defaults to always make the defaul control 'DONE' to allow
  // natual entry on keyboards.
  //
  m_dwDefaultFocusControlID = 300;
#endif

  CGUIDialog::OnInitWindow();

  m_bIsConfirmed = false;

  // set alphabetic (capitals)
  UpdateButtons();

  CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
  if (pEdit)
  {
    pEdit->ShowCursor();
  }

  // set heading
  if (!m_strHeading.IsEmpty())
  {
    SET_CONTROL_LABEL(CTL_LABEL_HEADING, m_strHeading);
    SET_CONTROL_VISIBLE(CTL_LABEL_HEADING);
  }
  else
  {
    SET_CONTROL_HIDDEN(CTL_LABEL_HEADING);
  }
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:33,代码来源:GUIDialogKeyboard.cpp

示例5: Load

bool CGUIDialog::Load(const CStdString& strFileName, bool bContainsPath)
{
  m_renderOrder = 1;
  if (!CGUIWindow::Load(strFileName, bContainsPath))
  {
    return false;
  }

  // Clip labels to extents
  if (m_vecControls.size())
  {
    CGUIControl* pBase = m_vecControls[0];

    for (ivecControls p = m_vecControls.begin() + 1; p != m_vecControls.end(); ++p)
    {
      if ((*p)->GetControlType() == CGUIControl::GUICONTROL_LABEL)
      {
        CGUILabelControl* pLabel = (CGUILabelControl*)(*p);

        if (!pLabel->GetWidth())
        {
          float spacing = (pLabel->GetXPosition() - pBase->GetXPosition()) * 2;
          pLabel->SetWidth(pBase->GetWidth() - spacing);
          pLabel->SetTruncate(true);
        }
      }
    }
  }

  return true;
}
开发者ID:Castlecard,项目名称:plex,代码行数:31,代码来源:GUIDialog.cpp

示例6: MoveCursor

void CGUIDialogKeyboardGeneric::MoveCursor(int iAmount)
{
  CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
  if (pEdit)
  {
    pEdit->SetCursorPos(pEdit->GetCursorPos() + iAmount);
  }
}
开发者ID:maximuska,项目名称:xbmc,代码行数:8,代码来源:GUIDialogKeyboardGeneric.cpp

示例7: SetCursorPos

void CGUIDialogKeyboardGeneric::SetCursorPos(int iPos)
{
  CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
  if (pEdit)
  {
    pEdit->SetCursorPos(iPos);
  }
}
开发者ID:AFFLUENTSOCIETY,项目名称:SPMC,代码行数:8,代码来源:GUIDialogKeyboardGeneric.cpp

示例8: UpdateButtons

void CGUIDialogKeyboardGeneric::OnInitWindow()
{
  CGUIDialog::OnInitWindow();

  m_bIsConfirmed = false;
  m_isKeyboardNavigationMode = false;

  // fill in the keyboard layouts
  m_currentLayout = 0;
  m_layouts.clear();
  const KeyboardLayouts& keyboardLayouts = CKeyboardLayoutManager::GetInstance().GetLayouts();
  std::vector<CVariant> layoutNames = CSettings::GetInstance().GetList(CSettings::SETTING_LOCALE_KEYBOARDLAYOUTS);

  for (std::vector<CVariant>::const_iterator layoutName = layoutNames.begin(); layoutName != layoutNames.end(); ++layoutName)
  {
    KeyboardLayouts::const_iterator keyboardLayout = keyboardLayouts.find(layoutName->asString());
    if (keyboardLayout != keyboardLayouts.end())
      m_layouts.push_back(keyboardLayout->second);
  }

  // set alphabetic (capitals)
  UpdateButtons();

  // set heading
  if (!m_strHeading.empty())
  {
    SET_CONTROL_LABEL(CTL_LABEL_HEADING, m_strHeading);
    SET_CONTROL_VISIBLE(CTL_LABEL_HEADING);
  }
  else
  {
    SET_CONTROL_HIDDEN(CTL_LABEL_HEADING);
  }
  // set type
  {
    CGUIMessage msg(GUI_MSG_SET_TYPE, GetID(), CTL_EDIT, m_hiddenInput ? CGUIEditControl::INPUT_TYPE_PASSWORD : CGUIEditControl::INPUT_TYPE_TEXT);
    OnMessage(msg);
  }
  SetEditText(m_text);

  // get HZLIST label options
  CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_HZLIST));
  CLabelInfo labelInfo = pEdit->GetLabelInfo();
  m_listfont = labelInfo.font;
  m_listwidth = pEdit->GetWidth();
  m_hzcode.clear();
  m_words.clear();
  SET_CONTROL_LABEL(CTL_LABEL_HZCODE, "");
  SET_CONTROL_LABEL(CTL_LABEL_HZLIST, "");

  CVariant data;
  data["title"] = m_strHeading;
  data["type"] = !m_hiddenInput ? "keyboard" : "password";
  data["value"] = GetText();
  ANNOUNCEMENT::CAnnouncementManager::GetInstance().Announce(ANNOUNCEMENT::Input, "xbmc", "OnInputRequested", data);
}
开发者ID:evilhamster,项目名称:xbmc,代码行数:56,代码来源:GUIDialogKeyboardGeneric.cpp

示例9: if

void CGUIDialogKeyboardGeneric::SetCursorPos(int iPos)
{
  if (iPos < 0)
    iPos = 0;
  else if (iPos > (int)m_strEdit.size())
    iPos = (int)m_strEdit.size();
  m_iCursorPos = iPos;
  CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
  if (pEdit)
  {
    pEdit->SetCursorPos(m_iCursorPos + (m_hiddenInput ? 0 : m_iEditingOffset));
  }
}
开发者ID:lewy20041,项目名称:xbmclibmedia,代码行数:13,代码来源:GUIDialogKeyboardGeneric.cpp

示例10: OnWindowLoaded

void CGUIWindowFullScreen::OnWindowLoaded()
{
  CGUIWindow::OnWindowLoaded();

  CGUIProgressControl* pProgress = (CGUIProgressControl*)GetControl(CONTROL_PROGRESS);
  if(pProgress)
  {
    if( pProgress->GetInfo() == 0 || pProgress->GetVisibleCondition() == 0)
    {
      pProgress->SetInfo(PLAYER_PROGRESS);
      pProgress->SetVisibleCondition(PLAYER_DISPLAY_AFTER_SEEK, false);
      pProgress->SetVisible(true);
    }
  }

  CGUILabelControl* pLabel = (CGUILabelControl*)GetControl(LABEL_BUFFERING);
  if(pLabel && pLabel->GetVisibleCondition() == 0)
  {
    pLabel->SetVisibleCondition(PLAYER_CACHING, false);
    pLabel->SetVisible(true);
  }

  pLabel = (CGUILabelControl*)GetControl(LABEL_CURRENT_TIME);
  if(pLabel && pLabel->GetVisibleCondition() == 0)
  {
    pLabel->SetVisibleCondition(PLAYER_DISPLAY_AFTER_SEEK, false);
    pLabel->SetVisible(true);
    pLabel->SetLabel("$INFO(VIDEOPLAYER.TIME) / $INFO(VIDEOPLAYER.DURATION)");
  }
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:30,代码来源:GUIWindowFullScreen.cpp

示例11: OnWindowLoaded

void CGUIWindowFullScreen::OnWindowLoaded()
{
  CGUIWindow::OnWindowLoaded();
  // override the clear colour - we must never clear fullscreen
  m_clearBackground = 0;

  CGUIProgressControl* pProgress = dynamic_cast<CGUIProgressControl*>(GetControl(CONTROL_PROGRESS));
  if(pProgress)
  {
    if( pProgress->GetInfo() == 0 || !pProgress->HasVisibleCondition())
    {
      pProgress->SetInfo(PLAYER_PROGRESS);
      pProgress->SetVisibleCondition("player.displayafterseek");
      pProgress->SetVisible(true);
    }
  }

  CGUILabelControl* pLabel = dynamic_cast<CGUILabelControl*>(GetControl(LABEL_BUFFERING));
  if(pLabel && !pLabel->HasVisibleCondition())
  {
    pLabel->SetVisibleCondition("player.caching");
    pLabel->SetVisible(true);
  }

  pLabel = dynamic_cast<CGUILabelControl*>(GetControl(LABEL_CURRENT_TIME));
  if(pLabel && !pLabel->HasVisibleCondition())
  {
    pLabel->SetVisibleCondition("player.displayafterseek");
    pLabel->SetVisible(true);
    pLabel->SetLabel("$INFO(VIDEOPLAYER.TIME) / $INFO(VIDEOPLAYER.DURATION)");
  }

  m_showCodec.Parse("player.showcodec", GetID());
}
开发者ID:stef64,项目名称:xbmc,代码行数:34,代码来源:GUIWindowFullScreen.cpp

示例12: if

void CGUIDialogNumeric::FrameMove()
{
  CStdString strLabel;
  unsigned int start = 0;
  unsigned int end = 0;
  if (m_mode == INPUT_PASSWORD)
  {
    for (unsigned int i=0; i < m_number.size(); i++)
      strLabel += '*';
  }
  else if (m_mode == INPUT_NUMBER)
  { // simple - just render text directly
    strLabel = m_number;
  }
  else if (m_mode == INPUT_TIME)
  { // format up the time
    strLabel = StringUtils::Format("%2d:%02d", m_datetime.wHour, m_datetime.wMinute);
    start = m_block * 3;
    end = m_block * 3 + 2;
  }
  else if (m_mode == INPUT_TIME_SECONDS)
  { // format up the time
    strLabel = StringUtils::Format("%2d:%02d", m_datetime.wMinute, m_datetime.wSecond);
    start = m_block * 3;
    end = m_block * 3 + 2;
  }
  else if (m_mode == INPUT_DATE)
  { // format up the date
    strLabel = StringUtils::Format("%2d/%2d/%4d", m_datetime.wDay, m_datetime.wMonth, m_datetime.wYear);
    start = m_block * 3;
    end = m_block * 3 + 2;
    if (m_block == 2)
      end = m_block * 3 + 4;
  }
  else if (m_mode == INPUT_IP_ADDRESS)
  { // format up the date
    strLabel = StringUtils::Format("%3d.%3d.%3d.%3d", m_ip[0], m_ip[1], m_ip[2], m_ip[3]);
    start = m_block * 4;
    end = m_block * 4 + 3;
  }
  CGUILabelControl *pLabel = (CGUILabelControl *)GetControl(CONTROL_INPUT_LABEL);
  if (pLabel)
  {
    pLabel->SetLabel(strLabel);
    pLabel->SetHighlight(start, end);
  }
  CGUIDialog::FrameMove();
}
开发者ID:Anankin,项目名称:xbmc,代码行数:48,代码来源:GUIDialogNumeric.cpp

示例13: 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

示例14: UpdateLabel

void CGUIDialogKeyboard::UpdateLabel() // FIXME seems to be called twice for one USB SDL keyboard action/character
{
  CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT));
  if (pEdit)
  {
    CStdStringW edit = m_strEdit;
    if (m_hiddenInput)
    { // convert to *'s
      edit.Empty();
      if (m_lastRemoteClickTime + REMOTE_SMS_DELAY > timeGetTime() && m_strEdit.size())
      { // using the remove to input, so display the last key input
        edit.append(m_strEdit.size() - 1, L'*');
        edit.append(1, m_strEdit[m_strEdit.size() - 1]);
      }
      else
        edit.append(m_strEdit.size(), L'*');
    }
    // convert back to utf8
    CStdString utf8Edit;
    g_charsetConverter.wToUTF8(edit, utf8Edit);
    pEdit->SetLabel(utf8Edit);
    // Send off a search message if it's been SEARCH_DELAY since last search.
    DWORD now = timeGetTime();
    if (!m_lastSearchUpdate || m_lastSearchUpdate + SEARCH_DELAY >= now)
      m_lastSearchUpdate = now; // update is called when we haven't passed our search delay, so reset it
    if (m_lastSearchUpdate + SEARCH_DELAY < now)
    {
      // don't send until the REMOTE_SMS_DELAY has passed
      if (m_lastRemoteClickTime && m_lastRemoteClickTime + REMOTE_SMS_DELAY >= now)
        return;
      m_lastSearchUpdate = 0;
      if (m_filtering == FILTERING_CURRENT)
      { // send our filter message
        CGUIMessage message(GUI_MSG_NOTIFY_ALL, GetID(), 0, GUI_MSG_FILTER_ITEMS);
        message.SetStringParam(utf8Edit);
        g_graphicsContext.SendMessage(message);
      }
      if (m_filtering == FILTERING_SEARCH)
      { // send our search message
        CGUIMessage message(GUI_MSG_NOTIFY_ALL, GetID(), 0, GUI_MSG_SEARCH_UPDATE);
        message.SetStringParam(utf8Edit);
        g_graphicsContext.SendMessage(message);
      }
    }
  }
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:46,代码来源:GUIDialogKeyboard.cpp

示例15: GetControl

void CGUIWindowMusicNav::OnWindowLoaded()
{
#ifdef PRE_SKIN_VERSION_2_1_COMPATIBILITY
  const CGUIControl *pList = GetControl(CONTROL_LIST);
  if (pList && !GetControl(CONTROL_LABELEMPTY))
  {
    CLabelInfo info;
    info.align = XBFONT_CENTER_X | XBFONT_CENTER_Y;
    info.font = g_fontManager.GetFont("font13");
    info.textColor = 0xffffffff;
    CGUILabelControl *pLabel = new CGUILabelControl(GetID(),CONTROL_LABELEMPTY,pList->GetXPosition(),pList->GetYPosition(),pList->GetWidth(),pList->GetHeight(),info,false,false);
    pLabel->SetAnimations(pList->GetAnimations());
    Add(pLabel);
  }
#endif

  CGUIWindowMusicBase::OnWindowLoaded();
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:18,代码来源:GUIWindowMusicNav.cpp


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