本文整理汇总了C++中CGUIMessage::GetLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIMessage::GetLabel方法的具体用法?C++ CGUIMessage::GetLabel怎么用?C++ CGUIMessage::GetLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIMessage
的用法示例。
在下文中一共展示了CGUIMessage::GetLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMessage
bool CGUIButtonControl::OnMessage(CGUIMessage& message)
{
if (message.GetControlId() == GetID())
{
if (message.GetMessage() == GUI_MSG_LABEL_SET)
{
SetLabel(message.GetLabel());
return true;
}
if (message.GetMessage() == GUI_MSG_LABEL2_SET)
{
SetLabel2(message.GetLabel());
return true;
}
if (message.GetMessage() == GUI_MSG_SELECTED)
{
if (!m_bSelected)
SetInvalid();
m_bSelected = true;
return true;
}
if (message.GetMessage() == GUI_MSG_DESELECTED)
{
if (m_bSelected)
SetInvalid();
m_bSelected = false;
return true;
}
}
return CGUIControl::OnMessage(message);
}
示例2: OnMessage
bool CGUIFadeLabelControl::OnMessage(CGUIMessage& message)
{
if ( message.GetControlId() == GetID() )
{
if (message.GetMessage() == GUI_MSG_LABEL_ADD)
{
AddLabel(message.GetLabel());
return true;
}
if (message.GetMessage() == GUI_MSG_LABEL_RESET)
{
m_lastLabel = -1;
m_infoLabels.clear();
m_scrollInfo.Reset();
return true;
}
if (message.GetMessage() == GUI_MSG_LABEL_SET)
{
m_lastLabel = -1;
m_infoLabels.clear();
m_scrollInfo.Reset();
AddLabel(message.GetLabel());
return true;
}
}
return CGUIControl::OnMessage(message);
}
示例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_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);
}
示例4: OnMessage
bool CGUIDialogKeyboardGeneric::OnMessage(CGUIMessage& message)
{
CGUIDialog::OnMessage(message);
switch ( message.GetMessage() )
{
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
switch (iControl)
{
case CTL_BUTTON_DONE:
OnOK();
break;
case CTL_BUTTON_CANCEL:
Close();
break;
case CTL_BUTTON_SHIFT:
OnShift();
break;
case CTL_BUTTON_CAPS:
if (m_keyType == LOWER)
m_keyType = CAPS;
else if (m_keyType == CAPS)
m_keyType = LOWER;
UpdateButtons();
break;
case CTL_BUTTON_SYMBOLS:
OnSymbols();
break;
case CTL_BUTTON_LEFT:
MoveCursor( -1);
break;
case CTL_BUTTON_RIGHT:
MoveCursor(1);
break;
case CTL_BUTTON_IP_ADDRESS:
OnIPAddress();
break;
default:
m_lastRemoteKeyClicked = 0;
OnClickButton(iControl);
break;
}
}
break;
case GUI_MSG_SET_TEXT:
SetText(message.GetLabel());
// close the dialog if requested
if (message.GetParam1() > 0)
OnOK();
break;
}
return true;
}
示例5: OnMessage
bool CGUITextBox::OnMessage(CGUIMessage& message)
{
if (message.GetControlId() == GetID())
{
if (message.GetMessage() == GUI_MSG_LABEL_SET)
{
m_offset = 0;
m_scrollOffset = 0;
ResetAutoScrolling();
CGUITextLayout::Reset();
m_info.SetLabel(message.GetLabel(), "", GetParentID());
}
if (message.GetMessage() == GUI_MSG_LABEL_RESET)
{
m_offset = 0;
m_scrollOffset = 0;
ResetAutoScrolling();
CGUITextLayout::Reset();
UpdatePageControl();
SetInvalid();
}
if (message.GetMessage() == GUI_MSG_PAGE_CHANGE)
{
if (message.GetSenderId() == m_pageControl)
{ // update our page
Scroll(message.GetParam1());
return true;
}
}
}
return CGUIControl::OnMessage(message);
}
示例6: 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);
}
示例7: OnMessage
bool CGUIDialogNumeric::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_INIT:
{
m_bConfirmed = false;
m_bCanceled = false;
m_dirty = false;
return CGUIDialog::OnMessage(message);
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
m_bConfirmed = false;
m_bCanceled = false;
if (CONTROL_NUM0 <= iControl && iControl <= CONTROL_NUM9) // User numeric entry via dialog button UI
{
OnNumber(iControl - 10);
return true;
}
else if (iControl == CONTROL_PREVIOUS)
{
OnPrevious();
return true;
}
else if (iControl == CONTROL_NEXT)
{
OnNext();
return true;
}
else if (iControl == CONTROL_BACKSPACE)
{
OnBackSpace();
return true;
}
else if (iControl == CONTROL_ENTER)
{
OnOK();
return true;
}
}
break;
case GUI_MSG_SET_TEXT:
SetMode(m_mode, message.GetLabel());
// close the dialog if requested
if (message.GetParam1() > 0)
OnOK();
break;
}
return CGUIDialog::OnMessage(message);
}
示例8: OnMessage
bool CGUILabelControl::OnMessage(CGUIMessage& message)
{
if ( message.GetControlId() == GetID() )
{
if (message.GetMessage() == GUI_MSG_LABEL_SET)
{
SetLabel(message.GetLabel());
return true;
}
}
return CGUIControl::OnMessage(message);
}
示例9: OnMessage
bool CGUICheckMarkControl::OnMessage(CGUIMessage& message)
{
if ( message.GetControlId() == GetID() )
{
if (message.GetMessage() == GUI_MSG_LABEL_SET)
{
m_strLabel = message.GetLabel();
return true;
}
}
if (CGUIControl::OnMessage(message)) return true;
return false;
}
示例10: 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);
}
示例11: 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);
}
示例12: OnMessage
bool CGUIDialogKeyboardGeneric::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
switch (iControl)
{
case CTL_BUTTON_DONE:
OnOK();
break;
case CTL_BUTTON_CANCEL:
Close();
break;
case CTL_BUTTON_SHIFT:
OnShift();
break;
case CTL_BUTTON_CAPS:
if (m_keyType == LOWER)
m_keyType = CAPS;
else if (m_keyType == CAPS)
m_keyType = LOWER;
UpdateButtons();
break;
case CTL_BUTTON_LAYOUT:
OnLayout();
break;
case CTL_BUTTON_SYMBOLS:
OnSymbols();
break;
case CTL_BUTTON_LEFT:
MoveCursor( -1);
break;
case CTL_BUTTON_RIGHT:
MoveCursor(1);
break;
case CTL_BUTTON_IP_ADDRESS:
OnIPAddress();
break;
case CTL_BUTTON_CLEAR:
SetEditText("");
break;
case CTL_EDIT:
{
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CTL_EDIT);
OnMessage(msg);
// update callback I guess?
if (m_pCharCallback)
{ // we did _something_, so make sure our search message filter is reset
m_pCharCallback(this, msg.GetLabel());
}
m_text = msg.GetLabel();
return true;
}
default:
OnClickButton(iControl);
break;
}
}
break;
case GUI_MSG_SET_TEXT:
case GUI_MSG_INPUT_TEXT_EDIT:
{
// the edit control only handles these messages if it is either focues
// or its specific control ID is set in the message. As neither is the
// case here (focus is on one of the keyboard buttons) we have to force
// the control ID of the message to the control ID of the edit control
// (unfortunately we have to create a whole copy of the message object for that)
CGUIMessage messageCopy(message.GetMessage(), message.GetSenderId(), CTL_EDIT, message.GetParam1(), message.GetParam2(), message.GetItem());
messageCopy.SetLabel(message.GetLabel());
// ensure this goes to the edit control
CGUIControl *edit = GetControl(CTL_EDIT);
if (edit)
edit->OnMessage(messageCopy);
// close the dialog if requested
if (message.GetMessage() == GUI_MSG_SET_TEXT && message.GetParam1() > 0)
OnOK();
return true;
}
}
return CGUIDialog::OnMessage(message);
}
示例13: 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;
//.........这里部分代码省略.........
示例14: OnMessage
bool CGUITextBox::OnMessage(CGUIMessage& message)
{
if (message.GetControlId() == GetID() )
{
if (message.GetSenderId() == CONTROL_UPDOWN)
{
if (message.GetMessage() == GUI_MSG_CLICKED)
{
ResetAutoScrolling();
if (m_upDown.GetValue() >= 1)
ScrollToOffset((m_upDown.GetValue() - 1) * m_itemsPerPage);
}
}
if (message.GetMessage() == GUI_MSG_LABEL_SET)
{
m_offset = 0;
m_scrollOffset = 0;
ResetAutoScrolling();
CGUITextLayout::Reset();
m_upDown.SetRange(1, 1);
m_upDown.SetValue(1);
m_info.SetLabel(message.GetLabel(), "");
}
if (message.GetMessage() == GUI_MSG_LABEL_RESET)
{
m_offset = 0;
m_scrollOffset = 0;
ResetAutoScrolling();
CGUITextLayout::Reset();
m_upDown.SetRange(1, 1);
m_upDown.SetValue(1);
if (m_pageControl)
{
CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), m_pageControl, m_itemsPerPage, m_lines.size());
SendWindowMessage(msg);
}
}
if (message.GetMessage() == GUI_MSG_SETFOCUS)
{
m_upDown.SetFocus(true);
ResetAutoScrolling();
}
if (message.GetMessage() == GUI_MSG_LOSTFOCUS)
{
m_upDown.SetFocus(false);
}
if (message.GetMessage() == GUI_MSG_PAGE_CHANGE)
{
if (message.GetSenderId() == m_pageControl)
{ // update our page
ResetAutoScrolling();
ScrollToOffset(message.GetParam1());
return true;
}
}
}
return CGUIControl::OnMessage(message);
}
示例15: OnMessage
bool CGUIDialogKeyboardGeneric::OnMessage(CGUIMessage& message)
{
CGUIDialog::OnMessage(message);
switch ( message.GetMessage() )
{
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
switch (iControl)
{
case CTL_BUTTON_DONE:
OnOK();
break;
case CTL_BUTTON_CANCEL:
Close();
break;
case CTL_BUTTON_SHIFT:
OnShift();
break;
case CTL_BUTTON_CAPS:
OnCapsLock();
break;
case CTL_BUTTON_SYMBOLS:
OnSymbols();
break;
case CTL_BUTTON_LEFT:
MoveCursor( -1);
break;
case CTL_BUTTON_RIGHT:
MoveCursor(1);
break;
case CTL_BUTTON_IP_ADDRESS:
OnIPAddress();
break;
case CTL_BUTTON_CLEAR:
SetText("");
break;
default:
m_lastRemoteKeyClicked = 0;
OnClickButton(iControl);
break;
}
}
break;
case GUI_MSG_SET_TEXT:
SetText(message.GetLabel());
// close the dialog if requested
if (message.GetParam1() > 0)
OnOK();
break;
case GUI_MSG_INPUT_TEXT:
InputText(message.GetLabel());
break;
case GUI_MSG_INPUT_TEXT_EDIT:
InputTextEditing(message.GetLabel(), message.GetParam1(), message.GetParam2());
break;
}
return true;
}