本文整理汇总了C++中CGUILabelControl::SetLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUILabelControl::SetLabel方法的具体用法?C++ CGUILabelControl::SetLabel怎么用?C++ CGUILabelControl::SetLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUILabelControl
的用法示例。
在下文中一共展示了CGUILabelControl::SetLabel方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: 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());
}
示例3: 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)");
}
}
示例4: Render
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();
}
示例5: FrameMove
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();
}
示例6: 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();
}
示例7: 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);
}
}
}
}
示例8: 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;
pEdit->SetHighlight(0, 0);
pEdit->SetSelection(0, 0);
if (m_hiddenInput)
{ // convert to *'s
edit.clear();
if (m_lastRemoteClickTime + REMOTE_SMS_DELAY > CTimeUtils::GetFrameTime() && m_iCursorPos > 0)
{ // using the remove to input, so display the last key input
edit.append(m_iCursorPos - 1, L'*');
edit.append(1, m_strEdit[m_iCursorPos - 1]);
}
else
edit.append(m_strEdit.size(), L'*');
}
else if (!m_strEditing.empty())
{
edit.insert(m_iCursorPos, m_strEditing);
pEdit->SetHighlight(m_iCursorPos, m_iCursorPos + m_strEditing.size());
if (m_iEditingLength > 0)
pEdit->SetSelection(m_iCursorPos + m_iEditingOffset, m_iCursorPos + m_iEditingOffset + m_iEditingLength);
}
// 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)
{
// do not send editing text comes from system input method
if (!m_hiddenInput && !m_strEditing.empty())
g_charsetConverter.wToUTF8(m_strEdit, utf8Edit);
m_pCharCallback(this, utf8Edit);
}
}
}
示例9: FrameMove
void CGUIDialogNumeric::FrameMove()
{
std::string strLabel;
unsigned int start = 0;
unsigned int end = 0;
if (m_mode == INPUT_PASSWORD)
strLabel.assign(m_number.length(), '*');
else if (m_mode == INPUT_NUMBER)
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:%02d", m_datetime.wHour, 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 = dynamic_cast<CGUILabelControl *>(GetControl(CONTROL_INPUT_LABEL));
if (pLabel)
{
pLabel->SetLabel(strLabel);
pLabel->SetHighlight(start, end);
}
CGUIDialog::FrameMove();
}