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

Go to the SVN repository for this file.

1 /* $Id: validate_panel.hpp 47106 2022-08-09 13:30:47Z 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: Igor Filippov
27  *
28  */
29 
30 #ifndef _VALIDATE_PANEL_H_
31 #define _VALIDATE_PANEL_H_
32 
33 #include <corelib/ncbistd.hpp>
37 
38 #include <objmgr/scope.hpp>
40 #include <objmgr/bioseq_handle.hpp>
41 
43 
47 
51 
52 #include <wx/panel.h>
53 
54 class wxChoice;
55 class wxStaticText;
56 
58 
59 class IProjectView;
60 class IFlatFileCtrl;
61 
62 /*!
63  * Control identifiers
64  */
65 
66 ////@begin control identifiers
67 #define ID_VALIDATE_FRAME_PANEL 17001
68 #define ID_VALIDATE_FRAME_SEVERITY 17002
69 #define ID_VALIDATE_FRAME_TEXTCTRL 17003
70 #define ID_VALIDATE_FRAME_ERRCODE 17005
71 #define SYMBOL_VALIDATE_PANEL_STYLE wxSUNKEN_BORDER|wxTAB_TRAVERSAL
72 #define SYMBOL_VALIDATE_PANEL_IDNAME ID_VALIDATE_FRAME_PANEL
73 #define SYMBOL_VALIDATE_PANEL_SIZE wxDefaultSize
74 #define SYMBOL_VALIDATE_PANEL_POSITION wxDefaultPosition
75 ////@end control identifiers
76 
77 
78 /*!
79  * CValidatePanel class declaration
80  */
81 
82 class CValidatePanel : public wxPanel
83  , public CEventHandler
85 {
86  DECLARE_CLASS(CValidatePanel)
87  DECLARE_EVENT_TABLE()
88 
90 
91 public:
92 
93  /// Constructors
95  CValidatePanel(wxWindow* parent,
96  IWorkbench* wb,
97  CRef<objects::CUser_object> params,
98  wxWindowID id = SYMBOL_VALIDATE_PANEL_IDNAME,
101  long style = SYMBOL_VALIDATE_PANEL_STYLE);
102 
103  bool Create(wxWindow* parent,
104  wxWindowID id = SYMBOL_VALIDATE_PANEL_IDNAME,
105  const wxPoint& pos = SYMBOL_VALIDATE_PANEL_POSITION,
107  long style = SYMBOL_VALIDATE_PANEL_STYLE);
108 
109  /// Destructor
110  virtual ~CValidatePanel();
111 
112  /// Initialises member variables
113  void Init();
114 
115  /// Creates the controls and sizers
116  void CreateControls();
117 
118  /// @name CJobAdapter::IJobCallback interface implementation
119  /// @{
120  virtual void OnJobResult(CObject* result, CJobAdapter& adapter);
121  virtual void OnJobFailed(const string&, CJobAdapter& adapter);
122  /// @}
123 
124 ////@begin CValidatePanel event handler declarations
125  void OnListItemSelected(wxListEvent& event);
126  void OnListItemActivated(wxListEvent& event);
127  void OnListItemRightClick(wxListEvent& event);
128  void OnValidatorSeveritySelected(wxCommandEvent& event);
129  void OnErrcodeChoiceSelected(wxCommandEvent& event);
130  void OnMouseMove(wxMouseEvent& event);
131  void OnChildFocus(wxChildFocusEvent& evt);
132 ////@end CValidatePanel event handler declarations
133 
134 
135  /// Retrieves bitmap resources
136  wxBitmap GetBitmapResource(const wxString& name);
137 
138  /// Retrieves icon resources
139  wxIcon GetIconResource(const wxString& name);
140 
141  /// Should we show tooltips?
142  static bool ShowToolTips();
143 
144  string GetItemText(long item) const;
145 
146  void GetSelected(set<objects::CBioseq_Handle>& selected);
147 
148  void GetTopSeqAndSeqSubmit(objects::CSeq_entry_Handle& top_seq_entry, CConstRef<objects::CSeq_submit>& seq_submit);
149 
151 
153 
154  wxString GetWorkDir() { return m_WorkDir; }
155 
157 
158  void LoadData(void);
159 
160  void SetProjectHandleAndItem(objects::CGBProjectHandle* ph, objects::CProjectItem* pi)
161  {
163  }
164 
165 private:
166  void x_UpdateList(const string& statusText);
167 
168  void x_DisplayList(void);
169 
170  bool x_MatchFilter(const objects::CValidErrItem& valitem) const;
171 
172  bool x_MatchSeverity(const objects::CValidErrItem& valitem) const;
173 
174  void x_OnDataChanged(CEvent* evt);
175 
176  void x_ConnectListener(void);
177 
178  void x_DisconnectListener(void);
179 
180  bool x_IsSelectable(const CSerialObject* obj);
181 
183 
185 
187 
188 
191 
196 
197  wxStaticText* m_SummaryText;
198  wxStaticText* m_Modified;
199  wxChoice* m_Severity;
200  wxChoice* m_Filter;
202 
204 
205  vector<size_t> m_visible;
206 
209  bool m_IsBusy{ false };
210  string m_RegPath;
211 
212  wxString m_WorkDir;
213  objects::CGBProjectHandle* m_ProjectHandle{ nullptr };
214  objects::CProjectItem* m_ProjectItem{ nullptr };
215 };
216 
218 
219 #endif
220  // _VALIDATE_PANEL_H_
User-defined methods of the data storage class.
#define static
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CBioseq_Handle –.
CConstRef –.
Definition: ncbiobj.hpp:1266
CEventHandler.
CEvent - generic event implementation TODO TODO - Attachments.
Definition: event.hpp:86
CObjectFor –.
Definition: ncbiobj.hpp:2335
CObject –.
Definition: ncbiobj.hpp:180
CRef –.
Definition: ncbiobj.hpp:618
CSeq_entry_Handle –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
static bool ShowToolTips()
Should we show tooltips?
void OnErrcodeChoiceSelected(wxCommandEvent &event)
CRef< CJobAdapter > m_JobAdapter
CRef< CObjectFor< objects::CValidError::TErrs > > m_errs
IWorkbench * m_Workbench
objects::CGBProjectHandle * m_ProjectHandle
void OnChildFocus(wxChildFocusEvent &evt)
objects::CProjectItem * m_ProjectItem
string GetItemText(long item) const
void OnListItemActivated(wxListEvent &event)
bool x_IsSelectable(const CSerialObject *obj)
void Init()
Initialises member variables.
void x_LaunchEditor(CRef< objects::CValidErrItem > error)
void OnListItemRightClick(wxListEvent &event)
void OnListItemSelected(wxListEvent &event)
void x_DisplayList(void)
void OnValidatorSeveritySelected(wxCommandEvent &event)
CErrorListCtrl * m_ErrorListCtrl
IProjectView * x_FindGraphicalSequenceView(CRef< objects::CSeq_id > id)
wxString GetWorkDir()
CIRef< IFlatFileCtrl > m_FlatFileCtrl
void LoadData(void)
void SetProjectHandleAndItem(objects::CGBProjectHandle *ph, objects::CProjectItem *pi)
CRef< objects::CUser_object > m_params
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void CreateControls()
Creates the controls and sizers.
void GetSelected(set< objects::CBioseq_Handle > &selected)
wxChoice * m_Filter
void x_GetObjectsFromProjectItem()
TConstScopedObjects GetObjects()
TConstScopedObjects m_objects
void x_ConnectListener(void)
vector< size_t > m_visible
void GetTopSeqAndSeqSubmit(objects::CSeq_entry_Handle &top_seq_entry, CConstRef< objects::CSeq_submit > &seq_submit)
wxChoice * m_Severity
virtual void OnJobResult(CObject *result, CJobAdapter &adapter)
void x_DisconnectListener(void)
CRef< CObjectFor< objects::CValidError::TErrs > > GetErrors()
CRef< objects::CScope > m_Scope
void OnMouseMove(wxMouseEvent &event)
wxStaticText * m_SummaryText
void x_UpdateList(const string &statusText)
CRef< objects::CScope > GetScope()
bool m_SelectionClientAttached
bool Create(wxWindow *parent, wxWindowID id=17001, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSUNKEN_BORDER|wxTAB_TRAVERSAL)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
bool x_MatchFilter(const objects::CValidErrItem &valitem) const
CRef< CSelectionClient > m_SelectionClient
virtual void OnJobFailed(const string &, CJobAdapter &adapter)
bool x_MatchSeverity(const objects::CValidErrItem &valitem) const
void x_OnDataChanged(CEvent *evt)
wxStaticText * m_Modified
class IProjectView defines the abstract interface for views observing projects.
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
Definition: set.hpp:45
Include a standard set of the NCBI C++ Toolkit most basic headers.
const float pi
Definition: math.hpp:54
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const struct ncbi::grid::netcache::search::fields::SIZE size
else result
Definition: token2.c:20
#define SYMBOL_VALIDATE_PANEL_SIZE
#define SYMBOL_VALIDATE_PANEL_IDNAME
#define SYMBOL_VALIDATE_PANEL_STYLE
#define SYMBOL_VALIDATE_PANEL_POSITION
#define const
Definition: zconf.h:232
Modified on Tue May 28 05:49:15 2024 by modify_doxy.py rev. 669887