51 #include <wx/checkbox.h>
89 wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
101 bool CEditHistory::Create( wxWindow* parent, wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
104 SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
105 wxDialog::Create( parent,
id, caption, pos,
size, style );
110 GetSizer()->SetSizeHints(
this);
154 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
155 itemDialog1->SetSizer(itemBoxSizer2);
157 wxArrayString seq_ids_replaces;
158 wxArrayString seq_ids_replaced_by;
161 bool is_deleted =
false;
169 const auto& ids =
m_Bioseq.GetBioseqCore()->GetId();
170 for (
const auto& id_it : ids) {
173 size_t pos =
label.find(
'.');
186 size_t pos = id_label.find(
'.');
188 id_label = id_label.substr(0, pos);
191 for (
const auto& it : seq_ids) {
231 if (seq_ids_replaces.IsEmpty())
232 seq_ids_replaces.Add(wxEmptyString);
233 if (seq_ids_replaced_by.IsEmpty())
234 seq_ids_replaced_by.Add(wxEmptyString);
236 wxStaticText* itemStaticText1 =
new wxStaticText( itemDialog1, wxID_STATIC,
_(
"Replaces Seq-id"), wxDefaultPosition, wxDefaultSize, 0 );
237 itemBoxSizer2->Add(itemStaticText1, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
243 itemBoxSizer2->Add(
m_ReplacesDate, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
245 wxStaticText* itemStaticText2 =
new wxStaticText( itemDialog1, wxID_STATIC,
_(
"Replaced By Seq-id"), wxDefaultPosition, wxDefaultSize, 0 );
246 itemBoxSizer2->Add(itemStaticText2, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
252 itemBoxSizer2->Add(
m_ReplacedByDate, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
254 wxStaticText* itemStaticText3 =
new wxStaticText( itemDialog1, wxID_STATIC,
_(
"Status"), wxDefaultPosition, wxDefaultSize, 0 );
255 itemBoxSizer2->Add(itemStaticText3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
257 m_Deleted =
new wxCheckBox( itemDialog1,
wxID_ANY,
_(
"Deleted"), wxDefaultPosition, wxDefaultSize, 0 );
258 itemBoxSizer2->Add(
m_Deleted, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
262 itemBoxSizer2->Add(
m_DeletedDate, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
265 wxBoxSizer* itemBoxSizer6 =
new wxBoxSizer(wxHORIZONTAL);
266 itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
268 wxButton* itemButton7 =
new wxButton( itemDialog1, wxID_OK,
_(
"Accept"), wxDefaultPosition, wxDefaultSize, 0 );
269 itemBoxSizer6->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
271 wxButton* itemButton8 =
new wxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
272 itemBoxSizer6->Add(itemButton8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
285 vector<string> replaces_ids;
287 vector<string> replaced_ids;
290 for (
size_t i = 0;
i < replaces_ids.size();
i++)
293 new_inst->
SetHist().SetReplaces().SetIds().push_back(
id);
296 for (
size_t i = 0;
i < replaced_ids.size();
i++)
299 new_inst->
SetHist().SetReplaced_by().SetIds().push_back(
id);
310 new_inst->
SetHist().SetDeleted().SetBool(
true);
319 new_desc->
Assign(*desc_iter);
325 for (
size_t i = 0;
i < replaces_ids.size();
i++)
327 string str = replaces_ids[
i];
335 cmd->AddCommand (*ecmd);
340 for (
size_t i = 0;
i < replaces_ids.size();
i++)
342 string str = replaces_ids[
i];
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CFlexibleDatePanel * m_ReplacesDate
static bool ShowToolTips()
Should we show tooltips?
CRef< CCmdComposite > GetCommand()
CEditHistory()
Constructors.
~CEditHistory()
Destructor.
CFlexibleDatePanel * m_DeletedDate
CGrowableListCtrl * m_IdListReplacedBy
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Edit History"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void CreateControls()
Creates the controls and sizers.
void Init()
Initialises member variables.
CGrowableListCtrl * m_IdListReplaces
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
CFlexibleDatePanel * m_ReplacedByDate
objects::CBioseq_Handle m_Bioseq
CRef< objects::CDate > GetDate() const
void GetItems(vector< string > &items)
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
CSeq_entry_Handle GetSeq_entry_Handle(void) const
#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 const char label[]
TExtra_accessions & SetExtra_accessions(void)
Assign a value to Extra_accessions data member.
const TExtra_accessions & GetExtra_accessions(void) const
Get the Extra_accessions member data.
bool IsSetDeleted(void) const
Check if a value has been assigned to Deleted data member.
bool IsSetReplaced_by(void) const
these seqs make this one obsolete Check if a value has been assigned to Replaced_by data member.
const TDeleted & GetDeleted(void) const
Get the Deleted member data.
bool IsSetIds(void) const
Check if a value has been assigned to Ids data member.
void SetHist(THist &value)
Assign a value to Hist data member.
TGenbank & SetGenbank(void)
Select the variant.
bool IsSetReplaces(void) const
seq makes these seqs obsolete Check if a value has been assigned to Replaces data member.
const TGenbank & GetGenbank(void) const
Get the variant data.
const TIds & GetIds(void) const
Get the Ids member data.
TBool GetBool(void) const
Get the variant data.
void ResetHist(void)
Reset Hist data member.
bool IsDate(void) const
Check if variant Date is selected.
bool IsSetDate(void) const
Check if a value has been assigned to Date data member.
const TReplaces & GetReplaces(void) const
Get the Replaces member data.
const TDate & GetDate(void) const
Get the Date member data.
const TReplaced_by & GetReplaced_by(void) const
Get the Replaced_by member data.
bool IsBool(void) const
Check if variant Bool is selected.
const TDate & GetDate(void) const
Get the variant data.
@ e_Genbank
GenBank specific info.
const struct ncbi::grid::netcache::search::fields::SIZE size
static int match(register const pcre_uchar *eptr, register const pcre_uchar *ecode, const pcre_uchar *mstart, int offset_top, match_data *md, eptrblock *eptrb, unsigned int rdepth)
static const char * str(char *buf, int n)
wxString ToWxString(const string &s)