2
* filterErrorDialog.cpp - Dialog for displaying error notices computed from filter tree
3
* Copyright (C) 2013, D Haley
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 3 of the License, or
8
* (at your option) any later version.
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.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
// -*- C++ -*- generated by wxGlade 0.6.3 on Sun Jun 24 00:03:00 2012
20
#include "filterErrorDialog.h"
22
#include "common/translation.h"
24
#include <wx/artprov.h>
25
// begin wxGlade: ::extracode
31
FilterErrorDialog::FilterErrorDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
32
wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
34
// begin wxGlade: FilterErrorDialog::FilterErrorDialog
35
textErrorMessage = new wxTextCtrl(this, wxID_ANY, wxEmptyString,wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE|wxTE_READONLY);
36
bitmapError = new wxStaticBitmap(this, wxID_ANY, wxArtProvider::GetBitmap(wxART_ERROR));
37
labelError = new wxStaticText(this, wxID_ANY, wxTRANS("Error"));
38
bitmapWarning = new wxStaticBitmap(this, wxID_ANY,wxArtProvider::GetBitmap(wxART_WARNING));
39
labelWarning = new wxStaticText(this, wxID_ANY, wxTRANS("Warning"));
40
btnOK = new wxButton(this, wxID_OK, wxEmptyString);
42
SetTitle(wxTRANS("Filter Errors"));
49
void FilterErrorDialog::set_properties()
51
// begin wxGlade: FilterErrorDialog::set_properties
52
SetTitle(wxTRANS("Filter Errors"));
53
SetSize(wxSize(551, 414));
57
void FilterErrorDialog::SetText(const std::vector<string> &text)
59
std::string bigMessage;
60
for(unsigned int ui=0;ui<text.size();ui++)
62
bigMessage+= text[ui];
64
bigMessage+= "\n-------------------\n\n";
67
textErrorMessage->Clear();
68
textErrorMessage->AppendText(wxStr(bigMessage));
71
void FilterErrorDialog::do_layout()
73
// begin wxGlade: FilterErrorDialog::do_layout
74
wxBoxSizer* sizerMain = new wxBoxSizer(wxVERTICAL);
75
wxBoxSizer* sizerTop = new wxBoxSizer(wxHORIZONTAL);
76
wxBoxSizer* sizerKey = new wxBoxSizer(wxVERTICAL);
77
wxBoxSizer* sizerWarn = new wxBoxSizer(wxHORIZONTAL);
78
wxBoxSizer* sizerError = new wxBoxSizer(wxHORIZONTAL);
79
sizerTop->Add(textErrorMessage, 4, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 6);
80
sizerKey->Add(10, 10, 0, 0, 0);
81
sizerError->Add(bitmapError, 0, 0, 0);
82
sizerError->Add(labelError, 0, wxALIGN_CENTER_VERTICAL, 0);
83
sizerKey->Add(sizerError, 0, wxTOP|wxEXPAND, 5);
84
sizerWarn->Add(bitmapWarning, 0, 0, 0);
85
sizerWarn->Add(labelWarning, 0, wxALIGN_CENTER_VERTICAL, 0);
86
sizerKey->Add(sizerWarn, 0, wxTOP|wxEXPAND, 6);
87
sizerKey->Add(20, 20, 0, 0, 0);
88
sizerTop->Add(sizerKey, 1, wxEXPAND, 0);
89
sizerMain->Add(sizerTop, 1, wxEXPAND, 0);
90
sizerMain->Add(btnOK, 0, wxALL|wxALIGN_RIGHT, 5);