42 #include <wx/msgdlg.h>
48 IMPLEMENT_DYNAMIC_CLASS(
CBulkRna, wxDialog )
50 BEGIN_EVENT_TABLE(
CBulkRna, wxDialog )
65 wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
80 wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
81 : m_FeatHandles(feat_handles)
89 bool CBulkRna::Create( wxWindow* parent, wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
91 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
92 SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);
93 wxDialog::Create( parent,
id, caption, pos,
size, style );
98 GetSizer()->SetSizeHints(
this);
124 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
125 itemDialog1->SetSizer(itemBoxSizer2);
127 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
128 itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
130 wxArrayString itemChoiceStrings, itemChoiceStringsWritable;
134 wxMessageBox(
wxT(
"No RNA records found"),
wxT(
"Error"), wxOK | wxICON_ERROR);
139 if (values_table->GetNum_rows() < 1)
141 wxMessageBox(
wxT(
"No RNA records found"),
wxT(
"Error"), wxOK | wxICON_ERROR);
147 itemBoxSizer3->Add(
m_GridPanel, 0, wxALIGN_TOP|wxALL, 5);
150 m_Grid->SetTable(gridAdapter,
true);
151 m_Grid->AutoSizeColumns();
152 int l_height =
m_Grid->GetColLabelSize();
153 m_Grid->SetColLabelSize( 2 * l_height );
161 if ((*it)->IsSetHeader() && (*it)->GetHeader().IsSetTitle() )
163 string title = (*it)->GetHeader().GetTitle();
166 itemChoiceStrings.Add(wxString(title));
168 itemChoiceStringsWritable.Add(wxString(title));
177 if (glyph_col >= 0 && glyph_col+1 <
m_Grid->GetNumberCols())
185 itemBoxSizer2->Add(itemStringConstraintPanel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|
wxFIXED_MINSIZE, 0);
190 wxBoxSizer* itemBoxSizer13 =
new wxBoxSizer(wxHORIZONTAL);
191 itemBoxSizer2->Add(itemBoxSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
193 wxButton* itemButton14 =
new wxButton( itemDialog1, wxID_OK,
_(
"Accept"), wxDefaultPosition, wxDefaultSize, 0 );
194 itemBoxSizer13->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
196 wxButton* itemButton15 =
new wxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
197 itemBoxSizer13->Add(itemButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
204 id_col->SetHeader().SetField_id(objects::CSeqTable_column_info::eField_id_location_id);
208 expand_col->SetHeader().SetTitle(
"");
209 expand_col->SetHeader().SetField_name(
"expand");
210 expand_col->SetData().SetString();
213 product_col->SetHeader().SetTitle(
"product");
214 product_col->SetHeader().SetField_name(
"product");
215 product_col->SetData().SetString();
218 loc_col->SetHeader().SetTitle(
"location");
219 loc_col->SetHeader().SetField_name(
"location");
220 loc_col->SetData().SetString();
223 comment_col->SetHeader().SetTitle(
"comment");
224 comment_col->SetHeader().SetField_name(
"comment");
225 comment_col->SetData().SetString();
229 bogus_col->SetHeader().SetTitle(
"");
230 bogus_col->SetHeader().SetField_name(
"");
231 bogus_col->SetData().SetString();
234 table->SetColumns().push_back(id_col);
235 table->SetColumns().push_back(expand_col);
236 table->SetColumns().push_back(product_col);
237 table->SetColumns().push_back(loc_col);
247 table->SetColumns().push_back(comment_col);
248 table->SetColumns().push_back(bogus_col);
254 string product,loc,comment;
256 const CSeq_feat &feat = *
fi->GetOriginalSeq_feat();
258 product =
rna.GetRnaProductName();
266 id_col->SetData().SetId().push_back(
id);
267 expand_col->SetData().SetString().push_back(
"");
268 product_col->SetData().SetString().push_back(product);
269 loc_col->SetData().SetString().push_back(loc);
272 comment_col->SetData().SetString().push_back(comment);
273 bogus_col->SetData().SetString().push_back(
"");
292 const CSeq_feat &feat = *
fi->GetOriginalSeq_feat();
295 string product,loc,comment;
296 bool modified =
false;
298 product =
rna.GetRnaProductName();
308 if (row < values_table->GetColumn(
"product").GetData().GetString().
size())
312 if (new_product != product)
315 new_feat->
SetData().SetRna().SetRnaProductName(new_product, remainder);
322 if (row < values_table->GetColumn(
"comment").GetData().GetString().
size())
326 if (new_comment != comment)
328 if (new_comment.empty())
335 string partial_start_val = partial_start_feat_col->
GetFromFeat(feat);
336 string new_partial_start_val;
343 if (new_partial_start_val != partial_start_val)
345 if (new_partial_start_val.empty())
352 string partial_stop_val = partial_stop_feat_col->
GetFromFeat(feat);
353 string new_partial_stop_val;
356 if (row < values_table->GetColumn(
kPartialStop).GetData().GetString().
size())
360 if (new_partial_stop_val != partial_stop_val)
362 if (new_partial_stop_val.empty())
388 return "Invalid operation in Bulk Rna Edit";
448 wxMessageDialog dlg(
this,
_(
"Discard modifications?"),
_(
"Attention"),wxOK|wxCANCEL|wxCENTRE);
449 if (dlg.ShowModal() == wxID_OK)
User-defined methods of the data storage class.
USING_SCOPE(ncbi::objects)
static bool ShowToolTips()
Should we show tooltips?
CApplyEditconvertPanel * m_AecrPanel
void OnClickOk(wxCommandEvent &event)
void CreateControls()
Creates the controls and sizers.
bool IsReadOnlyColumn(string column_name)
CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >)
void Init()
Initialises member variables.
vector< CSeq_feat_Handle > m_FeatHandles
void OnClickCancel(wxCommandEvent &event)
CRef< objects::CSeq_table > GetValuesTableFromSeqEntry()
virtual const CObject * RowToScopedObjects(int row, TConstScopedObjects &objects, CBioseq_Handle &bsh)
CRef< CCmdComposite > GetCommand()
CRef< objects::CSeq_table > GetChoices(CRef< objects::CSeq_table > values_table)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("RNA Editing"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
CSeqTableGridPanel * m_GridPanel
wxBitmap GetBitmapResource(const wxString &name)
static CRef< CFeatureSeqTableColumnBase > Create(const string &sTitle, objects::CSeqFeatData::ESubtype subtype=objects::CSeqFeatData::eSubtype_any)
virtual void ClearInFeature(objects::CSeq_feat &in_out_feat)
virtual string GetFromFeat(const objects::CSeq_feat &in_out_feat)
virtual bool AddToFeature(objects::CSeq_feat &in_out_feat, const string &newValue, objects::edit::EExistingText existing_text)
@RNA_ref.hpp User-defined methods of the data storage class.
CConstRef< objects::CSeq_submit > m_SeqSubmit
Seq-loc and seq-align mapper exceptions.
void MakeColumnReadOnly(int pos, bool val=true)
void SetColumnSizesAndChoices()
void InitColumnCollapse(int col)
CRef< objects::CSeq_table > GetValuesTable()
namespace ncbi::objects::
const CSeqTable_column & GetColumn(CTempString column_name) const
IWorkbench is the central interface in the application framework.
const string kPartialStart
const string kPartialStop
const char * kSequenceIdColLabel
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
vector< SConstScopedObject > TConstScopedObjects
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
void GetLabel(string *label) const
Appends a label suitable for display (e.g., error messages) label must point to an existing string ob...
TBioseqCore GetBioseqCore(void) const
Get bioseq core structure.
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CScope & GetScope(void) const
Get scope this handle belongs to.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void SetHeader(THeader &value)
Assign a value to Header data member.
vector< CRef< CSeqTable_column > > TColumns
const TString & GetString(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
bool IsSetComment(void) const
Check if a value has been assigned to Comment data member.
void SetComment(const TComment &value)
Assign a value to Comment data member.
const TLocation & GetLocation(void) const
Get the Location member data.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
void ResetComment(void)
Reset Comment data member.
const TComment & GetComment(void) const
Get the Comment member data.
const TRna & GetRna(void) const
Get the variant data.
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
<!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
CRef< CSeqTable_column > AddStringColumnToTable(CRef< CSeq_table > table, string label)
void AddValueToColumn(CRef< CSeqTable_column > column, string value, size_t row, edit::EExistingText existing_text=edit::eExistingText_replace_old)
#define row(bind, expected)
@ eExistingText_replace_old