Пример #1
0
/*
void MerryFrame::OnActivateEvent(wxActivateEvent& e)
{
#ifndef DEBUG_ALWAYS_SHOW
	if (!e.GetActive() && !this->IsShownOnScreen())
		this->Hide();
#endif
}
*/
void MerryFrame::OnShowEvent(wxShowEvent& e)
{
	MerryTextCtrl* textCtrl = m_mainPanel->GetTextCtrl();
	assert(textCtrl);
	if (e.IsShown())
	{
		if (g_config->get(PlayPopupNotify))//ÊÇ·ñ²¥·ÅÌáʾÒô
			wxSound("Popup.wav").Play();
		textCtrl->ChangeValue(wxT(""));
		this->CentreOnce();
		m_listBoxPanel->Dismiss();
		this->Raise();
		g_controller->SetWindowPos(this->GetHWND(),HWND_TOPMOST,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
		ActiveWindow(this->GetHWND());
//		textCtrl->SetFocus();
#ifdef __WXMSW__
		textCtrl->SetEnInputMode();
#endif
		if (g_config->get(AutoPopup))
			textCtrl->AppendText(wxT(""));
	}
	else
		textCtrl->ChangeValue(wxT(""));

	textCtrl->EnterArgs = 0;
}
Пример #2
0
wxThread::ExitCode Generator::Entry(){
	// Create Lua environment process
	Scripting env(this->log, this->progressbar);
	// Load & execute Lua scripts
	wxArrayString inc_files;
	wxDir::GetAllFiles(wxStandardPaths::Get().GetExecutablePath().BeforeLast('\\') + wxT("\\include\\"), &inc_files, wxT("*.lua"), wxDIR_FILES);
	for(unsigned int i = 0; i < inc_files.GetCount(); i++)
		if( !env.DoFile(inc_files[i]) )
			return 0;
	if( !env.CallInit(2, this->ass_file, this->output_file) )
		return 0;
	if( !env.DoFile(this->lua_file) )
		return 0;
	if( !env.CallExit() )
		return 0;
	// Success sound
	if(this->sound.Trim().IsEmpty())
		wxSound(wxT("nyu_sound"), true).Play();
	else
		wxSound::Play(this->sound);
	// Execute after process command
	if(!this->command.IsEmpty())
		wxExecute(this->command);
	// Run ends
	return 0;
}
Пример #3
0
void PlayWavFile(const char *fname)
{//================================
	char command[120];

#ifdef PLATFORM_WINDOWS
	wxSound(wxString(fname,wxConvLocal)).Play(wxSOUND_SYNC);
#else
//	wxSound(wxString(fname,wxConvLocal)).Play(wxSOUND_SYNC);  // This gives a click at the start of each play
	sprintf(command,"aplay %s",fname);
	if(system(command) == -1)
	{
		sprintf(command,"play %s",fname);
		if(system(command) == -1)
		{
			wxLogError(_T("Failed to run system command:\n\n"+wxString(command,wxConvLocal)));
		}
	}
#endif
}
Пример #4
0
///usr/share/sounds/pop.wav
//
void TestDialog::OnButtonSelect( wxCommandEvent& event )
{
   	//wxMessageBox(wxT("impl"));
	wxSound(wxT("/usr/share/sounds/pop.wav")).Play(wxSOUND_ASYNC | wxSOUND_LOOP) ;

}