Esempio n. 1
0
void ChatPanel::SetBattle(IBattle* battle)
{
	if (m_battle == battle) { // battle didn't change, skip
		return;
	}

	if (m_battle != NULL) {
		OutputLine(_T("** ") + _("Left Battle."), sett().GetChatColorNotification());
	}

	if (battle == NULL) {
		SetLogFile(wxEmptyString);
		return;
	}

	OutputLine(_T("** ") + _("Joined Battle."), sett().GetChatColorNotification());

	for (unsigned int i = 0; i < battle->GetNumUsers(); ++i) {
		const wxString nick = TowxString(battle->GetUser(i).GetNick());
		textcompletiondatabase.Insert_Mapping(nick, nick);
	}

	SetLogFile(_T( "_BATTLE_" ) + TowxString(battle->GetFounder().GetNick()));
	m_battle = battle;
}
Esempio n. 2
0
void ChatPanel::SetTopic( const wxString& who, const wxString& message )
{
	/*
 int pos = refined.Find( _T("\\n") ); // serch for the \n string
 while ( pos != -1 )
 {
   if ( refined.Mid( pos - 1, 3 ) == _T("\\\n") ) continue; // the string \\n means escaped \n
   refined = refined.Left ( pos -1 ) + _T("\n") + refined.Right( pos +1 ); // replace the /n string with the carriage return char
   pos = refined.Find( _T("\\n") );
 }
 */
	wxFont f = m_chatlog_text->GetFont();
	f.SetFamily( wxFONTFAMILY_MODERN );
	// change the image of the tab to show new events
	if ( m_topic_set )
		SetIconHighlight( highlight_say );
	OutputLine( _( " ** Channel topic:" ), sett().GetChatColorServer(), f );
	wxStringTokenizer tkz( message, _T("\n") );
	while ( tkz.HasMoreTokens() )
	{
		wxString msg = tkz.GetNextToken();
		OutputLine( _T(" ") + msg, sett().GetChatColorServer(), f );
	}
	OutputLine( _( " ** Set by " ) + who, sett().GetChatColorServer(), f );
	m_topic_set = true;
}
Esempio n. 3
0
/* ==================================================================== */
void scDrawLine::DrawField()
{
	OutputLine();

	USTR	ustr;
	TypeSpec		spec;
	MicroPoint* 	widths = 0;

	clField& field = APPCreateField(txl_.GetColumn()->GetStream(), fChRec->flags.GetField());
	field.content( ustr, txl_.GetColumn()->GetAPPName(), fSpec );
	field.release();

	if ( ustr.len )
		widths = new MicroPoint[ ustr.len ];

	UnivStringWidth( ustr, widths, fSpec );

	for ( UINT i = 0; i < ustr.len; i++ ) { 	
		fChA->fGlyphID	= CMctToAPP( ustr.ptr[i] );

		fChA->hEscapement	= widths[i];
		fChA->hEscapement	+= fLetterSpace;
		fChA->vEscapement	= 0;
		
		fCurPos.Translate( fChA->hEscapement, fChA->vEscapement );

		IncrementDrawing();
	}	
	OutputLine();
	delete widths;
	widths = NULL;
}
Esempio n. 4
0
void ChatPanel::Parted( User& who, const wxString& message )
{
//    assert( m_type == CPT_Channel || m_type == CPT_Server || m_type == CPT_Battle || m_type == CPT_User );
    bool me_parted = m_channel && &who == &m_channel->GetMe();
	if ( m_type == CPT_Channel ) {
		if ( m_channel == 0 ) return;
		if ( me_parted ) {
			m_channel->uidata.panel = 0;
			SetChannel( 0 );
			return;
		}
		if ( sett().GetDisplayJoinLeave( m_channel->GetName() ) ) {
          // change the image of the tab to show new events
          SetIconHighlight( highlight_join_leave );
		  OutputLine( _T( " ** " ) + who.GetNick() + _( " left the " ) + GetChatTypeStr() + _T( "( " ) + message + _T( " )." ), sett().GetChatColorJoinPart(), sett().GetChatFont() );
        }
	} else if ( m_type == CPT_Battle ) {
		if ( sett().GetDisplayJoinLeave( _T( "game/battle" ) ) )  {
		    OutputLine( _T( " ** " ) + who.GetNick() + _( " left the " ) + GetChatTypeStr() + _T( "( " ) + message + _T( " )." ), sett().GetChatColorJoinPart(), sett().GetChatFont() );
        }
	}
	else if ( m_type == CPT_Server && me_parted )
        return;
	if ( m_show_nick_list && ( m_nicklist != 0 ) )
	{
		unsigned int numusers = 0;
		if ( m_type == CPT_Channel ) numusers = GetChannel()->GetNumUsers();
		else if ( m_type == CPT_Server && m_server ) numusers = m_server->GetNumUsers();
		m_usercount_label->SetLabel( wxString::Format( _("%d users"), numusers ) );
		m_nicklist->RemoveUser( who );
	}
	// Also remove the User from the TextCompletionDatabase
	textcompletiondatabase.Delete_Mapping( who.GetNick() );
}
Esempio n. 5
0
//! @brief Output a message said in the channel.
//!
//! @param who nick of the person who said something.
//! @param message the message to be outputted.
void ChatPanel::Said( const wxString& who, const wxString& message )
{
	wxString me = GetMe().GetNick();
	wxColour col;
	bool req_user = false;
	if ( who.Upper() == me.Upper() )
  {
		col = sett().GetChatColorMine();
	} else
	{
    // change the image of the tab to show new events
    SetIconHighlight( highlight_say );
    if ( m_type == CPT_User ) req_user = true;
    //process logic for custom word highlights
    if ( ContainsWordToHighlight( message ) )
    {
        req_user = sett().GetRequestAttOnHighlight();
        col = sett().GetChatColorHighlight();
    }
    else
        col = sett().GetChatColorNormal();
  }

	if ( ( who == _T( "MelBot" ) || who == _T( "[BOT]tizbacbridgebot" ) )
            && message.StartsWith( _T( "<" ) ) && message.Find( _T( ">" ) ) != wxNOT_FOUND )
    {
		wxString who2;
		wxString message2;
		who2 = message.BeforeFirst( '>' ).AfterFirst( '<' );
		if ( who != _T( "[BOT]tizbacbridgebot" ) ) who2 += _T( "@IRC" );
		//don't highlight if i'm talking from irc to channel
		if ( who2.Upper().BeforeLast(_T('@')) == me.Upper() )
		{
		    req_user = false;
		    col = sett().GetChatColorNormal();
		}
		message2 = message.AfterFirst( '>' );
		OutputLine( _T( " <" ) + who2 + _T( "> " ) + message2, col, sett().GetChatFont() );
	} else {
		OutputLine( _T( " <" ) + who + _T( "> " ) + message, col, sett().GetChatFont() );
	}


	if ( req_user ) {
		bool inactive = ui().GetActiveChatPanel() != this  || !wxTheApp->IsActive() ;
		ui().mw().RequestUserAttention();
		if ( inactive )
			UiEvents::GetNotificationEventSender().SendEvent(
					UiEvents::NotficationData( UiEvents::PrivateMessage,
											   wxString::Format( _T("%s:\n%s"), who.c_str(), message.Left(50).c_str() ) ) );
	}
}
Esempio n. 6
0
/*= Output_Monitor_Hdr =======================================================
Purpose: After clearing screen, outputs to terminal the header block of text.

Inputs:  None

Returns: None
============================================================================*/
tZGVoidReturn Output_Monitor_Hdr(tZGVoidInput)
{
    // KS:
    // EraseEntireScreen();

    ZG_PUTRSUART("\n\r");
    OutputLine('=', 79);
    ZG_PUTRSUART("* ZeroG Host Interface Monitor\n\r");
    ZG_PUTRSUART("* (c) 2008 -- ZeroG, Inc.\n\r");
    ZG_PUTRSUART("*\n\r* Type 'help' to get a list of commands.\n\r");
    OutputLine('=', 79);
    OutputCommandPrompt();

}
Esempio n. 7
0
/*= Output_Monitor_Hdr =======================================================
Purpose: After clearing screen, outputs to terminal the header block of text.

Inputs:  None

Returns: None
============================================================================*/
void Output_Monitor_Hdr(void)
{
    // KS:
    // EraseEntireScreen();

    putrsUART("\n\r");
    OutputLine('=', 79);
    putrsUART("* WiFi Host Interface Monitor\n\r");
    putrsUART("* (c) 2008, 2009, 2010, 2011 -- Microchip Technology, Inc.\n\r");
    putrsUART("*\n\r* Type 'help' to get a list of commands.\n\r");
    OutputLine('=', 79);
    OutputCommandPrompt();

}
Esempio n. 8
0
void ChatPanel::Parted(User& who, const wxString& message)
{
	//    assert( m_type == CPT_Channel || m_type == CPT_Server || m_type == CPT_Battle || m_type == CPT_User );
	const bool me_parted = m_channel && &who == &m_channel->GetMe();
	const wxString nick = TowxString(who.GetNick());
	const bool wasactive = m_active_users.erase(nick) > 0;
	if (m_display_joinitem || (wasactive && !who.IsBot())) {
		OutputLine(_T( "** " ) + wxString::Format(_("%s left %s (%s)."), nick.c_str(), GetChatTypeStr().c_str(), message.c_str()), sett().GetChatColorJoinPart());
	}
	if (m_type == CPT_Channel) {
		if (m_channel == 0)
			return;
		if (me_parted) {
			m_channel->panel = nullptr;
			SetChannel(0);
			return;
		}
		if (m_display_joinitem) {
			// change the image of the tab to show new events
			SetIconHighlight(highlight_join_leave);
		}
	} else if (m_type == CPT_Server && me_parted)
		return;
	if (m_show_nick_list && (m_nicklist != nullptr)) {
		m_nicklist->RemoveUser(who);
		UpdateUserCountLabel();
	}
	// Also remove the User from the TextCompletionDatabase
	textcompletiondatabase.Delete_Mapping(TowxString(who.GetNick()));
}
Esempio n. 9
0
void ChatPanel::OutputLine( const wxString& message, const wxColour& col, const wxFont& fon )
{

	if ( ! m_chatlog_text ) return;

	wxDateTime now = wxDateTime::Now();
	wxTextAttr timestyle( sett().GetChatColorTime(), sett().GetChatColorBackground(), sett().GetChatFont() );
	wxTextAttr chatstyle( col, sett().GetChatColorBackground(), fon );

    ChatLine newline;
#ifdef __WXMSW__
    newline.chat = wxString( message.c_str() );
#else
    newline.chat = message;
#endif
    newline.time = _T( "[" ) + now.Format( _T( "%H:%M:%S" ) ) + _T( "]" );
    newline.chatstyle = chatstyle;
    newline.timestyle = timestyle;

  if ( m_disable_append )
  {
    m_buffer.push_back( newline );
  }
  else
  {
    OutputLine( newline );
  }

	m_chat_log.AddMessage( message );

}
Esempio n. 10
0
void ChatPanel::SetBattle( Battle* battle )
{
	if ( m_battle != battle )
	{
		if ( m_battle ) OutputLine( _( " ** Left Battle." ), sett().GetChatColorNotification(), sett().GetChatFont() );
		if ( battle ) OutputLine( _( " ** Joined Battle." ), sett().GetChatColorNotification(), sett().GetChatFont() );
	}
	m_battle = battle;
	if ( m_battle )
	{
		for (unsigned int i = 0; i < m_battle->GetNumUsers();++i)
    {
       textcompletiondatabase.Insert_Mapping( m_battle->GetUser(i).GetNick(), m_battle->GetUser(i).GetNick() );
    }
	}
}
Esempio n. 11
0
/* ==================================================================== */
void scDrawLine::SetCaseCharData( caseState cs )
{
	OutputLine();

	fGlyphInfo.fontname 	= scCachedStyle::GetCurrentCache().GetFont();
	fGlyphInfo.emphasis_	= scCachedStyle::GetCurrentCache().GetEmphasis();
	fGlyphInfo.fontRender	= scCachedStyle::GetCurrentCache().GetRender();
	fGlyphInfo.typespec 	= scCachedStyle::GetCurrentCache().GetSpec();
	fGlyphInfo.color		= scCachedStyle::GetCurrentCache().GetColor( );

	if ( cs == lowerCase ) {
		fGlyphInfo.pointsize	= scRoundGS( scCachedStyle::GetCurrentCache().GetGlyphHeight() * kSmallCapCorrection );
		fGlyphInfo.setsize		= scRoundGS( scCachedStyle::GetCurrentCache().GetGlyphWidth() * kSmallCapCorrection );
	}
	else {
		fGlyphInfo.pointsize	= scCachedStyle::GetCurrentCache().GetGlyphHeight();
		fGlyphInfo.setsize		= scCachedStyle::GetCurrentCache().GetGlyphWidth();
	}
		
	fGlyphInfo.oblique		= 0;
	fGlyphInfo.rotation 	= 0;

	fGlyphInfo.flowDir		= fFlowDir;

	if ( fFlowDir.IsVertical() ) {
		fGlyphInfo.fBaseline	= scCachedStyle::GetCurrentCache().GetVertBaseline( );
		fBaseline.Set( scCachedStyle::GetCurrentCache().GetBaseline(), 0 );
	}
	else {
		fGlyphInfo.fBaseline	= scCachedStyle::GetCurrentCache().GetHorzBaseline( );
		fBaseline.Set( 0, -scCachedStyle::GetCurrentCache().GetBaseline() );
	}
}
Esempio n. 12
0
void Game::DBZLoop()
{
	float toMove;
	if (!g_pInput->m_Touched && g_pInput->m_PrevTouched)
	{
		toMove = (float)(ScreenHeight / 100);
		g_pInput->Reset();
	}
	else
	{
		toMove = -((float)ScreenHeight / 1500);
	}

	OutputLine(toMove);
	projectiles[PLAYER_ONE].at(0)->m_Y += toMove;
	ResizeLine(projectileLines[PLAYER_ONE].at(0), PLAYER_ONE, projectiles[PLAYER_ONE].back()->m_Y);

	projectiles[PLAYER_TWO].at(0)->m_Y = projectiles[PLAYER_ONE].at(0)->m_Y;
	ResizeLine(projectileLines[PLAYER_TWO].at(0), PLAYER_TWO, projectiles[PLAYER_TWO].back()->m_Y);

	if(toMove > 0)
	{
		if (player[PLAYER_TWO]->HitTest(projectiles[PLAYER_TWO].at(0)->m_X + 20, projectiles[PLAYER_TWO].at(0)->m_Y + projectiles[PLAYER_TWO].at(0)->getWidth()))
		{
			DBZWin(PLAYER_TWO);
		}
	}
	else
	{
		if (player[PLAYER_ONE]->HitTest(projectiles[PLAYER_ONE].at(0)->m_X + 20, projectiles[PLAYER_ONE].at(0)->m_Y - projectiles[PLAYER_ONE].at(0)->getWidth()))
		{
			DBZWin(PLAYER_ONE);
		}
	}
}
Esempio n. 13
0
void ChatPanel::UnknownCommand( const wxString& command, const wxString& params )
{
	wxFont f = m_chatlog_text->GetFont();
	f.SetFamily( wxFONTFAMILY_MODERN );
  // change the image of the tab to show new events
	SetIconHighlight( highlight_important );
	OutputLine( _( " !! Command: \"" ) + command + _( "\" params: \"" ) + params + _T( "\"." ), sett().GetChatColorError(), f );
}
Esempio n. 14
0
RDLogCL::RDLogCL(void)
:m_pFile(NULL)
,m_enable(true)
{
	SetUnhandledExceptionFilter( (LPTOP_LEVEL_EXCEPTION_FILTER) SDErrorUnhandledExceptionFilter );

	Open() ;

	OutputLine("\n") ;
	OutputLine("/*-----------------RDLogStart----------------*/") ;

	SYSTEMTIME time ;
	GetSystemTime(&time) ;
	OutputLine("LogStartTime : %d年%d月%d日 , 星期%d" , time.wYear , time.wMonth , time.wDay , time.wDayOfWeek) ;
	OutputLine("               %d:%d:%d" , time.wHour , time.wMinute , time.wSecond) ;
	OutputLine("") ;
}
Esempio n. 15
0
//! @brief Output motd sent by server
//!
//! @param message The MOTD message to output
void ChatPanel::Motd( const wxString& message )
{
	wxFont f = m_chatlog_text->GetFont();
	f.SetFamily( wxFONTFAMILY_MODERN );
  // change the image of the tab to show new events
	SetIconHighlight( highlight_say );
	OutputLine( _T( " ** motd ** " ) + message, sett().GetChatColorServer(), f );
}
Esempio n. 16
0
//! @brief Output a message said in the channel.
//!
//! @param who nick of the person who said something.
//! @param message the message to be outputted.
void ChatPanel::Said(const wxString& who, const wxString& message)
{
	if (m_active_users.find(who) == m_active_users.end()) {
		m_active_users.insert(who);
	}

	wxString me = TowxString(GetMe().GetNick());
	wxColour col;
	bool req_user = false;
	if (who.Upper() == me.Upper()) {
		col = sett().GetChatColorMine();
	} else {
		// change the image of the tab to show new events
		SetIconHighlight(highlight_say);
		if (m_type == CPT_User)
			req_user = true;
		//process logic for custom word highlights
		if (ContainsWordToHighlight(message)) {
			req_user = sett().GetRequestAttOnHighlight();
			col = sett().GetChatColorHighlight();
		} else
			col = sett().GetChatColorNormal();
	}

	if ((who == cfg().ReadString(_T("/Channel/bridgebot"))) && (message.StartsWith(_T( "<" ))) && (message.Find(_T( ">" )) != wxNOT_FOUND)) {
		wxString who2;
		wxString message2;
		who2 = message.BeforeFirst('>').AfterFirst('<');
		message2 = message.AfterFirst('>');
		OutputLine(_T( "<" ) + who2 + _T( "> " ) + message2, col);
	} else {
		OutputLine(_T( "<" ) + who + _T( "> " ) + message, col);
	}


	if (req_user) {
		bool inactive = ui().GetActiveChatPanel() != this || !wxTheApp->IsActive();
		if (inactive) {
			ui().mw().RequestUserAttention();
			const wxString msg = wxString::Format(_T("%s:\n%s"), who.c_str(), message.Left(50).c_str());
			UiEvents::GetNotificationEventSender().SendEvent(
			    UiEvents::NotficationData(UiEvents::PrivateMessage, msg));
		}
	}
}
Esempio n. 17
0
/* ==================================================================== */
scCachedStyle& scDrawLine::UpdateCaseSpec( caseState cs )
{
	OutputLine();
	
	scCachedStyle& cachedStyle = scCachedStyle::GetCachedStyle( fSpec );
	SetCharData( );

	return cachedStyle;
}
Esempio n. 18
0
void CExporter::OutputFormat(LPCTSTR sFormat, ...)
{
    va_list params;
    va_start(params, sFormat);
    TCHAR sLine[4096];
    vsprintf(sLine, sFormat, params);
    va_end(params);
    OutputLine(sLine);
}
Esempio n. 19
0
/* ==================================================================== */
scCachedStyle& scDrawLine::UpdateSpec( )
{
	OutputLine();
	fSpec = (fSpecRec++)->spec();
	scCachedStyle& cachedStyle = scCachedStyle::GetCachedStyle( fSpec );
	SetCharData( );

	return cachedStyle;
}
Esempio n. 20
0
void ChatPanel::SetTopic(const wxString& who, const wxString& message)
{
	if (message.empty()) {
		m_topic_set = false;
		return;
	}
	const wxColor col = sett().GetChatColorServer();
	// change the image of the tab to show new events
	if (m_topic_set)
		SetIconHighlight(highlight_say);
	OutputLine(_T("** ") + _("Channel topic"), col);
	wxStringTokenizer tkz(message, _T("\n"));
	while (tkz.HasMoreTokens()) {
		wxString msg = tkz.GetNextToken();
		OutputLine(_T(" ") + msg, col);
	}
	OutputLine(_T("** ") + wxString::Format(_("Set by %s"), who), col);
	m_topic_set = true;
}
Esempio n. 21
0
void ChatPanel::StatusMessage(const wxString& message)
{
	if (m_chatlog_text == 0) {
		wxLogMessage(_T( "m_chatlog_text is NULL" ));
	} else {
		if (CPT_Server == m_type)
			SetIconHighlight(highlight_important);
		OutputLine(_T( "** Server ** " ) + message, sett().GetChatColorServer());
	}
}
Esempio n. 22
0
/*= Output_Monitor_Hdr =======================================================
Purpose: After clearing screen, outputs to terminal the header block of text.

Inputs:  None

Returns: None
============================================================================*/
void Output_Monitor_Hdr(void)
{
    // KS:
    // EraseEntireScreen();

    putrsUART("\n\r");
    OutputLine('=', 79);
    putrsUART("* WiFi Host Interface Monitor\n\r");
    putrsUART("* (c) 2008, 2009, 2010 -- Microchip Technology, Inc.\n\r");
    putrsUART("*\n\r* Type 'help' to get a list of commands.\n\r");
	#if defined(WIFI_USB_DBG)//DIA 12_7_11
    	copyArrayToUSBBuffer("* WiFi Host Interface Monitor\n\r", sizeof("* WiFi Host Interface Monitor\n\r"));
    	copyArrayToUSBBuffer("* (c) 2008, 2009, 2010 -- Microchip Technology, Inc.\n\r", sizeof("* (c) 2008, 2009, 2010 -- Microchip Technology, Inc.\n\r"));
    	copyArrayToUSBBuffer("*\n\r* Type 'help' to get a list of commands.\n\r", sizeof("*\n\r* Type 'help' to get a list of commands.\n\r"));
	#endif
    OutputLine('=', 79);
    OutputCommandPrompt();

}
Esempio n. 23
0
void ChatPanel::StatusMessage( const wxString& message )
{
	if ( m_chatlog_text == 0 ) {
		wxLogMessage( _T( "m_chatlog_text is NULL" ) );
	} else {
		wxFont f = m_chatlog_text->GetFont();
		f.SetFamily( wxFONTFAMILY_MODERN );
		if( CPT_Server == m_type ) SetIconHighlight( highlight_important );
		OutputLine( _T( " ** Server ** " ) + message, sett().GetChatColorServer(), f );
	}
}
Esempio n. 24
0
void ChatPanel::DidAction( const wxString& who, const wxString& action )
{
  // change the image of the tab to show new events
	SetIconHighlight( highlight_say );
	OutputLine( _T( " * " ) + who + _T( " " ) + action, sett().GetChatColorAction(), sett().GetChatFont() );
	if ( m_type == CPT_User && ( ui().GetActiveChatPanel() != this  || !wxTheApp->IsActive() ) )
	{
		UiEvents::GetNotificationEventSender().SendEvent(
				UiEvents::NotficationData( UiEvents::PrivateMessage,
										   wxString::Format( _T("%s \n%s"), who.c_str(), action.Left(50).c_str() ) ) );
	}
}
Esempio n. 25
0
void ChatPanel::Joined( User& who )
{
	if ( m_type == CPT_Channel ) {
		if ( sett().GetDisplayJoinLeave( m_channel->GetName() ) ) {
      // change the image of the tab to show new events
      SetIconHighlight( highlight_join_leave );
      OutputLine( _T( " ** " ) + who.GetNick() + _( " joined the " ) + GetChatTypeStr() + _T( "." ), sett().GetChatColorJoinPart(), sett().GetChatFont() );
    }
	} else if ( m_type == CPT_Battle ) {
		if ( sett().GetDisplayJoinLeave( _T( "game/battle" ) ) ) { OutputLine( _T( " ** " ) + who.GetNick() + _( " joined the " ) + GetChatTypeStr() + _T( "." ), sett().GetChatColorJoinPart(), sett().GetChatFont() ); }
	}
	if ( m_show_nick_list && ( m_nicklist != 0 ) )
	{
		unsigned int numusers = 0;
		if ( m_type == CPT_Channel ) numusers = GetChannel()->GetNumUsers();
		else if ( m_type == CPT_Server && m_server ) numusers = m_server->GetNumUsers();
		m_usercount_label->SetLabel( wxString::Format( _("%d users"), numusers ) );
		m_nicklist->AddUser( who );
	}
	// Also add the User to the TextCompletionDatabase
	textcompletiondatabase.Insert_Mapping( who.GetNick(), who.GetNick() );
}
Esempio n. 26
0
void ChatPanel::OnChannelJoin(User& who)
{
	//    assert( m_type == CPT_Channel || m_type == CPT_Server || m_type == CPT_Battle || m_type == CPT_User );
	if (m_show_nick_list && (m_nicklist != nullptr)) {
		m_nicklist->AddUser(who);
		UpdateUserCountLabel();
	}
	if (m_display_joinitem) {
		OutputLine(_T( "** " ) + wxString::Format(_("%s joined %s."), TowxString(who.GetNick()).c_str(), GetChatTypeStr().c_str()), sett().GetChatColorJoinPart());
	}
	// Also add the User to the TextCompletionDatabase
	textcompletiondatabase.Insert_Mapping(TowxString(who.GetNick()), TowxString(who.GetNick()));
}
Esempio n. 27
0
void ChatPanel::SetLogFile(const wxString& name)
{
	m_chat_log.SetLogFile(name);
	if (name.empty()) {
		return;
	}
	wxWindowUpdateLocker noUpdates(m_chatlog_text);
	wxArrayString lines = m_chat_log.GetLastLines();
	const size_t num_lines = sett().GetAutoloadedChatlogLinesCount();
	const size_t start = std::max<size_t>(0, lines.Count() - num_lines);
	for (size_t i = start; i < lines.Count(); ++i) {
		OutputLine(lines[i], sett().GetChatColorServer(), false);
	}
}
Esempio n. 28
0
void ChatPanel::Joined(User& who)
{
	if (m_display_joinitem) {
		// change the image of the tab to show new events
		if (m_type == CPT_Channel) {
			SetIconHighlight(highlight_join_leave);
		}
		OutputLine(_T( "** " ) + wxString::Format(_("%s joined %s."), TowxString(who.GetNick()).c_str(), GetChatTypeStr().c_str()), sett().GetChatColorJoinPart());
	}

	if (m_show_nick_list && (m_nicklist != nullptr)) {
		m_nicklist->AddUser(who);
		UpdateUserCountLabel();
	}
	// Also add the User to the TextCompletionDatabase
	textcompletiondatabase.Insert_Mapping(TowxString(who.GetNick()), TowxString(who.GetNick()));
}
Esempio n. 29
0
/**
 * Process text sent by the server, not users
 * Check for vote events, promote events and something else
 */
void ChatPanel::DidAction(const wxString& who, const wxString& action)
{
	//Handle vote events in chat by VotePanel
	if (m_votePanel != NULL) {
		m_votePanel->OnChatAction(who, action);
	}

	//Look for "promote" notifications from server
	CheckForPromotion(who, action);

	// change the image of the tab to show new events
	SetIconHighlight(highlight_say);
	OutputLine(_T( "* " ) + who + _T( " " ) + action, sett().GetChatColorAction());
	if (m_type == CPT_User && (ui().GetActiveChatPanel() != this || !wxTheApp->IsActive())) {
		const wxString msg = wxString::Format(_T("%s \n%s"), who.c_str(), action.Left(50).c_str());
		UiEvents::GetNotificationEventSender().SendEvent(
		    UiEvents::NotficationData(UiEvents::PrivateMessage, msg));
	}
}
Esempio n. 30
0
    void CLogger::PrintLines(ETagLogLevel Filter, const char* pStr) {
        BEHAVIAC_UNUSED_VAR(Filter);

        TestInit();

        const int kMaxStringLength = 2048;
        int count = 0;
        char line[kMaxStringLength];

        while (*pStr != '\0' && *pStr != '\n') {
            line[count++] = *pStr++;
        }

        if (*pStr == '\n') {
            line[count++] = *pStr++;
        }

        line[count++] = '\0';

        BEHAVIAC_ASSERT(count < kMaxStringLength);
        count = 0;

        //the first line
        OutputDecoratedLine(Filter, line);

        while (*pStr != '\0') {
            while (*pStr != '\0' && *pStr != '\n') {
                line[count++] = *pStr++;
            }

            if (*pStr == '\n') {
                line[count++] = *pStr++;
            }

            line[count++] = '\0';

            BEHAVIAC_ASSERT(count < kMaxStringLength);
            count = 0;

            OutputLine(line);
        }
    }