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

Go to the SVN repository for this file.

1 /* $Id: srceditdialog.hpp 47655 2024-01-26 18:45:13Z 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: 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|wxMAXIMIZE_BOX|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,
98  wxWindowID id = SYMBOL_SRCEDITDIALOG_IDNAME,
99  const wxString& caption = SYMBOL_SRCEDITDIALOG_TITLE,
100  const wxPoint& pos = SYMBOL_SRCEDITDIALOG_POSITION,
101  const wxSize& size = SYMBOL_SRCEDITDIALOG_SIZE,
102  long style = SYMBOL_SRCEDITDIALOG_STYLE );
103 
104  SrcEditDialog( wxWindow* parent, const vector<CBioseq_Handle>& bioseq_handles, IWorkbench* workbench = NULL,
105  wxWindowID id = SYMBOL_SRCEDITDIALOG_IDNAME,
106  const wxString& caption = SYMBOL_SRCEDITDIALOG_TITLE,
107  const wxPoint& pos = SYMBOL_SRCEDITDIALOG_POSITION,
108  const wxSize& size = SYMBOL_SRCEDITDIALOG_SIZE,
109  long style = SYMBOL_SRCEDITDIALOG_STYLE );
110 
111  /// Creation
112  bool Create( wxWindow* parent,
113  wxWindowID id = SYMBOL_SRCEDITDIALOG_IDNAME,
114  const wxString& caption = SYMBOL_SRCEDITDIALOG_TITLE,
115  const wxPoint& pos = SYMBOL_SRCEDITDIALOG_POSITION,
116  const wxSize& size = SYMBOL_SRCEDITDIALOG_SIZE,
117  long style = SYMBOL_SRCEDITDIALOG_STYLE );
118 
119  /// Destructor
120  ~SrcEditDialog();
121 
122  /// Initialises member variables
123  void Init();
124 
125  /// Creates the controls and sizers
126  void CreateControls();
127 
128 ////@begin SrcEditDialog event handler declarations
129 
130  /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_QUALCHOICE
131  void OnQualchoiceSelected( wxCommandEvent& event );
132 
133  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ADD_QUAL_BUTTON
134  void OnAddQual( wxCommandEvent& event );
135 
136  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LOADQUALS
137  void OnLoadqualsClick( wxCommandEvent& event );
138 
139  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EXPORT_QUALS
140  void OnExportQualsClick( wxCommandEvent& event );
141 
142  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CLEAR_QUALS_BTN
143  void OnClearQuals( wxCommandEvent& event );
144 
145  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
146  void OnClickOk( wxCommandEvent& event );
147 
148  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
149  void OnClickCancel( wxCommandEvent& event );
150 
151 ////@end SrcEditDialog event handler declarations
152 
153  void OnCopyCells( wxCommandEvent& event );
154  void OnPasteCells( wxCommandEvent& event );
155  void OnPasteAppendCells( wxCommandEvent& event );
156  void OnCopyCellsFromId( wxCommandEvent& event );
157 
158 
159 ////@begin SrcEditDialog member function declarations
160 
161  /// Retrieves bitmap resources
162  wxBitmap GetBitmapResource( const wxString& name );
163 
164  /// Retrieves icon resources
165  wxIcon GetIconResource( const wxString& name );
166 ////@end SrcEditDialog member function declarations
167 
168  /// Should we show tooltips?
169  static bool ShowToolTips();
170  void GetQualChoices(wxArrayString& srcModNameStrings);
172 
173  int GetCollapsible() const {return 0;}
174  bool IsReadOnlyColumn(string column_name) const;
175 
176  wxChoice* m_QualList;
177  wxButton* m_AddQualBtn;
178  wxGrid* m_Grid;
179 
181  void ChangeColumnName(int col, string qual_name);
182  void ResetSubPanels();
183  int GetNewColumn(wxString new_col);
185 
186  void SetWorkDir(const wxString& workDir) { m_SaveFileDir = workDir; }
187 
188 private:
189  vector<CBioseq_Handle> m_BioseqHandles;
190  objects::CSeq_entry_Handle m_SEH;
193  wxString m_SaveFileDir;
194  wxString m_SaveFileName;
197  objects::CSeq_table::TColumns m_columns;
198 
199  int x_FindColumn( const wxString& name );
206  //CRef<CSeq_table> GetSeqTableFromSeqEntry (CSeq_entry_Handle seh);
207  //string GetPrimerSetNameValues(const objects::CPCRPrimerSet& primer_set);
208  //string GetPrimerSetSeqValues(const objects::CPCRPrimerSet& primer_set);
209  CRef<objects::CSeqTable_column> FindSeqIDColumn(const objects::CSeq_table& table);
212  int CombineTables (CRef<objects::CSeq_table> dst, const objects::CSeq_table& src);
213  bool SaveTableFile (wxWindow *parent, wxString& save_file_dir, wxString& save_file_name, CRef<objects::CSeq_table> values_table);
217  int CountTableColumnConflicts (CRef<objects::CSeq_table> dst, const objects::CSeq_table& src);
220  string GetLabelForTitle(string sTitle);
222 
223 };
224 
226 
227 #endif
228  // _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)
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|wxMAXIMIZE_BOX|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
int GetCollapsible() const
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)
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)
vector< CBioseq_Handle > m_BioseqHandles
CRef< objects::CSeq_table > m_Copied
int x_FindColumn(const wxString &name)
bool IsReadOnlyColumn(string column_name) const
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 Fri Sep 20 14:57:27 2024 by modify_doxy.py rev. 669887