confsearch.cc

Go to the documentation of this file.
00001 /* Eliot                                                                     */
00002 /* Copyright (C) 1999  Antoine Fraboulet                                     */
00003 /* Antoine.Fraboulet@free.fr                                                 */
00004 /*                                                                           */
00005 /* This program is free software; you can redistribute it and/or modify      */
00006 /* it under the terms of the GNU General Public License as published by      */
00007 /* the Free Software Foundation; either version 2 of the License, or         */
00008 /* (at your option) any later version.                                       */
00009 /*                                                                           */
00010 /* This program is distributed in the hope that it will be useful,           */
00011 /* but WITHOUT ANY WARRANTY; without even the implied warranty of            */
00012 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */
00013 /* GNU General Public License for more details.                              */
00014 /*                                                                           */
00015 /* You should have received a copy of the GNU General Public License         */
00016 /* along with this program; if not, write to the Free Software               */
00017 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
00018 
00019 #include "ewx.h"
00020 #include "wx/sizer.h"
00021 #include "confsearch.h"
00022 
00023 enum {
00024         Button_Ok,
00025         Button_Cancel,
00026         CheckBox_Joker,
00027         CheckBox_Rack
00028 };
00029 
00030 BEGIN_EVENT_TABLE(ConfSearchDlg,wxDialog)
00031   EVT_CLOSE    (ConfSearchDlg::OnCloseWindow)
00032   EVT_BUTTON   (Button_Ok,      ConfSearchDlg::OnButtonOk)
00033   EVT_BUTTON   (Button_Cancel,  ConfSearchDlg::OnButtonCancel)
00034 END_EVENT_TABLE()
00035 
00036 
00037 ConfSearchDlg::ConfSearchDlg(wxWindow* parent)
00038         : wxDialog(parent, -1, wxString(wxT("Configuration recherche")))
00039 {
00040 
00041   joker_searching = new wxCheckBox(this,CheckBox_Joker,wxT("Recherche sur joker dans 7+1"));
00042 // XXX:  rack_checking = new wxCheckBox(this,CheckBox_Rack,wxT("Vérification de la validité des tirages"));
00043   rack_checking = new wxCheckBox(this,CheckBox_Rack,wxT("Verification de la validite des tirages"));
00044 
00045   bcancel = new wxButton(this,Button_Cancel,wxT("Annuler"),wxPoint(-1,-1));
00046   bcancel->SetToolTip(wxT("Annuler les dernier changements et quitter"));
00047   bok = new wxButton(this,Button_Ok,wxT("OK"),wxPoint(-1,-1));
00048   bok->SetToolTip(wxT("Enregistrer les changements et quitter"));
00049 
00050   wxBoxSizer *bsizer = new wxBoxSizer( wxHORIZONTAL);
00051   bsizer->Add(bok, 1, wxALL, 1);
00052   bsizer->Add(bcancel, 1, wxALL, 1);
00053 
00054   wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
00055   sizer->Add(joker_searching, 1, wxEXPAND | wxALL, 2);
00056   sizer->Add(rack_checking, 1, wxEXPAND | wxALL, 2);
00057   sizer->Add(bsizer, 0, wxEXPAND, 0);
00058 
00059   SetAutoLayout(TRUE);
00060   SetSizer(sizer);
00061   sizer->Fit(this);
00062   sizer->SetSizeHints(this);
00063   readconf();
00064 }
00065 
00066 void
00067 ConfSearchDlg::readconf()
00068 {
00069   joker_searching->SetValue(config.getJokerPlus1());
00070   rack_checking->SetValue(config.getRackChecking());
00071 }
00072 
00073 void
00074 ConfSearchDlg::writeconf()
00075 {
00076   config.setJokerPlus1(joker_searching->GetValue());
00077   config.setRackChecking(rack_checking->GetValue());
00078 }
00079 
00080 void
00081 ConfSearchDlg::OnCloseWindow(wxCloseEvent&)
00082 {
00083   if (IsModal() == TRUE)
00084     EndModal(1);
00085   else
00086     this->Destroy();
00087 }
00088 
00089 void
00090 ConfSearchDlg::OnButtonOk(wxCommandEvent&)
00091 {
00092   writeconf();
00093   if (IsModal() == TRUE)
00094     EndModal(1);
00095   else
00096     this->Destroy();
00097 }
00098 
00099 void
00100 ConfSearchDlg::OnButtonCancel(wxCommandEvent&)
00101 {
00102   if (IsModal() == TRUE)
00103     EndModal(1);
00104   else
00105     this->Destroy();
00106 }
00107 

Generated on Thu Dec 29 02:01:15 2005 for Eliot by  doxygen 1.4.5