(parent,
id, caption, pos,
size, style);
88CSeq_feat::TDbxref::const_iterator it = feat->
GetDbxref().begin();
100COrg_ref::TDb::const_iterator it = org->
GetDb().begin();
101 while(it != org->
GetDb().end()) {
116 bool CDbxrefPanel::Create( wxWindow* parent, wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
119SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
120wxPanel::Create( parent,
id, pos,
size, style );
125GetSizer()->SetSizeHints(
this);
168wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
169itemPanel1->SetSizer(itemBoxSizer2);
171wxBoxSizer* itemBoxSizer3 =
newwxBoxSizer(wxHORIZONTAL);
172itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
174wxStaticText* itemStaticText4 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"Database"), wxDefaultPosition, wxSize(100, -1), 0 );
175itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
177wxStaticText* itemStaticText5 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"Object ID"), wxDefaultPosition, wxSize(100, -1), 0 );
178itemBoxSizer3->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
181itemBoxSizer2->Add(
m_ScrolledWindow, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
183 m_Sizer=
newwxBoxSizer(wxVERTICAL);
195 m_Sizer->Add(
row, 0, wxALIGN_LEFT|wxALL, 0);
198 row->GetSize(&row_width, &row_height);
212 while(
m_Sizer->GetItemCount() > 0) {
214 m_Sizer->GetItem(pos)->DeleteWindows();
223vector< CRef< objects::CDbtag > >::iterator it =
m_Xrefs.begin();
224vector<wxWindow*> rows_to_update;
226rows_to_update.push_back(
x_AddRow(*it));
229 ITERATE(vector<wxWindow*>, it, rows_to_update) {
230(*it)->TransferDataToWindow();
240 if(!wxPanel::TransferDataToWindow())
248 if(!wxPanel::TransferDataFromWindow())
253wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
254 for(; node !=
m_Sizer->GetChildren().end(); ++node) {
255wxWindow *w = (*node)->GetWindow();
261 if(singlexref_panel) {
262edited_tag = singlexref_panel->
GetDbtag();
263 m_Xrefs.push_back(edited_tag);
274 if(
tag.IsSetTag()) {
277}
else if(
tag.GetTag().IsId()) {
291 for(CSeq_feat::TDbxref::iterator x =
m_Xrefs.begin();
294 if((*x)->IsSetDb() ||
s_HasTag(**x)) {
296new_tag->Assign(**x);
297seq_feat.
SetDbxref().push_back(new_tag);
309 for(COrg_ref::TDb::iterator x =
m_Xrefs.begin();
312 if((*x)->IsSetDb() ||
s_HasTag(**x)) {
314new_tag->Assign(**x);
315org.
SetDb().push_back(new_tag);
328wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
330 introw_width, row_height;
331vector<size_t> removed_pos;
332 for(node; node !=
m_Sizer->GetChildren().end(); ++node, ++pos) {
333wxWindow *w = (*node)->GetWindow();
336 if(singlexref_panel) {
339singlexref_panel->GetSize(&row_width, &row_height);
340removed_pos.push_back(pos);
346 if( ! removed_pos.empty()) {
347 for(pos = 0; pos < removed_pos.size(); ++pos) {
348 m_Sizer->GetItem(removed_pos[pos])->DeleteWindows();
349 m_Sizer->Remove(
static_cast<int>(removed_pos[pos]));
397 static bool s_IsLastRow(wxWindow* wnd, wxSizerItemList& itemList)
399 boolis_last =
false;
403 for(wxSizerItemList::iterator it = itemList.begin(); it != itemList.end(); ++it) {
404wxWindow* child = (**it).GetWindow();
405 if(child && child == wnd) {
422wxSizerItemList& itemList =
m_Sizer->GetChildren();
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
static bool ShowToolTips()
Should we show tooltips?
~CDbxrefPanel()
Destructor.
vector< CRef< objects::CDbtag > > m_Xrefs
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void AddLastDbxref(wxWindow *link)
virtual bool TransferDataFromWindow()
virtual bool TransferDataToWindow()
void PopulateDbxrefs(objects::CSeq_feat &seq_feat)
wxScrolledWindow * m_ScrolledWindow
void CreateControls()
Creates the controls and sizers.
CDbxrefPanel()
Constructors.
void Init()
Initialises member variables.
wxWindow * x_AddRow(CRef< objects::CDbtag > tag)
bool Create(wxWindow *parent, wxWindowID id=ID_CDBXREFPANEL, const wxString &caption=_("DbxrefPanel"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
namespace ncbi::objects::
Base class for all serializable objects.
CRef< objects::CDbtag > GetDbtag()
static bool s_IsLastRow(wxWindow *wnd, wxSizerItemList &itemList)
static bool s_HasTag(CDbtag &tag)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERASE_ITERATE(Type, Var, Cont)
Non-constant version with ability to erase current element, if container permits.
#define VECTOR_ERASE(Var, Cont)
Use this macro inside body of ERASE_ITERATE cycle to erase from vector-like container.
#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 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.
@ eNocase
Case insensitive compare.
bool IsSetDb(void) const
ids in taxonomic or culture dbases Check if a value has been assigned to Db data member.
TDb & SetDb(void)
Assign a value to Db data member.
vector< CRef< CDbtag > > TDb
const TDb & GetDb(void) const
Get the Db member data.
void ResetDb(void)
Reset Db data member.
TDbxref & SetDbxref(void)
Assign a value to Dbxref data member.
const TDbxref & GetDbxref(void) const
Get the Dbxref member data.
void ResetDbxref(void)
Reset Dbxref data member.
bool IsSetDbxref(void) const
support for xref to other databases Check if a value has been assigned to Dbxref data member.
const struct ncbi::grid::netcache::search::fields::SIZE size
#define row(bind, expected)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4