32 #include "wx/wxprec.h"
61 string title =
"Country Fixup Do Not Fix Capitalization After Colon";
63 title =
"Country Fixup Fix Capitalization After Colon";
74 if (dlg.ShowModal() == wxID_OK)
104 new_feat->
Assign(feat_it->GetOriginalFeature());
117 if ((*it)->IsSource()) {
123 new_desc->
Assign(orig_desc);
142 bool modified =
false;
145 if ((*subsource)->IsSetSubtype() &&
146 (*subsource)->IsSetName() &&
149 string country = (*subsource)->GetName();
151 if (!new_country.empty() && new_country != country)
153 (*subsource)->SetName(new_country);
186 wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
187 : m_invalid_countries(invalid_countries)
190 Create(parent,
id, caption, pos,
size, style);
196 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
197 wxDialog::Create( parent,
id, caption, pos,
size, style );
202 GetSizer()->SetSizeHints(
this);
228 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
229 itemDialog1->SetSizer(itemBoxSizer2);
231 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
232 itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
234 wxArrayString itemChoiceStrings, itemChoiceStringsWritable;
240 itemBoxSizer3->Add(
m_GridPanel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
243 m_Grid->SetTable(gridAdapter,
true);
244 m_Grid->AutoSizeColumns();
245 int l_height =
m_Grid->GetColLabelSize();
246 m_Grid->SetColLabelSize( 2 * l_height );
253 if ((*it)->IsSetHeader() && (*it)->GetHeader().IsSetTitle() )
255 string title = (*it)->GetHeader().GetTitle();
258 itemChoiceStrings.Add(wxString(title));
260 itemChoiceStringsWritable.Add(wxString(title));
269 if (glyph_col >= 0 && glyph_col+1 <
m_Grid->GetNumberCols())
275 wxBoxSizer* itemBoxSizer4 =
new wxBoxSizer(wxHORIZONTAL);
276 itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
281 wxBoxSizer* itemBoxSizer5 =
new wxBoxSizer(wxHORIZONTAL);
282 itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
287 wxBoxSizer* itemBoxSizer13 =
new wxBoxSizer(wxHORIZONTAL);
288 itemBoxSizer2->Add(itemBoxSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
290 wxButton* itemButton14 =
new wxButton( itemDialog1, wxID_OK,
_(
"Accept"), wxDefaultPosition, wxDefaultSize, 0 );
291 itemBoxSizer13->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
293 wxButton* itemButton15 =
new wxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
294 itemBoxSizer13->Add(itemButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
306 expand_col->
SetHeader().SetField_name(
"expand");
307 expand_col->
SetData().SetString();
310 country_col->
SetHeader().SetTitle(
"Country");
311 country_col->
SetHeader().SetField_name(
"country");
312 country_col->
SetData().SetString();
315 accession_col->
SetHeader().SetTitle(
"Accession");
316 accession_col->
SetHeader().SetField_name(
"accession");
317 accession_col->
SetData().SetString();
322 bogus_col->
SetHeader().SetField_name(
"");
323 bogus_col->
SetData().SetString();
326 table->SetColumns().push_back(id_col);
327 table->SetColumns().push_back(expand_col);
328 table->SetColumns().push_back(country_col);
329 table->SetColumns().push_back(accession_col);
330 table->SetColumns().push_back(bogus_col);
335 string country = it->first;
336 string accession = it->second;
341 id_col->
SetData().SetId().push_back(
id);
342 expand_col->
SetData().SetString().push_back(
"");
343 country_col->
SetData().SetString().push_back(country);
344 accession_col->
SetData().SetString().push_back(accession);
345 bogus_col->
SetData().SetString().push_back(
"");
361 string country = it->first;
362 string accession = it->second;
367 if (row < values_table->GetColumn(
"country").GetData().GetString().
size())
371 if (new_country != country && !new_country.empty())
373 result[country] = new_country;
385 return fixed_countries;
390 return "Invalid operation in Bulk Country Edit";
443 wxMessageDialog dlg(
this,
_(
"Discard modifications?"),
_(
"Attention"),wxOK|wxCANCEL|wxCENTRE);
444 if (dlg.ShowModal() == wxID_OK)
~CBulkCountryEdit()
Destructor.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Country Modifiers That Could Not Be Autocorrected"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
CBulkCountryEdit()
Constructors.
void Init()
Initialises member variables.
static bool ShowToolTips()
Should we show tooltips?
void OnClickCancel(wxCommandEvent &event)
void CreateControls()
Creates the controls and sizers.
map< string, string > GetValuesFromValuesTable(CRef< objects::CSeq_table >)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
bool IsReadOnlyColumn(string column_name)
CSeqTableGridPanel * m_GridPanel
CApplyEditconvertPanel * m_AecrPanel
CStringConstraintSelect * m_StringConstraintPanel
vector< pair< string, string > > m_invalid_countries
CRef< objects::CSeq_table > GetChoices(CRef< objects::CSeq_table > values_table)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
CRef< objects::CSeq_table > GetValuesTable()
map< string, string > GetValues()
void AddCommand(IEditCommand &command)
static bool IsValid(const string &country)
static string CountryFixupItem(const string &input, bool capitalize_after_colon)
bool m_capitalize_after_colon
void x_ApplyToDescriptors(const objects::CSeq_entry &se, CCmdComposite *composite)
map< string, string > m_fixed_countries
void x_ApplyToSeqAndFeat(CCmdComposite *composite)
vector< pair< string, string > > m_invalid_countries
bool x_ApplyToBioSource(objects::CBioSource &biosource)
objects::CSeq_entry_Handle m_Seh
CRef< CCmdComposite > GetCommand(objects::CSeq_entry_Handle tse, bool capitalize_after_colon)
Seq-loc and seq-align mapper exceptions.
void MakeColumnReadOnly(int pos, bool val=true)
void InitColumnCollapse(int col)
CRef< objects::CSeq_table > GetValuesTable()
namespace ncbi::objects::
const CSeqTable_column & GetColumn(CTempString column_name) const
const_iterator end() const
const_iterator find(const key_type &key) const
static string s_GetAccession(CBioseq_Handle bsh)
const char * kSequenceIdColLabel
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
void GetLabel(string *label, ELabelType type=eDefault, TLabelFlags flags=fLabel_Default) const
Append a label for this Seq-id to the supplied string.
CConstRef< CSeq_id > GetSeqId(void) const
@ eContent
Untagged human-readable accession or the like.
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
CSeq_entry_Handle GetSeq_entryHandle(CDataLoader *loader, const TBlobId &blob_id, EMissing action=eMissing_Default)
Get Seq-entry handle by its blob-id, with possible loading.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const TColumns & GetColumns(void) const
Get the Columns member data.
void SetHeader(THeader &value)
Assign a value to Header data member.
vector< CRef< CSeqTable_column > > TColumns
void SetData(TData &value)
Assign a value to Data data member.
const TString & GetString(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
@ eField_id_location_id
location Seq-id
void SetData(TData &value)
Assign a value to Data data member.
const TSeq & GetSeq(void) const
Get the variant data.
const TSet & GetSet(void) const
Get the variant data.
bool IsSeq(void) const
Check if variant Seq is selected.
bool IsSet(void) const
Check if variant Set is selected.
TSource & SetSource(void)
Select the variant.
<!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 EDIT_EACH_SUBSOURCE_ON_BIOSOURCE(Itr, Var)
#define FOR_EACH_SEQENTRY_ON_SEQSET(Itr, Var)
FOR_EACH_SEQENTRY_ON_SEQSET EDIT_EACH_SEQENTRY_ON_SEQSET.
#define FOR_EACH_SEQDESC_ON_SEQENTRY(Itr, Var)
FOR_EACH_SEQDESC_ON_SEQENTRY EDIT_EACH_SEQDESC_ON_SEQENTRY.
#define row(bind, expected)