40 #include <wx/bitmap.h>
42 #include <wx/scrolwin.h>
43 #include <wx/hyperlink.h>
44 #include <wx/statline.h>
46 #include <wx/stattext.h>
86 wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
102 bool CGBQualPanel::Create( wxWindow* parent, wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
105 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
106 wxPanel::Create( parent,
id, pos,
size, style );
111 GetSizer()->SetSizeHints(
this);
158 for (CSeq_feat::TQual::const_iterator qual = feat.
GetQual().begin();
159 qual != feat.
GetQual().end() && !rval;
175 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
176 itemPanel1->SetSizer(itemBoxSizer2);
184 m_Sizer =
new wxBoxSizer(wxVERTICAL);
201 string parseable_rpt_types =
"";
204 vector<CSeqFeatData::EQualifier> subtypes;
206 CSeq_feat::TQual::iterator qual = edited_feat.
SetQual().begin();
207 while (qual != edited_feat.
SetQual().end()) {
211 parseable_rpt_types = parseable_rpt_types +
";";
213 parseable_rpt_types = parseable_rpt_types + (*qual)->GetVal();
214 qual = edited_feat.
SetQual().erase(qual);
216 placed.push_back(
false);
225 new_qual->
SetVal(parseable_rpt_types);
226 edited_feat.
SetQual().push_back(new_qual);
227 placed.push_back(
false);
237 bool have_any =
false;
241 for (CSeq_feat::TQual::iterator qual = edited_feat.
SetQual().begin();
242 qual != edited_feat.
SetQual().end();
244 if (!placed[pos] && subtypes[pos] == *required) {
254 edited_feat.
SetQual().push_back(new_qual);
255 placed.push_back(
true);
256 subtypes.push_back(*required);
267 bool is_mandatory =
false;
269 if (*m == required) {
277 bool have_any =
false;
281 for (CSeq_feat::TQual::iterator qual = edited_feat.
SetQual().begin();
282 qual != edited_feat.
SetQual().end();
284 if (!placed[pos] && subtypes[pos] == required) {
296 edited_feat.
SetQual().push_back(new_qual);
297 placed.push_back(
true);
298 subtypes.push_back(required);
304 bool any_unplaced =
false;
306 for (CSeq_feat::TQual::iterator qual = edited_feat.
SetQual().begin();
307 qual != edited_feat.
SetQual().end();
316 wxStaticLine* itemStaticLine =
new wxStaticLine(
m_ScrolledWindow, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
317 m_Sizer->Add(itemStaticLine, 0, wxGROW|wxALL, 5);
318 itemStaticLine->GetClientSize(&row_width, &row_height);
323 for (CSeq_feat::TQual::iterator qual = edited_feat.
SetQual().begin();
324 qual != edited_feat.
SetQual().end();
333 bool any_illegal =
false;
335 for (CSeq_feat::TQual::iterator qual = edited_feat.
SetQual().begin();
336 qual != edited_feat.
SetQual().end();
345 wxStaticLine* itemStaticLine =
new wxStaticLine(
m_ScrolledWindow, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
346 m_Sizer->Add(itemStaticLine, 0, wxGROW|wxALL, 5);
347 itemStaticLine->GetClientSize(&row_width, &row_height);
352 for (CSeq_feat::TQual::iterator qual = edited_feat.
SetQual().begin();
353 qual != edited_feat.
SetQual().end();
374 wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
375 for (; node !=
m_Sizer->GetChildren().end(); ++node) {
376 wxWindow *row = (*node)->GetWindow();
382 row->GetClientSize(&row_width, &row_height);
403 m_Sizer->Add(row, 0, wxALIGN_LEFT|wxALL, 0);
406 row->GetClientSize(&row_width, &row_height);
417 bool found_product =
false;
418 wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
419 for (; node !=
m_Sizer->GetChildren().end(); ++node) {
420 wxWindow *w = (*node)->GetWindow();
425 if (singlequal_panel) {
431 found_product =
true;
442 if (!found_product && !
value.empty()) {
452 if (!wxPanel::TransferDataToWindow())
455 wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
456 for (; node !=
m_Sizer->GetChildren().end(); ++node) {
457 wxWindow *w = (*node)->GetWindow();
462 if (singlequal_panel) {
473 if (!wxPanel::TransferDataFromWindow())
479 wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
480 for (; node !=
m_Sizer->GetChildren().end(); ++node) {
481 wxWindow *w = (*node)->GetWindow();
487 if (singlequal_panel) {
488 edited_qual = singlequal_panel->
GetGbQual();
491 edited_feat.
SetQual().push_back(edited_qual);
505 for (CSeq_feat::TQual::iterator qual = edited_feat.
SetQual().begin();
506 qual != edited_feat.
SetQual().end();
508 if ((*qual)->IsSetQual() && !
NStr::IsBlank((*qual)->GetQual())
510 && (*qual)->IsSetVal() &&
515 vector<string> tokens;
517 ITERATE (vector<string>, tok, tokens) {
521 seq_feat.SetQual().push_back(new_qual);
526 seq_feat.SetQual().push_back(new_qual);
static bool ShowToolTips()
Should we show tooltips?
void Init()
Initialises member variables.
virtual bool TransferDataToWindow()
CRef< CSerialObject > m_EditedFeat
virtual bool TransferDataFromWindow()
wxScrolledWindow * m_ScrolledWindow
static const char * stRNA_IMet
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CGBQualPanel()
Constructors.
void CreateControls()
Creates the controls and sizers.
void PopulateGBQuals(objects::CSeq_feat &seq_feat)
static bool PanelNeeded(objects::CSeq_feat &seq_feat)
~CGBQualPanel()
Destructor.
static const char * stRNA_FMet
void x_AddRow(CRef< objects::CGb_qual > qual)
void Update_tRNA_ProductQual(const string &value)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
bool Create(wxWindow *parent, wxWindowID id=ID_CGBQUALPANEL, const wxString &caption=_("GBQual Panel"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
@Gb_qual.hpp User-defined methods of the data storage class.
static bool IsParseable(const string &val)
EQualifier
List of available qualifiers for feature keys.
@ eQual_ribosomal_slippage
ESubtype GetSubtype(void) const
const TLegalQualifiers & GetLegalQualifiers(void) const
Get a list of all the legal qualifiers for the feature.
const TQualifiers & GetMandatoryQualifiers(void) const
Get the list of all mandatory qualifiers for the feature.
@ eSubtype_transit_peptide
static EQualifier GetQualifierType(CTempString qual)
convert qual string to enumerated value
static CTempString GetQualifierAsString(EQualifier qual)
Convert a qualifier from an enumerated value to a string representation or empty if not found.
namespace ncbi::objects::
Base class for all serializable objects.
void SetGbQual(CRef< objects::CGb_qual > &qual)
virtual bool TransferDataToWindow()
CRef< objects::CGb_qual > GetGbQual()
bool AlwaysHandledElsewhere(CSeqFeatData::EQualifier qual_type)
bool PreferredHandledElsewhere(CSeqFeatData::ESubtype feat_subtype, CSeqFeatData::EQualifier qual_type)
#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 Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
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 bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
const TVal & GetVal(void) const
Get the Val member data.
void SetQual(const TQual &value)
Assign a value to Qual 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 IsImp(void) const
Check if variant Imp is selected.
const TQual & GetQual(void) const
Get the Qual member data.
const TData & GetData(void) const
Get the Data member data.
bool IsSetQual(void) const
Check if a value has been assigned to Qual data member.
void SetVal(const TVal &value)
Assign a value to Val data member.
const TQual & GetQual(void) const
Get the Qual member data.
TQual & SetQual(void)
Assign a value to Qual data member.
bool IsSetVal(void) const
Check if a value has been assigned to Val data member.
void ResetQual(void)
Reset Qual data member.
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key