+
+#endif // USE_MODAL_PRESENTATION
+
+#if USE_SETTINGS_DIALOG
+// ----------------------------------------------------------------------------
+// SettingsDialog
+// ----------------------------------------------------------------------------
+
+IMPLEMENT_CLASS(SettingsDialog, wxPropertySheetDialog)
+
+BEGIN_EVENT_TABLE(SettingsDialog, wxPropertySheetDialog)
+END_EVENT_TABLE()
+
+SettingsDialog::SettingsDialog(wxWindow* win, int dialogType)
+{
+ SetExtraStyle(wxDIALOG_EX_CONTEXTHELP|wxWS_EX_VALIDATE_RECURSIVELY);
+
+ int tabImage1 = -1;
+ int tabImage2 = -1;
+
+ bool useToolBook = (dialogType == DIALOGS_PROPERTY_SHEET_TOOLBOOK || dialogType == DIALOGS_PROPERTY_SHEET_BUTTONTOOLBOOK);
+ int resizeBorder = wxRESIZE_BORDER;
+
+ if (useToolBook)
+ {
+ resizeBorder = 0;
+ tabImage1 = 0;
+ tabImage2 = 1;
+
+ int sheetStyle = wxPROPSHEET_SHRINKTOFIT;
+ if (dialogType == DIALOGS_PROPERTY_SHEET_BUTTONTOOLBOOK)
+ sheetStyle |= wxPROPSHEET_BUTTONTOOLBOOK;
+ else
+ sheetStyle |= wxPROPSHEET_TOOLBOOK;
+
+ SetSheetStyle(sheetStyle);
+ SetSheetInnerBorder(0);
+ SetSheetOuterBorder(0);
+
+ // create a dummy image list with a few icons
+ const wxSize imageSize(32, 32);
+
+ m_imageList = new wxImageList(imageSize.GetWidth(), imageSize.GetHeight());
+ m_imageList->
+ Add(wxArtProvider::GetIcon(wxART_INFORMATION, wxART_OTHER, imageSize));
+ m_imageList->
+ Add(wxArtProvider::GetIcon(wxART_QUESTION, wxART_OTHER, imageSize));
+ m_imageList->
+ Add(wxArtProvider::GetIcon(wxART_WARNING, wxART_OTHER, imageSize));
+ m_imageList->
+ Add(wxArtProvider::GetIcon(wxART_ERROR, wxART_OTHER, imageSize));
+ }
+ else
+ m_imageList = NULL;
+
+ Create(win, wxID_ANY, _("Preferences"), wxDefaultPosition, wxDefaultSize,
+ wxDEFAULT_DIALOG_STYLE| (int)wxPlatform::IfNot(wxWinCE, resizeBorder)
+/*
+#ifndef __WXWINCE__
+ |resizeBorder
+#endif
+*/
+ );
+
+ // If using a toolbook, also follow Mac style and don't create buttons
+ if (!useToolBook)
+ CreateButtons(wxOK|wxCANCEL| (int)wxPlatform::IfNot(wxWinPocketPC, wxHELP)
+/*
+#ifndef __POCKETPC__
+ |wxHELP
+#endif
+*/
+ );
+
+ wxBookCtrlBase* notebook = GetBookCtrl();
+ notebook->SetImageList(m_imageList);
+
+ wxPanel* generalSettings = CreateGeneralSettingsPage(notebook);
+ wxPanel* aestheticSettings = CreateAestheticSettingsPage(notebook);
+
+ notebook->AddPage(generalSettings, _("General"), true, tabImage1);
+ notebook->AddPage(aestheticSettings, _("Aesthetics"), false, tabImage2);
+
+ LayoutDialog();
+}
+
+SettingsDialog::~SettingsDialog()
+{
+ delete m_imageList;
+}
+
+wxPanel* SettingsDialog::CreateGeneralSettingsPage(wxWindow* parent)
+{
+ wxPanel* panel = new wxPanel(parent, wxID_ANY);
+
+ wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL );
+ wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
+
+ //// LOAD LAST FILE
+
+ wxBoxSizer* itemSizer3 = new wxBoxSizer( wxHORIZONTAL );
+ wxCheckBox* checkBox3 = new wxCheckBox(panel, ID_LOAD_LAST_PROJECT, _("&Load last project on startup"), wxDefaultPosition, wxDefaultSize);
+ itemSizer3->Add(checkBox3, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+ item0->Add(itemSizer3, 0, wxGROW|wxALL, 0);
+
+ //// AUTOSAVE
+
+ wxString autoSaveLabel = _("&Auto-save every");
+ wxString minsLabel = _("mins");
+
+ wxBoxSizer* itemSizer12 = new wxBoxSizer( wxHORIZONTAL );
+ wxCheckBox* checkBox12 = new wxCheckBox(panel, ID_AUTO_SAVE, autoSaveLabel, wxDefaultPosition, wxDefaultSize);
+
+#if wxUSE_SPINCTRL
+ wxSpinCtrl* spinCtrl12 = new wxSpinCtrl(panel, ID_AUTO_SAVE_MINS, wxEmptyString,
+ wxDefaultPosition, wxSize(40, wxDefaultCoord), wxSP_ARROW_KEYS, 1, 60, 1);
+#endif
+
+ itemSizer12->Add(checkBox12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+#if wxUSE_SPINCTRL
+ itemSizer12->Add(spinCtrl12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+#endif
+ itemSizer12->Add(new wxStaticText(panel, wxID_STATIC, minsLabel), 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+ item0->Add(itemSizer12, 0, wxGROW|wxALL, 0);
+
+ //// TOOLTIPS
+
+ wxBoxSizer* itemSizer8 = new wxBoxSizer( wxHORIZONTAL );
+ wxCheckBox* checkBox6 = new wxCheckBox(panel, ID_SHOW_TOOLTIPS, _("Show &tooltips"), wxDefaultPosition, wxDefaultSize);
+ itemSizer8->Add(checkBox6, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+ item0->Add(itemSizer8, 0, wxGROW|wxALL, 0);
+
+ topSizer->Add( item0, 1, wxGROW|wxALIGN_CENTRE|wxALL, 5 );
+
+ panel->SetSizer(topSizer);
+ topSizer->Fit(panel);
+
+ return panel;
+}
+
+wxPanel* SettingsDialog::CreateAestheticSettingsPage(wxWindow* parent)
+{
+ wxPanel* panel = new wxPanel(parent, wxID_ANY);
+
+ wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL );
+ wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
+
+ //// PROJECT OR GLOBAL
+ wxString globalOrProjectChoices[2];
+ globalOrProjectChoices[0] = _("&New projects");
+ globalOrProjectChoices[1] = _("&This project");
+
+ wxRadioBox* projectOrGlobal = new wxRadioBox(panel, ID_APPLY_SETTINGS_TO, _("&Apply settings to:"),
+ wxDefaultPosition, wxDefaultSize, 2, globalOrProjectChoices);
+ item0->Add(projectOrGlobal, 0, wxGROW|wxALL, 5);
+
+ projectOrGlobal->SetSelection(0);
+
+ //// BACKGROUND STYLE
+ wxArrayString backgroundStyleChoices;
+ backgroundStyleChoices.Add(wxT("Colour"));
+ backgroundStyleChoices.Add(wxT("Image"));
+ wxStaticBox* staticBox3 = new wxStaticBox(panel, wxID_ANY, _("Background style:"));
+
+ wxBoxSizer* styleSizer = new wxStaticBoxSizer( staticBox3, wxVERTICAL );
+ item0->Add(styleSizer, 0, wxGROW|wxALL, 5);
+
+ wxBoxSizer* itemSizer2 = new wxBoxSizer( wxHORIZONTAL );
+
+ wxChoice* choice2 = new wxChoice(panel, ID_BACKGROUND_STYLE, wxDefaultPosition, wxDefaultSize, backgroundStyleChoices);
+
+ itemSizer2->Add(new wxStaticText(panel, wxID_ANY, _("&Window:")), 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+ itemSizer2->Add(5, 5, 1, wxALL, 0);
+ itemSizer2->Add(choice2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
+
+ styleSizer->Add(itemSizer2, 0, wxGROW|wxALL, 5);
+
+#if wxUSE_SPINCTRL
+ //// FONT SIZE SELECTION
+
+ wxStaticBox* staticBox1 = new wxStaticBox(panel, wxID_ANY, _("Tile font size:"));
+ wxBoxSizer* itemSizer5 = new wxStaticBoxSizer( staticBox1, wxHORIZONTAL );
+
+ wxSpinCtrl* spinCtrl = new wxSpinCtrl(panel, ID_FONT_SIZE, wxEmptyString, wxDefaultPosition,
+ wxSize(80, wxDefaultCoord));
+ itemSizer5->Add(spinCtrl, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
+
+ item0->Add(itemSizer5, 0, wxGROW|wxLEFT|wxRIGHT, 5);
+#endif
+
+ topSizer->Add( item0, 1, wxGROW|wxALIGN_CENTRE|wxALL, 5 );
+ topSizer->AddSpacer(5);
+
+ panel->SetSizer(topSizer);
+ topSizer->Fit(panel);
+
+ return panel;
+}
+
+#endif // USE_SETTINGS_DIALOG