这篇教程C++ AppendText函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AppendText函数的典型用法代码示例。如果您正苦于以下问题:C++ AppendText函数的具体用法?C++ AppendText怎么用?C++ AppendText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AppendText函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AppendTextvoid luConsoleEdit::writeLine(const wxString& line, bool newLine){ AppendText(line); //long pos = GetLastPosition(); //Replace(pos, pos, line); if (newLine) AppendText("/n");}
开发者ID:Ali-il,项目名称:gamekit,代码行数:7,
示例2: tokensvoid CChatSession::AddText(const wxString& text, const wxTextAttr& style, bool newline){ // Split multi-line messages into individual lines wxStringTokenizer tokens( text, wxT("/n") ); while ( tokens.HasMoreTokens() ) { // Check if we should add a time-stamp if ( GetNumberOfLines() > 1 ) { // Check if the last line ended with a newline wxString line = GetLineText( GetNumberOfLines() - 1 ); if ( line.IsEmpty() ) { SetDefaultStyle( COLOR_BLACK ); AppendText( wxT(" [") + wxDateTime::Now().FormatISOTime() + wxT("] ") ); } } SetDefaultStyle(style); AppendText( tokens.GetNextToken() ); // Only add newlines after the last line if it is desired if ( tokens.HasMoreTokens() || newline ) { AppendText( wxT("/n") ); } }}
开发者ID:geekt,项目名称:amule,代码行数:27,
示例3: AppendTextvoid SvnConsole::Stop(){ if (m_process) { delete m_process; m_process = NULL; } AppendText(_("Aborted./n")); AppendText(wxT("--------/n"));}
开发者ID:HTshandou,项目名称:codelite,代码行数:9,
示例4: wxDELETEvoid FindResultsTab::OnSearchMatch(wxCommandEvent& e){ SearchResultList* res = (SearchResultList*)e.GetClientData(); if(!res) return; int m = m_book ? m_book->GetPageIndex(m_recv) : 0; if(m == wxNOT_FOUND) { wxDELETE(res); return; } MatchInfo& matchInfo = GetMatchInfo(m); for(SearchResultList::iterator iter = res->begin(); iter != res->end(); iter++) { if(matchInfo.empty() || matchInfo.rbegin()->second.GetFileName() != iter->GetFileName()) { if(!matchInfo.empty()) { AppendText("/n"); } wxFileName fn(iter->GetFileName()); fn.MakeRelativeTo(); AppendText(fn.GetFullPath() + wxT("/n")); } int lineno = m_recv->GetLineCount() - 1; matchInfo.insert(std::make_pair(lineno, *iter)); wxString text = iter->GetPattern(); int delta = -text.Length(); text.Trim(false); delta += text.Length(); text.Trim(); wxString linenum; if(iter->GetMatchState() == CppWordScanner::STATE_CPP_COMMENT || iter->GetMatchState() == CppWordScanner::STATE_C_COMMENT) linenum = wxString::Format(wxT(" %5u //"), iter->GetLineNumber()); else linenum = wxString::Format(wxT(" %5u "), iter->GetLineNumber()); SearchData* d = GetSearchData(m_recv); // Print the scope name if(d->GetDisplayScope()) { TagEntryPtr tag = TagsManagerST::Get()->FunctionFromFileLine(iter->GetFileName(), iter->GetLineNumber()); wxString scopeName(wxT("global")); if(tag) { scopeName = tag->GetPath(); } linenum << wxT("[ ") << scopeName << wxT(" ] "); iter->SetScope(scopeName); } delta += linenum.Length(); AppendText(linenum + text + wxT("/n")); m_recv->IndicatorFillRange(m_sci->PositionFromLine(lineno) + iter->GetColumn() + delta, iter->GetLen()); } wxDELETE(res);}
开发者ID:Jactry,项目名称:codelite,代码行数:56,
示例5: sizeofvoid CLogView::Log(LogFacility logType, BSTR bsSource, BSTR bsModuleID, VARIANT vtValue){ CHARFORMAT cf = {0}; cf.cbSize = sizeof(CHARFORMAT); cf.dwMask = CFM_COLOR; CString sType; switch(logType) { case LT_DEBUG: sType = _T("debug"); cf.crTextColor = LOG_COLOR_DEBUG; break; case LT_INFO: sType = _T("info"); cf.crTextColor = LOG_COLOR_INFO; break; case LT_WARN: sType = _T("warning"); cf.crTextColor = LOG_COLOR_WARN; break; case LT_ERROR: sType = _T("error"); cf.crTextColor = LOG_COLOR_ERROR; break; default: sType = _T("log"); cf.crTextColor = LOG_DEFAULTCOLOR; break; } CTime ts = CTime::GetCurrentTime(); CString sDate(ts.Format(_T("%H:%M:%S"))); CComVariant vt; vt.ChangeType(VT_BSTR, &vtValue); if (vt.vt != VT_BSTR) { vt = _T("???"); } CString s; s.Format(_T("%s %s [%s: %s]: "), sDate, sType, bsSource, bsModuleID); SetSelectionCharFormat(cf); AppendText(s); cf.dwMask |= CFM_BOLD; cf.dwEffects = CFE_BOLD; SetSelectionCharFormat(cf); AppendText(vt.bstrVal); cf.dwMask = CFM_COLOR; cf.crTextColor = LOG_DEFAULTCOLOR; SetSelectionCharFormat(cf); AppendText(_T("/r/n"));}
开发者ID:bver,项目名称:ancho,代码行数:55,
示例6: write_filevoid write_file(JJGui *jibber_ui){ GError *err = NULL; gchar *text; gboolean result; GtkTextBuffer *buffer; GtkTextIter start, end; char szFilename[35] = ""; time_t t; struct tm *tmNow; // make sure the gui is finished with any queued instructions before going further while (gtk_events_pending()) gtk_main_iteration(); // get contents of buffer buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW (jibber_ui->text_view)); gtk_text_buffer_get_start_iter(buffer, &start); gtk_text_buffer_get_end_iter(buffer, &end); text = gtk_text_buffer_get_text(buffer, &start, &end, FALSE); gtk_text_buffer_set_modified(buffer, FALSE); t = time(NULL); tmNow = localtime(&t); if (tmNow == NULL) { // create a filename from the compile stamp sprintf(szFilename, "jibber_%s_%s.txt", __DATE__, __TIME__); } else { // create a filename from the time strftime(szFilename, 35, "jibber_%F_%H-%M-%S.txt", tmNow); } result = g_file_set_contents (szFilename, text, -1, &err); if (result == FALSE) { // error saving file, show message to user AppendText(jibber_ui, DIR_SYSTEM, "Couldn't save file: %s", szFilename); AppendText(jibber_ui, DIR_SYSTEM, (err->message)); } else AppendText(jibber_ui, DIR_SYSTEM, "Saved file: %s", szFilename); // free the text memory g_free (text);} // end of write_file
开发者ID:TheGurkha,项目名称:Jibber,代码行数:52,
示例7: AppendTextvoid BuildProgressPnl::OnMustRefresh(wxCommandEvent&){ std::vector < CodeCompilerTask > currentTasks = CodeCompiler::Get()->GetCurrentTasks(); if (CodeCompiler::Get()->CompilationInProcess()) { if (!currentTasks.empty()) { if (!CodeCompiler::Get()->LastTaskFailed()) { statusTxt->SetLabel(_("Task in progress:")+currentTasks[0].userFriendlyName); AppendText(_("Task in progress:")+currentTasks[0].userFriendlyName+("...")+"/n"); } else { statusTxt->SetLabel(_("The task ")+currentTasks[0].userFriendlyName+_("failed.")); AppendText(_("The task ")+currentTasks[0].userFriendlyName+_("failed.")+"/n"); } } } else { if (CodeCompiler::Get()->LastTaskFailed()) { statusTxt->SetLabel(_("Some tasks failed.")); AppendText(_("Some tasks failed.")+"/n"); } else { wxString timeStr = wxString::Format(_("( %ld seconds )"), compilationTimer.Time()/1000); if (!currentTasks.empty()) { statusTxt->SetLabel(_("Compilation finished")+timeStr+_(", but ")+gd::String::From(currentTasks.size())+_(" task(s) are waiting.")); AppendText(_("Tasks finished ")+timeStr+_(", but ")+gd::String::From(currentTasks.size())+_(" task(s) are waiting.")+"/n"); } else { statusTxt->SetLabel(_("Compilation finished.")); AppendText(_("All tasks have been completed.")+" "+timeStr+"/n"); } } clearOnNextTextAdding = true; } if (!currentTasks.empty()) progressGauge->SetValue(100.f/static_cast<float>(currentTasks.size()));}
开发者ID:HaoDrang,项目名称:GD,代码行数:48,
示例8: Freezevoid SearchWindow::SearchMessage(const wxString& message){ Freeze(); SetDefaultStyle(m_messageAttr); AppendText(message + "/n"); Thaw();}
开发者ID:dansen,项目名称:luacode,代码行数:7,
示例9: wxCHECK_RETvoid wxLuaConsole::DisplayStack(const wxLuaState& wxlState){ wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); int nIndex = 0; lua_Debug luaDebug = INIT_LUA_DEBUG; wxString buffer; lua_State* L = wxlState.GetLuaState(); while (lua_getstack(L, nIndex, &luaDebug) != 0) { if (lua_getinfo(L, "Sln", &luaDebug)) { wxString what (luaDebug.what ? lua2wx(luaDebug.what) : wxString(wxT("?"))); wxString nameWhat(luaDebug.namewhat ? lua2wx(luaDebug.namewhat) : wxString(wxT("?"))); wxString name (luaDebug.name ? lua2wx(luaDebug.name) : wxString(wxT("?"))); buffer += wxString::Format(wxT("[%d] %s '%s' '%s' (line %d)/n Line %d src='%s'/n"), nIndex, what.c_str(), nameWhat.c_str(), name.c_str(), luaDebug.linedefined, luaDebug.currentline, lua2wx(luaDebug.short_src).c_str()); } nIndex++; } if (!buffer.empty()) { AppendText(wxT("/n-----------------------------------------------------------") wxT("/n- Backtrace") wxT("/n-----------------------------------------------------------/n") + buffer + wxT("/n-----------------------------------------------------------/n/n")); }}
开发者ID:mattprintz,项目名称:wx-xword,代码行数:33,
示例10: SetPreservedRow//setting up the textarea for smooth scrolling, the first//TEXTAREA_OUTOFTEXT callback is called automaticallyvoid TextArea::SetupScroll(unsigned long tck){ SetPreservedRow(0); smooth = ftext->maxHeight; startrow = 0; ticks = tck; //clearing the textarea Clear(); unsigned int i = (unsigned int) (Height/smooth); while (i--) { char *str = (char *) malloc(1); str[0]=0; lines.push_back(str); lrows.push_back(0); } i = (unsigned int) lines.size(); Flags |= IE_GUI_TEXTAREA_SMOOTHSCROLL; GetTime( starttime ); if (RunEventHandler( TextAreaOutOfText )) { //event handler destructed this object? return; } if (i==lines.size()) { ResetEventHandler( TextAreaOutOfText ); return; } //recalculates rows AppendText("/n",-1);}
开发者ID:NickDaly,项目名称:GemRB-MultipleConfigs,代码行数:31,
示例11: AppendTextint wxTextCtrlBase::overflow(int c){ AppendText((wxChar)c); // return something different from EOF return 0;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:7,
示例12: assertvoidCBExecOutputDocument::ReceiveRecord(){ assert( itsRecordLink != NULL ); JString text; const JBoolean ok = itsRecordLink->GetNextMessage(&text); assert( ok ); // remove text that has already been printed if (!itsLastPrompt.IsEmpty() && text.BeginsWith(itsLastPrompt)) { text.RemoveSubstring(1, itsLastPrompt.GetLength()); } itsLastPrompt.Clear(); const JXTEBase::DisplayState state = GetTextEditor()->SaveDisplayState(); AppendText(text); GetTextEditor()->ClearUndo(); if (!itsReceivedDataFlag) { itsReceivedDataFlag = kJTrue; if (!IsActive()) { Activate(); } } GetTextEditor()->RestoreDisplayState(state);}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:33,
示例13: wxTvoid FindResultsTab::OnSearchStart(wxCommandEvent& e){ m_searchInProgress = true; SearchData* data = (SearchData*)e.GetClientData(); wxString label = data ? data->GetFindString() : wxT(""); if(e.GetInt() != 0 || m_sci == NULL) { if(m_book) { clWindowUpdateLocker locker(this); MySTC* sci = new MySTC(m_book); SetStyles(sci); sci->Connect(wxEVT_STC_STYLENEEDED, wxStyledTextEventHandler(FindResultsTab::OnStyleNeeded), NULL, this); m_book->AddPage(sci, label, true);#ifdef __WXMAC__ m_book->GetSizer()->Layout();#endif size_t where = m_book->GetPageCount() - 1; // keep the search data used for this tab wxWindow* tab = m_book->GetPage(where); if(tab) { tab->SetClientData(data); } m_matchInfo.push_back(MatchInfo()); m_sci = sci; } } else if(m_book) { // using current tab, update the tab title and the search data int where = m_book->GetPageIndex(m_sci); if(where != wxNOT_FOUND) { m_book->SetPageText(where, label); // delete the old search data wxWindow* tab = m_book->GetPage(where); SearchData* oldData = (SearchData*)tab->GetClientData(); if(oldData) { delete oldData; } // set the new search data tab->SetClientData(data); } } // This is needed in >=wxGTK-2.9, otherwise the 'Search' pane doesn't fully expand SendSizeEvent(wxSEND_EVENT_POST); m_recv = m_sci; Clear(); if(data) { m_searchData = *data; wxString message; message << _("====== Searching for: '") << data->GetFindString() << _("'; Match case: ") << (data->IsMatchCase() ? _("true") : _("false")) << _(" ; Match whole word: ") << (data->IsMatchWholeWord() ? _("true") : _("false")) << _(" ; Regular expression: ") << (data->IsRegularExpression() ? _("true") : _("false")) << wxT(" ======/n"); AppendText(message); }}
开发者ID:Jactry,项目名称:codelite,代码行数:60,
示例14: AppendTextwxTextCtrl& wxTextCtrlBase::operator<<(long i){ wxString str; str.Printf(wxT("%ld"), i); AppendText(str); return *TEXTCTRL(this);}
开发者ID:gitrider,项目名称:wxsj2,代码行数:7,
示例15: GetLastErrorvoid CRedirect::ShowLastError(LPCTSTR szText){ LPVOID lpMsgBuf; DWORD Success; //-------------------------------------------------------------------------- // Get the system error message. //-------------------------------------------------------------------------- Success = FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), //lint !e1924 (warning about C-style cast) LPTSTR(&lpMsgBuf), 0, NULL ); CString Msg; Msg = szText; Msg += _T("/r/n"); if ( Success ) { Msg += LPTSTR(lpMsgBuf); } else { Msg += _T("No status because FormatMessage failed./r/n"); } AppendText(Msg);}
开发者ID:weiwei22844,项目名称:UsefullProject,代码行数:35,
示例16: AssertAUI_ERRCODE aui_TextBox::AppendText( MBCHAR const * text, COLORREF color, sint32 bold, sint32 italic ){ Assert( text != NULL ); if ( !text ) return AUI_ERRCODE_INVALIDPARAM; if ( !strlen( text ) ) return AppendText(" ", color, bold, italic ); m_curColor = color; m_curBold = bold; m_curItalic = italic; CalculateAppendedItems( text ); Assert( m_curLength + strlen( text ) <= m_maxLength ); strncat( m_text, text, m_maxLength - m_curLength ); m_curLength = strlen( m_text ); return AUI_ERRCODE_OK;}
开发者ID:talentlesshack,项目名称:C2P2,代码行数:33,
示例17: svoid SvnConsole::OnReadProcessOutput(wxCommandEvent& event){ ProcessEventData *ped = (ProcessEventData *)event.GetClientData(); if (ped) { m_output.Append(ped->GetData().c_str()); } wxString s (ped->GetData()); s.MakeLower(); if (m_currCmd.printProcessOutput) AppendText( ped->GetData() ); static wxRegEx reUsername("username[ /t]*:", wxRE_DEFAULT|wxRE_ICASE); wxArrayString lines = wxStringTokenize(s, wxT("/n"), wxTOKEN_STRTOK); if( !lines.IsEmpty() && lines.Last().StartsWith(wxT("password for '")) ) { m_output.Clear(); wxString pass = wxGetPasswordFromUser(ped->GetData(), wxT("Subversion")); if(!pass.IsEmpty() && m_process) { m_process->WriteToConsole(pass); } } else if ( !lines.IsEmpty() && reUsername.IsValid() && reUsername.Matches( lines.Last() ) ) { // Prompt the user for "Username:" wxString username = ::wxGetTextFromUser(ped->GetData(), "Subversion"); if ( !username.IsEmpty() && m_process ) { m_process->Write(username + "/n"); } } delete ped;}
开发者ID:HTshandou,项目名称:codelite,代码行数:30,
示例18: AppendTextNyqRedirector::~NyqRedirector(){ std::cout.flush(); std::cout.rdbuf(mOld); if (s.length() > 0) { AppendText(); }}
开发者ID:finefin,项目名称:audacity,代码行数:8,
示例19: wxTextCtrlSourceView::SourceView(wxWindow *parent, MainWin* mainwin_): wxTextCtrl(parent, SOURCE_VIEW, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxSUNKEN_BORDER | wxTE_READONLY | wxTE_DONTWRAP | wxTE_RICH2 ), mainwin(mainwin_){ AppendText("Select a procedure from the list above.");}
开发者ID:mhoffesommer,项目名称:Very-Sleepy,代码行数:8,
示例20: HotKeyPressedvoid HotKeyPressed(WPARAM wParam){ //AppendText(txtbox, _T("hotkey test")); if (wParam == (pauseHotKey + hotkeyIdOffset)) { if (!isPaused) { AppendText(txtbox, _T("Paused/r/n")); isPaused = true; } else { isPaused = false; AppendText(txtbox, _T("Unpaused/r/n")); } }}
开发者ID:Synthuse,项目名称:synthuse-src,代码行数:17,
示例21: AppendTextvoid FindResultsTab::OnSearchCancel(wxCommandEvent& e){ m_searchInProgress = false; wxString* str = (wxString*)e.GetClientData(); if(!str) return; AppendText((*str) + wxT("/n")); wxDELETE(str);}
开发者ID:pengshp,项目名称:codelite,代码行数:8,
示例22: hardware/************************************************************************* errorType STLServerCommandWaitForCompletionXXX::Read()will have already read the Socket command type and the command idnow need to read the command specific data from the client.Should only be called from a GSISocket server or derived classNote that the corresponding ::Write function will be waiting for aServerReturnRecord. This function does not return this record as itdoesn't know if the task was completed without error.The calling code will need to perform the required hardware (or other) tasksand return the ServerReturnRecord indicating status of the functionReads:nothing to read*************************************************************************/errorType STLServerCommandWaitForCompletionXXX::Read(wxSocketBase &sock){errorType rv; rv=ReadFixedFields(sock); //reads qflag, at_tick FillGSIRecord(); //fill in the Hdw record AppendText("Read WaitForCompletion from client/n"); return errNone;}
开发者ID:glennspr,项目名称:iCanPic,代码行数:24,
示例23: AppendTextvoid FindResultsTab::OnSearchMatch(wxCommandEvent& e){ SearchResultList* res = (SearchResultList*)e.GetClientData(); if(!res) return; SearchResultList::iterator iter = res->begin(); for(; iter != res->end(); ++iter) { if(m_matchInfo.empty() || m_matchInfo.rbegin()->second.GetFileName() != iter->GetFileName()) { if(!m_matchInfo.empty()) { AppendText("/n"); } wxFileName fn(iter->GetFileName()); fn.MakeRelativeTo(); AppendText(fn.GetFullPath() + wxT("/n")); } int lineno = m_sci->GetLineCount() - 1; m_matchInfo.insert(std::make_pair(lineno, *iter)); wxString text = iter->GetPattern(); // int delta = -text.Length(); // text.Trim(false); // delta += text.Length(); // text.Trim(); wxString linenum = wxString::Format(wxT(" %5u: "), iter->GetLineNumber()); SearchData* d = GetSearchData(); // Print the scope name if(d->GetDisplayScope()) { TagEntryPtr tag = TagsManagerST::Get()->FunctionFromFileLine(iter->GetFileName(), iter->GetLineNumber()); wxString scopeName(wxT("global")); if(tag) { scopeName = tag->GetPath(); } linenum << wxT("[ ") << scopeName << wxT(" ] "); iter->SetScope(scopeName); } AppendText(linenum + text + wxT("/n")); int indicatorStartPos = m_sci->PositionFromLine(lineno) + iter->GetColumn() + linenum.Length(); int indicatorLen = iter->GetLen(); m_indicators.push_back(indicatorStartPos); m_sci->IndicatorFillRange(indicatorStartPos, indicatorLen); } wxDELETE(res);}
开发者ID:kluete,项目名称:codelite,代码行数:46,
示例24: StopMessageHookvoid StopMessageHook(){ EnableMenuItem(mainMenu, ID_FILE_STOPHOOK, MF_DISABLED | MF_GRAYED); EnableMenuItem(mainMenu, ID_FILE_STARTHOOK, MF_ENABLED); AppendText(txtbox, TEXT("Stopping Message Hook/r/n")); //KillHook(); RemoveHook(); msgCount = 0;}
开发者ID:Synthuse,项目名称:synthuse-src,代码行数:9,
示例25: PrintResultstatic void PrintResult(HWND hText, number_t number){ char buf[MAX_RESULT_BUFFER]; unsigned long print_format; unsigned long print_format_float; print_format = GetIdentifierValueAsNativeInteger("print_format"); if (print_format == 0) { print_format = PRINT_FORMAT_DEC; } print_format_float = GetIdentifierValueAsNativeInteger("print_format_float"); if (print_format_float == 0) { print_format_float = PRINT_FORMAT_FLOAT_AUTO; } if ((print_format & PRINT_FORMAT_BIN) || (print_format & PRINT_FORMAT_HEX)) { integer_t *integer_result; char *str_result; integer_result = AllocateAndInitInteger(); mpz_set_f(*integer_result, number); if (print_format & PRINT_FORMAT_BIN) { str_result = mpz_get_str(NULL, 2, *integer_result); AppendText(hText, NEWLINE"=0b"); AppendText(hText, str_result); free(str_result); } if (print_format & PRINT_FORMAT_HEX) { str_result = mpz_get_str(NULL, 16, *integer_result); AppendText(hText, NEWLINE"=0x"); AppendText(hText, str_result); free(str_result); } FreeInteger(integer_result); } if (print_format & PRINT_FORMAT_DEC) { char format_str[] = NEWLINE"=%F "; format_str[strlen(format_str)-1] = print_format_float == PRINT_FORMAT_FLOAT_AUTO ? 'G' : print_format_float == PRINT_FORMAT_FLOAT_FIXED ? 'f' : print_format_float == PRINT_FORMAT_FLOAT_SCIENTIFIC ? 'e' : print_format_float == PRINT_FORMAT_FLOAT_HEX ? 'X' : 'g'; gmp_snprintf(buf, sizeof(buf), format_str, number); AppendText(hText, buf); }}
开发者ID:samueldotj,项目名称:eva,代码行数:44,
注:本文中的AppendText函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AppendToString函数代码示例 C++ AppendString函数代码示例 |