void CAnalogueRepeaterFrame::onUpdates(wxCommandEvent& event)
{
	m_updates = event.IsChecked();
}
예제 #2
0
void ContinuousBuild::OnStopIgnoreFileSaved(wxCommandEvent& e)
{
	e.Skip();
	m_buildInProgress = false;
}
예제 #3
0
void TranslDlg::OnCommand(wxCommandEvent& event)
{//=============================================
	#define N_PH_LIST  N_PHONEME_LIST

	void *vp;
	int translate_text = 0;
	char buf[1000];
	char phon_out[N_PH_LIST*2];
	int clause_tone;
	int clause_count;
	int use_ipa = 0;
	FILE *f;
	int  fd_temp;
	char fname_temp[100];
	static int n_ph_list;
	static PHONEME_LIST ph_list[N_PH_LIST+1];

	if(translator==NULL)
	{
		wxLogError(_T("Voice not set"));
		return;
	}

	option_phonemes = 0;

	switch(event.GetId())
	{
	case T_RULES:
	case MENU_SPEAK_RULES:
#ifdef PLATFORM_POSIX
		strcpy(fname_temp,"/tmp/espeakXXXXXX");
		if((fd_temp = mkstemp(fname_temp)) >= 0)
		{
			close(fd_temp);

			if((f = fopen(fname_temp,"w+")) != NULL)
			{
				f_trans = f;   // write translation rule trace to a temp file
			}
		}
#else
		strcpy(fname_temp,tmpnam(NULL));
		if((f = fopen(fname_temp,"w+")) != NULL)
		{
			f_trans = f;   // write translation rule trace to a temp file
		}
#endif
		t_phonetic->SetDefaultStyle(style_phonetic);
		translate_text = 2;
		break;

	case T_TRANSLATE:
	case MENU_SPEAK_TRANSLATE:
		t_phonetic->SetDefaultStyle(style_phonetic);
		translate_text = 1;
		break;

	case T_TRANSLATE_IPA:
	case MENU_SPEAK_IPA:
		t_phonetic->SetDefaultStyle(style_phonetic_large);

		translate_text = 3;
		use_ipa = 1;
		break;

	case T_PROCESS:
	case MENU_SPEAK_TEXT:
        myframe->OnProsody(event);
		prosodycanvas->LayoutData(ph_list,n_ph_list);
        myframe->Refresh();
		option_phoneme_events = espeakINITIALIZE_PHONEME_EVENTS;
		option_log_frames = 1;
		MakeWave2(ph_list,n_ph_list);
		option_log_frames = 0;
		break;
	}

	if(translate_text)
	{
		option_phonemes = translate_text;

		option_multibyte = espeakCHARS_AUTO;
		SpeakNextClause(NULL,NULL,2);  // stop speaking file

		strncpy0(buf,t_source->GetValue().mb_str(wxConvUTF8),sizeof(buf));
		phon_out[0] = 0;
		n_ph_list = 0;
		clause_count = 0;

		vp = buf;
		InitText(0);
		while((vp != NULL) && (n_ph_list < N_PH_LIST))
		{
			vp = TranslateClause(translator,NULL,vp,&clause_tone,NULL);
			CalcPitches(translator,clause_tone);
			CalcLengths(translator);

			GetTranslatedPhonemeString(translator->phon_out, sizeof(translator->phon_out), use_ipa);
			if(clause_count++ > 0)
				strcat(phon_out," ||");
			strcat(phon_out,translator->phon_out);
			t_phonetic->SetValue(wxString(translator->phon_out,wxConvUTF8));

			if((n_ph_list + n_phoneme_list) >= N_PH_LIST)
			{
				n_phoneme_list = N_PH_LIST - n_ph_list;
			}

			memcpy(&ph_list[n_ph_list],phoneme_list,sizeof(PHONEME_LIST)*n_phoneme_list);
			n_ph_list += n_phoneme_list;
		}

        ph_list[N_PH_LIST].ph = NULL;  // to recognize overrun off list (in Generate() )

		t_phonetic->Clear();
		if(option_phonemes == 2)
		{
			option_phonemes=0;
			rewind(f_trans);
			while(fgets(buf,sizeof(buf),f_trans) != NULL)
			{
				t_phonetic->AppendText(wxString(buf,wxConvUTF8));
			}
			t_phonetic->AppendText(_T("---\n"));
			if(f_trans != NULL)
				fclose(f_trans);
			remove(fname_temp);
		}
		t_phonetic->AppendText(wxString(phon_out,wxConvUTF8));
	}
}  // end of TranslDlg::OnCommand
예제 #4
0
void clThemedChoice::OnThemeChanged(wxCommandEvent& event)
{
    event.Skip();
    ApplyTheme();
}
예제 #5
0
//
// void frmOdaGet::OnHttpThreadMessage(wxCommandEvent &event)
//
// Events sent back by HTTP thread
void frmOdaGet::OnHttpThreadMessage(wxCommandEvent &event)
{
    wxString String;

    switch (event.GetId())
    {
        case HTTP_BADURL:
        {
            String = wxString::Format(wxT("Invalid URL: %s\n"),
                                      event.GetString().c_str());

            m_LocationDisplay->AppendText(String);
        }
        break;

        case HTTP_CONNECTED:
        {
            String = wxString::Format(wxT("Connected to %s:%u\n"),
                                      event.GetString().c_str(),
                                      event.GetInt());

            m_LocationDisplay->AppendText(String);
        }
        break;

        case HTTP_DISCONNECTED:
        {
            String = wxString::Format(wxT("Failed to connect to %s:%u\n"),
                                      event.GetString().c_str(),
                                      event.GetInt());

            m_LocationDisplay->AppendText(String);
        }
        break;

        case HTTP_GOTFILEINFO:
        {
            String = wxString::Format(wxT("File size is %llu\n"),
                                      (size_t)event.GetInt());

            m_DownloadGauge->SetRange((size_t)event.GetInt());

            m_LocationDisplay->AppendText(String);
        }
        break;

        case HTTP_DOWNLOADING:
        {
            String = wxString::Format(wxT("Now downloading file to %s\n"),
                                      event.GetString().c_str());

            m_LocationDisplay->AppendText(String);
        }
        break;

        case HTTP_DOWNLOADERROR:
        {
            String = wxString::Format(wxT("Download of file %s failed\n"),
                                        event.GetString().c_str());

            m_LocationDisplay->AppendText(String);
        }
        break;

        case HTTP_DOWNLOADTERMINATED:
        {
            String = wxT("User stopped download\n");

            m_LocationDisplay->AppendText(String);
        }
        break;

        case SIZE_UPDATE:
        {
            int i = m_DownloadGauge->GetValue();
            
            m_DownloadGauge->SetValue((size_t)event.GetInt() + i);
        }
        break;

        case HTTP_DOWNLOADCOMPLETE:
        {
            String = wxT("Download complete\n");

            m_LocationDisplay->AppendText(String);
        }
        break;

        default:
            break;
    }
}
예제 #6
0
void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
{
    PCB_SCREEN* screen = (PCB_SCREEN*) ( m_Parent->GetScreen() );
    wxPoint     locate_pos;
    wxString    msg;
    bool        FindMarker = false;
    BOARD_ITEM* foundItem  = 0;

    switch( event.GetId() )
    {
    case ID_FIND_ITEM:
        s_ItemCount = 0;
        break;

    case ID_FIND_MARKER:
        s_MarkerCount = 0;

    // fall thru

    case ID_FIND_NEXT_MARKER:
        FindMarker = true;
        break;
    }

    s_OldStringFound = m_NewText->GetValue();

    m_Parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y );

    if( FindMarker )
    {
        MARKER_PCB* marker = m_Parent->GetBoard()->GetMARKER( s_MarkerCount++ );

        if( marker )
        {
            foundItem  = marker;
            locate_pos = marker->GetPosition();
        }
    }
    else
    {
        int StartCount = 0;

        for( MODULE* module = m_Parent->GetBoard()->m_Modules; module; module = module->Next() )
        {
            if( WildCompareString( s_OldStringFound, module->GetReference().GetData(), false ) )
            {
                StartCount++;

                if( StartCount > s_ItemCount )
                {
                    foundItem  = module;
                    locate_pos = module->GetPosition();
                    s_ItemCount++;
                    break;
                }
            }

            if( WildCompareString( s_OldStringFound, module->m_Value->m_Text.GetData(), false ) )
            {
                StartCount++;

                if( StartCount > s_ItemCount )
                {
                    foundItem  = module;
                    locate_pos = module->m_Pos;
                    s_ItemCount++;
                    break;
                }
            }
        }
    }

    if( foundItem )
    {
        m_Parent->SetCurItem( foundItem );

        if( FindMarker )
            msg = _( "Marker found" );
        else
            msg.Printf( _( "<%s> Found" ), GetChars( s_OldStringFound ) );

        m_Parent->SetStatusText( msg );

        m_Parent->CursorGoto( locate_pos );

        EndModal( 1 );
    }
    else
    {
        m_Parent->SetStatusText( wxEmptyString );

        if( FindMarker )
            msg = _( "Marker not found" );
        else
            msg.Printf( _( "<%s> Not Found" ), GetChars( s_OldStringFound ) );

        DisplayError( this, msg, 10 );
        EndModal( 0 );
    }
}
예제 #7
0
void LLDBPlugin::OnInitDone(wxCommandEvent& event)
{
    event.Skip();
}
예제 #8
0
void XFunctionsDialog::OnCoherenceCheck( wxCommandEvent& event )
{
    m_pXf->SetCoherenceWeighting(event.IsChecked());
}
예제 #9
0
void XFunctionsDialog::OnSaveMultispectrumCheck( wxCommandEvent& event )
{
    m_pXf->SetSaveMultispectrum(event.IsChecked());
}
예제 #10
0
void XFunctionsDialog::OnShiftToHalfWindowCheck( wxCommandEvent& event )
{
    m_pXf->SetShiftToHalfWindow(event.IsChecked());
}
예제 #11
0
void XFunctionsDialog::OnTimeReversalCheck( wxCommandEvent& event )
{
    m_pXf->SetTimeReversal(event.IsChecked());
}
예제 #12
0
void XFunctionsDialog::OnHilbertCheck( wxCommandEvent& event )
{
    m_pXf->SetHilbertTransform(event.IsChecked());
}
예제 #13
0
void XFunctionsDialog::OnNormalizeLeftChannelCheck( wxCommandEvent& event )
{
    m_pXf->SetNormalize(event.IsChecked());
}
void GameCubeConfigPane::OnSP1Changed(wxCommandEvent& event)
{
	ChooseEXIDevice(event.GetString(), 2);
}
예제 #15
0
//------------------------------------------------------------------//
//--- an progress thread event was caught, figure out what to do ---//
//------------------------------------------------------------------//
void MusikTagFrame::OnTagThreadProg( wxCommandEvent& event )
{
	gProgress->SetValue( event.GetExtraLong() );
}
예제 #16
0
void XFunctionsDialog::OnDiracPulseCheck( wxCommandEvent& event )
{
    m_pXf->SetDiracPulse(event.IsChecked());
}
예제 #17
0
void SettingChoice::UpdateValue(wxCommandEvent& ev)
{
  m_setting = ev.GetInt();
  ev.Skip();
}
예제 #18
0
void XFunctionsShowDialog::OnExportAllSpectrumsCheck( wxCommandEvent& event )
{
	mExportData.SetExportAll(event.IsChecked());
}
예제 #19
0
void LLDBPlugin::OnWorkspaceLoaded(wxCommandEvent& event)
{
    event.Skip();
}
예제 #20
0
void XFunctionsDialog::OnFftSizeChoice( wxCommandEvent& event )
{
    wxString wxszValue = event.GetString();
    m_pXf->SetFFTLength(AFSampleCount(::StringToLong(wxszValue)));
    UpdateLag();
}
예제 #21
0
void wxSlider::Command (wxCommandEvent & event)
{
    SetValue (event.GetInt());
    ProcessCommand (event);
}
예제 #22
0
void XFunctionsDialog::OnWindowChoice( wxCommandEvent& event )
{
    m_pXf->SetWindowType(event.GetSelection());
}
예제 #23
0
//
// void frmOdaGet::OnFtpThreadMessage(wxCommandEvent &event)
//
// Events sent back by FTP thread
void frmOdaGet::OnFtpThreadMessage(wxCommandEvent &event)
{
    wxString String;

    switch (event.GetId())
    {
        case FTP_BADURL:
        {
            String = wxString::Format(wxT("Invalid URL: %s\n"),
                                      event.GetString().c_str());

            m_LocationDisplay->AppendText(String);
        }
        break;

        case FTP_CONNECTED:
        {
            String = wxString::Format(wxT("Connected to %s:%u\n"),
                                      event.GetString().c_str(),
                                      event.GetInt());

            m_LocationDisplay->AppendText(String);
        }
        break;

        case FTP_DISCONNECTED:
        {
            String = wxString::Format(wxT("Failed to connect to %s:%u\n"),
                                      event.GetString().c_str(),
                                      event.GetInt());

            m_LocationDisplay->AppendText(String);
        }
        break;

        case FTP_GOTFILEINFO:
        {
            m_FileSize = event.GetInt();
            
            if (m_FileSize > 0)
            {
                String = wxString::Format(wxT("File size is %d\n"),
                                        m_FileSize);
            
                m_DownloadGauge->SetRange(event.GetInt());
            }
            else
            {
                String = wxT("File size not available\n");
                
                m_DownloadGauge->SetRange(10);
            }
            
            m_LocationDisplay->AppendText(String);
        }
        break;

        case FTP_DOWNLOADING:
        {
            String = wxString::Format(wxT("Now downloading file to %s\n"),
                                      event.GetString().c_str());

            m_LocationDisplay->AppendText(String);
        }
        break;

        case FTP_DOWNLOADERROR:
        {
            String = wxString::Format(wxT("Download of file %s failed\n"),
                                        event.GetString().c_str());

            m_LocationDisplay->AppendText(String);
        }
        break;

        case FTP_DOWNLOADTERMINATED:
        {
            String = wxT("User stopped download\n");

            m_LocationDisplay->AppendText(String);
        }
        break;

        case SIZE_UPDATE:
        {
            if (m_FileSize > 0)
            {
                int i = m_DownloadGauge->GetValue();
                
                m_DownloadGauge->SetValue(event.GetInt() + i);
            }
            else
            {               
                // Our pseudo-progress indicator
                m_DownloadGauge->SetValue(m_DownloadGauge->GetValue() ? 0 : 10);
            }
        }
        break;

        case FTP_DOWNLOADCOMPLETE:
        {
            String = wxT("Download complete\n");

            m_LocationDisplay->AppendText(String);
        }
        break;

        default:
            break;
    }
}
예제 #24
0
void CUnitFieldDlg::OnCancel(wxCommandEvent &event)
{
    m_newUnit = GetUnitfieldActualunit()->GetValue();

    event.Skip();
}
예제 #25
0
void MainWindow::OnPopup(wxCommandEvent& event)
{
    switch (event.GetId())
    {
        case POEM_NEXT:
            // Another poem/page
            TheMainWindow->NextPage();
            break;
        case POEM_PREVIOUS:
            // Previous page
            TheMainWindow->PreviousPage();
            break;
        case POEM_SEARCH:
            // Search - with dialog
            TheMainWindow->Search(true);
            break;
        case POEM_NEXT_MATCH:
            // Search - without dialog (next match)
            TheMainWindow->Search(false);
            break;
        case POEM_MINIMIZE:
            TheMainWindow->Iconize(true);
            break;
#if wxUSE_CLIPBOARD
        case POEM_COPY:
            wxTheClipboard->UsePrimarySelection();
            if (wxTheClipboard->Open())
            {
                static wxString s;
                s = poem_buffer;
                s.Replace( wxT("@P"),wxEmptyString);
                s.Replace( wxT("@A "),wxEmptyString);
                s.Replace( wxT("@A"),wxEmptyString);
                s.Replace( wxT("@T "),wxEmptyString);
                s.Replace( wxT("@T"),wxEmptyString);
                wxTextDataObject *data = new wxTextDataObject( s.c_str() );
                if (!wxTheClipboard->SetData( data ))
                    wxMessageBox(wxT("Error while copying to the clipboard."));
            }
            else
            {
                wxMessageBox(wxT("Error opening the clipboard."));
            }
            wxTheClipboard->Close();
            break;
#endif
        case POEM_BIGGER_TEXT:
            pointSize ++;
            CreateFonts();
            TheMainWindow->Resize();
            break;
        case POEM_SMALLER_TEXT:
            if (pointSize > 2)
            {
                pointSize --;
                CreateFonts();
                TheMainWindow->Resize();
            }
            break;
        case POEM_ABOUT:
            (void)wxMessageBox(wxT("wxPoem Version 1.1\nJulian Smart (c) 1995"),
                               wxT("About wxPoem"), wxOK, TheMainWindow);
            break;
        case POEM_EXIT:
            // Exit
            TheMainWindow->Close(true);
            break;
        default:
            break;
    }
}
예제 #26
0
void AfficheModifFamille::OnSaisie(wxCommandEvent & event) {
    if ((event.GetId() == ID_AfficheModifFamilleLatin || event.GetId() == ID_AfficheModifFamilleComment)) {
        OKButton->Enable(true);
        OKButton->SetDefault();
    }
}
예제 #27
0
void ContinuousBuild::OnBuildProcessOutput(wxCommandEvent& e)
{
	ProcessEventData *ped = (ProcessEventData*)e.GetClientData();
	wxLogMessage(ped->GetData());
	delete ped;
}
예제 #28
0
void DIALOG_DIMENSION_EDITOR::OnOKClick( wxCommandEvent& event )
{
    BOARD_COMMIT commit( m_parent );

    PCB_LAYER_ID newlayer = ToLAYER_ID( m_SelLayerBox->GetLayerSelection() );

    if( !m_parent->GetBoard()->IsLayerEnabled( newlayer ) )
    {
        wxMessageBox( _( "The layer currently selected is not enabled for this board\n"
                         "You cannot use it" ) );
        return;
    }

#ifndef USE_WX_OVERLAY
    if( m_DC )     // Delete old text.
    {
        m_currentDimension->Draw( m_parent->GetCanvas(), m_DC, GR_XOR );
    }
#endif

    commit.Modify( m_currentDimension );

    if( m_Name->GetValue() != wxEmptyString )
    {
        m_currentDimension->SetText( m_Name->GetValue() );
    }

    wxString msg;

    // Get new size value:
    msg = m_TxtSizeXCtrl->GetValue();
    m_currentDimension->Text().SetTextWidth( ValueFromString( g_UserUnit, msg ) );
    msg = m_TxtSizeYCtrl->GetValue();
    m_currentDimension->Text().SetTextHeight( ValueFromString( g_UserUnit, msg ) );

    // Get new position value:
    // It will be copied later in dimension, because
    msg = m_textCtrlPosX->GetValue();
    wxPoint pos;
    pos.x = ValueFromString( g_UserUnit, msg );
    msg = m_textCtrlPosY->GetValue();
    pos.y = ValueFromString( g_UserUnit, msg );
    m_currentDimension->Text().SetTextPos( pos );

    // Get new line thickness value:
    msg = m_TxtWidthCtrl->GetValue();
    int width = ValueFromString( g_UserUnit, msg );
    int maxthickness = Clamp_Text_PenSize( width, m_currentDimension->Text().GetTextSize() );

    if( width > maxthickness )
    {
        DisplayError( NULL,
                      _( "The text thickness is too large for the text size.  "
                         "It will be clamped" ) );
        width = maxthickness;
    }

    m_currentDimension->SetWidth( width );
    m_currentDimension->Text().SetThickness( width );
    m_currentDimension->Text().SetMirrored( ( m_rbMirror->GetSelection() == 1 ) ? true : false );
    m_currentDimension->SetLayer( newlayer );

#ifndef USE_WX_OVERLAY
    if( m_DC )     // Display new text
    {
        m_currentDimension->Draw( m_parent->GetCanvas(), m_DC, GR_OR );
    }
#else
    m_parent->Refresh();
#endif

    commit.Push( _( "Modifed dimensions properties" ) );
    event.Skip();   // ends returning wxID_OK (default behavior)
}
예제 #29
0
void MainFrame::on_file_select(wxCommandEvent& event)
{
    editor_.select(event.GetInt());
}
예제 #30
0
void wxVListBox::InitEvent(wxCommandEvent& event, int n)
{
    event.SetEventObject(this);
    event.SetInt(n);
}