29 #include "wx/wxprec.h"
57 #include <wx/statbox.h>
58 #include <wx/treebook.h>
105 m_Source(
source), m_ParentPanel(desc_editor)
119 wxPanel::Create( parent,
id, pos,
size, style );
124 GetSizer()->SetSizeHints(
this);
165 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
166 itemPanel1->SetSizer(itemBoxSizer2);
168 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
169 itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);
171 wxStaticText* itemStaticText4 =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"Scientific Name"), wxDefaultPosition, wxDefaultSize, 0 );
172 itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
178 wxButton* itemButton6 =
new wxButton( itemPanel1,
ID_ORGPANEL_BTN,
_(
"Taxonomy Lookup"), wxDefaultPosition, wxDefaultSize, 0 );
179 itemBoxSizer3->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
185 wxStaticBox* itemStaticBoxSizer8Static =
new wxStaticBox(itemPanel1,
ID_ORGPANEL_SIZER,
_(
"Additional Modifiers"));
186 wxStaticBoxSizer* itemStaticBoxSizer8 =
new wxStaticBoxSizer(itemStaticBoxSizer8Static, wxVERTICAL);
187 itemBoxSizer2->Add(itemStaticBoxSizer8, 1, wxGROW|wxALL, 5);
190 itemStaticBoxSizer8->Add(
m_SrcModList, 1, wxGROW | wxALL, 5);
199 if (!wxPanel::TransferDataToWindow())
207 if (!wxPanel::TransferDataFromWindow())
217 if (
m_Source.GetOrg().IsSetTaxname()) {
225 bool disable_strain_forwarding =
m_Source.GetDisableStrainForwarding();
232 if (
source.IsSetOrgname()) {
247 old_taxname =
m_Source.GetOrg().GetTaxname();
253 m_Source.SetOrg().SetTaxname(new_taxname);
276 unique_ptr<CObjectOStream>
332 vector<CRef<COrg_ref> > rq_list;
335 rq_list.push_back(org);
341 CTaxon3_reply::TReply::const_iterator reply_it = reply->GetReply().begin();
342 if ((*reply_it)->IsData()) {
343 m_Source.SetOrg().Assign((*reply_it)->GetData().GetOrg());
365 wxWindow* w = this->GetParent();
367 wxTreebook* parent =
dynamic_cast<wxTreebook*
>(w);
394 otherPanel->OnChangedTaxname();
397 loc_gc_panel->OnChangedTaxname();
static void s_MoreCleanupForTaxnameChange(CBioSource &source)
bool AutoComplete(wxTextCompleter *completer)
CSrcModListPanel * m_SrcModList
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
IDescEditorPanel * m_ParentPanel
void OnUpdatedTaxname(wxMouseEvent &event)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void CreateControls()
Creates the controls and sizers.
CAutoCompleteTextCtrl * m_ScientificNameCtrl
static bool ShowToolTips()
Should we show tooltips?
void PopulateBioSource(objects::CBioSource &source)
void OnEvtText(wxCommandEvent &event)
void OnTaxonomyLookup(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ORGPANEL_BTN
void Init()
Initialises member variables.
wxCheckBox * m_DisableStrainForwardingBtn
wxTreebook * m_ParentTreebook
bool Create(wxWindow *parent, wxWindowID id=ID_ORGANISMNAMEPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
virtual bool TransferDataFromWindow()
objects::CBioSource & m_Source
virtual bool TransferDataToWindow()
~CBioSourcePanel()
Destructor.
CBioSourcePanel()
Constructors.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
void TransferFromOrgRef(const objects::COrg_ref &org)
virtual bool TransferDataFromWindow()
void PopulateModifiers(objects::CBioSource &biosrc)
void OnChangedTaxname(void)
void SetSource(const objects::CBioSource &biosrc)
virtual CRef< CTaxon3_reply > SendOrgRefList(const vector< CRef< COrg_ref > > &list, COrg_ref::fOrgref_parts result_parts=COrg_ref::eOrgref_default, fT3reply_parts t3result_parts=eT3reply_default)
virtual void UpdateTaxname()
std::ofstream out("events_result.xml")
main entry point for tests
void CleanupForTaxnameChange(CObjectInfo oi)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
@ eSerial_AsnText
ASN.1 text.
static CObjectOStream * Open(ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)
Create serial object writer and attach it to an output stream.
#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 void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
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.
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.
void ResetName(void)
Reset Name data member.
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
@ eSubtype_gb_acronym
used by taxonomy database
@ eSubtype_gb_synonym
used by taxonomy database
@ eSubtype_gb_anamorph
used by taxonomy database
const struct ncbi::grid::netcache::search::fields::SIZE size
const CharType(& source)[N]
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)