| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (C) 2006 by Guy Rutenberg * |
|---|
| 3 | * guy@Guy_Computer * |
|---|
| 4 | * * |
|---|
| 5 | * This program is free software; you can redistribute it and/or modify * |
|---|
| 6 | * it under the terms of the GNU General Public License as published by * |
|---|
| 7 | * the Free Software Foundation; either version 2 of the License, or * |
|---|
| 8 | * (at your option) any later version. * |
|---|
| 9 | * * |
|---|
| 10 | * This program is distributed in the hope that it will be useful, * |
|---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
|---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
|---|
| 13 | * GNU General Public License for more details. * |
|---|
| 14 | * * |
|---|
| 15 | * You should have received a copy of the GNU General Public License * |
|---|
| 16 | * along with this program; if not, write to the * |
|---|
| 17 | * Free Software Foundation, Inc., * |
|---|
| 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
|---|
| 19 | ***************************************************************************/ |
|---|
| 20 | |
|---|
| 21 | // -*- C++ -*- generated by wxGlade 0.4 on Wed Oct 11 10:39:57 2006 |
|---|
| 22 | //this file was originally base on the output of wxGlades but i had to make many changes - Guy |
|---|
| 23 | |
|---|
| 24 | #include "SettingsDialog.h" |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | SettingsDialog::SettingsDialog(wxWindow* parent, int id): |
|---|
| 28 | wxDialog(parent, wxID_ANY, wxT("Settins Dialog"), wxDefaultPosition, wxDefaultSize, wxCLOSE_BOX) |
|---|
| 29 | { |
|---|
| 30 | // begin wxGlade: SettingsDialog::SettingsDialog |
|---|
| 31 | label_1 = new wxStaticText(this, -1, wxT("High-score table size:")); |
|---|
| 32 | spin_ctrl = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS,0,1024,20); |
|---|
| 33 | button_3 = new wxButton(this, ID_RESETHIGHSCORE, wxT("reset high-score table")); |
|---|
| 34 | button_1 = new wxButton(this, wxID_OK); |
|---|
| 35 | button_2 = new wxButton(this, wxID_CANCEL); |
|---|
| 36 | |
|---|
| 37 | set_properties(); |
|---|
| 38 | do_layout(); |
|---|
| 39 | // end wxGlade |
|---|
| 40 | ConnectEventTable(); |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | void SettingsDialog::set_properties() |
|---|
| 45 | { |
|---|
| 46 | // begin wxGlade: SettingsDialog::set_properties |
|---|
| 47 | //SetTitle(wxT("Settings Dialog")); /*unneeded anymore -guy*/ |
|---|
| 48 | //button_1->SetDefault();/*unneeded anymore -guy*/ |
|---|
| 49 | // end wxGlade |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | void SettingsDialog::do_layout() |
|---|
| 54 | { |
|---|
| 55 | // begin wxGlade: SettingsDialog::do_layout |
|---|
| 56 | wxBoxSizer* top_sizer = new wxBoxSizer(wxVERTICAL); |
|---|
| 57 | wxBoxSizer* sizer_2 = new wxBoxSizer(wxHORIZONTAL); |
|---|
| 58 | wxBoxSizer* highscoresizer = new wxBoxSizer(wxHORIZONTAL); |
|---|
| 59 | highscoresizer->Add(label_1, 0, wxALL|wxADJUST_MINSIZE, 10); |
|---|
| 60 | highscoresizer->Add(spin_ctrl, 0, wxALL|wxADJUST_MINSIZE, 10); |
|---|
| 61 | top_sizer->Add(highscoresizer, 0, 0, 0); |
|---|
| 62 | top_sizer->Add(button_3, 0,wxALL|wxALIGN_RIGHT|wxADJUST_MINSIZE, 10); |
|---|
| 63 | sizer_2->Add(button_1, 0, wxALL|wxADJUST_MINSIZE, 10); |
|---|
| 64 | sizer_2->Add(button_2, 0, wxALL|wxADJUST_MINSIZE, 10); |
|---|
| 65 | top_sizer->Add(sizer_2, 1, 0, 0); |
|---|
| 66 | SetAutoLayout(true); |
|---|
| 67 | SetSizer(top_sizer); |
|---|
| 68 | top_sizer->Fit(this); |
|---|
| 69 | top_sizer->SetSizeHints(this); |
|---|
| 70 | Layout(); |
|---|
| 71 | // end wxGlade |
|---|
| 72 | } |
|---|
| 73 | |
|---|
| 74 | void SettingsDialog::ConnectEventTable() |
|---|
| 75 | { |
|---|
| 76 | Connect(ID_RESETHIGHSCORE, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (SettingsDialog::OnResetHighScore)); |
|---|
| 77 | |
|---|
| 78 | } |
|---|
| 79 | |
|---|
| 80 | void SettingsDialog::OnResetHighScore(wxCommandEvent& event) |
|---|
| 81 | { |
|---|
| 82 | |
|---|
| 83 | } |
|---|