X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fdialogs.cpp;h=8a3bf0ae0902408e287932a7b999ee90ac12965a;hb=88d74265a18a5be9623b7c781dec7389a28bf8ef;hp=0afae267baa58b0d64d4f0a9615943fe46eae1ad;hpb=d3fa225aa232e132cc198672c4fc148f96a1ab8c;p=ctsim.git diff --git a/src/dialogs.cpp b/src/dialogs.cpp index 0afae26..8a3bf0a 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: dialogs.cpp,v 1.29 2001/02/11 04:56:38 kevin Exp $ +** $Id: dialogs.cpp,v 1.30 2001/02/11 21:57:08 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -198,6 +198,66 @@ DialogGetComparisonImage::getMakeDifferenceImage() } +///////////////////////////////////////////////////////////////////// +// CLASS DiaglogPreferences Implementation +///////////////////////////////////////////////////////////////////// + +DialogPreferences::DialogPreferences (wxWindow* pParent, const char* const pszTitle, + bool bAdvancedOptions, bool bAskDeleteNewDocs) +: wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION) +{ + wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL); + + pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxTOP | wxLEFT | wxRIGHT, 5); + + pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); + + m_pCBAdvancedOptions = new wxCheckBox (this, -1, "", wxDefaultPosition, wxSize(100, 25), 0); + m_pCBAdvancedOptions->SetValue (bAdvancedOptions); + + m_pCBAskDeleteNewDocs = new wxCheckBox (this, -1, "", wxDefaultPosition, wxSize(100, 25), 0); + m_pCBAskDeleteNewDocs->SetValue (bAskDeleteNewDocs); + + wxFlexGridSizer *pGridSizer = new wxFlexGridSizer (2); + pGridSizer->Add (m_pCBAdvancedOptions, 0, wxALIGN_CENTER_VERTICAL); + pGridSizer->Add (new wxStaticText (this, -1, "Show Advanced Options"), 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); + pGridSizer->Add (m_pCBAskDeleteNewDocs, 0, wxALIGN_CENTER_VERTICAL); + pGridSizer->Add (new wxStaticText (this, -1, "Ask Save New Documents Before Closing"), 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); + pTopSizer->Add (pGridSizer, 1, wxALL, 10); + + pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); + + wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL); + wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay"); + wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel"); + pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10); + pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10); + + pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER); + + SetAutoLayout (true); + SetSizer (pTopSizer); + pTopSizer->Fit (this); + pTopSizer->SetSizeHints (this); +} + +DialogPreferences::~DialogPreferences () +{ +} + +bool +DialogPreferences::getAdvancedOptions () +{ + return static_cast(m_pCBAdvancedOptions->GetValue()); +} + +bool +DialogPreferences::getAskDeleteNewDocs () +{ + return static_cast(m_pCBAskDeleteNewDocs->GetValue()); +} + + ///////////////////////////////////////////////////////////////////// // CLASS DiaglogGetMinMax Implementation /////////////////////////////////////////////////////////////////////