///////////////////////////////////////////////////////////////////////////// // Name: preferences.cpp // tag: The aBridge preferences window. // Author: David Roundy // Modified by: // Copyright: (c) 2002 David Roundy // Licence: GPL //--------------------------------------------------------------------------- // Last modified: Jan 26, 2002 /* 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 #endif #include "globals.h" #include "debug.h" // include config.h for VERSION #include "config.h" #include "preferences.h" #include "playerprefs.h" #include "speechprefs.h" #include "advancedprefs.h" #include "guiprefs.h" BEGIN_EVENT_TABLE(aBridgePreferences, wxDialog) EVT_CLOSE(aBridgePreferences::OnCloseWindow) EVT_BUTTON(wxID_OK,aBridgePreferences::OnOK) END_EVENT_TABLE() // My frame constructor aBridgePreferences::aBridgePreferences(wxFrame* parent) : wxDialog(parent, -1, "aBridge Preferences", wxDefaultPosition, wxSize(610,480), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { wxLayoutConstraints *c; wxNotebook *the_notebook = new wxNotebook(this, -1, wxDefaultPosition, wxSize(600,400), wxCLIP_CHILDREN); wxButton *btn = new wxButton(this, wxID_OK, "OK"); btn->SetDefault(); c = new wxLayoutConstraints; c->left.SameAs(this, wxLeft, 10); c->top.SameAs(this, wxTop, 5); // c->height.AsIs(); c->bottom.Above(btn, -10); c->right.SameAs(this, wxRight, 10); the_notebook->SetConstraints(c); c = new wxLayoutConstraints; c->left.SameAs(this, wxLeft, 10); c->bottom.SameAs(this, wxBottom, 10); c->height.AsIs(); c->width.AsIs(); btn->SetConstraints(c); m_playerprefs = new aPlayerPreferences(the_notebook); the_notebook->AddPage(m_playerprefs, "General"); aGUIPreferences *guiprefs = new aGUIPreferences(the_notebook); the_notebook->AddPage(guiprefs, "Display"); #ifdef WITH_SPEECH aSpeechPreferences *speechprefs = new aSpeechPreferences(the_notebook); the_notebook->AddPage(speechprefs, "Speech"); #endif advancedPreferences *advprefs = new advancedPreferences(the_notebook); the_notebook->AddPage(advprefs, "Advanced"); Layout(); SetAutoLayout(true); } aBridgePreferences::~aBridgePreferences() { } void aBridgePreferences::OnCloseWindow(wxCloseEvent& event) { Destroy(); } void aBridgePreferences::OnOK(wxCommandEvent& event) { m_playerprefs->ApplyChanges(); Destroy(); }