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;
}
//--------------------------------------------------------------------------
//	功能:窗口消息函数
//--------------------------------------------------------------------------
int KUiNewPlayer2::WndProc(unsigned int uMsg, unsigned int uParam, int nParam)
{
    int	nRet = 0;
    switch(uMsg)
    {
    case WND_N_BUTTON_CLICK:
        OnClickButton((KWndWindow*)uParam);
        break;
    case WM_KEYDOWN:
        if (uParam == VK_ESCAPE)
        {
            OnCancel();
            nRet = 1;
        }
        else if (uParam == VK_RETURN)
        {
            OnOk();
            nRet = 1;
        }
        break;
    case WND_M_OTHER_WORK_RESULT:
        if (uParam == LOGIN_CANCEL_OPER)
        {
            g_NetConnectAgent.SendUndispatchedToGameSpace(false);
            KSelSavedCharacter* pTool = KLogin::GetCharacterModule();
            if (pTool)
                pTool->CancelOperaton();
            OnCancel();
        }
        break;
    default:
        nRet = KWndShowAnimate::WndProc(uMsg, uParam, nParam);
    }
    return nRet;
}
Example #3
0
//--------------------------------------------------------------------------
//	功能:窗口消息函数
//--------------------------------------------------------------------------
int KUiSelDlg::WndProc(unsigned int uMsg, unsigned int uParam, int nParam)
{
	if (uMsg != WND_N_BUTTON_CLICK)
		return KWndWindow::WndProc(uMsg, uParam, nParam);
	OnClickButton((KWndWindow*)uParam);
	return 0;
}
Example #4
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;
}
//******************************************************************************
HRESULT CBCGPToolBoxPage::accDoDefaultAction(VARIANT varChild)
{
    if (varChild.vt != VT_I4)
    {
        return E_INVALIDARG;
    }

	return OnClickButton((int)varChild.lVal - 1) ? S_OK : S_FALSE;
}
//*********************************************************************************
void CBCGPToolBoxPage::OnLButtonDown(UINT nFlags, CPoint point) 
{
	CWnd::OnLButtonDown(nFlags, point);

	SetFocus ();

	ReleaseCapture ();
	m_nHighlightedButton = -1;

	OnClickButton(HitTest (point));
}
BOOL CDockFinderBar::PreTranslateMessage(MSG* pMsg)
{
	if (pMsg->hwnd == m_edit.m_hWnd)
	{
		if (pMsg->message == WM_KEYUP)
		{
			OnClickButton(DOCK_FINDER_INDEX+2);
		}
	}
	return CStatic::PreTranslateMessage(pMsg);
}
Example #8
0
// -------------------------------------------------------------------------
// 函数	: 消息处理
// -------------------------------------------------------------------------
int KUiSelPlayer::WndProc(unsigned int uMsg, unsigned int uParam, int nParam)
{
	int	nRet = 0;
	switch(uMsg)
	{
	case WND_N_BUTTON_CLICK:
		OnClickButton((KWndButton*)(KWndWindow*)uParam, false);
        break;

	case WND_N_BUTTON_DB_CLICK:
		OnClickButton((KWndButton*)(KWndWindow*)uParam, true);
        break;
	case WM_KEYDOWN:
		nRet = OnKeyDown(uParam);
		break;
	default:
		nRet = KWndShowAnimate::WndProc(uMsg, uParam, nParam);
		break;
	}
	return nRet;
}
Example #9
0
int KUiInit::OnKeyDown(unsigned int uKey)
{
	int	nRet = 1;
	KWndButton* pActive = NULL;
	KWndButton* pToActive = NULL;
	if (uKey == VK_RETURN)
	{
		if (pActive = GetActiveBtn())
			OnClickButton(pActive);
	}
	else if (uKey == VK_UP)
	{
		pActive = GetActiveBtn();
		if (pActive == &m_ExitGame)
			pToActive = &m_DesignerList;
		else if (pActive == &m_DesignerList)
			pToActive = &m_GameConfig;
		else if (pActive == &m_EnterGame)
			pToActive = &m_ExitGame;
		else
			pToActive = &m_EnterGame;
	}
	else if (uKey == VK_DOWN)
	{
		pActive = GetActiveBtn();
		if (pActive == &m_EnterGame)
			pToActive = &m_GameConfig;
		else if (pActive == &m_GameConfig)
			pToActive = &m_DesignerList;
		else if (pActive == &m_DesignerList)
			pToActive = &m_ExitGame;
		else
			pToActive = &m_EnterGame;
	}
	else
		nRet = 0;
	if (pToActive)
		pToActive->SetCursorAbove();
	return nRet;
}
Example #10
0
//--------------------------------------------------------------------------
//	功能:窗口消息函数
//--------------------------------------------------------------------------
int KUiInit::WndProc(unsigned int uMsg, unsigned int uParam, int nParam)
{
	int nRet = 0;
	switch(uMsg)
	{
	case WND_N_BUTTON_CLICK:
		OnClickButton((KWndButton*)(KWndWindow*)uParam);
		break;
	case WM_KEYDOWN:
		nRet = OnKeyDown(uParam);
		break;
	case WM_SYSKEYDOWN:
		if (uParam == 'A')
			OnAutoLogin();
		break;
	case WND_M_OTHER_WORK_RESULT:
		PlayStartMovie();
		break;
	default:
		nRet = KWndShowAnimate::WndProc(uMsg, uParam, nParam);	
	}
	return nRet;
}
Example #11
0
//--------------------------------------------------------------------------
//	功能:窗口函数
//--------------------------------------------------------------------------
int KUiSelServer::WndProc(unsigned int uMsg, unsigned int uParam, int nParam)
{
	int	nRet = 0;
	switch(uMsg)
	{
	case WND_N_BUTTON_CLICK:
		OnClickButton((KWndButton*)(KWndWindow*)uParam);
		break;
	case WND_N_SCORLLBAR_POS_CHANGED:
		m_List.SetTopItemIndex(nParam);
		break;
	case WM_KEYDOWN:
		nRet = OnKeyDown(uParam);
		break;
	case WND_N_LIST_ITEM_D_CLICK:
		if (nParam >= 0 && uParam == (unsigned int)(KWndWindow*)&m_List)
			OnLogin();
		break;
	default:
		nRet = KWndShowAnimate::WndProc(uMsg, uParam, nParam);
	}
	return nRet;
}
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);
}
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;
}
Example #14
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);
}
Example #15
0
int KUiSelPlayer::OnKeyDown(unsigned int uKey)
{
	int			nRet = 1;
	KWndWindow* pActive = NULL;
	KWndButton* pToActive = NULL;
	switch (uKey)
	{
	case VK_RETURN:
		pActive = GetActiveBtn();
		if (pActive == NULL && m_btnOk.IsDisable() == FALSE)
			pActive = &m_btnOk;
		OnClickButton((KWndButton*)pActive, false);
		break;
	case VK_ESCAPE:
		OnCancel();
		nRet = 1;
		break;
	case VK_UP:
		pActive = GetActiveBtn();
		if (pActive == &m_btnCancel)
			pToActive = &m_btnDel;
		else if (pActive == &m_btnDel)
			pToActive = &m_btnNew;
		else if (pActive == &m_btnOk)
			pToActive = &m_btnCancel;
		else
			pToActive = &m_btnOk;
		nRet = 1;
		break;
	case VK_DOWN:
		pActive = GetActiveBtn();
		if (pActive == &m_btnOk)
			pToActive = &m_btnNew;
		else if (pActive == &m_btnNew)
			pToActive = &m_btnDel;
		else if (pActive == &m_btnCancel)
			pToActive = &m_btnOk;
		else
			pToActive = &m_btnCancel;
		nRet = 1;
		break;
	case VK_LEFT:
		if (m_nSelPlayer > 0)
			OnSelectPlayer(m_nSelPlayer - 1);
		else if (m_nSelPlayer < 0 && m_nNumPlayer > 0)
			OnSelectPlayer(0);
		m_btnDel.Enable(m_nSelPlayer >= 0);
		nRet = 1;
		break;
	case VK_RIGHT:
	case VK_SPACE:
		if (m_nSelPlayer < m_nNumPlayer - 1)
			OnSelectPlayer(m_nSelPlayer + 1);
		else if (m_nNumPlayer < 0 && m_nNumPlayer > 0)
			OnSelectPlayer(0);
		m_btnDel.Enable(m_nSelPlayer >= 0);
		nRet = 1;
		break;
	default:
		nRet = 0;
	}
	if (pToActive)
		pToActive->SetCursorAbove();
	return nRet;
}
Example #16
0
void GridInfoLayer::onBattleClick(cocos2d::Ref *sender)
{
    OnClickButton(this);
    this->removeFromParent();
//    setVisible(false);
}
Example #17
0
int KUiESCDlg::OnKeyDown(unsigned int uKey)
{
	int	nRet = 1;
	KWndButton* pActive = NULL;
	KWndButton* pToActive = NULL;
	if (uKey == VK_RETURN)
	{
		if (pActive = GetActiveBtn())
			OnClickButton(pActive);
	}
	else if (uKey == VK_ESCAPE)
		CloseWindow(false);
	else if (uKey == VK_UP)
	{
		pActive = GetActiveBtn();
		if (pActive == &m_ExitGameBtn)
			pToActive = &m_ContinueGameBtn;
		//else if (pActive == &m_ExitBtn)
		//	pToActive = &m_ExitGameBtn;
		else if (pActive == &m_HelpBtn)
			pToActive = &m_ExitGameBtn;
		//else if (pActive == &m_TaskBtn)
		//	pToActive = &m_HelpBtn;
		else if (pActive == &m_OptionsBtn)
			pToActive = &m_HelpBtn;
		else if (pActive == &m_ContinueGameBtn)
			pToActive = &m_OptionsBtn;
		else
			pToActive = &m_ExitGameBtn;
	}
	else if (uKey == VK_DOWN)
	{
		pActive = GetActiveBtn();
		if (pActive == &m_ExitGameBtn)
			pToActive = &m_HelpBtn;
		//else if (pActive == &m_ExitBtn)
		//	pToActive = &m_HelpBtn;
		else if (pActive == &m_HelpBtn)
			pToActive = &m_OptionsBtn;
		//else if (pActive == &m_TaskBtn)
		//	pToActive = &m_OptionsBtn;
		else if (pActive == &m_OptionsBtn)
			pToActive = &m_ContinueGameBtn;
		else if (pActive == &m_ContinueGameBtn)
			pToActive = &m_ExitGameBtn;
		else
			pToActive = &m_ExitGameBtn;
	}
	else
		nRet = 0;
	if (pToActive)
	{
		POINT		Pos;
		SIZE		Size;
		pToActive->GetAbsolutePos((int*)&Pos.x, (int*)&Pos.y);
		pToActive->GetSize((int*)&Size.cx, (int*)&Size.cy);
		Pos.x += Size.cx / 2;
		Pos.y += Size.cy / 2;
		Wnd_SetCursorPos(Pos.x, Pos.y);
	}
	return nRet;
}