36 std::vector<std::reference_wrapper<RC_ITEM>> aItems,
37 std::map<int, SEVERITY>& aSeverities,
39 wxPanel( aParentWindow ),
44 wxString severities[] = {
_(
"Error" ),
_(
"Warning" ),
_(
"Ignore" ) };
45 int severityCount =
sizeof( severities ) /
sizeof( wxString );
47 wxBoxSizer* panelSizer =
new wxBoxSizer( wxVERTICAL );
48 wxScrolledWindow* scrollWin =
new wxScrolledWindow(
this, wxID_ANY,
49 wxDefaultPosition, wxDefaultSize,
50 wxTAB_TRAVERSAL | wxVSCROLL );
51 bool firstLine =
true;
53 scrollWin->SetScrollRate( 0, 5 );
55 wxBoxSizer* scrollWinSizer =
new wxBoxSizer( wxVERTICAL );
56 scrollWin->SetSizer( scrollWinSizer );
58 wxFlexGridSizer* gridSizer =
new wxFlexGridSizer( 0, 2, 0, 5 );
59 gridSizer->SetFlexibleDirection( wxBOTH );
60 gridSizer->SetVGap( 5 );
64 int errorCode = item.GetErrorCode();
65 wxString msg = item.GetErrorText();
72 wxStaticText* heading =
new wxStaticText( scrollWin, wxID_ANY, msg );
73 wxFont headingFont = heading->GetFont();
75 heading->SetFont( headingFont.Bold() );
79 gridSizer->AddSpacer( 5 );
80 gridSizer->AddSpacer( 5 );
83 gridSizer->Add( heading, 0, wxALIGN_BOTTOM | wxALL | wxEXPAND, 4 );
84 gridSizer->AddSpacer( 0 );
86 else if( !msg.IsEmpty() )
88 wxStaticText* errorLabel =
new wxStaticText( scrollWin, wxID_ANY, msg + wxT(
":" ) );
89 gridSizer->Add( errorLabel, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 15 );
93 wxPanel* radioPanel =
new wxPanel( scrollWin );
94 wxBoxSizer* radioSizer =
new wxBoxSizer( wxHORIZONTAL );
96 for(
int i = 0; i < severityCount; ++i )
98 m_buttonMap[ errorCode ][i] =
new wxRadioButton( radioPanel,
99 baseID + errorCode * 10 + i,
101 wxDefaultPosition, wxDefaultSize,
102 i == 0 ? wxRB_GROUP : 0 );
104 wxRIGHT | wxALIGN_CENTER_VERTICAL, 30 );
107 radioPanel->SetSizer( radioSizer );
108 radioPanel->Layout();
109 gridSizer->Add( radioPanel, 0, wxALIGN_CENTER_VERTICAL );
118 wxString pinMapSeverities[] = {
_(
"From Pin Conflicts Map" ), wxT(
"" ),
_(
"Ignore" ) };
122 wxStaticText* errorLabel =
new wxStaticText( scrollWin, wxID_ANY, msg + wxT(
":" ) );
123 gridSizer->Add( errorLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL | wxEXPAND, 15 );
125 wxPanel* radioPanel =
new wxPanel( scrollWin );
126 wxBoxSizer* radioSizer =
new wxBoxSizer( wxHORIZONTAL );
128 for(
size_t i = 0; i < 3; ++i )
130 if( pinMapSeverities[i] == wxT(
"" ) )
132 wxStaticText* spacer =
new wxStaticText( radioPanel, wxID_ANY, wxT(
"" ) );
133 radioSizer->Add( spacer, 0, wxRIGHT | wxEXPAND, 17 );
137 m_buttonMap[ errorCode ][i] =
new wxRadioButton( radioPanel,
138 baseID + errorCode * 10 + i,
140 wxDefaultPosition, wxDefaultSize,
141 i == 0 ? wxRB_GROUP : 0 );
142 radioSizer->Add(
m_buttonMap[ errorCode ][i], 0, wxEXPAND );
146 radioPanel->SetSizer( radioSizer );
147 radioPanel->Layout();
148 gridSizer->Add( radioPanel, 0, wxALIGN_CENTER_VERTICAL );
151 scrollWinSizer->Add( gridSizer, 1, wxEXPAND | wxALL, 5 );
152 panelSizer->Add( scrollWin, 1, wxEXPAND, 0 );
155 [
this]( wxIdleEvent& aEvent )
159 wxWindow* dialog = wxGetTopLevelParent(
this );
160 wxWindow* topLevelFocus = wxGetTopLevelParent( wxWindow::FindFocus() );
162 if( topLevelFocus == dialog )
167 SetSizer( panelSizer );
169 panelSizer->Fit(
this );