wxWindowID
id,
constwxPoint& pos,
constwxSize&
size,
longstyle )
88: m_CmdProcessor(cmdproc), m_Seh(seh)
102SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
103wxPanel::Create( parent,
id, pos,
size, style );
108GetSizer()->SetSizeHints(
this);
152wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
153itemPanel1->SetSizer(itemBoxSizer2);
155wxFlexGridSizer* itemFlexGridSizer1 =
newwxFlexGridSizer(0, 2, 0, 0);
156itemBoxSizer2->Add(itemFlexGridSizer1, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
158wxStaticText* itemStaticText2 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"Organism*"), wxDefaultPosition, wxDefaultSize, 0 );
159itemFlexGridSizer1->Add(itemStaticText2, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
162 m_Taxname=
newwxTextCtrl(itemPanel1,
ID_ORGTAXNAME, wxEmptyString, wxDefaultPosition, wxSize(240, -1), 0);
164 m_Taxname=
newwxTextCtrl(itemPanel1,
ID_ORGTAXNAME, wxEmptyString, wxDefaultPosition, wxSize(270, -1), 0);
166itemFlexGridSizer1->Add(
m_Taxname, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
168wxStaticText* itemStaticText3 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"strain**"), wxDefaultPosition, wxDefaultSize, 0 );
169itemFlexGridSizer1->Add(itemStaticText3, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
171 m_Strain=
newwxTextCtrl( itemPanel1,
ID_ORGSTRAIN, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
172itemFlexGridSizer1->Add(
m_Strain, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
174wxStaticText* itemStaticText4 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"isolate**"), wxDefaultPosition, wxDefaultSize, 0 );
175itemFlexGridSizer1->Add(itemStaticText4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
177 m_Isolate=
newwxTextCtrl( itemPanel1,
ID_ORGISOLATE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
178itemFlexGridSizer1->Add(
m_Isolate, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
180wxStaticText* itemStaticText5 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"cultivar**"), wxDefaultPosition, wxDefaultSize, 0 );
181itemFlexGridSizer1->Add(itemStaticText5, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
184itemFlexGridSizer1->Add(
m_Cultivar, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
186wxStaticText* itemStaticText6 =
newwxStaticText(itemPanel1, wxID_STATIC,
_(
"breed**"), wxDefaultPosition, wxDefaultSize, 0);
187itemFlexGridSizer1->Add(itemStaticText6, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 5);
189 m_Breed=
newwxTextCtrl(itemPanel1,
ID_ORGBREED, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
190itemFlexGridSizer1->Add(
m_Breed, 0, wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
193itemBoxSizer2->AddStretchSpacer();
195wxStaticText* itemStaticText7 =
newwxStaticText(itemPanel1, wxID_STATIC,
_(
"**At least one field is required"), wxDefaultPosition, wxDefaultSize, 0);
196itemBoxSizer2->Add(itemStaticText7, 0, wxALIGN_RIGHT | wxALL, 5);
263 for(
auto& it :
m_Source->GetOrg().GetOrgname().GetMod()) {
264 if(it->IsSetSubtype() && it->IsSetSubname()) {
265 autosubtype = it->GetSubtype();
290(
COrgName::TMod& orgmod_list, COrgName::TMod::iterator it, wxTextCtrl* ctrl,
bool& changed)
292 if(ctrl->IsEmpty()) {
293it = orgmod_list.erase(it);
297(*it)->SetSubname(
ToStdString(ctrl->GetValue()));
307 boolany_change =
false;
314 if(taxname.empty()) {
323 else if(!taxname.empty()) {
328 boolfound_strain =
false;
329 boolfound_isolate =
false;
330 boolfound_cultivar =
false;
331 boolfound_breed =
false;
333 auto& orgmodlist = org.
SetOrgname().SetMod();
334 auto mod= orgmodlist.begin();
335 while(
mod!= orgmodlist.end()) {
336 if((*mod)->IsSetSubtype() && (*mod)->IsSetSubname()) {
337 autosubtype = (*mod)->GetSubtype();
340found_strain =
true;
344found_isolate =
true;
348found_cultivar =
true;
365 if(!found_strain && !
m_Strain->IsEmpty()) {
369 if(!found_isolate && !
m_Isolate->IsEmpty()) {
373 if(!found_cultivar && !
m_Cultivar->IsEmpty()) {
377 if(!found_breed && !
m_Breed->IsEmpty()) {
383 if(any_change && orgmodlist.empty()) {
424 boolany_changes =
false;
426 booltaxname_changed =
false;
436 if(taxname_changed) {
441 if(!di->
Equals(*cpy)) {
443 cmd->AddCommand(*chg);
455 cmd->AddCommand(*cmdAddDesc);
457taxname_changed =
true;
465 if(taxname_changed) {
480 text+=
"Organism\n";
483 text+=
"At least one field is required: strain, isolate, cultivar, breed\n";
const string & GetTaxname(void) const
bool IsSetLineage(void) const
bool IsSetTaxname(void) const
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
bool x_ApplyChangesToSource(objects::CBioSource &src)
bool Create(wxWindow *parent, wxWindowID id=ID_CORGGENERALPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
void CreateControls()
Creates the controls and sizers.
virtual void ApplyCommand()
static bool ShowToolTips()
Should we show tooltips?
virtual bool TransferDataToWindow()
void Init()
Initialises member variables.
objects::CSeq_entry_Handle m_Seh
virtual bool TransferDataFromWindow()
virtual void ReportMissingFields(string &text)
ICommandProccessor * m_CmdProcessor
void ApplyBioSource(objects::CBioSource &src)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
~COrgGeneralPanel()
Destructor.
bool x_HasTaxnameChanged(const objects::CBioSource &orig_src, const objects::CBioSource &edited_src)
COrgGeneralPanel()
Constructors.
CRef< objects::CBioSource > m_Source
@OrgMod.hpp User-defined methods of the data storage class.
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
const string & GetMsg(void) const
Get message string.
void CleanupForTaxnameChange(CObjectInfo oi)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
TClass GetClass(void) const
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
CSeq_entry_Handle GetParentEntry(void) const
Return a handle for the parent seq-entry of the bioseq.
bool IsSetClass(void) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool EqualCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-sensitive 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.
void SetOrg(TOrg &value)
Assign a value to Org data member.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
void ResetTaxname(void)
Reset Taxname data member.
void SetTaxname(const TTaxname &value)
Assign a value to Taxname data member.
list< CRef< COrgMod > > TMod
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
void SetOrgname(TOrgname &value)
Assign a value to Orgname data member.
@ eClass_nuc_prot
nuc acid and coded proteins
const TSource & GetSource(void) const
Get the variant data.
TSource & SetSource(void)
Select the variant.
@ e_Source
source of materials, includes Org-ref
@ eMol_na
just a nucleic acid
static void text(MDB_val *v)
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
COrgName::TMod::iterator s_UpdateSubtype(COrgName::TMod &orgmod_list, COrgName::TMod::iterator it, wxTextCtrl *ctrl, bool &changed)
CRef< CCmdComposite > TaxonomyLookupCommand(objects::CSeq_entry_Handle seh)
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)
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