Пример #1
0
void CApplicationMessenger::SendText(const std::string &aTextString, bool closeKeyboard /* = false */)
{
  if (CGUIKeyboardFactory::SendTextToActiveKeyboard(aTextString, closeKeyboard))
    return;

  CGUIWindow *window = g_windowManager.GetWindow(g_windowManager.GetFocusedWindow());
  if (!window)
    return;

  CGUIMessage msg(GUI_MSG_SET_TEXT, 0, window->GetFocusedControlID());
  msg.SetLabel(aTextString);
  msg.SetParam1(closeKeyboard ? 1 : 0);
  SendGUIMessage(msg, window->GetID());
}
Пример #2
0
JSONRPC_STATUS CInputOperations::SendText(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
  if (CGUIKeyboardFactory::SendTextToActiveKeyboard(parameterObject["text"].asString(), parameterObject["done"].asBoolean()))
    return ACK;

  CGUIWindow *window = g_windowManager.GetWindow(g_windowManager.GetFocusedWindow());
  if (!window)
    return ACK;

  CGUIMessage msg(GUI_MSG_SET_TEXT, 0, window->GetFocusedControlID());
  msg.SetLabel(parameterObject["text"].asString());
  msg.SetParam1(parameterObject["done"].asBoolean() ? 1 : 0);
  CApplicationMessenger::GetInstance().SendGUIMessage(msg, window->GetID());

  return ACK;
}