Example #1
0
void AfficheAjoutFamille::OnSaisie(wxCommandEvent & event) {
    if (event.GetId() == ID_AfficheAjoutFamilleLatin) {
        nbCar = event.GetString().length() > 0 ? 1 : 0;
        nbTextFields[0] = (nbCar == 1) ? 1 : 0;
    }
    int oblig = 0; // = 1 : commentaire facultatif ; = 0 : commentaire obligatoire
    switch (oblig) {
        case 0:
            if (event.GetId() == ID_AfficheAjoutFamilleComment) {
                nbCar = event.GetString().length() > 0 ? 1 : 0;
                nbTextFields[1] = (nbCar == 1) ? 1 : 0;
            }
            if (nbTextFields[0] == 1 && nbTextFields[1] == 1) {
                latinValueOrdre->Enable(true);
                ordre = latinValueOrdre->GetValue();
            } else {
                OKButton->Enable(false);
            }
            break;
        case 1:
            if (nbTextFields[0] == 1) {
                latinValueOrdre->Enable(true);
                ordre = latinValueOrdre->GetValue();
            } else {
                OKButton->Enable(false);
            }
            break;
        default:
            wxMessageBox(wxT("Erreur irréparable"), wxT("Impossible d'ajouter un ordre"));
            break;
    }
}
Example #2
0
void CDialogProxyRefresh::OnRefreshCMD( wxCommandEvent& event )
{
	switch(event.GetInt())
	{
	case EVENT_TYPE_REFRESH_INFO:
		m_textCtrlInfo->AppendText(event.GetString());
		break;
	case EVENT_TYPE_REFRESH_SUCC:
		{
			m_textCtrlInfo->AppendText(wxString::Format("* %s succ\n", event.GetString()));
			m_iRefreshNums++;
			RefreshInfo();
		}
		break;
	case EVENT_TYPE_REFRESH_FAIL:
		{
			if (m_bUseProxy) {
				wxString key = event.GetString();
				if (key.Len()>0)
					m_pConfig->Remove(key);
			}

			m_textCtrlInfo->AppendText(wxString::Format("* %s fail\n", event.GetString()));
		}
		break;
	case EVENT_TYPE_THREAD_EXIT:
		m_iThreadNums--;
		CreatThreads();
		break;
	default:
		m_textCtrlInfo->AppendText(event.GetString());
		break;
	}
}
Example #3
0
void NouvelleConnexion::OnSaisie(wxCommandEvent & event) {
    if (event.GetId() == ID_Host) {
        nbCar = event.GetString().length() > 0 ? 1 : 0;
        nbTextFields[0] = (nbCar == 1) ? 1 : 0;
    }
    if (event.GetId() == ID_Port) {
        nbCar = (event.GetString().length()) > 0 ? 1 : 0;
        nbTextFields[1] = (nbCar == 1) ? 1 : 0;
    }
    if (event.GetId() == ID_Dbname) {
        nbCar = event.GetString().length() > 0 ? 1 : 0;
        nbTextFields[2] = (nbCar == 1) ? 1 : 0;
    }
    if (event.GetId() == ID_User) {
        nbCar = event.GetString().length() > 0 ? 1 : 0;
        nbTextFields[3] = (nbCar == 1) ? 1 : 0;
    }
    if (event.GetId() == ID_Pwd) {
        nbCar = event.GetString().length() > 0 ? 1 : 0;
        nbTextFields[4] = (nbCar == 1) ? 1 : 0;
    }
    if (nbTextFields[0] == 1 && nbTextFields[1] == 1 && nbTextFields[2] == 1 && nbTextFields[3] == 1 && nbTextFields[4] == 1) {
        connButton->Enable(true);
        connButton->SetDefault();
    } else {
        connButton->Enable(false);
    }
}
Example #4
0
void UpdateDlg::OnDownloadEnded(wxCommandEvent& event)
{
    UpdateStatus(_("Download finished: ") + event.GetString());
    XRCCTRL(*this, "lblProgress", wxStaticText)->SetLabel(_T(""));
    m_LastBlockSize = 0;

    if (m_HasUpdated && event.GetInt() == 0)
    {
        UpdateRec* rec = GetRecFromListView();
        if (rec)
        {
            if (rec->bytes != m_CurrFileSize)
                wxMessageBox(_("File size mismatch for ") + event.GetString() + _("!\n\n"
                            "This, usually, means one of three things:\n"
                            "1) The reported size in the update list is wrong. The DevPak might still be valid.\n"
                            "2) The file's location returned a web error-page. Invalid DevPak...\n"
                            "3) The file is corrupt...\n\n"
                            "You can try to install it anyway. If it is not a valid DevPak, the operation will fail."),
                            _("Warning"), wxICON_WARNING);
        }
        if (rec && rec->installable && wxMessageBox(_("Do you want to install ") + event.GetString() + _(" now?"), _("Confirmation"), wxICON_QUESTION | wxYES_NO) == wxYES)
            InstallFile();
        else if (rec && rec->title == _T("WebUpdate Mirrors list"))
            InstallMirrors(GetPackagePath() + rec->local_file);
    }
    m_CurrFileSize = 0;
}
Example #5
0
void MemoryImpl::JumpToSymbol( wxCommandEvent& event )
{
	// Lookup the text in a hashmap
	RefreshMem( lhm[event.GetString()]);
//	addressBox->SetValue(wxString::Format(_("%X"),lhm[event.GetString()]));
//	scrollRAM->SetThumbPosition(lhm[event.GetString()] / 16);
	ChangeAddress(lhm[event.GetString()]);
}
Example #6
0
void MainFrame::OnStringFilter(wxCommandEvent& event) {
    if (event.GetString().empty()) {
        OnStringFilterCancel(event);
        return;
    }
    stringList->ApplyFilter(event.GetString());
    searchBox->ShowCancelButton(true);
    UpdateStatus();
}
Example #7
0
/*!
    \brief Console output (stderr).
    \param event wxCommandEvent containing output data.
*/
void OpenOCDDriver::OnProcError(wxCommandEvent &event)
{
    wxString msg = event.GetString();
    if (!msg.IsEmpty())
    {
        Log(event.GetString());
        ParseOutput(msg);
    }
}
Example #8
0
void tracelogApp::OnDebugString(wxCommandEvent &event)
{
    m_pLogFrame->AddEntry(wxDateTime::UNow(), event.GetInt(), event.GetString());
    std::map<wxSocketBase *, wxSocketOutputStream *>::iterator it;
    for (it = m_mClients.begin() ; it != m_mClients.end(); it++) {
        wxTextOutputStream s(*(it->second));
        s << event.GetInt() << wxT("\t") << event.GetString() << endl;
    }
    event.Skip();
}
Example #9
0
void browsers::browserTAB::OnCommand(wxCommandEvent& event) {
   int command = event.GetInt();
   switch (command) {
      case BT_ADDTDT_TAB:OnTELLaddTDTtab(event.GetString(), 
                            (laydata::TDTHierTree*)event.GetClientData());break;
      case BT_ADDGDS_TAB:OnTELLaddGDStab(event.GetString(), 
                            (GDSin::GDSHierTree*)event.GetClientData());break;
      case BT_CLEARGDS_TAB:OnTELLclearGDStab(); break;
   }
}
Example #10
0
void MainFrame::SetWindowTitle(wxCommandEvent& event)
{
    if(event.GetString().IsEmpty()){
        if(CheckOption(wxT("UD_DRY_RUN"))){
            SetTitle(*m_title + wxT(" (Dry Run)"));
        } else {
            SetTitle(*m_title);
        }
    } else {
        SetTitle(event.GetString());
    }
}
void BibleStudyMainFrame::OnShowModuleLink(wxCommandEvent & event)
{
  wxLogTrace(wxTRACE_Messages,
             wxT("BibleStudyMainFrame::OnOpenInNewWindow called"));
  BookModule *bm = (BookModule*)(event.GetClientData());
  std::cout << "Opening link " << event.GetString().mb_str() << std::endl;
  bm->LookupKey(event.GetString(), wxT(""), 0, true);
  BibleStudyMainFrame *f = OpenNewWindow();
  f->ShowHideBookTree();
  f->DisplayModule(bm);

}
Example #12
0
void browsers::TDTbrowser::OnCommand(wxCommandEvent& event) {
   switch (event.GetInt()) {
      case BT_CELL_OPEN:OnTELLopencell(event.GetString());break;
      case BT_CELL_HIGHLIGHT:OnTELLhighlightcell(event.GetString());break;
      case BT_CELL_ADD :OnTELLaddcell(event.GetString(), 
          *((wxString*)event.GetClientData()), (int)event.GetExtraLong());
          delete ((wxString*)event.GetClientData()); break;
      case BT_CELL_REMOVE:OnTELLremovecell(event.GetString(), 
          *((wxString*)event.GetClientData()), (0 != event.GetExtraLong()));
          delete ((wxString*)event.GetClientData()); break;

   }   
}
Example #13
0
void EvtHandler::OnSelectPeople(wxCommandEvent& event) {
	int index = get_people_id(event.GetString());
	char s[10];
	_itoa(index, s, 10);
	wxMessageBox(_T("小混蛋点击了")+event.GetString()+_T(",序号,")+wxString(s), _T("提示"));
	vector<wxString> piclist = get_pic_list(index);
	wxString allpic=wxEmptyString;
	for (size_t i = 0; i < piclist.size(); i++) {
		allpic += piclist[i];
		allpic += ",";
	}
	wxMessageBox(allpic);
}
Example #14
0
// update gui
void NetPlayDiag::OnThread(wxCommandEvent& event)
{
    // player list
    m_playerids.clear();
    std::string tmps;
    netplay_ptr->GetPlayerList(tmps, m_playerids);

    const int selection = m_player_lbox->GetSelection();

    m_player_lbox->Clear();
    std::istringstream ss(tmps);
    while (std::getline(ss, tmps))
        m_player_lbox->Append(wxString(tmps.c_str(), *wxConvCurrent));

    m_player_lbox->SetSelection(selection);

    switch (event.GetId())
    {
    case NP_GUI_EVT_CHANGE_GAME :
        // update selected game :/
    {
        m_selected_game.assign(event.GetString().mb_str());
        m_game_btn->SetLabel(event.GetString().Prepend(_(" Game : ")));
    }
    break;
    case NP_GUI_EVT_START_GAME :
        // client start game :/
    {
        wxCommandEvent evt;
        OnStart(evt);
    }
    break;
    case NP_GUI_EVT_STOP_GAME :
        // client stop game
    {
        wxCommandEvent evt;
        OnStop(evt);
    }
    break;
    }

    // chat messages
    while (chat_msgs.Size())
    {
        std::string s;
        chat_msgs.Pop(s);
        //PanicAlert("message: %s", s.c_str());
        m_chat_text->AppendText(wxString(s.c_str(), *wxConvCurrent).Append(wxT('\n')));
    }
}
void t4p::ConfigTagDetectorActionClass::OnProcessFailed(wxCommandEvent &event) {
    wxString msg = event.GetString();
    wxString extensionMissingErr = wxT("requires the PDO and pdo_sqlite PHP extensions.");
    if (msg.Find(extensionMissingErr) != wxNOT_FOUND) {
        t4p::EditorLogError(t4p::ERR_MISSING_PHP_EXTENSIONS, msg);
    } else {
        t4p::EditorLogErrorFix(event.GetString(), _("There is an unexpected error in the detector. Was it modified?"));
    }
    if (ParamsQueue.empty()) {
        SignalEnd();
    } else {
        NextDetection();
    }
}
void wxSComboBox::OnChange(wxCommandEvent& event)
{
    if (m_pGrid)
    {
//		m_pGrid->GetTable()->SetValue(m_nRow, m_nCol, event.GetString());
        m_pGrid->SetCellValue(m_nRow, m_nCol, event.GetString());

        wxGridEvent gridEvt(m_pGrid->GetId(),
                            wxEVT_GRID_CELL_CHANGE, m_pGrid, m_nRow, m_nCol);
        gridEvt.SetString(event.GetString());
        GetEventHandler()->ProcessEvent(gridEvt);
    }
    event.Skip();
}
Example #17
0
void CFrame::OnHostMessage(wxCommandEvent& event)
{
	switch (event.GetId())
	{
	case IDM_UPDATEGUI:
		UpdateGUI();
		break;

	case IDM_UPDATESTATUSBAR:
		if (GetStatusBar() != NULL)
			GetStatusBar()->SetStatusText(event.GetString(), event.GetInt());
		break;

	case IDM_UPDATETITLE:
		if (m_RenderFrame != NULL)
			m_RenderFrame->SetTitle(event.GetString());
		break;

	case IDM_WINDOWSIZEREQUEST:
		{
			std::pair<int, int> *win_size = (std::pair<int, int> *)(event.GetClientData());
			OnRenderWindowSizeRequest(win_size->first, win_size->second);
			delete win_size;
		}
		break;

	case WM_USER_CREATE:
		if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
			m_RenderParent->SetCursor(wxCURSOR_BLANK);
		break;

#ifdef __WXGTK__
	case IDM_PANIC:
		{
			wxString caption = event.GetString().BeforeFirst(':');
			wxString text = event.GetString().AfterFirst(':');
			bPanicResult = (wxYES == wxMessageBox(text, 
						caption, event.GetInt() ? wxYES_NO : wxOK, wxGetActiveWindow()));
			panic_event.Set();
		}
		break;
#endif

	case WM_USER_STOP:
		DoStop();
		break;
	}
}
Example #18
0
void CodeFormatter::OnFormat(wxCommandEvent& e)
{
    IEditor* editor(NULL);
    wxString fileToFormat = e.GetString();

    // If we got a file name in the event, use it instead of the active editor
    if(fileToFormat.IsEmpty() == false) {
        editor = m_mgr->FindEditor(fileToFormat);

    } else {
        editor = m_mgr->GetActiveEditor();
    }

    // get the editor that requires formatting
    if(!editor) return;

    // Notify about indentation about to start
    wxCommandEvent evt(wxEVT_CODEFORMATTER_INDENT_STARTING);
    evt.SetString(editor->GetFileName().GetFullPath());
    EventNotifier::Get()->ProcessEvent(evt);

    m_mgr->SetStatusMessage(
        wxString::Format(wxT("%s: %s..."), _("Formatting"), editor->GetFileName().GetFullPath().c_str()), 0);
    DoFormatFile(editor);
    m_mgr->SetStatusMessage(_("Done"), 0);
}
Example #19
0
void ClangPlugin::OnCreateTranslationUnit( wxCommandEvent& event )
{
    if ( m_TranslUnitId != wxNOT_FOUND )
    {
        return;
    }
    wxString filename = event.GetString();
    if (filename.Length() == 0)
        return;

    EditorManager* edMgr = Manager::Get()->GetEditorManager();
    cbEditor* ed = edMgr->GetBuiltinActiveEditor();
    if (ed)
    {
        if (filename != ed->GetFilename())
            return;
        std::map<wxString, wxString> unsavedFiles;
        for (int i = 0; i < edMgr->GetEditorsCount(); ++i)
        {
            ed = edMgr->GetBuiltinEditor(i);
            if (ed && ed->GetModified())
                unsavedFiles.insert(std::make_pair(ed->GetFilename(), ed->GetControl()->GetText()));
        }
        ClangProxy::CreateTranslationUnitJob job( cbEVT_CLANG_ASYNCTASK_FINISHED, idClangCreateTU, filename, m_CompileCommand, unsavedFiles );
        m_Proxy.AppendPendingJob(job);
    }
}
Example #20
0
void MainFrame::OnThreadMessage(wxCommandEvent& evt)
{
	if(globalAppFrame != NULL)
	{
		wxString msg = evt.GetString();
		if(msg.compare(wxT("FON_FLASH_APPLICATION_END_SUCCESS")) == 0)
		{
			//report success and exit
			wxMessageDialog* success = new wxMessageDialog(NULL, wxT("Device Flashed Successfully"), wxT("Success"), wxOK );
			success->ShowModal();
			app->ExitMainLoop();
		}
		else if(msg.compare(wxT("FON_FLASH_APPLICATION_END_FAILURE")) == 0)
		{
			//report failure and exit
			wxMessageDialog* failure = new wxMessageDialog(NULL, wxT("Flashing Failed"), wxT("Failure"), wxOK | wxICON_ERROR);
			failure->ShowModal();
			app->ExitMainLoop();
		}
		else
		{
			//print message to output box
			globalAppFrame->outputText->SetInsertionPointEnd();	
			globalAppFrame->outputText->WriteText( msg  );
		}
	}
}
Example #21
0
	/// Show an error message from somewhere in the program
	void CmError(wxCommandEvent& event) {
		mutabor::error_type type = (mutabor::error_type) event.GetInt();
		wxString heading;
		int style;
		switch (type) {
		case mutabor::warning:
		case mutabor::compiler_warning:
		case mutabor::runtime_warning:
			style = wxICON_WARNING;
			break;
		case mutabor::error:
		case mutabor::internal_error:
		case mutabor::compiler_error:
		case mutabor::runtime_error:
		default:
			style = wxICON_ERROR;
			break;
		}
#if wxCHECK_VERSION(2,9,0)
		heading = to_string(type);
#else
		heading = wxString::FromUTF8(to_string(type));
#endif
		wxMessageBox(event.GetString(),heading,wxOK | style);
	}
Example #22
0
void CompOutput::OnText(wxCommandEvent &evt)
{
    bool clear = false;
    //SetValue shouldn't make dirty; only user's keypresses should
    if (m_setval)
        return;
    //PyPrintDebug(false, "value -> %s\n", evt.GetString().c_str());
    if (evt.GetString().empty())
        clear = true;

    switch (evt.GetId())
    {
    case ID_COMP_TIME:
        if (clear) ClearDirty(TIME_DIRTY);
        else AddDirty(TIME_DIRTY);
        break;
    case ID_COMP_SCORE_B:
        if (clear) ClearDirty(SCOREB_DIRTY);
        else AddDirty(SCOREB_DIRTY);
        break;
    case ID_COMP_SCORE_A: 
        if (clear) ClearDirty(SCOREA_DIRTY);
        else AddDirty(SCOREA_DIRTY);
        break;
    case ID_COMP_NAME_B:
        if (clear) ClearDirty(NAMEB_DIRTY);
        else AddDirty(NAMEB_DIRTY); 
        break;
    case ID_COMP_NAME_A:
        if (clear) ClearDirty(NAMEA_DIRTY);
        else AddDirty(NAMEA_DIRTY);
    }

}
Example #23
0
void TerrainSidebar::OnPassabilityChoice(wxCommandEvent& evt)
{
	if (evt.GetSelection() == 0)
		POST_MESSAGE(SetViewParamS, (AtlasMessage::eRenderView::GAME, L"passability", L""));
	else
		POST_MESSAGE(SetViewParamS, (AtlasMessage::eRenderView::GAME, L"passability", evt.GetString().c_str()));
}
Example #24
0
void CMainFrame::OnCreateItemOnListView(wxCommandEvent& event)
{
	wxString btnString = event.GetString();

	/*if (btnString.Find(m_leftWindow->getSkillRootID().GetID()) == "")
	{
	}*/
	wxString selText = wxT("");
	LOG_PROCESS_ERROR (m_leftWindow && m_rightWindow);

	wxTreeItemId selItem = m_leftWindow->GetSelection();

	LOG_PROCESS_ERROR (selItem.IsOk());

	if (selItem == m_leftWindow->getSkillRootID())
	{
		m_rightWindow->showGridPage(ECreateItemType_Skill, true);
	}else if (selItem == m_leftWindow->getAuraRootID())
	{
		m_rightWindow->showGridPage(ECreateItemType_Aura);
	}else if (selItem == m_leftWindow->getEotRootID())
	{
		m_rightWindow->showGridPage(ECreateItemType_Eot);
	}

	selText = m_leftWindow->GetItemText(selItem);
	wxLogMessage(selText);
	return;
Exit0:
	return;
}
void RelationshipWindow::OnTextUpdated( wxCommandEvent& event )
{
	if ( event.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED )
	{
		DoSearchUser(event.GetString());
	}
}
Example #26
0
void SearchPanel::OnSearchText(wxCommandEvent& evt) {
	restart_next_search = false;

	if(evt.GetString().empty()) {
		nextButton->Disable();
		prevButton->Disable();
		replaceButton->Disable();
		allButton->Disable();

		IEditorSearch* editorSearch = m_searchService.GetSearch();
		wxASSERT(editorSearch);
		editorSearch->ClearSearchHighlight();
	}
	else {
		nextButton->Enable();
		prevButton->Enable();
		replaceButton->Enable();
		allButton->Enable();
	}

	// Don't do a search if the searchstring is allready selected
	if (nosearch) return;

	Find();
}
Example #27
0
void CBDTWxFrame::OnCallStackListDoubleClicked(wxCommandEvent& event)
{
    wxString selection = event.GetString();
    TCHAR selectionChar[MAX_PATH];
    const wxChar* myStringChars = selection.c_str();  
    for (uint32_t i = 0; i < selection.Len(); i++) 
    {
        selectionChar[i] = myStringChars [i];
    }
    selectionChar[selection.Len()] = _T('\0');
    // Remove the "line:xxx" suffix from selection.
    TCHAR* pLastSpacePos = _tcsstr(selectionChar, _T(" "));
    TCHAR* pCurPos = pLastSpacePos;
    while (pCurPos != NULL)
    {
        pLastSpacePos = pCurPos;
        pCurPos = _tcsstr(pLastSpacePos + 1, _T(" "));
    }
    *pLastSpacePos = 0;
    FILE* pFile = _tfopen(selectionChar, _T("rb"));
    if (pFile != NULL)
    {
        fclose(pFile);
        bool bOpenFileInExistingIDE = false;
        if (IsDebuggerPresent() != FALSE)
        {
            HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, GetCurrentProcessId());
            if (hProcess != NULL)
            {
                typedef LONG (WINAPI *PROCNTQSIP)(HANDLE,UINT,PVOID,ULONG,PULONG);
                PROCNTQSIP NtQueryInformationProcess = (PROCNTQSIP)GetProcAddress(GetModuleHandle(_T("ntdll")), "NtQueryInformationProcess");
                if (NtQueryInformationProcess != NULL)
                {
                    PROCESS_BASIC_INFORMATION pbi;
                    long status = NtQueryInformationProcess(hProcess, 0, (PVOID)&pbi, sizeof(PROCESS_BASIC_INFORMATION), NULL);
                    if (status == 0)
                    {
                        HANDLE hDebuggerProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ , FALSE, pbi.InheritedFromUniqueProcessId);
                        if (hDebuggerProcess != NULL)
                        {
                            TCHAR processPath[MAX_PATH] = {0};
                            GetModuleFileNameEx(hDebuggerProcess, NULL, processPath, MAX_PATH);
                            fclose(pFile);
                            TCHAR parameter[MAX_PATH];
                            _stprintf_s(parameter, _T("/Edit \"%s\""), selectionChar);
                            ShellExecute(NULL, _T("open"), processPath, parameter, NULL, SW_SHOW);
                            CloseHandle(hDebuggerProcess);
                            bOpenFileInExistingIDE = true;
                        }
                    }
                }
            }
            CloseHandle(hProcess);
        }
        if (!bOpenFileInExistingIDE)
        {
            ShellExecute(NULL, _T("open"), selectionChar, NULL, NULL, SW_SHOW);
        }
    }
}
Example #28
0
// 投稿ペインでEnterキーを押下
void CMainWindow::onEnter(wxCommandEvent& event)
{
    CChatServiceBase* service = m_serviceHolder->getService(
            m_serviceHolder->getCurrentServiceId());

    wxString body = event.GetString();
    if (service == NULL || body == ""){
        return;
    }
    bool isCommand = invoke(body);
    if (isCommand){
        // 表示の更新
        m_view->clearPostPaneText();
        return;
    }
    if (service->getCurrentChannel() == "" || service->IsConnected() == false){
        return;
    }
    // 送信履歴を追加
    m_inputManager->addHistory(body);
    // コンテンツの更新
    CChatMessage* log = service->generateMessage(body);
    service->postMessage(log);
    m_view->addMessage(log);

    // 表示の更新
    m_view->clearPostPaneText();

}
Example #29
0
void
BossaWindow::OnThreadError(wxCommandEvent& event)
{
    wxString message = event.GetString();
    Error(message);
    _progress->EndModal(0);
}
Example #30
0
void wxTextCtrl::Command(
  wxCommandEvent&                   rEvent
)
{
    SetValue(rEvent.GetString());
    ProcessCommand (rEvent);
} // end of wxTextCtrl::Command