33 #include "wx/imaglist.h"
48 #include <wx/stattext.h>
49 #include <wx/statbox.h>
51 #include <wx/bitmap.h>
52 #include <wx/msgdlg.h>
53 #include <wx/radiobut.h>
54 #include <wx/listctrl.h>
55 #include <wx/filename.h>
91 wxPanel::Create( parent,
id, pos,
size, style );
96 GetSizer()->SetSizeHints(
this);
133 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
134 itemPanel1->SetSizer(itemBoxSizer2);
136 wxStaticBox* itemStaticBoxSizer3Static =
new wxStaticBox(itemPanel1,
wxID_ANY, wxEmptyString);
137 wxStaticBoxSizer* itemStaticBoxSizer3 =
new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL);
138 itemBoxSizer2->Add(itemStaticBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
140 wxBoxSizer* itemBoxSizer4 =
new wxBoxSizer(wxHORIZONTAL);
141 itemStaticBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_LEFT|wxALL, 5);
143 wxStaticBox* itemStaticBoxSizer5Static =
new wxStaticBox(itemStaticBoxSizer3->GetStaticBox(),
wxID_ANY,
_(
"Table Data Format"));
144 wxStaticBoxSizer* itemStaticBoxSizer5 =
new wxStaticBoxSizer(itemStaticBoxSizer5Static, wxVERTICAL);
145 itemBoxSizer4->Add(itemStaticBoxSizer5, 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
147 m_DelimitedBtn =
new wxRadioButton( itemStaticBoxSizer5->GetStaticBox(),
ID_DELIMITEDBUTTON,
_(
"Delimited - Columns are separated by characters, e.g. tabs or commas"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
149 itemStaticBoxSizer5->Add(
m_DelimitedBtn, 0, wxALIGN_LEFT|wxALL, 5);
151 m_FixedWidthBtn =
new wxRadioButton( itemStaticBoxSizer5->GetStaticBox(),
ID_FIXEDWIDTHBUTTON,
_(
"Fixed Width - Columns all have a fixed character width"), wxDefaultPosition, wxDefaultSize, 0 );
155 wxBoxSizer* itemBoxSizer8 =
new wxBoxSizer(wxHORIZONTAL);
156 itemStaticBoxSizer3->Add(itemBoxSizer8, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT, 5);
158 m_ImportStaticText =
new wxStaticText( itemStaticBoxSizer3->GetStaticBox(), wxID_STATIC,
_(
"Import data starting with row:"), wxDefaultPosition, wxDefaultSize, 0 );
166 m_CommentStaticText =
new wxStaticText( itemStaticBoxSizer3->GetStaticBox(), wxID_STATIC,
_(
"Comment Character:"), wxDefaultPosition, wxDefaultSize, 0 );
175 wxBoxSizer* itemBoxSizer13 =
new wxBoxSizer(wxHORIZONTAL);
176 itemStaticBoxSizer3->Add(itemBoxSizer13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT, 5);
182 m_HeaderImportRow =
new wxStaticText( itemStaticBoxSizer3->GetStaticBox(),
wxID_COLUMNNAMESROW, wxEmptyString, wxDefaultPosition, wxSize(40, -1), wxST_NO_AUTORESIZE|wxSTATIC_BORDER );
186 m_PreviewResultsInfoTxt->SetFont(wxFont(wxNORMAL_FONT->GetPointSize(), wxNORMAL_FONT->GetFamily(), wxNORMAL_FONT->GetStyle(), wxFONTWEIGHT_BOLD, wxNORMAL_FONT->GetUnderlined(), wxNORMAL_FONT->GetFaceName()));
189 wxStaticBox* itemStaticBoxSizer17Static =
new wxStaticBox(itemPanel1,
wxID_ANY,
_(
"Table Preview"));
190 wxStaticBoxSizer* itemStaticBoxSizer17 =
new wxStaticBoxSizer(itemStaticBoxSizer17Static, wxHORIZONTAL);
191 itemBoxSizer2->Add(itemStaticBoxSizer17, 1, wxGROW|wxALL, 5);
193 m_ListCtrlPanel =
new wxPanel( itemStaticBoxSizer17->GetStaticBox(),
ID_PANEL4, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
196 wxBoxSizer* itemBoxSizer19 =
new wxBoxSizer(wxHORIZONTAL);
260 CFile tstfile(s.c_str().AsChar());
264 wxString
msg =
wxT(
"Error opening file: ") + s;
265 wxMessageBox(
msg,
wxT(
"Error Opening or Loading File"),
266 wxOK | wxICON_ERROR,
this);
283 },
wxT(
"Loading Table..."))) {
285 wxMessageBox(
msg,
wxT(
"Error Opening or Loading File"),
286 wxOK | wxICON_ERROR);
311 if (comment_char ==
wxT(
" ") )
312 comment_char =
wxT(
"");
324 wxString delim_char(delim);
326 delim_char =
"space";
327 else if (delim ==
'\t')
331 delim_char +
wxT(
"'"));
351 wxString
msg =
wxT(
"Unable to open file: ") + s +
wxT(
" for reading");
352 wxMessageBox(
msg,
wxT(
"Error Opening File"),
353 wxOK | wxICON_ERROR,
this);
404 char updated_char =
str.size() > 0 ?
str[0] :
' ';
407 if (updated_char ==
'\t')
414 if (comment_char != updated_char) {
423 long sel =
m_TableListCtrl->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
432 string numstr = NStr::NumericToString<long>(sel+1);
EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX, CAdjustFeaturesForGaps::OnKnownUnknownSelected) EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX1
std::invoke_result< _Fty, ICanceled & >::type GUI_AsyncExec(_Fty &&_Fnarg, const wxString &msg=wxT("Accessing network..."))
#define ID_PARSECOLUMNNAMESBTN
static bool FileExists(const wxString &fileName)
int GetNumImportedRows() const
Get the total # of rows imported (row num>m_ImportFromRow and not starting with m_CommentChar.
const vector< char > & GetDelimiters() const
Return copy of current delimiter(s)
void SetColumnHeaderRow(int c)
set/get (optional) row from which to parse column names
void SetTableType(EFieldSeparatorType e)
Update current table type.
void SetCommentChar(char c)
set/get comment character (lines beginning with this are not imported)
char GetCommentChar() const
EFieldSeparatorType GetTableType() const
bool LoadTable(const wxString &fname, CUser_object &user_object)
size_t GetNumRows() const
return total number of rows read
int GetFirstImportRow() const
void RecomputeHeaders()
Update columns to genereated names or names parsed from row m_ColumnHeaderRow.
void SetFirstImportRow(int r)
set/get first row for import (0-based)
void SetViewType(eDataViewType t)
Set/get view type.
void SetDataSource(CRef< CTableImportDataSource > ds)
Set/update data source (used to refresh view to match data source column info)
Interface for testing cancellation request in a long lasting operation.
static const char * str(char *buf, int n)
Int8 GetLength(void) const
Get size of file.
bool IsFile(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a file.
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
virtual bool IsCanceled(void) const =0
static string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)
Convert Int8 to string.
void Start(void)
Start the timer.
const struct ncbi::grid::netcache::search::fields::SIZE size
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
Defines: CTimeFormat - storage class for time format.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)