///////////////////////////////////////////////////////////////////////////// // Name: guiprefs.cpp // tag: a gui 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 "guiprefs.h" #include "prefmacros.h" enum { RWP=37 }; BEGIN_EVENT_TABLE(aGUIPreferences, wxPanel) EVT_CHECKBOX(RWP, aGUIPreferences::OnRememberClicked) END_EVENT_TABLE() // My frame constructor aGUIPreferences::aGUIPreferences(wxWindow *parent) : wxPanel(parent, -1) { wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); wxStaticText *first_string = new wxStaticText(this, -1, "These are the display settings.", wxPoint(0,0)); topsizer->Add(first_string, 0, // make vertically unstretchable wxEXPAND | // make horizontally stretchable wxTOP|wxBOTTOM|wxLEFT|wxRIGHT, 10 ); // set border width to 10 wxCheckBox *remember_window_positions = new wxCheckBox(this, RWP, "Remember window positions"); remember_window_positions ->SetValue(GetRememberWindowPositions()); topsizer->Add(remember_window_positions, 0, // make vertically unstretchable wxEXPAND | // make horizontally stretchable wxLEFT | wxRIGHT, // and make border all around 10 ); // set border width to 10 SetAutoLayout( TRUE ); SetSizer( topsizer ); // actually set the sizer topsizer->Fit( this ); // set size to minimum size as calculated by the sizer topsizer->SetSizeHints( this ); // set size hints to honour mininum size } aGUIPreferences::~aGUIPreferences() { } void aGUIPreferences::OnRememberClicked(wxCommandEvent &evt) { wxConfig::Get()->Write("/General/RememberWindowPositions", (long)evt.IsChecked()); wxConfig::Get()->Flush(); }