예제 #1
0
/////////////////////////////////////////////////////////////////////////////
//	OnKillFocus
//		Sent when the grid is loosing focus.
//	Params:
//		section - Id of the grid section loosing focus, usually UG_GRID
//				  possible sections:
//						UG_TOPHEADING, UG_SIDEHEADING, UG_GRID
//		pNewWnd - pointer to the window gaining focus
//	Return:
//		<none>
void CDropDayCug::OnKillFocus(int section, CWnd *pNewWnd)
{
	UNREFERENCED_PARAMETER(section);

	if ( m_editInProgress == TRUE )
	{
		CString tempStr = "";

		if ( pNewWnd == NULL )
		{
			m_editCtrl->GetWindowText( tempStr );
		}
		else
		{
			if (( pNewWnd->GetParent() != m_CUGGrid ) && 
				( pNewWnd->GetParent() != this ))
			{
				m_editCtrl->GetWindowText( tempStr );
			}
		}

		if ( tempStr != "" )
			EditCtrlFinished( tempStr, FALSE, FALSE, 0, 0 );
	}

	if ( m_editInProgress == FALSE && m_cellType != NULL )
	{
		m_adoDatasource.OnRowChange( GetCurrentRow(), GetCurrentRow());
		((CUGCTDropGrid*)m_cellType)->OnClosePopup();
	}
}
void ScreenNetworkOptions::MenuStart( PlayerNumber pn, const InputEventType type )
{
	switch( GetCurrentRow() )
	{
	case PO_CONNECTION:
		switch (m_Rows[GetCurrentRow()]->GetOneSharedSelection())
		{
		case NO_CONNECT:
			SCREENMAN->TextEntry( SM_DoneConnecting, "Enter a Network Address\n127.0.0.1 to connect to yourself", "", NULL );
			break;
		case NO_DISCONNECT:
			NSMAN->CloseConnection();
			SCREENMAN->SystemMessage("Disconnected from server.");
			break;
		}
		break;
	case PO_SERVER:
		switch (m_Rows[GetCurrentRow()]->GetOneSharedSelection())
		{
		case NO_START_SERVER:
			if (!NSMAN->isLanServer)
				SCREENMAN->TextEntry( SM_ServerNameEnter, "Enter a server name...", "", NULL );
			break;
		case NO_STOP_SERVER:
			if ( NSMAN->LANserver != NULL )
				NSMAN->LANserver->ServerStop();
			SCREENMAN->SystemMessage( "Server Stopped." );
			NSMAN->isLanServer = false;
			break;
		}
		break;
	default:
		ScreenOptions::MenuStart( pn, type );
	}
}
예제 #3
0
void ScreenMiniMenu::ExportOptions( int r, const vector<PlayerNumber> &vpns )
{
	if( r == GetCurrentRow() )
		s_iLastRowCode = m_vMenuRows[r].iRowCode;
	s_viLastAnswers.resize( m_vMenuRows.size() );
	s_viLastAnswers[r] = m_pRows[r]->GetOneSharedSelection( true );
}
예제 #4
0
/***********************************************
	QuickRedrawCell
		The QuickRedrawCell function is used to quickly
		and effectively redraw a cell.  This function
		will directly add draw hints to the CUGGrid and
		use PaintDrawHintsNow to quickly redraw a cell.
***********************************************/
void CRealTimeGrid::QuickRedrawCell( int col, long row )
{
	CRect rect;
	GetCellRect( col, row, rect );
	m_CUGGrid->m_drawHint.AddHint( col, row, col, row );

	if( GetCurrentRow() != row || GetCurrentCol() != col )
		TempDisableFocusRect();

	m_CUGGrid->PaintDrawHintsNow( rect );
}
void ScreenNetworkOptions::MenuStart( PlayerNumber pn, const InputEventType type )
{
#if defined( WITHOUT_NETWORKING )
#else
	switch( GetCurrentRow() )
	{
	case PO_CONNECTION:
		if ( !NSMAN->useSMserver )
		{
			SCREENMAN->TextEntry( SM_DoneConnecting, "Enter a Network Address\n127.0.0.1 to connect to yourself", g_sLastServer, 128 );
		}
		else
		{
			NSMAN->CloseConnection();
			SCREENMAN->SystemMessage("Disconnected from server.");
			UpdateConnectStatus( );
		}
		break;
	case PO_SERVER:
		switch (m_Rows[GetCurrentRow()]->GetOneSharedSelection())
		{
		case NO_START_SERVER:
			if (!NSMAN->isLanServer)
			{
				SCREENMAN->TextEntry( SM_ServerNameEnter, "Enter a server name...", "", 0);
			}
			break;
		case NO_STOP_SERVER:
			if ( NSMAN->LANserver != NULL )
				NSMAN->LANserver->ServerStop();
			SCREENMAN->SystemMessage( "Server Stopped." );
			NSMAN->isLanServer = false;
			break;
		}
		break;
	default:
		ScreenOptions::MenuStart( pn, type );
	}
#endif
}
예제 #6
0
void ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
{
	switch( GetCurrentRow() )
	{
	case PO_CONNECTION:
		if ( !NSMAN->useSMserver )
		{
			ScreenTextEntry::TextEntry( SM_DoneConnecting, ENTER_NETWORK_ADDRESS.GetValue()+"\n\n"+CONNECT_TO_YOURSELF.GetValue(), g_sLastServer, 128 );
		}
		else
		{
			NSMAN->CloseConnection();
			SCREENMAN->SystemMessage( DISCONNECTED );
			UpdateConnectStatus( );
		}
		break;
	case PO_SCOREBOARD:
		if (m_pRows[PO_SCOREBOARD]->GetOneSharedSelection() == NO_SCOREBOARD_ON)
			PREFSMAN->m_bEnableScoreboard.Set(true);
		else
			PREFSMAN->m_bEnableScoreboard.Set(false);
		break;
	case PO_SERVERS:
		if ( !AllServers.empty() )
		{
			string sNewName = AllServers[m_pRows[GetCurrentRow()]->GetOneSharedSelection()].Address;
			NSMAN->PostStartUp(sNewName);
			NSMAN->DisplayStartupStatus();
			UpdateConnectStatus( );
		}
		else
		{
			//If the server list is empty, keep passing the message on so exit works
			ScreenOptions::MenuStart( input );
		}
		break;
	default:
		ScreenOptions::MenuStart( input );
	}
}
예제 #7
0
bool CGUIPanelContainer::GetCondition(int condition, int data) const
{
  int row = GetCurrentRow();
  int col = GetCurrentColumn();

  if (m_orientation == HORIZONTAL)
    std::swap(row, col);

  switch (condition)
  {
  case CONTAINER_ROW:
    return (row == data);
  case CONTAINER_COLUMN:
    return (col == data);
  default:
    return CGUIBaseContainer::GetCondition(condition, data);
  }
}
예제 #8
0
void ScreenOptionsEditProfile::ProcessMenuStart( const InputEventPlus &input )
{
	if( IsTransitioning() )
		return;

	int iRow = GetCurrentRow();
	//OptionRow &row = *m_pRows[iRow];

	switch( iRow )
	{
	case ROW_CHARACTER:
		{
		}
		break;
	default:
		ScreenOptions::ProcessMenuStart( input );
		break;
	}
}
예제 #9
0
std::string CGUIPanelContainer::GetLabel(int info) const
{
  int row = GetCurrentRow();
  int col = GetCurrentColumn();

  if (m_orientation == HORIZONTAL)
    std::swap(row, col);

  switch (info)
  {
  case CONTAINER_ROW:
    return StringUtils::Format("%i", row);
  case CONTAINER_COLUMN:
    return StringUtils::Format("%i", col);
  default:
    return CGUIBaseContainer::GetLabel(info);
  }
  return StringUtils::Empty;
}