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

Go to the SVN repository for this file.

1 /* $Id: tbl_edit_dlg.hpp 34165 2015-11-17 14:28:55Z filippov $
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: Colleen Bollin
27  */
28 #ifndef _TBL_EDIT_DLG_H_
29 #define _TBL_EDIT_DLG_H_
30 
31 #include <corelib/ncbistd.hpp>
38 #include <wx/sizer.h>
39 #include <wx/button.h>
40 
41 /*!
42  * Includes
43  */
44 
45 ////@begin includes
46 ////@end includes
47 
48 /*!
49  * Forward declarations
50  */
51 
52 ////@begin forward declarations
53 class wxBoxSizer;
54 ////@end forward declarations
55 
57 
59 {
60 public:
63 
64  virtual CRef<objects::CSeq_table> GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh) = 0;
65  virtual CRef<CCmdComposite> GetCommandFromValuesTable(CRef<objects::CSeq_table>, objects::CSeq_entry_Handle seh) = 0;
67  virtual string CheckForMixedValues(CRef<objects::CSeq_table> values_table, string column_name);
68  virtual CRef<objects::CSeq_table> GetChoices(CRef<objects::CSeq_table> values_table) { CRef<objects::CSeq_table> choices; return choices; } ;
69  virtual bool IsReadOnlyColumn(string column_name) { return false; };
70  virtual int GetCollapsible() {return -1;}
71 };
72 
73 
75 {
76 public:
79 
80  virtual CRef<CCmdComposite> ClearAllValues(objects::CSeq_entry_Handle seh) = 0;
81  virtual string RemapColumnName(string column_name) = 0;
82 };
83 
84 /*!
85  * Control identifiers
86  */
87 
88 ////@begin control identifiers
89 #define ID_CTBLEDITDLG 10079
90 #define ID_IMPORT_TABLE 10086
91 #define ID_EXPORT_TABLE 10087
92 #define ID_CLEAR_TABLE 10088
93 #define SYMBOL_CTBLEDITDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
94 #define SYMBOL_CTBLEDITDLG_TITLE _("TblEditDlg")
95 #define SYMBOL_CTBLEDITDLG_IDNAME ID_CTBLEDITDLG
96 #define SYMBOL_CTBLEDITDLG_SIZE wxSize(400, 300)
97 #define SYMBOL_CTBLEDITDLG_POSITION wxDefaultPosition
98 ////@end control identifiers
99 #define ID_UPDATE_PROBLEMS 10100
100 
101 /*!
102  * CTblEditDlg class declaration
103  */
104 
106 {
107  DECLARE_DYNAMIC_CLASS( CTblEditDlg )
108  DECLARE_EVENT_TABLE()
109 
110 public:
111  /// Constructors
112  CTblEditDlg();
113  // Dialog takes ownership of converter
114  CTblEditDlg( wxWindow* parent, objects::CSeq_entry_Handle seh,
115  CTableCommandConverter *converter,
116  IWorkbench* workbench = NULL,
117  wxWindowID id = SYMBOL_CTBLEDITDLG_IDNAME, const wxString& caption = SYMBOL_CTBLEDITDLG_TITLE, const wxPoint& pos = SYMBOL_CTBLEDITDLG_POSITION, const wxSize& size = SYMBOL_CTBLEDITDLG_SIZE, long style = SYMBOL_CTBLEDITDLG_STYLE, wxString label = wxT("") );
118 
119  /// Creation
120  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CTBLEDITDLG_IDNAME, const wxString& caption = SYMBOL_CTBLEDITDLG_TITLE, const wxPoint& pos = SYMBOL_CTBLEDITDLG_POSITION, const wxSize& size = SYMBOL_CTBLEDITDLG_SIZE, long style = SYMBOL_CTBLEDITDLG_STYLE );
121 
122  /// Destructor
123  ~CTblEditDlg();
124 
125  /// Initialises member variables
126  void Init();
127 
128  /// Creates the controls and sizers
129  void CreateControls();
130 
131 ////@begin CTblEditDlg event handler declarations
132 
133  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_IMPORT_TABLE
134  void OnImportTableClick( wxCommandEvent& event );
135 
136  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EXPORT_TABLE
137  void OnExportTableClick( wxCommandEvent& event );
138 
139  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CLEAR_TABLE
140  void OnClearTableClick( wxCommandEvent& event );
141 
142 ////@end CTblEditDlg event handler declarations
143 
144  void OnUpdateProblems( wxCommandEvent& event );
145 
146 ////@begin CTblEditDlg member function declarations
147 
148  /// Retrieves bitmap resources
149  wxBitmap GetBitmapResource( const wxString& name );
150 
151  /// Retrieves icon resources
152  wxIcon GetIconResource( const wxString& name );
153 ////@end CTblEditDlg member function declarations
154 
155  /// Should we show tooltips?
156  static bool ShowToolTips();
157 
158 ////@begin CTblEditDlg member variables
159  wxBoxSizer* m_GridHolder;
160  wxBoxSizer* m_TableControlsSizer;
161  wxButton* m_ImportBtn;
162  wxButton* m_ExportBtn;
163 ////@end CTblEditDlg member variables
165  virtual string GetErrorMessage();
166  wxGrid* GetGrid() { return m_Grid->GetGrid(); }
167 private:
168  objects::CSeq_entry_Handle m_TopSeqEntry;
172  wxString m_SaveFileDir;
173  wxString m_SaveFileName;
174  wxString m_StaticLabel;
176 };
177 
178 
180 {
181 public:
182  CDBLinkTableCommandConverter(vector<string> fields)
183  : m_DBLinkFields(fields)
184  {};
186 
187  virtual CRef<objects::CSeq_table> GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh);
188  virtual CRef<CCmdComposite> GetCommandFromValuesTable(CRef<objects::CSeq_table>, objects::CSeq_entry_Handle seh);
189  virtual CRef<CCmdComposite> ClearAllValues(objects::CSeq_entry_Handle seh);
190  virtual string RemapColumnName(string column_name);
192 private:
193  vector<string> m_DBLinkFields;
194 };
195 
196 
198 {
199 public:
202 
203  virtual CRef<objects::CSeq_table> GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh);
204  virtual CRef<CCmdComposite> GetCommandFromValuesTable(CRef<objects::CSeq_table> values_table, objects::CSeq_entry_Handle seh);
205  virtual CRef<CCmdComposite> ClearAllValues(objects::CSeq_entry_Handle seh);
206  virtual string RemapColumnName(string column_name);
207  virtual string GetErrorMessage(CRef<objects::CSeq_table> values_table);
208  virtual string CheckForMixedValues(CRef<objects::CSeq_table> table, string column_name = "");
209 private:
210  string m_Label;
211 };
212 
213 
215 {
216 public:
218  : m_Label(label), m_SrcType (src_type) {};
220 
221  virtual CRef<objects::CSeq_table> GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh);
222  virtual CRef<CCmdComposite> GetCommandFromValuesTable(CRef<objects::CSeq_table>, objects::CSeq_entry_Handle seh);
223  virtual CRef<CCmdComposite> ClearAllValues(objects::CSeq_entry_Handle seh);
224  virtual string RemapColumnName(string column_name);
226  virtual string CheckForMixedValues(CRef<objects::CSeq_table> table, string column_name = "");
227 private:
228  string m_Label;
230 };
231 
232 
234 {
235 public:
238 
239  virtual CRef<objects::CSeq_table> GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh);
241  CRef<CCmdComposite> GetCommandFromValuesTable(CRef<objects::CSeq_table> values_table, objects::CSeq_entry_Handle seh, bool add_confirmed);
242  virtual CRef<CCmdComposite> ClearAllValues(objects::CSeq_entry_Handle seh);
243  virtual string RemapColumnName(string column_name);
246 private:
248 };
249 
250 
252 {
253 public:
256  : m_WizardType (wizard_type) , m_SrcType (src_type) {};
258 
259  virtual CRef<objects::CSeq_table> GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh);
260  virtual CRef<CCmdComposite> GetCommandFromValuesTable(CRef<objects::CSeq_table>, objects::CSeq_entry_Handle seh);
261  virtual CRef<CCmdComposite> ClearAllValues(objects::CSeq_entry_Handle seh);
262  virtual string RemapColumnName(string column_name);
265  virtual string CheckForMixedValues(CRef<objects::CSeq_table> values_table, string column_name = "");
266 private:
269 };
270 
272 {
273 public:
276 
277  virtual CRef<objects::CSeq_table> GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh);
278  virtual CRef<CCmdComposite> GetCommandFromValuesTable(CRef<objects::CSeq_table>, objects::CSeq_entry_Handle seh);
279  virtual CRef<CCmdComposite> ClearAllValues(objects::CSeq_entry_Handle seh);
280  virtual string RemapColumnName(string column_name);
283  string GetPrimerTypeColumnName();
284  virtual string CheckForMixedValues(CRef<objects::CSeq_table> values_table, string column_name = "");
285 };
286 
288 {
289 public:
290  CStructuredCommentCommandConverter(string prefix, vector<string> fields)
291  : m_Prefix (prefix), m_Fields(fields) {};
293  virtual CRef<objects::CSeq_table> GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh);
294  virtual CRef<CCmdComposite> GetCommandFromValuesTable(CRef<objects::CSeq_table>, objects::CSeq_entry_Handle seh);
296  virtual CRef<CCmdComposite> ClearAllValues(objects::CSeq_entry_Handle seh);
297  virtual string RemapColumnName(string column_name);
298 private:
299  string m_Prefix;
300  vector<string> m_Fields;
301 };
302 
303 
305 {
306 public:
307  CFeatureTableCommandConverter(const objects::CSeq_feat& ftemplate,
308  const TFeatureSeqTableColumnList& reqs,
309  const TFeatureSeqTableColumnList& opts);
311  virtual CRef<objects::CSeq_table> GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh);
312  virtual CRef<CCmdComposite> GetCommandFromValuesTable(CRef<objects::CSeq_table>, objects::CSeq_entry_Handle seh);
314  virtual CRef<CCmdComposite> ClearAllValues(objects::CSeq_entry_Handle seh);
315  virtual string RemapColumnName(string column_name);
318 private:
322 };
323 
324 
325 vector<string> GetAssemblyDataFields();
326 
328 
329 #endif
330  // _TBL_EDIT_DLG_H_
CChimeraCommentDescriptorTableCommandConverter(const string &label, CSourceRequirements::EWizardSrcType src_type)
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
virtual string RemapColumnName(string column_name)
virtual string GetErrorMessage(CRef< objects::CSeq_table >)
virtual CRef< CCmdComposite > ClearAllValues(objects::CSeq_entry_Handle seh)
virtual string CheckForMixedValues(CRef< objects::CSeq_table > table, string column_name="")
CSourceRequirements::EWizardSrcType m_SrcType
virtual CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >, objects::CSeq_entry_Handle seh)
virtual string RemapColumnName(string column_name)
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
CCommentDescriptorTableCommandConverter(const string &label)
virtual CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table > values_table, objects::CSeq_entry_Handle seh)
virtual string CheckForMixedValues(CRef< objects::CSeq_table > table, string column_name="")
virtual string GetErrorMessage(CRef< objects::CSeq_table > values_table)
virtual CRef< CCmdComposite > ClearAllValues(objects::CSeq_entry_Handle seh)
virtual CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >, objects::CSeq_entry_Handle seh)
virtual CRef< CCmdComposite > ClearAllValues(objects::CSeq_entry_Handle seh)
vector< string > m_DBLinkFields
CDBLinkTableCommandConverter(vector< string > fields)
virtual string RemapColumnName(string column_name)
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
virtual string GetErrorMessage(CRef< objects::CSeq_table > table)
CFeatureTableCommandConverter(const objects::CSeq_feat &ftemplate, const TFeatureSeqTableColumnList &reqs, const TFeatureSeqTableColumnList &opts)
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
virtual CRef< objects::CSeq_table > GetChoices(CRef< objects::CSeq_table > values_table)
CRef< objects::CSeq_feat > m_Template
virtual CRef< CCmdComposite > ClearAllValues(objects::CSeq_entry_Handle seh)
virtual string RemapColumnName(string column_name)
TFeatureSeqTableColumnList m_Opts
virtual CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >, objects::CSeq_entry_Handle seh)
virtual CRef< objects::CSeqTable_column > MakeProblemsColumn(CRef< objects::CSeq_table > values_table)
TFeatureSeqTableColumnList m_Reqs
virtual string GetErrorMessage(CRef< objects::CSeq_table >)
virtual CRef< CCmdComposite > ClearAllValues(objects::CSeq_entry_Handle seh)
virtual string RemapColumnName(string column_name)
virtual CRef< objects::CSeq_table > GetChoices(CRef< objects::CSeq_table > values_table)
virtual string CheckForMixedValues(CRef< objects::CSeq_table > values_table, string column_name="")
CSourceRequirements::EWizardType m_WizardType
virtual CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >, objects::CSeq_entry_Handle seh)
CGenomeTableCommandConverter(CSourceRequirements::EWizardType wizard_type=CSourceRequirements::eWizardType_standard, CSourceRequirements::EWizardSrcType src_type=CSourceRequirements::eWizardSrcType_any)
CSourceRequirements::EWizardSrcType m_SrcType
virtual string GetErrorMessage(CRef< objects::CSeq_table >)
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
virtual CRef< CCmdComposite > ClearAllValues(objects::CSeq_entry_Handle seh)
virtual string RemapColumnName(string column_name)
CSourceRequirements::EWizardType m_WizardType
virtual CRef< objects::CSeq_table > GetChoices(CRef< objects::CSeq_table > values_table)
virtual string GetErrorMessage(CRef< objects::CSeq_table >)
CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table > values_table, objects::CSeq_entry_Handle seh, bool add_confirmed)
virtual CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >, objects::CSeq_entry_Handle seh)
CMolInfoTableCommandConverter(CSourceRequirements::EWizardType wizard_type=CSourceRequirements::eWizardType_standard)
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
virtual string GetErrorMessage(CRef< objects::CSeq_table >)
virtual CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >, objects::CSeq_entry_Handle seh)
virtual CRef< CCmdComposite > ClearAllValues(objects::CSeq_entry_Handle seh)
virtual CRef< objects::CSeq_table > GetChoices(CRef< objects::CSeq_table > values_table)
virtual string RemapColumnName(string column_name)
virtual string CheckForMixedValues(CRef< objects::CSeq_table > values_table, string column_name="")
wxGrid * GetGrid(void)
virtual CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >, objects::CSeq_entry_Handle seh)
CStructuredCommentCommandConverter(string prefix, vector< string > fields)
virtual CRef< CCmdComposite > ClearAllValues(objects::CSeq_entry_Handle seh)
virtual string GetErrorMessage(CRef< objects::CSeq_table >)
virtual string RemapColumnName(string column_name)
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)
virtual ~CTableCommandConverter()
virtual bool IsReadOnlyColumn(string column_name)
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)=0
virtual CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >, objects::CSeq_entry_Handle seh)=0
virtual string GetErrorMessage(CRef< objects::CSeq_table >)=0
virtual int GetCollapsible()
virtual CRef< objects::CSeq_table > GetChoices(CRef< objects::CSeq_table > values_table)
virtual string CheckForMixedValues(CRef< objects::CSeq_table > values_table, string column_name)
virtual CRef< CCmdComposite > ClearAllValues(objects::CSeq_entry_Handle seh)=0
virtual string RemapColumnName(string column_name)=0
wxString m_SaveFileName
virtual CRef< CCmdComposite > GetCommand()
virtual string GetErrorMessage()
void CreateControls()
Creates the controls and sizers.
string x_FindBadImportColumns(CRef< objects::CSeq_table > table)
wxString m_SaveFileDir
wxButton * m_ImportBtn
wxBoxSizer * m_TableControlsSizer
void OnExportTableClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EXPORT_TABLE
CTblEditDlg()
Constructors.
IWorkbench * m_Workbench
void OnImportTableClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_IMPORT_TABLE
wxBoxSizer * m_GridHolder
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
~CTblEditDlg()
Destructor.
void OnUpdateProblems(wxCommandEvent &event)
static bool ShowToolTips()
Should we show tooltips?
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CTblEditDlg(wxWindow *parent, objects::CSeq_entry_Handle seh, CTableCommandConverter *converter, IWorkbench *workbench=NULL, wxWindowID id=10079, const wxString &caption=_("TblEditDlg"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL, wxString label=wxT(""))
wxString m_StaticLabel
void OnClearTableClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CLEAR_TABLE
CSeqTableGridPanel * m_Grid
CTableCommandConverter * m_Converter
objects::CSeq_entry_Handle m_TopSeqEntry
wxGrid * GetGrid()
wxButton * m_ExportBtn
void Init()
Initialises member variables.
bool Create(wxWindow *parent, wxWindowID id=10079, const wxString &caption=_("TblEditDlg"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
Include a standard set of the NCBI C++ Toolkit most basic headers.
vector< CRef< CFeatureSeqTableColumnBase > > TFeatureSeqTableColumnList
#define NULL
Definition: ncbistd.hpp:225
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static const char label[]
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
static const char * prefix[]
Definition: pcregrep.c:405
#define SYMBOL_CTBLEDITDLG_SIZE
#define SYMBOL_CTBLEDITDLG_IDNAME
#define SYMBOL_CTBLEDITDLG_POSITION
#define SYMBOL_CTBLEDITDLG_TITLE
vector< string > GetAssemblyDataFields()
#define SYMBOL_CTBLEDITDLG_STYLE
Modified on Mon Feb 26 04:04:35 2024 by modify_doxy.py rev. 669887