50 #include <wx/stattext.h>
51 #include <wx/textctrl.h>
52 #include <wx/choice.h>
53 #include <wx/bitmap.h>
55 #include <wx/treebook.h>
56 #include <wx/msgdlg.h>
97 wxWindowID
id,
const wxPoint& pos,
const wxSize&
size,
long style ) :
113 wxPanel::Create( parent,
id, pos,
size, style );
118 GetSizer()->SetSizeHints(
this);
163 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
164 itemPanel1->SetSizer(itemBoxSizer2);
166 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
167 itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
169 wxStaticText* itemStaticText4 =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"Pseudogene"), wxDefaultPosition, wxDefaultSize, 0 );
170 itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
172 wxArrayString m_PseudogeneChoiceStrings;
176 wxBoxSizer* itemBoxSizer6 =
new wxBoxSizer(wxHORIZONTAL);
177 itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_LEFT|wxALL, 0);
179 wxStaticText* itemStaticText7 =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"Exception"), wxDefaultPosition, wxDefaultSize, 0 );
180 itemBoxSizer6->Add(itemStaticText7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
182 wxArrayString m_ExplanationStrings;
183 m_Explanation =
new wxComboBox( itemPanel1,
ID_EXPLANATION, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_ExplanationStrings, wxCB_DROPDOWN );
184 itemBoxSizer6->Add(
m_Explanation, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
186 wxBoxSizer* itemBoxSizer9 =
new wxBoxSizer(wxHORIZONTAL);
187 itemBoxSizer2->Add(itemBoxSizer9, 0, wxALIGN_LEFT|wxALL, 0);
189 wxArrayString m_EvidenceStrings;
190 m_EvidenceStrings.Add(
_(
"N/A"));
191 m_EvidenceStrings.Add(
_(
"Experimental"));
192 m_EvidenceStrings.Add(
_(
"Non-Experimental"));
193 m_Evidence =
new wxRadioBox( itemPanel1,
ID_RADIOBOX3,
_(
"Evidence"), wxDefaultPosition, wxDefaultSize, m_EvidenceStrings, 1, wxRA_SPECIFY_ROWS );
196 m_Evidence->SetToolTip(
_(
"The use of the Evidence field is discouraged - if you wish to list experimental evidence, please use the Experiments tab. If you wish to describe how similar sequences, alignments, or gene prediction software were used to infer the presence of the feature, please use the Inferences tab."));
197 itemBoxSizer9->Add(
m_Evidence, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
199 m_Partial =
new wxCheckBox( itemPanel1,
ID_RADIOBOX2,
_(
"Partial"), wxDefaultPosition, wxDefaultSize, 0 );
202 itemBoxSizer2->Add(
m_Partial, 0, wxALIGN_LEFT|wxALL, 5);
208 m_ExplanationStrings.clear();
210 for (vector<string>::const_iterator s = explanation_strings.begin(); s != explanation_strings.end(); ++s)
211 m_ExplanationStrings.Add(wxString(*s));
229 string pseudo_choice =
"";
231 pseudo_choice =
"Unqualified";
236 if ((*it)->IsSetQual()
238 && (*it)->IsSetVal()) {
239 pseudo_choice = (*it)->GetVal();
246 for (
auto it : pseudogene_values) {
259 for (
auto it : pseudogene_values) {
290 if (!wxPanel::TransferDataFromWindow()) {
318 return pseudo_choice;
324 CSeq_feat::TQual::iterator it = feat.
SetQual().begin();
325 while (it != feat.
SetQual().end()) {
337 if (pseudo_choice !=
"unqualified")
340 feat.
SetQual().push_back(qual);
403 wxWindow* parent = this->GetParent();
404 wxTreebook* tbook =
dynamic_cast<wxTreebook*
>(parent);
407 for (
size_t i = 0;
i < tbook->GetPageCount() && !genePanel; ++
i) {
408 genePanel =
dynamic_cast<CGenePanel*
>(tbook->GetPage(
i));
432 for (CBioseq_Handle::TId::const_iterator idh = bsh.
GetId().begin(); idh != bsh.
GetId().end(); ++idh)
451 wxWindow* w = this->GetParent();
453 wxTreebook* parent =
dynamic_cast<wxTreebook*
>(w);
475 for (
size_t i = 0;
i < parent->GetPageCount(); ++
i) {
477 if (translation_panel)
480 if (translation_panel) {
static CRef< CScope > m_Scope
static bool IsValidException(const string &text)
void DisableRetranslateOnOk(bool exception, bool pseudo)
@Gb_qual.hpp User-defined methods of the data storage class.
static const TLegalPseudogeneSet & GetSetOfLegalPseudogenes(void)
void Init()
Initialises member variables.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void CreateControls()
Creates the controls and sizers.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
CGenericPropsPanel()
Constructors.
bool Create(wxWindow *parent, wxWindowID id=ID_CGENEPROPSPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
bool PseudoSelectionChanged() const
wxChoice * m_PseudogeneChoice
void OnExplanationSelected(wxCommandEvent &event)
wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_EXPLANATION
void OnExplanationUpdated(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_UPDATED event handler for ID_EXPLANATION
bool TransferDataFromWindow()
static void ModifyPseudo(objects::CSeq_feat &feat, const string &pseudo_choice)
objects::CScope * m_Scope
objects::CSeq_feat * m_Object
static bool ShowToolTips()
Should we show tooltips?
void x_UpdateDisableOnRetranslate()
wxComboBox * m_Explanation
wxString m_OriginalPseudoSelection
~CGenericPropsPanel()
Destructor.
void OnPseudoChanged(wxCommandEvent &event)
namespace ncbi::objects::
static vector< string > GetListOfLegalExceptions(bool include_refseq)
Produces the list of legal exceptions.
static const string kPseudogene
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
objects::CBioseq_Handle GetBioseqForSeqFeat(const objects::CSeq_feat &f, objects::CScope &scope)
int SeqLocPartialCheck(const CSeq_loc &loc, CScope *scope)
@ eSeqlocPartial_Internal
@ eSeqlocPartial_Nointernal
bool IsPseudo(const CSeq_feat &feat, CScope &scope)
Determines whether given feature is pseudo, using gene associated with feature if necessary Checks to...
const TId & GetId(void) const
#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 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 & ToLower(string &str)
Convert string to lower case – string& version.
void ResetPartial(void)
Reset Partial data member.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsSetQual(void) const
qualifiers Check if a value has been assigned to Qual data member.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
void ResetExcept(void)
Reset Except data member.
void SetPartial(TPartial value)
Assign a value to Partial data member.
const TQual & GetQual(void) const
Get the Qual member data.
bool IsSetPartial(void) const
incomplete in some way? Check if a value has been assigned to Partial data member.
void ResetExcept_text(void)
Reset Except_text data member.
const TLocation & GetLocation(void) const
Get the Location member data.
void SetExcept(TExcept value)
Assign a value to Except data member.
void ResetPseudo(void)
Reset Pseudo data member.
const TData & GetData(void) const
Get the Data member data.
const TExcept_text & GetExcept_text(void) const
Get the Except_text member data.
bool IsSetExcept_text(void) const
explain if except=TRUE Check if a value has been assigned to Except_text data member.
bool IsSetExp_ev(void) const
Check if a value has been assigned to Exp_ev data member.
void SetPseudo(TPseudo value)
Assign a value to Pseudo data member.
TPartial GetPartial(void) const
Get the Partial member data.
void SetExcept_text(const TExcept_text &value)
Assign a value to Except_text data member.
vector< CRef< CGb_qual > > TQual
TQual & SetQual(void)
Assign a value to Qual data member.
void ResetQual(void)
Reset Qual data member.
bool IsOther(void) const
Check if variant Other is selected.
const struct ncbi::grid::netcache::search::fields::SIZE size
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)