55 DEFINE_EVENT_TYPE(wxEVT_COMMAND_UPDATE_FEATLIST)
97 CFieldNamePanel::Create( parent,
id, pos,
size, style );
102 GetSizer()->SetSizeHints(
this);
145 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
146 itemCFieldNamePanel1->SetSizer(itemBoxSizer2);
148 wxFlexGridSizer* itemFlexGridSizer3 =
new wxFlexGridSizer(0, 2, 0, 0);
149 itemBoxSizer2->Add(itemFlexGridSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5);
151 m_FeatureTypeLabel =
new wxStaticText( itemCFieldNamePanel1, wxID_STATIC,
_(
"Feature Type"), wxDefaultPosition, wxDefaultSize, 0 );
152 itemFlexGridSizer3->Add(
m_FeatureTypeLabel, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 3);
154 wxStaticText* itemStaticText5 =
new wxStaticText( itemCFieldNamePanel1, wxID_STATIC,
_(
"Qualifier"), wxDefaultPosition, wxDefaultSize, 0 );
155 itemFlexGridSizer3->Add(itemStaticText5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 3);
158 itemFlexGridSizer3->Add(
m_FeatureType, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
160 wxArrayString m_QualifierNameStrings;
162 itemFlexGridSizer3->Add(
m_QualifierName, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
189 vector<string>
names;
197 bool product_present =
false;
198 bool note_present =
false;
199 for (
auto &name :
names)
208 product_present =
true;
225 list.Add(wxString(name));
228 list.Add(wxString(
"satellite-type"));
229 list.Add(wxString(
"satellite-name"));
233 list.Add(wxString(
"mobile-element-type-type"));
234 list.Add(wxString(
"mobile-element-type-name"));
239 list.Insert(
_T(
"note"), 0);
241 list.Insert(
_T(
"product"), 0);
251 const string& target,
const string& selected_field)
254 string feature = feat;
255 string field = qualifier;
258 feature =
"cdregion";
261 feature =
"precursor_RNA";
268 if (field ==
"gene" || field ==
"locus")
271 str =
"\"data.gene.locus\"";
273 str =
"\"qual\", \"locus\"";
276 if (field ==
"product" || field ==
"name")
282 str =
"\"data.rna.ext.name\"";
286 str =
"\"data.rna.ext.gen.product\"";
288 str =
"\"data.prot.name\"";
292 str =
"\"data.prot.name\"";
301 if (field ==
"db_xref")
303 str = macro::CMacroFunction_GetDBXref::GetFuncName() +
"()";
305 if (field ==
"desc" || field ==
"description")
308 str =
"\"data.gene.desc\"";
310 str =
"\"data.prot.desc\"";
312 str =
"\"qual\", \"description\"";
317 str =
"\"data.gene.locus-tag\"";
320 str =
"\"data.gene.syn\"";
322 else if (field ==
"allele") {
323 str =
"\"data.gene.allele\"";
327 if (field ==
"activity") {
329 str =
"\"data.prot.activity\"";
333 str =
"\"data.prot.activity\"";
339 str =
"\"data.prot.ec\"";
343 str =
"\"data.prot.ec\"";
348 str =
"\"data.rna.ext.gen.quals\", \"" + field +
"\"";
352 if (field ==
"translation")
355 str =
"TRANSLATION()";
358 if (field ==
"satellite_type") {
359 str = macro::CMacroFunction_SatelliteType::GetFuncName() +
"()";
361 else if (field ==
"satellite_name") {
362 str = macro::CMacroFunction_SatelliteName::GetFuncName() +
"()";
364 else if (field ==
"mobile_element_type_type") {
365 str = macro::CMacroFunction_MobileElementType::GetFuncName() +
"()";
367 else if (field ==
"mobile_element_type_name") {
368 str = macro::CMacroFunction_MobileElementName::GetFuncName() +
"()";
372 str =
"\"qual\", \"" + field +
"\"";
380 (selected_field ==
"preRNA" && feature ==
"precursor_RNA")) {
392 str =
"RELATED_FEATURE(\"" + feature +
"\", " +
str +
")";
395 str =
"FEATURES(\"" + feature +
"\"," +
str +
")";
473 string qual_name =
"";
490 field = feat +
" " + qual;
507 if (pos != string::npos) {
508 string feat = field.substr(0, pos);
509 string qual = field.substr(pos + 1);
537 if (field_name.empty())
545 wxCommandEvent listbxEvent(wxEVT_COMMAND_UPDATE_FEATLIST,
GetId());
546 listbxEvent.SetEventObject(
this);
547 GetEventHandler()->ProcessEvent(listbxEvent);
552 vector<string> choices;
556 if (field_name ==
"codon_start")
558 choices.push_back(
"1");
559 choices.push_back(
"2");
560 choices.push_back(
"3");
563 if (field_name ==
"pseudo")
565 choices.push_back(
"Processed");
566 choices.push_back(
"Unprocessed");
567 choices.push_back(
"Unitary");
568 choices.push_back(
"Allelic");
569 choices.push_back(
"Unknown");
570 choices.push_back(
"Unqualified");
573 if (field_name ==
"transl_table")
576 choices.reserve(codes.size());
579 string str = (*it)->GetName();
580 choices.push_back(
str);
static wxArrayString s_FillFeatQualList(objects::CSeqFeatData::ESubtype subtype)
virtual void UpdateEditor()
virtual bool SetFieldName(const string &field)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
const objects::CGenetic_code_table & m_code_table
void CreateControls()
Creates the controls and sizers.
static string s_GetMacroFieldName(const string &feature, const string &qualifier, const string &target, const string &selected_field=kEmptyStr)
CFeatureFieldNamePanel * m_Sibling
void PopulateFeatureListbox(void)
virtual void SetShowLegalOnly(bool show)
wxStaticText * m_FeatureTypeLabel
wxListBox * m_QualifierName
static bool ShowToolTips()
Should we show tooltips?
string GetQualifierName()
CFeatureTypePanel * m_FeatureType
CFeatureFieldNamePanel()
Constructors.
virtual string GetMacroFieldName(const string &target, const string &selected_field=kEmptyStr)
virtual vector< string > GetChoices(bool &allow_other)
@ ID_FEATQUALIFIER_LISTBOX
~CFeatureFieldNamePanel()
Destructor.
bool SetFeatureType(const string &feature_type)
void OnQualifierListboxSelected(wxCommandEvent &event)
wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_QUALIFIER_LISTBOX
void Init()
Initialises member variables.
virtual string GetFieldName(const bool subfield=false)
Returns the name of the field as selected in the panel.
bool Create(wxWindow *parent, wxWindowID id=ID_CFEATUREFIELDNAMEPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
Creation.
virtual void ClearValues(void)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void ListPresentFeaturesFirst(objects::CSeq_entry_Handle seh, vector< const objects::CFeatListItem * > *featlist=nullptr)
virtual bool SetFieldName(const string &field)
virtual void ClearValues(void)
virtual string GetFieldName(const bool subfield=false)
Returns the name of the field as selected in the panel.
virtual void SetShowLegalOnly(bool show)
void ListPresentFeaturesFirst(const objects::CSeq_entry_Handle &entry, vector< const objects::CFeatListItem * > *featlist=nullptr)
void x_UpdateParent(void)
static bool IsFeature(const string &target)
static bool IsDiscouragedQual(EQualifier qual)
const TLegalQualifiers & GetLegalQualifiers(void) const
Get a list of all the legal qualifiers for the feature.
static CTempString GetQualifierAsString(EQualifier qual)
Convert a qualifier from an enumerated value to a string representation or empty if not found.
static ESubtype SubtypeNameToValue(CTempString sName)
Turn a string into its ESubtype which is NOT necessarily related to the identifier of the enum.
static const struct name_t names[]
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
bool StringsAreEquivalent(const string &name1, const string &name2)
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,...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
@ eReverseSearch
Search in a backward direction.
@ eCase
Case sensitive compare.
list< CRef< CGenetic_code > > Tdata
const struct ncbi::grid::netcache::search::fields::SIZE size
static const char * str(char *buf, int n)
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)