Exemplo n.º 1
0
uint32 CScreenConfigure::OnCommand(uint32 dwCommand, uint32 dwParam1, uint32 dwParam2)
{
	switch(dwCommand)
	{
	case CMD_MOVE_COM:
		SetCurrentType(COM_MOVE);
		break;
	case CMD_INV_COM:
		SetCurrentType(COM_INV);
		break;
	case CMD_VIEW_COM:
		SetCurrentType(COM_VIEW);
		break;
	case CMD_MISC_COM:
		SetCurrentType(COM_MISC);
		break;


	case CMD_CHANGE_CONTROL:
		{

			if (m_bWaitingForKey)
				break;
			// Set the current screen item to ??? while tracking the device.
			int nIndex=m_pList[m_nType]->GetSelectedIndex()-1;
			if (nIndex < 0)
				break;

			CLTGUIColumnCtrl *pCtrl= (CLTGUIColumnCtrl *)m_pList[m_nType]->GetSelectedControl();

			pCtrl->SetString(SCREEN_COLUMN_EQUALS, "=");

			pCtrl->SetString(SCREEN_COLUMN_KEY, " ");



			// see if we can track the input devices
            LTRESULT hResult = g_pLTClient->StartDeviceTrack (DEVICETYPE_KEYBOARD | DEVICETYPE_MOUSE | devices[2], TRACK_BUFFER_SIZE);
			if (hResult != LT_OK)
			{
                g_pLTClient->EndDeviceTrack();
			}
			else
			{
                m_bWaitingForKey = LTTRUE;
			}


			break;
		}
	default:
		return CBaseScreen::OnCommand(dwCommand,dwParam1,dwParam2);
	}
	return 1;
};
Exemplo n.º 2
0
void CScreenConfigure::Escape()
{
	if (m_bWaitingForKey || m_fInputPauseTimeLeft)
	{
		return;
	}

	for (int n = 0; n < 4; n++)
	{
		if (GetSelection() == GetIndex(m_pList[n]))
		{
			SetCurrentType(kNumCommandTypes);
			g_pInterfaceMgr->RequestInterfaceSound(IS_SELECT);
			return;
		}
	}

    m_bControlChanged = LTFALSE;

	CBaseScreen::Escape();
}
Exemplo n.º 3
0
void
InfoBoxManager::Event_Change(int i)
{
  int j = 0, k;

  int InfoFocus = GetFocused();
  if (InfoFocus < 0)
    return;

  k = GetCurrentType(InfoFocus);
  if (i > 0)
    j = InfoBoxFactory::GetNext(k);
  else if (i < 0)
    j = InfoBoxFactory::GetPrevious(k);

  // TODO code: if i==0, go to default or reset

  SetCurrentType(InfoFocus, j);

  InfoBoxes[InfoFocus]->UpdateContent();
  Paint();
}
Exemplo n.º 4
0
void CScreenConfigure::OnFocus(LTBOOL bFocus)
{
	if (bFocus)
	{
		m_pProfile = g_pProfileMgr->GetCurrentProfile();
		m_pProfile->SetBindings();
		UpdateControlList();
	}
	else
	{
		m_pProfile->ApplyBindings();
		m_pProfile->Save();
		m_pProfile = LTNULL;
		for (int nType = 0; nType < kNumCommandTypes; nType++)
			m_pList[nType]->Show(LTFALSE);
	}
	CBaseScreen::OnFocus(bFocus);

	if (bFocus)
		SetCurrentType(COM_MOVE);

}