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

Go to the SVN repository for this file.

1 /* $Id: srceditdialog.hpp 43832 2019-09-09 13:50:37Z 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 _SRCEDITDIALOG_H_
29 #define _SRCEDITDIALOG_H_
30 
31 #include <corelib/ncbistd.hpp>
34 #include <objmgr/seqdesc_ci.hpp>
35 #include <objmgr/bioseq_ci.hpp>
42 
43 #include <wx/dialog.h>
44 #include <wx/choice.h>
45 #include <wx/menu.h>
46 #include <wx/event.h>
47 #include <wx/stattext.h>
48 
49 /*!
50  * Includes
51  */
52 
53 ////@begin includes
54 ////@end includes
55 
56 /*!
57  * Forward declarations
58  */
59 
61 
62 ////@begin forward declarations
63 ////@end forward declarations
64 
65 /*!
66  * Control identifiers
67  */
68 
69 ////@begin control identifiers
70 #define ID_SRCEDITDIALOG 10013
71 #define ID_QUALCHOICE 10017
72 #define ID_ADD_QUAL_BUTTON 10018
73 #define ID_LOADQUALS 10084
74 #define ID_EXPORT_QUALS 10085
75 #define SYMBOL_SRCEDITDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
76 #define SYMBOL_SRCEDITDIALOG_TITLE _("Source Editing")
77 #define SYMBOL_SRCEDITDIALOG_IDNAME ID_SRCEDITDIALOG
78 #define SYMBOL_SRCEDITDIALOG_SIZE wxDefaultSize
79 #define SYMBOL_SRCEDITDIALOG_POSITION wxDefaultPosition
80 ////@end control identifiers
81 
82 /*!
83  * SrcEditDialog class declaration
84  */
85 
86 
87 
89 {
90  DECLARE_DYNAMIC_CLASS( SrcEditDialog )
91  DECLARE_EVENT_TABLE()
92 
93 public:
94  /// Constructors
95  SrcEditDialog();
96  SrcEditDialog( wxWindow* parent, objects::CSeq_entry_Handle seh, IWorkbench* workbench, CConstRef<objects::CSeq_submit> seqSubmit,
97  wxWindowID id = SYMBOL_SRCEDITDIALOG_IDNAME,
98  const wxString& caption = SYMBOL_SRCEDITDIALOG_TITLE,
99  const wxPoint& pos = SYMBOL_SRCEDITDIALOG_POSITION,
100  const wxSize& size = SYMBOL_SRCEDITDIALOG_SIZE,
101  long style = SYMBOL_SRCEDITDIALOG_STYLE );
102 
103  SrcEditDialog( wxWindow* parent, const vector<CBioseq_Handle>& bioseq_handles, IWorkbench* workbench = NULL,
104  wxWindowID id = SYMBOL_SRCEDITDIALOG_IDNAME,
105  const wxString& caption = SYMBOL_SRCEDITDIALOG_TITLE,
106  const wxPoint& pos = SYMBOL_SRCEDITDIALOG_POSITION,
107  const wxSize& size = SYMBOL_SRCEDITDIALOG_SIZE,
108  long style = SYMBOL_SRCEDITDIALOG_STYLE );
109 
110  /// Creation
111  bool Create( wxWindow* parent,
112  wxWindowID id = SYMBOL_SRCEDITDIALOG_IDNAME,
113  const wxString& caption = SYMBOL_SRCEDITDIALOG_TITLE,
114  const wxPoint& pos = SYMBOL_SRCEDITDIALOG_POSITION,
115  const wxSize& size = SYMBOL_SRCEDITDIALOG_SIZE,
116  long style = SYMBOL_SRCEDITDIALOG_STYLE );
117 
118  /// Destructor
119  ~SrcEditDialog();
120 
121  /// Initialises member variables
122  void Init();
123 
124  /// Creates the controls and sizers
125  void CreateControls();
126 
127 ////@begin SrcEditDialog event handler declarations
128 
129  /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_QUALCHOICE
130  void OnQualchoiceSelected( wxCommandEvent& event );
131 
132  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ADD_QUAL_BUTTON
133  void OnAddQual( wxCommandEvent& event );
134 
135  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LOADQUALS
136  void OnLoadqualsClick( wxCommandEvent& event );
137 
138  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EXPORT_QUALS
139  void OnExportQualsClick( wxCommandEvent& event );
140 
141  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CLEAR_QUALS_BTN
142  void OnClearQuals( wxCommandEvent& event );
143 
144  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
145  void OnClickOk( wxCommandEvent& event );
146 
147  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
148  void OnClickCancel( wxCommandEvent& event );
149 
150 ////@end SrcEditDialog event handler declarations
151 
152  void OnCopyCells( wxCommandEvent& event );
153  void OnPasteCells( wxCommandEvent& event );
154  void OnPasteAppendCells( wxCommandEvent& event );
155  void OnCopyCellsFromId( wxCommandEvent& event );
156 
157 
158 ////@begin SrcEditDialog member function declarations
159 
160  /// Retrieves bitmap resources
161  wxBitmap GetBitmapResource( const wxString& name );
162 
163  /// Retrieves icon resources
164  wxIcon GetIconResource( const wxString& name );
165 ////@end SrcEditDialog member function declarations
166 
167  /// Should we show tooltips?
168  static bool ShowToolTips();
169  void GetQualChoices(wxArrayString& srcModNameStrings);
171 
172  int GetCollapsible() {return 0;}
173  bool IsReadOnlyColumn(string column_name) { if (column_name == "location" || column_name.empty() || column_name == "expand") return true; return false; };
174 
175 ////@begin SrcEditDialog member variables
176  wxChoice* m_QualList;
177  wxButton* m_AddQualBtn;
178 ////@end SrcEditDialog member variables
179  wxGrid* m_Grid;
180 
182  void ChangeColumnName(int col, string qual_name);
183  void ResetSubPanels();
184  int GetNewColumn(wxString new_col);
186 
187  void SetWorkDir(const wxString& workDir) { m_SaveFileDir = workDir; }
188 
189 private:
190  vector<CBioseq_Handle> m_BioseqHandles;
191  objects::CSeq_entry_Handle m_SEH;
194  wxString m_SaveFileDir;
195  wxString m_SaveFileName;
198  objects::CSeq_table::TColumns m_columns;
199 
200  int x_FindColumn( const wxString& name );
207  //CRef<CSeq_table> GetSeqTableFromSeqEntry (CSeq_entry_Handle seh);
208  //string GetPrimerSetNameValues(const objects::CPCRPrimerSet& primer_set);
209  //string GetPrimerSetSeqValues(const objects::CPCRPrimerSet& primer_set);
210  CRef<objects::CSeqTable_column> FindSeqIDColumn(const objects::CSeq_table& table);
213  int CombineTables (CRef<objects::CSeq_table> dst, const objects::CSeq_table& src);
214  bool SaveTableFile (wxWindow *parent, wxString& save_file_dir, wxString& save_file_name, CRef<objects::CSeq_table> values_table);
218  int CountTableColumnConflicts (CRef<objects::CSeq_table> dst, const objects::CSeq_table& src);
221  string GetLabelForTitle(string sTitle);
223 
224 };
225 
227 
228 #endif
229  // _SRCEDITDIALOG_H_
User-defined methods of the data storage class.
CBioseq_Handle –.
CObject –.
Definition: ncbiobj.hpp:180
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
wxChoice * m_QualList
string FindBadColumns(CRef< objects::CSeq_table > table)
int GetNewColumn(wxString new_col)
wxString m_SaveFileDir
void OnAddQual(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ADD_QUAL_BUTTON
CStringConstraintSelect * m_StringConstraintPanel
int CombineTables(CRef< objects::CSeq_table > dst, const objects::CSeq_table &src)
void DeleteTableRow(CRef< objects::CSeq_table > table, int row)
SrcEditDialog()
Constructors.
objects::CSeq_table::TColumns m_columns
void OnCopyCellsFromId(wxCommandEvent &event)
void GetQualChoices(wxArrayString &srcModNameStrings)
CRef< objects::CSeq_table > x_GetSourceTableChoices(CRef< objects::CSeq_table > values)
void OnQualchoiceSelected(wxCommandEvent &event)
wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_QUALCHOICE
CSeqTableGridPanel * m_GridPanel
CRef< objects::CSeq_table > x_GetValuesTableFromGridPanel()
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
~SrcEditDialog()
Destructor.
void OnExportQualsClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EXPORT_QUALS
int CountColumnRowConflicts(CRef< objects::CSeqTable_column > dst_id, CRef< objects::CSeqTable_column > dst_col, CRef< objects::CSeqTable_column > src_id, CRef< objects::CSeqTable_column > src_col)
void OnClickCancel(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void CombineColumns(CRef< objects::CSeqTable_column > dst_id, CRef< objects::CSeqTable_column > dst_col, CRef< objects::CSeqTable_column > src_id, CRef< objects::CSeqTable_column > src_col)
wxString m_SaveFileName
string GetLabelForTitle(string sTitle)
CApplyEditconvertPanel * m_AecrPanel
void Init()
Initialises member variables.
CBioseq_Handle GetBioseqHandle(int row)
bool Create(wxWindow *parent, wxWindowID id=10013, const wxString &caption=_("Source Editing"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
CRef< CCmdComposite > ApplySrcTableToSeqEntry(CRef< objects::CSeq_table >values_table)
void OnClickOk(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnCopyCells(wxCommandEvent &event)
CRef< CCmdComposite > GetCommand()
virtual const CObject * RowToScopedObjects(int row, TConstScopedObjects &objects, CBioseq_Handle &bsh)
CRef< objects::CSeqTable_column > FindSeqIDColumn(const objects::CSeq_table &table)
wxButton * m_AddQualBtn
int FindRowForSeqId(CRef< objects::CSeqTable_column > id_col, CRef< objects::CSeq_id > id)
void OnClearQuals(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CLEAR_QUALS_BTN
static bool ShowToolTips()
Should we show tooltips?
void SetWorkDir(const wxString &workDir)
bool SaveTableFile(wxWindow *parent, wxString &save_file_dir, wxString &save_file_name, CRef< objects::CSeq_table > values_table)
void OnPasteCells(wxCommandEvent &event)
bool IsReadOnlyColumn(string column_name)
vector< CBioseq_Handle > m_BioseqHandles
CRef< objects::CSeq_table > m_Copied
int x_FindColumn(const wxString &name)
void ChangeColumnName(int col, string qual_name)
void OnLoadqualsClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LOADQUALS
void FixTableAfterImport(CRef< objects::CSeq_table > input_table)
string FindBadRows(CRef< objects::CSeq_table > src, CRef< objects::CSeq_table > dst)
void OnPasteAppendCells(wxCommandEvent &event)
objects::CSeq_entry_Handle m_SEH
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void CreateControls()
Creates the controls and sizers.
int CountTableColumnConflicts(CRef< objects::CSeq_table > dst, const objects::CSeq_table &src)
void x_RepopulateAddQualList()
bool OneRowOk(CRef< objects::CSeq_id > id, CRef< objects::CSeqTable_column > id_col)
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define NULL
Definition: ncbistd.hpp:225
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
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_SRCEDITDIALOG_POSITION
#define SYMBOL_SRCEDITDIALOG_SIZE
#define SYMBOL_SRCEDITDIALOG_STYLE
#define SYMBOL_SRCEDITDIALOG_IDNAME
#define SYMBOL_SRCEDITDIALOG_TITLE
#define row(bind, expected)
Definition: string_bind.c:73
Modified on Wed Apr 24 14:09:39 2024 by modify_doxy.py rev. 669887