///////////////////////////////////////////////////////////////////////////// // Name: speechprefs.cpp // tag: a speech preferences tab. // Author: David Roundy // Modified by: // Copyright: (c) 2002 David Roundy // Licence: GPL /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes . #include #ifndef WX_PRECOMP #include #include #include #include #endif #include "globals.h" #include "debug.h" // include config.h for VERSION #include "config.h" #include "speechprefs.h" enum Boxes_and_stuff { SPEAK_CHAT=37, SPEAK_BIDS, SPEAK_JOIN }; BEGIN_EVENT_TABLE(aSpeechPreferences, wxPanel) EVT_CHECKBOX(SPEAK_CHAT, aSpeechPreferences::OnChatClicked) EVT_CHECKBOX(SPEAK_BIDS, aSpeechPreferences::OnBidsClicked) EVT_CHECKBOX(SPEAK_JOIN, aSpeechPreferences::OnJoinClicked) END_EVENT_TABLE() // My frame constructor aSpeechPreferences::aSpeechPreferences(wxWindow *parent) : wxPanel(parent, -1) { wxLayoutConstraints *c; wxStaticText *first_string = new wxStaticText(this, -1, "These are the settings for the festival speech synthesizer.", wxPoint(0,0)); c = new wxLayoutConstraints; c->left.SameAs(this, wxLeft, 10); c->top.SameAs(this, wxTop, 5); c->height.AsIs(); c->right.SameAs(this, wxRight, 10); first_string->SetConstraints(c); wxCheckBox *speak_chat_box = new wxCheckBox(this, SPEAK_CHAT, "Speak chat dialog"); speak_chat_box ->SetValue(wxConfig::Get()->Read("/Speech/Chat", 0l)); c = new wxLayoutConstraints; c->left.SameAs(this, wxLeft, 10); c->top.Below(first_string, 5); c->height.AsIs(); c->right.SameAs(this, wxRight, 10); speak_chat_box->SetConstraints(c); wxCheckBox *speak_bids_box = new wxCheckBox(this, SPEAK_BIDS, "Speak bids"); speak_bids_box ->SetValue(wxConfig::Get()->Read("/Speech/Bids", 1)); c = new wxLayoutConstraints; c->left.SameAs(this, wxLeft, 10); c->top.Below(speak_chat_box, 5); c->height.AsIs(); c->right.SameAs(this, wxRight, 10); speak_bids_box->SetConstraints(c); wxCheckBox *speak_join_box = new wxCheckBox(this,SPEAK_JOIN, "Tell me when someone joins abridge"); speak_join_box ->SetValue(wxConfig::Get()->Read("/Speech/Join", 1)); c = new wxLayoutConstraints; c->left.SameAs(this, wxLeft, 10); c->top.Below(speak_bids_box, 5); c->height.AsIs(); c->right.SameAs(this, wxRight, 10); speak_join_box->SetConstraints(c); SetAutoLayout( TRUE ); } aSpeechPreferences::~aSpeechPreferences() { } void aSpeechPreferences::OnChatClicked(wxCommandEvent &evt) { wxConfig::Get()->Write("/Speech/Chat", (long)evt.IsChecked()); wxConfig::Get()->Flush(); } void aSpeechPreferences::OnJoinClicked(wxCommandEvent &evt) { wxConfig::Get()->Write("/Speech/Join", (long)evt.IsChecked()); wxConfig::Get()->Flush(); } void aSpeechPreferences::OnBidsClicked(wxCommandEvent &evt) { wxConfig::Get()->Write("/Speech/Bids", (long)evt.IsChecked()); wxConfig::Get()->Flush(); }