33 #include <wx/button.h>
34 #include <wx/textctrl.h>
35 #include <wx/statline.h>
36 #include <wx/hyperlink.h>
37 #include <wx/stattext.h>
45 using namespace macro;
81 Create(parent,
id, caption, pos,
size, style);
89 bool CMacroErrorDlg::Create( wxWindow* parent, wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
92 SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY|wxWS_EX_BLOCK_EVENTS);
93 wxDialog::Create( parent,
id, caption, pos,
size, style );
98 GetSizer()->SetSizeHints(
this);
125 m_ErrorTextCtrl =
NULL;
126 m_ErrorDetailsLink =
NULL;
127 m_ErrorDetailsCtrl =
NULL;
128 m_DataDetailsLink =
NULL;
129 m_DataDetailsCtrl =
NULL;
143 m_VSizer =
new wxBoxSizer(wxVERTICAL);
144 itemDialog1->SetSizer(m_VSizer);
146 m_ErrorTextCtrl =
new wxStaticText( itemDialog1, wxID_ERROR_STATIC,
_(
"Static text"), wxDefaultPosition, wxSize(400, -1), 0 );
147 m_VSizer->Add(m_ErrorTextCtrl, 0, wxGROW|wxALL, 5);
149 wxStaticLine* itemStaticLine4 =
new wxStaticLine( itemDialog1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
150 m_VSizer->Add(itemStaticLine4, 0, wxGROW|wxALL, 5);
152 m_ErrorDetailsLink =
new wxHyperlinkCtrl( itemDialog1, ID_ERROR_DETALS_HYPERLINKCTRL, wxGetTranslation(wxString() + (wxChar) 0x02C5 +
wxT(
" Error Details")), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
153 m_ErrorDetailsLink->Enable(
false);
154 m_VSizer->Add(m_ErrorDetailsLink, 0, wxALIGN_LEFT|wxALL, 5);
156 m_ErrorDetailsCtrl =
new wxTextCtrl( itemDialog1, ID_ERROR_DETAILS_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(-1, 100), wxTE_MULTILINE|wxTE_READONLY );
157 m_ErrorDetailsCtrl->Show(
false);
160 wxStaticLine* itemStaticLine7 =
new wxStaticLine( itemDialog1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
161 m_VSizer->Add(itemStaticLine7, 0, wxGROW|wxALL, 5);
163 m_DataDetailsLink =
new wxHyperlinkCtrl( itemDialog1, ID_DATA_DETAILS_HYPERLINKCTRL, wxGetTranslation(wxString() + (wxChar) 0x02C5 +
wxT(
" Data Details")), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
164 m_DataDetailsLink->Enable(
false);
165 m_VSizer->Add(m_DataDetailsLink, 0, wxALIGN_LEFT|wxALL, 5);
167 m_DataDetailsCtrl =
new wxTextCtrl( itemDialog1, ID_DATA_DETAILS_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(-1, 100), wxTE_MULTILINE|wxTE_READONLY );
168 m_DataDetailsCtrl->Show(
false);
171 wxStaticLine* itemStaticLine10 =
new wxStaticLine( itemDialog1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
172 m_VSizer->Add(itemStaticLine10, 0, wxGROW|wxALL, 5);
174 wxBoxSizer* itemBoxSizer11 =
new wxBoxSizer(wxHORIZONTAL);
175 m_VSizer->Add(itemBoxSizer11, 0, wxGROW|wxALL, 5);
177 itemBoxSizer11->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
179 wxButton* itemButton13 =
new wxButton( itemDialog1, ID_FEEDBACK_BUTTON,
_(
"Send Feedback..."), wxDefaultPosition, wxDefaultSize, 0 );
180 itemBoxSizer11->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
182 wxButton* itemButton14 =
new wxButton( itemDialog1, wxID_CANCEL,
_(
"Close"), wxDefaultPosition, wxDefaultSize, 0 );
183 itemButton14->SetDefault();
184 itemBoxSizer11->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
193 msg += x_MergeExceptionMessages(
error);
196 const macro::CMacroDataException *pDataException = x_FindDataException(
error);
198 SetReport(
error.ReportAll());
199 if (pDataException) {
200 SetData(pDataException->GetDataAsString());
207 m_ErrorTextCtrl->SetLabelText(message.c_str());
208 m_ErrorTextCtrl->GetContainingSizer()->Fit(m_ErrorTextCtrl);
209 m_VSizer->SetSizeHints(
this);
215 m_ErrorDetailsCtrl->Clear();
216 m_ErrorDetailsCtrl->AppendText(report.c_str());
217 m_ErrorDetailsLink->Enable();
218 m_VSizer->SetSizeHints(
this);
224 m_DataDetailsCtrl->Clear();
225 m_DataDetailsCtrl->AppendText(
data.c_str());
226 m_DataDetailsLink->Enable();
227 m_VSizer->SetSizeHints(
this);
272 if (m_ErrorDetailsCtrl->IsShown()) {
273 m_ErrorDetailsLink->SetLabel(L
"\u02C5 Error Details");
274 m_VSizer->Show(m_ErrorDetailsCtrl,
false);
277 m_ErrorDetailsLink->SetLabel(L
"\u02C4 Error Details");
278 m_VSizer->Show(m_ErrorDetailsCtrl);
281 m_VSizer->SetSizeHints(
this);
292 if (m_DataDetailsCtrl->IsShown()) {
293 m_DataDetailsLink->SetLabel(L
"\u02C5 Data Details");
294 m_VSizer->Show(m_DataDetailsCtrl,
false);
297 m_DataDetailsLink->SetLabel(L
"\u02C4 Data Details");
298 m_VSizer->Show(m_DataDetailsCtrl);
301 m_VSizer->SetSizeHints(
this);
309 while (
nullptr != current) {
322 while (
nullptr != current) {
328 return pDataException;
338 description += m_ErrorTextCtrl->GetLabelText().mb_str(wxConvUTF8);
339 description +=
"\n\n";
340 description +=
"Error Details:\n";
341 description += m_ErrorDetailsCtrl->GetValue().mb_str(wxConvUTF8);
class CMacroExecException
void CreateControls()
Creates the controls and sizers.
const macro::CMacroDataException * x_FindDataException(const CException &error) const
void SetData(const string &data)
void OnErrorDetalsClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_ERROR_DETALS_HYPERLINKCTRL
void Init()
Initialises member variables.
void OnFeedbackButtonClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FEEDBACK_BUTTON
~CMacroErrorDlg()
Destructor.
bool Create(wxWindow *parent, wxWindowID id=ID_CMACROERRORDLG, const wxString &caption=_("Macro Error"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
static bool ShowToolTips()
Should we show tooltips?
void SetMessage(const string &message)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void SetReport(const string &report)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
string x_MergeExceptionMessages(const CException &error) const
CMacroErrorDlg()
Constructors.
void SetException(const string &message, const CException &error)
void OnDataDetailsClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_DATA_DETAILS_HYPERLINKCTRL
void ShowFeedbackDialog(bool opt_out=false, const char *problem_description=nullptr)
single callable function that will show the feedback wizard, collect information, and file a report.
const string & GetMsg(void) const
Get message string.
const CException * GetPredecessor(void) const
Get "previous" exception from the backlog.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const struct ncbi::grid::netcache::search::fields::SIZE size
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)