88 CSeq_feat::TDbxref::const_iterator it = feat->
GetDbxref().begin();
100 COrg_ref::TDb::const_iterator it = org->
GetDb().begin();
101 while (it != org->
GetDb().end()) {
116 bool CDbxrefPanel::Create( wxWindow* parent, wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
119 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
120 wxPanel::Create( parent,
id, pos,
size, style );
125 GetSizer()->SetSizeHints(
this);
168 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
169 itemPanel1->SetSizer(itemBoxSizer2);
171 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
172 itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
174 wxStaticText* itemStaticText4 =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"Database"), wxDefaultPosition, wxSize(100, -1), 0 );
175 itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
177 wxStaticText* itemStaticText5 =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"Object ID"), wxDefaultPosition, wxSize(100, -1), 0 );
178 itemBoxSizer3->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
181 itemBoxSizer2->Add(
m_ScrolledWindow, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
183 m_Sizer =
new wxBoxSizer(wxVERTICAL);
198 row->GetSize(&row_width, &row_height);
212 while (
m_Sizer->GetItemCount() > 0) {
214 m_Sizer->GetItem(pos)->DeleteWindows();
223 vector< CRef< objects::CDbtag > >::iterator it =
m_Xrefs.begin();
224 vector<wxWindow*> rows_to_update;
226 rows_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())
253 wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
254 for (; node !=
m_Sizer->GetChildren().end(); ++node) {
255 wxWindow *w = (*node)->GetWindow();
261 if (singlexref_panel) {
262 edited_tag = singlexref_panel->
GetDbtag();
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)) {
296 new_tag->Assign(**x);
309 for (COrg_ref::TDb::iterator x =
m_Xrefs.begin();
312 if ((*x)->IsSetDb() ||
s_HasTag(**x)) {
314 new_tag->Assign(**x);
315 org.
SetDb().push_back(new_tag);
328 wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
330 int row_width, row_height;
331 vector<size_t> removed_pos;
332 for (node; node !=
m_Sizer->GetChildren().end(); ++node, ++pos) {
333 wxWindow *w = (*node)->GetWindow();
336 if (singlexref_panel) {
339 singlexref_panel->GetSize(&row_width, &row_height);
340 removed_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]));
399 bool is_last =
false;
403 for(wxSizerItemList::iterator it = itemList.begin(); it != itemList.end(); ++it) {
404 wxWindow* child = (**it).GetWindow();
405 if (child && child == wnd) {
422 wxSizerItemList& 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)