NCBI C++ ToolKit
macro_error_dlg.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: macro_error_dlg.hpp 44338 2019-12-03 15:36:51Z asztalos $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors:
27  */
28 #ifndef _MACRO_ERROR_DLG_H_
29 #define _MACRO_ERROR_DLG_H_
30 
31 #include <corelib/ncbistd.hpp>
32 #include <gui/gui_export.h>
33 #include <wx/dialog.h>
34 
35 class wxBoxSizer;
36 class wxHyperlinkCtrl;
37 class wxHyperlinkEvent;
38 class wxTextCtrl;
39 class wxStaticText;
40 
41 
42 /*!
43  * Control identifiers
44  */
45 
46 ////@begin control identifiers
47 #define SYMBOL_CMACROERRORDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
48 #define SYMBOL_CMACROERRORDLG_TITLE _("Macro Error")
49 #define SYMBOL_CMACROERRORDLG_IDNAME ID_CMACROERRORDLG
50 #define SYMBOL_CMACROERRORDLG_SIZE wxSize(400, 300)
51 #define SYMBOL_CMACROERRORDLG_POSITION wxDefaultPosition
52 ////@end control identifiers
53 
55 
56 BEGIN_SCOPE(macro)
58 END_SCOPE(macro)
59 
60 /*!
61  * CMacroErrorDlg class declaration
62  */
63 
65 {
66  DECLARE_DYNAMIC_CLASS( CMacroErrorDlg )
67  DECLARE_EVENT_TABLE()
68 
69 public:
70  /// Constructors
72  CMacroErrorDlg(wxWindow* parent,
73  wxWindowID id = SYMBOL_CMACROERRORDLG_IDNAME,
74  const wxString& caption = SYMBOL_CMACROERRORDLG_TITLE,
75  const wxPoint& pos = SYMBOL_CMACROERRORDLG_POSITION,
76  const wxSize& size = SYMBOL_CMACROERRORDLG_SIZE,
77  long style = SYMBOL_CMACROERRORDLG_STYLE);
78 
79  /// Creation
80  bool Create( wxWindow* parent,
81  wxWindowID id = SYMBOL_CMACROERRORDLG_IDNAME,
82  const wxString& caption = SYMBOL_CMACROERRORDLG_TITLE,
83  const wxPoint& pos = SYMBOL_CMACROERRORDLG_POSITION,
84  const wxSize& size = SYMBOL_CMACROERRORDLG_SIZE,
85  long style = SYMBOL_CMACROERRORDLG_STYLE );
86 
87  /// Destructor
88  ~CMacroErrorDlg();
89 
90  /// Initialises member variables
91  void Init();
92 
93  /// Creates the controls and sizers
94  void CreateControls();
95 
96  void SetException(const string &message, const CException &error);
97  void SetMessage(const string &message);
98  void SetReport(const string &report);
99  void SetData(const string &data);
100 
101 ////@begin CMacroErrorDlg event handler declarations
102 
103  /// wxEVT_COMMAND_HYPERLINK event handler for ID_ERROR_DETALS_HYPERLINKCTRL
104  void OnErrorDetalsClicked( wxHyperlinkEvent& event );
105 
106  /// wxEVT_COMMAND_HYPERLINK event handler for ID_DATA_DETAILS_HYPERLINKCTRL
107  void OnDataDetailsClicked( wxHyperlinkEvent& event );
108 
109  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FEEDBACK_BUTTON
110  void OnFeedbackButtonClick( wxCommandEvent& event );
111 
112 ////@end CMacroErrorDlg event handler declarations
113 
114 ////@begin CMacroErrorDlg member function declarations
115 
116  /// Retrieves bitmap resources
117  wxBitmap GetBitmapResource( const wxString& name );
118 
119  /// Retrieves icon resources
120  wxIcon GetIconResource( const wxString& name );
121 ////@end CMacroErrorDlg member function declarations
122 
123  /// Should we show tooltips?
124  static bool ShowToolTips();
125 
126 ////@begin CMacroErrorDlg member variables
127  wxBoxSizer* m_VSizer;
128  wxStaticText* m_ErrorTextCtrl;
129  wxHyperlinkCtrl* m_ErrorDetailsLink;
130  wxTextCtrl* m_ErrorDetailsCtrl;
131  wxHyperlinkCtrl* m_DataDetailsLink;
132  wxTextCtrl* m_DataDetailsCtrl;
133  /// Control identifiers
134  enum {
135  ID_CMACROERRORDLG = 10000,
136  wxID_ERROR_STATIC = 10003,
137  ID_ERROR_DETALS_HYPERLINKCTRL = 10001,
138  ID_ERROR_DETAILS_TEXTCTRL = 10002,
139  ID_DATA_DETAILS_HYPERLINKCTRL = 10003,
140  ID_DATA_DETAILS_TEXTCTRL = 10004,
141  ID_FEEDBACK_BUTTON = 10005
142  };
143 ////@end CMacroErrorDlg member variables
144 
145 protected:
146  string x_MergeExceptionMessages(const CException &error) const;
147  const macro::CMacroDataException* x_FindDataException(const CException &error) const;
148 };
149 
151 
152 #endif
153  // _MACRO_ERROR_DLG_H_
class CMacroExecException
Definition: macro_ex.hpp:146
wxTextCtrl * m_DataDetailsCtrl
wxBoxSizer * m_VSizer
wxHyperlinkCtrl * m_ErrorDetailsLink
wxStaticText * m_ErrorTextCtrl
wxTextCtrl * m_ErrorDetailsCtrl
wxHyperlinkCtrl * m_DataDetailsLink
Include a standard set of the NCBI C++ Toolkit most basic headers.
static void Init(void)
Definition: cursor6.c:76
char data[12]
Definition: iconv.c:80
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
#define NCBI_GUIWIDGETS_DATA_EXPORT
Definition: gui_export.h:524
Defines to provide correct exporting from DLLs in Windows.
#define SYMBOL_CMACROERRORDLG_SIZE
#define SYMBOL_CMACROERRORDLG_TITLE
#define SYMBOL_CMACROERRORDLG_IDNAME
#define SYMBOL_CMACROERRORDLG_POSITION
#define SYMBOL_CMACROERRORDLG_STYLE
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Fri Sep 20 14:58:21 2024 by modify_doxy.py rev. 669887