コード例 #1
0
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;
}
コード例 #2
0
bool CGUIDialogKeyboard::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();
        }
      default:
        m_lastRemoteKeyClicked = 0;
        OnClickButton(iControl);
        break;
      }
    }
    break;
  }

  return true;
}
コード例 #3
0
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);
}
コード例 #4
0
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_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:
  case GUI_MSG_INPUT_TEXT_EDIT:
    {
      // ensure this goes to the edit control
      CGUIControl *edit = GetControl(CTL_EDIT);
      if (edit)
        edit->OnMessage(message);

      // close the dialog if requested
      if (message.GetMessage() == GUI_MSG_SET_TEXT && message.GetParam1() > 0)
        OnOK();
      return true;
    }
  }

  return CGUIDialog::OnMessage(message);
}
コード例 #5
0
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;
}