| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2006-2008 by Guy Rutenberg * |
| 3 | * [email protected] * |
| 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 | #include "settings_dialog.h"cxx . . $ `<file>/src/settings_dialog.h`/ |
| 22 | #include "icon32.xpm"cxx . . $ `<file>/src/icon32.xpm`/ |
| 23 | |
| 24 | using namespace settings_dialog; |
| 25 | |
| 26 | SettingsDialogcxx . . $ settings_dialog/SettingsDialog#::SettingsDialogcxx . . $ settings_dialog/SettingsDialog#SettingsDialog(ac953e2d406b5f17).(wxWindowcxx . . $ wxWindow#* parent, configurationcxx . . $ configuration/::Configurationcxx . . $ configuration/Configuration#* config): |
| 27 | wxDialogcxx . . $ wxDialog#wxDialog(d091a3913c1b2ac).(parent, wxID_ANYcxx . . $ wxID_ANY., wxTcxx . . $ `<external>/13533349018018911527/chartype.h:199:17`!("Settings Dialog"), wxDefaultPositioncxx . . $ wxDefaultPosition., wxDefaultSizecxx . . $ wxDefaultSize., wxDEFAULT_DIALOG_STYLEcxx . . $ `<external>/1556222971298634691/dialog.h:31:9`!) |
| 28 | { |
| 29 | |
| 30 | SetIconcxx . . $ wxTopLevelWindowBase#SetIcon(d249de01a60891a7).(wxIconcxx . . $ wxIcon#wxIcon(ac4b840ac9fbb56d).(icon32_xpmcxx . . $ icon32_xpm.)); |
| 31 | |
| 32 | m_configcxx . . $ settings_dialog/SettingsDialog#m_config. = config; |
| 33 | |
| 34 | connectEventTablecxx . . $ settings_dialog/SettingsDialog#connectEventTable(49f6e7a06ebc5aa8).(); |
| 35 | createControlscxx . . $ settings_dialog/SettingsDialog#createControls(49f6e7a06ebc5aa8).(); |
| 36 | loadSettingscxx . . $ settings_dialog/SettingsDialog#loadSettings(49f6e7a06ebc5aa8).(); |
| 37 | doLayoutcxx . . $ settings_dialog/SettingsDialog#doLayout(49f6e7a06ebc5aa8).(); |
| 38 | } |
| 39 | |
| 40 | void SettingsDialogcxx . . $ settings_dialog/SettingsDialog#::createControlscxx . . $ settings_dialog/SettingsDialog#createControls(49f6e7a06ebc5aa8).() |
| 41 | { |
| 42 | // note that child windows are automatically deleted by wxWidgets, so |
| 43 | // need to delete them manually |
| 44 | animate_checkboxcxx . . $ settings_dialog/SettingsDialog#animate_checkbox. = new wxCheckBoxcxx . . $ wxCheckBox#(this, wxID_ANYcxx . . $ wxID_ANY., wxTcxx . . $ `<external>/13533349018018911527/chartype.h:199:17`!("Dice animation")); |
| 45 | subtotal_checkboxcxx . . $ settings_dialog/SettingsDialog#subtotal_checkbox. = new wxCheckBoxcxx . . $ wxCheckBox#(this, wxID_ANYcxx . . $ wxID_ANY., wxTcxx . . $ `<external>/13533349018018911527/chartype.h:199:17`!("Calculate sub-total score for the upper and lower sections")); |
| 46 | score_hints_checkboxcxx . . $ settings_dialog/SettingsDialog#score_hints_checkbox. = new wxCheckBoxcxx . . $ wxCheckBox#(this, wxID_ANYcxx . . $ wxID_ANY., wxTcxx . . $ `<external>/13533349018018911527/chartype.h:199:17`!("Display score hints.")); |
| 47 | horizontal_checkboxcxx . . $ settings_dialog/SettingsDialog#horizontal_checkbox. = new wxCheckBoxcxx . . $ wxCheckBox#(this, wxID_ANYcxx . . $ wxID_ANY., wxTcxx . . $ `<external>/13533349018018911527/chartype.h:199:17`!("Enable horizontal layout for user interface.")); |
| 48 | } |
| 49 | |
| 50 | |
| 51 | void SettingsDialogcxx . . $ settings_dialog/SettingsDialog#::connectEventTablecxx . . $ settings_dialog/SettingsDialog#connectEventTable(49f6e7a06ebc5aa8).() |
| 52 | { |
| 53 | Connectcxx . . $ wxEvtHandler#Connect(bb4f3294b37e5589).(wxID_OKcxx . . $ wxID_OK., wxEVT_COMMAND_BUTTON_CLICKEDcxx . . $ `<external>/9123237030240659982/event.h:4822:9`!, wxCommandEventHandlercxx . . $ `<external>/9123237030240659982/event.h:4270:9`!(SettingsDialog::onOK)); |
| 54 | } |
| 55 | |
| 56 | void SettingsDialogcxx . . $ settings_dialog/SettingsDialog#::doLayoutcxx . . $ settings_dialog/SettingsDialog#doLayout(49f6e7a06ebc5aa8).() |
| 57 | { |
| 58 | wxBoxSizercxx . . $ wxBoxSizer#* top_sizer = new wxBoxSizercxx . . $ wxBoxSizer#wxBoxSizer(d4f767463ce0a6b3).(wxVERTICALcxx . . $ wxVERTICAL.); |
| 59 | wxStaticBoxSizercxx . . $ wxStaticBoxSizer#* settings_sizer = new wxStaticBoxSizercxx . . $ wxStaticBoxSizer#( new wxStaticBoxcxx . . $ wxStaticBox#( this, wxID_ANYcxx . . $ wxID_ANY., wxTcxx . . $ `<external>/13533349018018911527/chartype.h:199:17`!("General Settings") ), wxVERTICALcxx . . $ wxVERTICAL.); |
| 60 | |
| 61 | settings_sizer->Addcxx . . $ wxSizer#Add(71dcc790f806ec5).(animate_checkboxcxx . . $ settings_dialog/SettingsDialog#animate_checkbox.,0,wxALLcxx . . $ wxALL.,5); |
| 62 | settings_sizer->Addcxx . . $ wxSizer#Add(71dcc790f806ec5).(subtotal_checkboxcxx . . $ settings_dialog/SettingsDialog#subtotal_checkbox.,0,wxALLcxx . . $ wxALL.,5); |
| 63 | settings_sizer->Addcxx . . $ wxSizer#Add(71dcc790f806ec5).(score_hints_checkboxcxx . . $ settings_dialog/SettingsDialog#score_hints_checkbox.,0,wxALLcxx . . $ wxALL.,5); |
| 64 | settings_sizer->Addcxx . . $ wxSizer#Add(71dcc790f806ec5).(horizontal_checkboxcxx . . $ settings_dialog/SettingsDialog#horizontal_checkbox.,0,wxALLcxx . . $ wxALL.,5); |
| 65 | |
| 66 | top_sizer->Addcxx . . $ wxSizer#Add(c5b4b396efb9dbb2).(settings_sizer,0,wxALLcxx . . $ wxALL.,5); |
| 67 | |
| 68 | top_sizer->Addcxx . . $ wxSizer#Add(c5b4b396efb9dbb2).(CreateButtonSizercxx . . $ wxDialogBase#CreateButtonSizer(7e6f577596ab4fac).(wxOKcxx . . $ `<external>/14689491191722134862/defs.h:1890:9`!|wxCANCELcxx . . $ `<external>/14689491191722134862/defs.h:1893:9`!), 1, wxBOTTOMcxx . . $ wxBOTTOM., 10); |
| 69 | |
| 70 | SetAutoLayoutcxx . . $ wxWindowBase#SetAutoLayout(b45ddcbc8423892c).(true); |
| 71 | SetSizercxx . . $ wxWindowBase#SetSizer(6b8f606b81107616).(top_sizer); |
| 72 | |
| 73 | top_sizer->Fitcxx . . $ wxSizer#Fit(4445f0b382dd2d34).(this); |
| 74 | top_sizer->SetSizeHintscxx . . $ wxSizer#SetSizeHints(4289b2e0b1e17a99).(this); |
| 75 | |
| 76 | Layoutcxx . . $ wxTopLevelWindowBase#Layout(c9857a73d68e59ba).(); |
| 77 | } |
| 78 | |
| 79 | void SettingsDialogcxx . . $ settings_dialog/SettingsDialog#::loadSettingscxx . . $ settings_dialog/SettingsDialog#loadSettings(49f6e7a06ebc5aa8).() |
| 80 | { |
| 81 | animate_checkboxcxx . . $ settings_dialog/SettingsDialog#animate_checkbox.->SetValuecxx . . $ wxCheckBox#SetValue(b45ddcbc8423892c).(m_configcxx . . $ settings_dialog/SettingsDialog#m_config.->getcxx . . $ configuration/Configuration#get(24764cae04130674).("dice-animation"cxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).)==cxx . . $ std/`operator==`(4b17aa87c9f300c6)."True"); |
| 82 | subtotal_checkboxcxx . . $ settings_dialog/SettingsDialog#subtotal_checkbox.->SetValuecxx . . $ wxCheckBox#SetValue(b45ddcbc8423892c).(m_configcxx . . $ settings_dialog/SettingsDialog#m_config.->getcxx . . $ configuration/Configuration#get(24764cae04130674).("calculate-subtotal"cxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).)==cxx . . $ std/`operator==`(4b17aa87c9f300c6)."True"); |
| 83 | score_hints_checkboxcxx . . $ settings_dialog/SettingsDialog#score_hints_checkbox.->SetValuecxx . . $ wxCheckBox#SetValue(b45ddcbc8423892c).(m_configcxx . . $ settings_dialog/SettingsDialog#m_config.->getcxx . . $ configuration/Configuration#get(24764cae04130674).("score-hints"cxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).)==cxx . . $ std/`operator==`(4b17aa87c9f300c6)."True"); |
| 84 | horizontal_checkboxcxx . . $ settings_dialog/SettingsDialog#horizontal_checkbox.->SetValuecxx . . $ wxCheckBox#SetValue(b45ddcbc8423892c).(m_configcxx . . $ settings_dialog/SettingsDialog#m_config.->getcxx . . $ configuration/Configuration#get(24764cae04130674).("horizontal-layout"cxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).)==cxx . . $ std/`operator==`(4b17aa87c9f300c6)."True"); |
| 85 | |
| 86 | } |
| 87 | void SettingsDialogcxx . . $ settings_dialog/SettingsDialog#::onOKcxx . . $ settings_dialog/SettingsDialog#onOK(f55e5a77ec619b42).(wxCommandEventcxx . . $ wxCommandEvent#& event) |
| 88 | { |
| 89 | m_configcxx . . $ settings_dialog/SettingsDialog#m_config.->setcxx . . $ configuration/Configuration#set(f712b3a0dad3b1f).("dice-animation"cxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).,animate_checkboxcxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).->GetValuecxx . . $ wxCheckBox#GetValue(50ce9a9e25b4a850).()?"True":"False"); |
| 90 | m_configcxx . . $ settings_dialog/SettingsDialog#m_config.->setcxx . . $ configuration/Configuration#set(f712b3a0dad3b1f).("calculate-subtotal"cxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).,subtotal_checkboxcxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).->GetValuecxx . . $ wxCheckBox#GetValue(50ce9a9e25b4a850).()?"True":"False"); |
| 91 | m_configcxx . . $ settings_dialog/SettingsDialog#m_config.->setcxx . . $ configuration/Configuration#set(f712b3a0dad3b1f).("score-hints"cxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).,score_hints_checkboxcxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).->GetValuecxx . . $ wxCheckBox#GetValue(50ce9a9e25b4a850).()?"True":"False"); |
| 92 | m_configcxx . . $ settings_dialog/SettingsDialog#m_config.->setcxx . . $ configuration/Configuration#set(f712b3a0dad3b1f).("horizontal-layout"cxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).,horizontal_checkboxcxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f).->GetValuecxx . . $ wxCheckBox#GetValue(50ce9a9e25b4a850).()?"True":"False"); |
| 93 | |
| 94 | m_configcxx . . $ settings_dialog/SettingsDialog#m_config.->savecxx . . $ configuration/Configuration#save(49f6e7a06ebc5aa8).(); |
| 95 | |
| 96 | event.Skipcxx . . $ wxEvent#Skip(b45ddcbc8423892c).(); |
| 97 | } |