void mxExportPreview::UpdatePrev ( ) { if (state!=mxEP_NONE && pid>0) { state=mxEP_UPDATE; the_process->Kill(pid,wxSIGKILL); return; } the_process = new wxProcess(this->GetEventHandler()); mxSource * src = main_window->GetCurrentSource(); if (!src) { SetMessage(_Z("No hay pseudocódigo para exportar")); state=mxEP_NONE; return; } wxString command; command<<config->pseint_command<<_T(" --nouser --norun \"")<<src->SaveTemp()<<_T("\" "); command<<mxProcess::GetProfileArgs(); command<<" --draw \""<<temp_filename<<".psd"<<"\""; _LOG("mxExportPreview, command="<<command); pid = wxExecute(command,wxEXEC_ASYNC,the_process); if (pid<=0) { SetMessage(_Z("Error al intentar exportar")); return; } SetMessage("Actualizando..."); state=mxEP_CHECK; }
bool CMakePacket::ProcessMessageBlock(_MakePacket* pMakePacket) { if(NULL == pMakePacket) { OUR_DEBUG((LM_ERROR,"[CMakePacket::ProcessMessageBlock] pMakePacket is NULL.\n")); return false; } //根据操作OP,调用相应的方法。 CMessage* pMessage = App_MessageServiceGroup::instance()->CreateMessage(pMakePacket->m_u4ConnectID, pMakePacket->m_PacketType); if(NULL == pMessage) { OUR_DEBUG((LM_ERROR,"[CMakePacket::ProcessMessageBlock] pMessage is NULL.\n")); return false; } if(pMakePacket->m_u1Option == PACKET_PARSE) { if(pMakePacket->m_PacketType == 0) { //TCP数据包处理方法 SetMessage(pMakePacket->m_pPacketParse, pMakePacket->m_u4ConnectID, pMessage); } else { //UDP数据包处理方法 SetMessage(pMakePacket->m_pPacketParse, pMakePacket->m_AddrRemote, pMessage); } } else if(pMakePacket->m_u1Option == PACKET_CONNECT) { SetMessageConnect(pMakePacket->m_u4ConnectID, pMessage); } else if(pMakePacket->m_u1Option == PACKET_CDISCONNECT) { SetMessageCDisConnect(pMakePacket->m_u4ConnectID, pMessage); } else if(pMakePacket->m_u1Option == PACKET_SDISCONNECT) { SetMessageSDisConnect(pMakePacket->m_u4ConnectID, pMessage); } else if(pMakePacket->m_u1Option == PACKET_SEND_TIMEOUT) { SetMessageSendTimeout(pMakePacket->m_u4ConnectID, pMessage); } else if(pMakePacket->m_u1Option == PACKET_CHEK_TIMEOUT) { SetMessageSendTimeout(pMakePacket->m_u4ConnectID, pMessage); } //将要处理的消息放入消息处理线程 if(false == App_MessageServiceGroup::instance()->PutMessage(pMessage)) { OUR_DEBUG((LM_ERROR, "[CMakePacket::ProcessMessageBlock] App_MessageServiceGroup::instance()->PutMessage Error.\n")); App_MessageServiceGroup::instance()->DeleteMessage(pMakePacket->m_u4ConnectID, pMessage); return false; } return true; }
/** ** Player quit. ** ** @param player Player number that quit. */ void CommandQuit(int player) { int i; // Set player to neutral, remove allied/enemy/shared vision status // If the player doesn't have any units then this is pointless? Players[player].Type = PlayerNeutral; for (i = 0; i < NumPlayers; ++i) { if (i != player && Players[i].Team != Players[player].Team) { Players[i].Allied &= ~(1 << player); Players[i].Enemy &= ~(1 << player); Players[player].Enemy &= ~(1 << i); Players[player].Allied &= ~(1 << i); // We clear Shared vision by sending fake shared vision commands. // We do this because Shared vision is a bit complex. CommandSharedVision(i, 0, player); CommandSharedVision(player, 0, i); // Remove Selection from Quit Player ChangeTeamSelectedUnits(&Players[player], NULL, 0, 0); } } if (Players[player].TotalNumUnits != 0) { SetMessage(_("Player \"%s\" has left the game"), Players[player].Name.c_str()); } else { SetMessage(_("Player \"%s\" has been killed"), Players[player].Name.c_str()); } }
BOOL CDialog::OnInit(HWND hwnd) { TCHAR szCaption[MAX_PATH] = {0}; m_hwnd = hwnd; if( IsAlreadyInstalled() ) { if( IsSameVersion() ) m_bUnInstall = true; else m_bNewVersion = true; } // Set dialog icon, big and small ::SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(m_hInstance, MAKEINTRESOURCE(IDI_MAIN))); ::SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(m_hInstance, MAKEINTRESOURCE(IDI_MAIN))); // Set dialog caption int caption = m_bUnInstall ? IDS_CAPTION_UNINSTALL : IDS_CAPTION_INSTALL; ::LoadString(m_hInstance, caption, szCaption, sizeof(szCaption)); ::SetWindowText(hwnd, szCaption); DisplayVersion(); // Set dialog message if(m_bUnInstall) SetMessage( IDS_BODY_UNINSTALL ); else SetMessage( IDS_BODY_INSTALL, m_szDestinationPath ); return TRUE; }
static void CheckPlayerThatTimeOut(int hostIndex) { const int playerIndex = Hosts[hostIndex].PlyNr; const unsigned long lastFrame = NetworkLastFrame[playerIndex]; if (!lastFrame) { return; } const int framesPerSecond = FRAMES_PER_SECOND * VideoSyncSpeed / 100; const int secs = (FrameCounter - lastFrame) / framesPerSecond; // FIXME: display a menu while we wait const int timeoutInS = CNetworkParameter::Instance.timeoutInS; if (3 <= secs && secs < timeoutInS && FrameCounter % framesPerSecond == 0) { SetMessage(_("Waiting for player \"%s\": %d:%02d"), Hosts[hostIndex].PlyName, (timeoutInS - secs) / 60, (timeoutInS - secs) % 60); } if (secs >= timeoutInS) { const unsigned int nextGameNetCycle = GameCycle / CNetworkParameter::Instance.gameCyclesPerUpdate + 1; CNetworkCommandQuit nc; nc.player = playerIndex; CNetworkCommandQueue *ncq = &NetworkIn[nextGameNetCycle & 0xFF][playerIndex][0]; ncq->Time = nextGameNetCycle * CNetworkParameter::Instance.gameCyclesPerUpdate; ncq->Type = MessageQuit; ncq->Data.resize(nc.Size()); nc.Serialize(&ncq->Data[0]); PlayerQuit[playerIndex] = 1; SetMessage("%s", _("Timed out")); CNetworkPacket np; np.Header.Cycle = ncq->Time & 0xFF; np.Header.Type[0] = ncq->Type; np.Header.Type[1] = MessageNone; NetworkBroadcast(np, 1); } }
/** ** Player quit. ** ** @param player Player number that quit. */ void CommandQuit(int player) { // Set player to neutral, remove allied/enemy/shared vision status // If the player doesn't have any units then this is pointless? Players[player].Type = PlayerNeutral; for (int i = 0; i < NumPlayers; ++i) { if (i != player && Players[i].Team != Players[player].Team) { Players[i].SetDiplomacyNeutralWith(Players[player]); Players[player].SetDiplomacyNeutralWith(Players[i]); // We clear Shared vision by sending fake shared vision commands. // We do this because Shared vision is a bit complex. CommandSharedVision(i, 0, player); CommandSharedVision(player, 0, i); // Remove Selection from Quit Player std::vector<CUnit *> empty; ChangeTeamSelectedUnits(Players[player], empty); } } if (Players[player].GetUnitCount() != 0) { SetMessage(_("Player \"%s\" has left the game"), Players[player].Name.c_str()); } else { SetMessage(_("Player \"%s\" has been killed"), Players[player].Name.c_str()); } }
/** ** Replay user commands from log each cycle */ static void ReplayEachCycle() { if (!CurrentReplay) { return; } if (InitReplay) { for (int i = 0; i < PlayerMax; ++i) { if (!CurrentReplay->Players[i].Name.empty()) { Players[i].SetName(CurrentReplay->Players[i].Name); } } ReplayStep = CurrentReplay->Commands; NextLogCycle = (ReplayStep ? (unsigned)ReplayStep->GameCycle : ~0UL); InitReplay = 0; } if (!ReplayStep) { SetMessage("%s", _("End of replay")); GameObserve = false; return; } if (NextLogCycle != ~0UL && NextLogCycle != GameCycle) { return; } do { DoNextReplay(); } while (ReplayStep && (NextLogCycle == ~0UL || NextLogCycle == GameCycle)); if (!ReplayStep) { SetMessage("%s", _("End of replay")); GameObserve = false; } }
void cSkinDisplayChannel::SetPositioner(const cPositioner *Positioner) { if (positioner && Positioner != positioner) SetMessage(mtInfo, NULL); positioner = Positioner; if (positioner) SetMessage(mtInfo, cString::sprintf(tr("Moving dish to %.1f..."), double(positioner->TargetLongitude()) / 10)); }
void Action_QuickLoad(void) { bool (* loadSnap)(const char *filename, Z80EX_CONTEXT *cpu, C_MemoryManager &mmgr, C_Border &border); isPaused = false; const char * snapName = (params.snapFormat==SNAP_FORMAT_SNA ? "snap.sna" : "snap.z80"); loadSnap = (params.snapFormat==SNAP_FORMAT_SNA ? load_sna_snap : load_z80_snap); if (!loadSnap(snapName, cpu, dev_mman, dev_border)) SetMessage("Error loading snapshot"); else SetMessage("Snapshot loaded"); }
void DisplayTurboMessage(void) { if (turboMultiplierNx < 2) { SetMessage("Turbo OFF"); } else { char buf[0x10]; sprintf(buf, (unturboNx ? "Slowness %dx" : "Turbo %dx"), turboMultiplierNx); SetMessage(buf); } }
void Action_AttributesHack(void) { isPaused = false; attributesHack = (attributesHack + 1) % 3; if (attributesHack) { char buf[0x20]; sprintf(buf, "AttributesHack #%d", attributesHack); SetMessage(buf); } else { SetMessage("AttributesHack OFF"); } }
PythonToCppException::PythonToCppException() : XbmcCommons::UncheckedException(" ") { setClassname("PythonToCppException"); PyObject* exc_type; PyObject* exc_value; PyObject* exc_traceback; PyObject* pystring = NULL; CStdString msg; PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); if (exc_type == 0 && exc_value == 0 && exc_traceback == 0) { msg = "Strange: No Python exception occured"; } else { msg = "-->Python callback/script returned the following error<--\n"; msg += " - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!\n"; if (exc_type != NULL && (pystring = PyObject_Str(exc_type)) != NULL && (PyString_Check(pystring))) { PyObject *tracebackModule; msg.AppendFormat("Error Type: %s\n", PyString_AsString(pystring)); if (PyObject_Str(exc_value)) msg.AppendFormat("Error Contents: %s\n", PyString_AsString(PyObject_Str(exc_value))); tracebackModule = PyImport_ImportModule((char*)"traceback"); if (tracebackModule != NULL) { PyObject *tbList, *emptyString, *strRetval; tbList = PyObject_CallMethod(tracebackModule, (char*)"format_exception", (char*)"OOO", exc_type, exc_value == NULL ? Py_None : exc_value, exc_traceback == NULL ? Py_None : exc_traceback); emptyString = PyString_FromString(""); strRetval = PyObject_CallMethod(emptyString, (char*)"join", (char*)"O", tbList); msg.Format("%s%s", msg.c_str(),PyString_AsString(strRetval)); Py_DECREF(tbList); Py_DECREF(emptyString); Py_DECREF(strRetval); Py_DECREF(tracebackModule); } msg += "-->End of Python script error report<--\n"; } else { pystring = NULL; msg += "<unknown exception type>"; } } Py_XDECREF(exc_type); Py_XDECREF(exc_value); // caller owns all 3 Py_XDECREF(exc_traceback); // already NULL'd out Py_XDECREF(pystring); SetMessage("%s",msg.c_str()); }
CLogEntryData::CLogEntryData ( CLogEntryData* parent , svn_revnum_t revision , __time64_t tmDate , const std::string& author , const std::string& message , ProjectProperties* projectProperties , const MergeInfo* mergeInfo) : parent (parent) , hasParent(false) , hasChildren (false) // we don't read that from the "mergesFollow" flag // (just to be sure that we actually have sub-nodes) , nonInheritable (mergeInfo && mergeInfo->nonInheritable) , subtractiveMerge (mergeInfo && mergeInfo->subtractiveMerge) , childStackDepth (parent == NULL ? 0 : parent->childStackDepth+1) , revision (revision) , tmDate (tmDate) , sAuthor (author) , projectProperties (projectProperties) , checked (false) , bugIDsPending (true) , unread(false) { // derived header info SetMessage (message); // update nesting info if (parent) { hasParent = true; parent->hasChildren = true; } }
void CDialog::AppendMessage(int msg, LPCTSTR pszParam, bool bNewLine) { UINT uLen; TCHAR szMessage[MAX_PATH] = {0}; TCHAR szBody[MAX_PATH] = {0}; uLen = ::GetDlgItemText( m_hwnd, IDC_MESSAGE, szBody, sizeof(szBody)); if(pszParam) { TCHAR szTemp[MAX_PATH] = {0}; ::LoadString(m_hInstance, msg, szTemp, sizeof(szTemp)); wsprintf(szMessage, szTemp, pszParam); } else { ::LoadString(m_hInstance, msg, szMessage, sizeof(szMessage)); } if(bNewLine && (lstrlen(szBody) > 0)) lstrcat(szBody, "\n"); lstrcat(szBody, szMessage); SetMessage( szBody ); }
BOOL CDialog::OnCommand(int id, int code) { switch(id) { case IDOK: if(m_bNewVersion) { if( Uninstall() ) return Install(); else { // Write something to RunOnce registry key // Keep in mind that Uninstall() already did! SetMessage( IDS_RESTARTBEFOREUPDATE ); } } else if(m_bUnInstall) return Uninstall(); else return Install(); break; case IDCANCEL: if(m_bUnInstall) CreateUninstall(TRUE); ::PostQuitMessage(1); break; } return FALSE; }
void Action_JoyOnKeyb(void) { isPaused = false; joyOnKeyb = !joyOnKeyb; dev_kempston.joy_kbd = 0; SetMessage(joyOnKeyb ? "Kempston on keyboard ON" : "Kempston on keyboard OFF"); }
/************************************************************************************************ * CRMObjective::CRMObjective * Constructs a random mission objective and fills in the default properties * * inputs: * none * * return: * none * ************************************************************************************************/ CRMObjective::CRMObjective ( CGPGroup* group ) { SetPriority(atoi(group->FindPairValue("priority", "0"))); SetMessage( group->FindPairValue("message",va("Objective %i Completed", GetPriority()) ) ); SetDescription(group->FindPairValue("description",va("Objective %i", GetPriority()) ) ); SetInfo(group->FindPairValue("info",va("Info %i", GetPriority()) ) ); SetTrigger(group->FindPairValue("trigger","")); SetName(group->GetName()); /* const char * soundPath = group->FindPairValue("completed_sound", "" ); if (soundPath) mCompleteSoundID = G_SoundIndex(soundPath); */ mCompleted = false; mOrderIndex = -1; // If no priority was specified for this objective then its active by default. if ( GetPriority ( ) ) { mActive = false; } else { mActive = true; } }
CscopeTab::CscopeTab( wxWindow* parent, CscopeConfig *cfg ) : wxPanel( parent ) , m_table(NULL) , m_cfg(cfg) { wxBoxSizer* mainSizer; mainSizer = new wxBoxSizer( wxVERTICAL ); m_pListCtrl = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_VRULES |wxLC_SINGLE_SEL); mainSizer->Add( m_pListCtrl, 1, wxEXPAND, 5 ); wxBoxSizer* bSizer3; bSizer3 = new wxBoxSizer( wxHORIZONTAL ); m_statusMessage = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_statusMessage->Wrap( -1 ); bSizer3->Add( m_statusMessage, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); m_gauge = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,15 ), wxGA_HORIZONTAL|wxGA_SMOOTH ); m_gauge->SetValue( 0 ); bSizer3->Add( m_gauge, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 0 ); mainSizer->Add( bSizer3, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); this->SetSizer( mainSizer ); this->Layout(); // Connect Events m_pListCtrl->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED,wxListEventHandler(CscopeTab::OnListItemActivated),NULL,this); Clear(); SetMessage(_T("Ready"), 0); }
static void TellUserAboutMessage(Widget label, ResCommand command) { char msg[BUFSIZ], *str; switch(command) { case LocalSendWidgetTree: str = " asking for widget tree"; break; case LocalSetValues: str = " asking it to perform SetValues()"; break; case LocalFlashWidget: case LocalGetGeometry: str = " asking it to perform GetGeometry()"; break; case LocalGetResources: str = " asking it to get a widget's resource list"; break; case LocalFindChild: str = " asking it to find the child Widget."; break; default: str = ""; break; } sprintf(msg, res_labels[8], str); SetMessage(label, msg); }
//------------------------------------------------------------------------------ BControl::~BControl() { if (fLabel) free(fLabel); SetMessage(NULL); }
void Action_AntiFlicker(void) { isPaused = false; params.antiFlicker = !params.antiFlicker; if (params.antiFlicker) doCopyOfSurfaces = true; SetMessage(params.antiFlicker ? "AntiFlicker ON" : "AntiFlicker OFF"); }
void avtVariableLegend::SetRange(double nmin, double nmax) { min = nmin; max = nmax; if (min == max) { // // Set a message and don't build labels. // SetMessage("Constant."); sBar->SetNumberOfLabels(0); sBar->SetRange(min, max); } else if (min == FLT_MAX || max == -FLT_MAX ) { debug5 << "avtVariableLegend did not get valid range." << endl; // // We didn't get good values for the range. // Don't label, don't set range of lut. sBar->SetNumberOfLabels(0); } else { sBar->SetNumberOfLabels(numTicks); if (lut != NULL) lut->SetTableRange(min, max); sBar->SetRange(min, max); } }
BControl::BControl(BMessage* data) : BView(data) { InitData(data); BMessage message; if (data->FindMessage("_msg", &message) == B_OK) SetMessage(new BMessage(message)); const char* label; if (data->FindString("_label", &label) == B_OK) SetLabel(label); int32 value; if (data->FindInt32("_val", &value) == B_OK) SetValue(value); bool toggle; if (data->FindBool("_disable", &toggle) == B_OK) SetEnabled(!toggle); if (data->FindBool("be:wants_nav", &toggle) == B_OK) fWantsNav = toggle; }
FactoryErrorDialog::FactoryErrorDialog( /* [in] */ IContext* context, /* [in] */ ICharSequence* msg) : BaseErrorDialog(context) { mHandler = new MyHandler(); SetCancelable(FALSE); AutoPtr<ICharSequence> title; context->GetText(R::string::factorytest_failed, (ICharSequence**)&title); SetTitle(title); SetMessage(msg); AutoPtr<ICharSequence> text; context->GetText(R::string::factorytest_reboot, (ICharSequence**)&text); AutoPtr<IMessage> msg2; mHandler->ObtainMessage(0, (IMessage**)&msg2); AlertDialog::SetButton(IDialogInterface::BUTTON_POSITIVE, text, msg2); AutoPtr<IWindow> window; GetWindow((IWindow**)&window); AutoPtr<IWindowManagerLayoutParams> attrs; window->GetAttributes((IWindowManagerLayoutParams**)&attrs); AutoPtr<ICharSequence> fcs; CString::New(String("Factory Error"), (ICharSequence**)&fcs); attrs->SetTitle(fcs); window->SetAttributes(attrs); }
// Find the previous occurance of a string and return a pointer to it. uint8 *FindPrev(const String &cText, int *pnLen) { uint8 *pBytes = ParseFindText(cText, pnLen); if( pBytes == NULL ) return NULL; const uint8 *pStart = GetBuffer(); const uint8 *pCurs = GetCursor(); const uint8 *pLook = pCurs - 1; const uint8 *pEnd = pStart + GetBufferLength() - *pnLen; while( pLook != pCurs ) { if( Match(pLook, pBytes, *pnLen) ) break; pLook--; if( pLook < pStart ) { pLook = pEnd; SetMessage(STR_MSG_SEARCH_CONTINUE_BOTTOM); } } free(pBytes); return (uint8 *)pLook; }
// Find the previous occurance of a string and return a pointer to it. uint8 *FindPrev(const String &cText, int *pnLen) { *pnLen = cText.size(); const uint8 *pStart = GetBuffer(); const uint8 *pCurs = GetCursor(); const uint8 *pLook = pCurs - 1; const uint8 *pEnd = pStart + GetBufferLength() - *pnLen; while( pLook != pCurs ) { bool bFound = true; for( uint32 i = 0; i < cText.size(); i++ ) if( *(pLook + i) != (uint8)cText[i] ) { bFound = false; break; } if( bFound ) break; pLook--; if( pLook < pStart ) { pLook = pEnd; SetMessage(STR_MSG_SEARCH_CONTINUE_BOTTOM); } } return (uint8 *)pLook; }
HCheckBox::HCheckBox(BView* view, const char* name, BMessage* msg, uint32 resizingMode) : BCheckBox(BRect(0, 0, 100, 50), name, "", msg, resizingMode) { if (view != NULL) view->AddChild(this); if (msg == NULL) SetMessage(new BMessage(msg_FieldChanged)); } /* HCheckBox::HCheckBox */
void Ask( const char *msg, pfGUICtrlProcObject *callbackProc, uint32_t noCBValue, uint32_t yesCBValue ) { SetMessage( msg ); fCBProc = callbackProc; fNoCBValue = noCBValue; fYesCBValue = yesCBValue; fDialog->Show(); }
void StateLabel::SetSlot (uint32_t aSlot) { assert(aSlot >= 1 && aSlot <= 9); MDFNI_SelectState(aSlot); SetMessage(_("Slot %d"), aSlot); FillScratch(); }
YesToAllDlg::YesToAllDlg( wxWindow* parent, const wxString& message /*=wxT("This space unintentionally left blank")*/, const bool setcheck /*=false*/, const wxString& title /*=wxT("Are you sure?")*/, wxWindowID id /*=wxID_ANY*/, const wxPoint& pos /*=wxDefaultPosition*/, const wxSize& size /*=wxSize( wxDefaultSize )*/, long style /*=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER )*/ ) : YesToAllBaseDlg( parent, id, title, pos, size, style ) { SetMessage(message); m_checkBoxAll->SetValue(setcheck); }