48 wxWindow* parent = this->GetParent();
52 while (parent && !listpanel) {
53 parent = parent->GetParent();
83 if (field.IsSetLabel() && (field.GetLabel().IsStr() &&
x_IsTypeString(field.GetLabel().GetStr()))) {
93 if (!field.IsSetData()) {
96 if (field.GetData().IsFields()) {
97 for (
auto& it : field.GetData().GetFields()) {
98 if (it->IsSetData() && it->GetData().IsStr() &&
103 }
else if (field.GetData().IsStr() && !
NStr::IsBlank(field.GetData().GetStr())) {
112 if (!field.IsSetData() || !field.GetData().IsFields()) {
115 for (
auto& it : field.GetData().GetFields()) {
144 if (field.IsSetData() && field.GetData().IsFields()) {
154 if (field.IsSetData() && field.GetData().IsFields() && !field.GetData().GetFields().empty()) {
187 CUser_object::TData::iterator it = user_obj.
SetData().begin();
188 while (it != user_obj.
SetData().end()) {
190 it = user_obj.
SetData().erase(it);
196 for (CUser_object::TData::iterator x =
m_Fields.begin();
202 user_obj.
SetData().push_back(new_field);
225 while (
m_Sizer->GetItemCount() > 0) {
227 m_Sizer->GetItem(pos)->DeleteWindows();
237 vector< CRef< CUser_field > >::iterator it =
m_Fields.begin();
238 vector<wxWindow *> new_rows;
241 if (!is_tpa && (*it)->IsSetData() && (*it)->GetData().IsFields()) {
242 for (
auto& fit : (*it)->GetData().GetFields()) {
259 ITERATE(vector<wxWindow *>, it, new_rows) {
260 (*it)->TransferDataToWindow();
263 if (!wxPanel::TransferDataToWindow())
271 if (!wxPanel::TransferDataFromWindow())
276 wxSizerItemList::iterator node =
m_Sizer->GetChildren().begin();
277 for (; node !=
m_Sizer->GetChildren().end(); ++node) {
278 wxWindow *w = (*node)->GetWindow();
282 w->TransferDataFromWindow();
298 wxSizerItemList& itemList =
m_Sizer->GetChildren();
301 link->TransferDataFromWindow();
318 sizer->Add(
row, 0, wxALIGN_LEFT|wxALL, 0);
321 row->GetSize(&row_width, &row_height);
348 bool IsLastRow(wxWindow* wnd, wxSizerItemList& itemList)
350 bool is_last =
false;
354 for(wxSizerItemList::iterator it = itemList.begin(); it != itemList.end(); ++it) {
355 wxWindow* child = (**it).GetWindow();
356 if (child && child == wnd) {
386 delims.push_back(
'\t');
426 if (include_header) {
427 ITERATE (objects::CSeq_table::TColumns, cit, values_table->GetColumns()) {
428 exporter.
Field((*cit)->GetHeader().GetTitle());
432 for (
int i = 0;
i < values_table->GetNum_rows(); ++
i) {
433 ITERATE (objects::CSeq_table::TColumns, cit, values_table->GetColumns()) {
434 if (
i < (*cit)->GetData().GetSize()) {
435 if ((*cit)->GetData().IsId()) {
439 }
else if ((*cit)->GetData().IsString()) {
440 exporter.
Field((*cit)->GetData().GetString()[
i]);
441 }
else if ((*cit)->GetData().IsInt()) {
447 exporter.
Field(blank);
458 if (!values_table || !values_table->IsSetColumns() || col >= values_table->GetColumns().size()) {
474 for (
size_t i = 0;
i < values_table->GetColumns()[col]->GetData().GetSize(); ++
i) {
475 if (i < src->GetData().GetSize()) {
496 || !
table->GetColumns()[0]->IsSetData()
497 || !
table->GetColumns()[0]->GetData().IsString()) {
502 if (
table->IsSetNum_rows()) {
503 num_rows =
table->GetNum_rows();
510 if (
table->GetColumns().size() > 2) {
511 from_col =
table->GetColumns()[1];
512 to_col =
table->GetColumns()[2];
515 for (
size_t row = 0;
row < num_rows;
row++) {
516 string accession =
table->GetColumns()[0]->GetData().GetString()[
row];
521 acc_field->
SetLabel().SetStr(
"accession");
522 acc_field->
SetData().SetStr(accession);
523 new_field->
SetData().SetFields().push_back(acc_field);
524 if (from_col && to_col
525 && row < from_col->GetData().GetSize()
526 && row < to_col->GetData().GetSize()
533 from_field->
SetLabel().SetStr(
"from");
534 from_field->
SetData().SetInt(from_val - 1);
535 new_field->
SetData().SetFields().push_back(from_field);
538 to_field->
SetData().SetInt(to_val - 1);
539 new_field->
SetData().SetFields().push_back(to_field);
540 }
catch(
CException &e) {}
catch (exception &e) {}
542 obj->
SetData().push_back(new_field);
555 table->SetColumns().push_back(acc_col);
557 table->SetColumns().push_back(from_col);
559 table->SetColumns().push_back(to_col);
562 if ((*it)->IsSetData() && ((*it)->GetData().IsFields())) {
563 string accession =
"";
567 if ((*fit)->IsSetLabel() && (*fit)->GetLabel().IsStr() && (*fit)->IsSetData()) {
568 string label = (*fit)->GetLabel().GetStr();
570 if ((*fit)->GetData().IsStr()) {
571 accession = (*fit)->GetData().GetStr();
574 if ((*fit)->GetData().IsInt()) {
575 from_val = (*fit)->GetData().GetInt();
578 if ((*fit)->GetData().IsInt()) {
579 to_val = (*fit)->GetData().GetInt();
585 acc_col->
SetData().SetString().push_back(accession);
588 if (from_val > -1 && to_val > -1) {
592 from_col->
SetData().SetString().push_back(from);
593 to_col->
SetData().SetString().push_back(to);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
virtual CSingleUserFieldPanel * MakeEditor(wxWindow *parent, objects::CUser_field &field)
virtual bool IsEmpty(const objects::CUser_field &field)
virtual bool IsEligible(const objects::CUser_field &field)
virtual CRef< objects::CUser_field > GetUserField(wxWindow *ctrl)
void Field(const string &value)
bool x_IsTypeString(const string &str)
virtual CRef< objects::CUser_field > GetUserField(wxWindow *ctrl)
virtual CSingleUserFieldPanel * MakeEditor(wxWindow *parent, objects::CUser_field &field)
virtual bool IsEligible(const objects::CUser_field &field)
virtual bool IsEmpty(const objects::CUser_field &field)
static bool x_HasPopulatedFields(const objects::CUser_field &field)
size_t GetSize(void) const
virtual CRef< objects::CUser_field > GetUser_field()
CRef< objects::CUser_field > GetUser_field()
void SetDelimiters(const vector< char > &d)
Get/set delimiter characters.
CTableImportDataSource -.
void SetColumnHeaderRow(int c)
set/get (optional) row from which to parse column names
void SetTableType(EFieldSeparatorType e)
Update current table type.
const CTableDelimiterRules & GetDelimiterRules() const
Get set all delimiter rules (for delimited tables)
void RecomputeFields(bool recreate_columns, int recompute_count=-1)
Updated the individual rows and columns to match the current delimiter choice.
vector< CTableImportColumn > & GetColumns()
return the array of column data
bool LoadTable(const wxString &fname, CUser_object &user_object)
void ConvertToSeqAnnot(CRef< CSeq_annot > annot_container)
Save data in table into annot_container.
void SetFirstImportRow(int r)
set/get first row for import (0-based)
wxScrolledWindow * m_ScrolledWindow
virtual bool TransferDataToWindow()
virtual void AddLastField(wxWindow *link)
vector< CRef< objects::CUser_field > > m_Fields
CRef< objects::CUser_object > m_UserObj
void SetUser_object(CRef< objects::CUser_object > user)
void PopulateFields(objects::CUser_object &user_obj)
virtual bool TransferDataFromWindow()
wxWindow * x_AddRow(CRef< objects::CUser_field > field, wxScrolledWindow *scrolled_window, wxBoxSizer *sizer)
CUserFieldManager * m_FieldManager
virtual CRef< objects::CUser_field > GetUserField(wxWindow *ctrl)=0
virtual bool IsEligible(const objects::CUser_field &field)=0
virtual CSingleUserFieldPanel * MakeEditor(wxWindow *parent, objects::CUser_field &field)=0
virtual bool IsEmpty(const objects::CUser_field &field)=0
std::ofstream out("events_result.xml")
main entry point for tests
static const char * str(char *buf, int n)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
static string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)
Convert Int8 to string.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
static const char label[]
bool IsSetData(void) const
the object itself Check if a value has been assigned to Data data member.
vector< CRef< CUser_field > > TFields
TData & SetData(void)
Assign a value to Data data member.
void SetLabel(TLabel &value)
Assign a value to Label data member.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
vector< CRef< CUser_field > > TData
bool IsId(void) const
Check if variant Id is selected.
bool IsString(void) const
Check if variant String is selected.
bool IsInt(void) const
Check if variant Int is selected.
void SetData(TData &value)
Assign a value to Data data member.
bool IsSetData(void) const
row data Check if a value has been assigned to Data data member.
const TInt & GetInt(void) const
Get the variant data.
const TString & GetString(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
const TId & GetId(void) const
Get the variant data.
const TSeq_table & GetSeq_table(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
#define row(bind, expected)
CRef< CSeq_table > SeqTableFromAssemblyFields(const CUser_object &obj)
void AddAssemblyUserFieldsFromSeqTable(CRef< CUser_object > obj, CRef< CSeq_table > table)
bool IsLastRow(wxWindow *wnd, wxSizerItemList &itemList)
CRef< CSeq_table > ReadTabDelimitedTable(const wxString &filename, bool read_header)
bool SaveTableRowAsListFile(const string &save_file_name, CRef< objects::CSeq_table > values_table, int col)
bool SaveTableFile(const string &save_file_name, CRef< objects::CSeq_table > values_table, bool include_header)