: m_standalone(
true), m_HideLibrary(
false), m_width(-1), m_height(-1), m_pos_x(-1), m_pos_y(-1),
208m_width_add_macro(-1), m_height_add_macro(-1), m_pos_x_add_macro(-1), m_pos_y_add_macro(-1)
214 Create( parent,
id, caption, pos,
size, style );
220wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
221: m_gui_core_helper(gui_core_helper), m_standalone(
false), m_HideLibrary(
false), m_width(-1), m_height(-1), m_pos_x(-1), m_pos_y(-1),
222m_width_add_macro(-1), m_height_add_macro(-1), m_pos_x_add_macro(-1), m_pos_y_add_macro(-1)
228 Create( parent,
id, caption, pos,
size, style );
236wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
254wxFrame::Create( parent,
id, caption, pos,
size, style );
261wxSize sz = GetSize();
338 if( !path.IsEmpty() )
351 if( path.IsEmpty() )
354 if( !wxFileName::FileExists( path ) )
392 for(
auto i= 0;
i< wxDisplay::GetCount();
i++)
394wxDisplay display(
i);
395max_x += display.GetGeometry().GetWidth();
397 if(
m_pos_x+ width > max_x)
m_pos_x= wxGetDisplaySize().GetWidth()-width-5;
398 if(
m_pos_y+ height > wxGetDisplaySize().GetHeight())
m_pos_y= wxGetDisplaySize().GetHeight()-height-5;
439wxMenuBar* menuBar =
newwxMenuBar;
440wxMenu* itemMenu3 =
newwxMenu;
441itemMenu3->Append(
ID_MACROFLOW_NEW,
_(
"New Script\tCtrl+N"), wxEmptyString, wxITEM_NORMAL);
442itemMenu3->Append(
ID_MACROFLOW_OPEN,
_(
"Open Script...\tCtrl+O"), wxEmptyString, wxITEM_NORMAL);
443itemMenu3->Append(
ID_MACROFLOW_SAVE,
_(
"Save Script\tCtrl+S"), wxEmptyString, wxITEM_NORMAL);
452itemMenu3->AppendSeparator();
454wxMenu* autofix_menu =
newwxMenu;
455itemMenu3->AppendSubMenu(autofix_menu,
"Save Autofix Scripts");
459autofix_menu->Append(
ID_MACROFLOW_SAVESYN,
_(
"Default substitution file (\"synonyms.txt\")"), wxEmptyString, wxITEM_NORMAL);
460itemMenu3->AppendSeparator();
462itemMenu3->Append(
ID_IMPORT_MENU,
_(
"Import Library..."), wxEmptyString, wxITEM_NORMAL);
463itemMenu3->Append(
ID_EXPORT_MENU,
_(
"Export Library..."), wxEmptyString, wxITEM_NORMAL);
464itemMenu3->Append(
ID_SET_LIB_MENU,
_(
"Set Default Library..."), wxEmptyString, wxITEM_NORMAL);
465itemMenu3->Append(
ID_EDIT_LIB_MENU,
_(
"Edit Library"), wxEmptyString, wxITEM_NORMAL);
466itemMenu3->Append(wxID_EXIT,
_(
"Exit\tCtrl+Q"), wxEmptyString, wxITEM_NORMAL);
467menuBar->Append(itemMenu3,
_(
"File"));
469wxMenu* itemMenu8 =
newwxMenu;
470itemMenu8->Append(
ID_MACROFLOW_CUT,
_(
"Cut\tCtrl+X"), wxEmptyString, wxITEM_NORMAL);
471itemMenu8->Append(
ID_MACROFLOW_COPY,
_(
"Copy\tCtrl+C"), wxEmptyString, wxITEM_NORMAL);
472itemMenu8->Append(
ID_MACROFLOW_PASTE,
_(
"Paste\tCtrl+V"), wxEmptyString, wxITEM_NORMAL);
475itemMenu8->Append(
ID_MACROFLOW_APPEND,
_(
"Add To Library\tAlt+A"), wxEmptyString, wxITEM_NORMAL);
476itemMenu8->Append(
ID_MACROFLOW_ADD,
_(
"Add New Macro..."), wxEmptyString, wxITEM_NORMAL);
477itemMenu8->Append(
ID_MACROFLOW_ZOOM_IN,
_(
"Increase Font\tAlt+I"), wxEmptyString, wxITEM_NORMAL);
480menuBar->Append(itemMenu8,
_(
"Edit"));
481wxMenu* itemMenu16 =
newwxMenu;
483itemMenu16->Append(
ID_MACROFLOW_STOP,
_(
"Stop script\tF1"), wxEmptyString, wxITEM_NORMAL);
484itemMenu16->Append(
ID_SKIP_STEP,
_(
"Enable/Disable Step\tF3"), wxEmptyString, wxITEM_NORMAL);
487itemMenu16->Append(
ID_MACROFLOW_UNDO,
_(
"Revert data edits\tCtrl+Z"), wxEmptyString, wxITEM_NORMAL);
489menuBar->Append(itemMenu16,
_(
"Run"));
494wxArtProvider::Push(provider);
506wxPanel* itemFrame1 =
newwxPanel(
this,
wxID_ANY);
507wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
508itemFrame1->SetSizer(itemBoxSizer2);
513wxStaticText* itemStaticText22 =
newwxStaticText(
m_toolbar, wxID_STATIC,
_(
"Input File(s): "), wxDefaultPosition, wxDefaultSize, 0 );
514 m_toolbar->AddControl(itemStaticText22);
519wxBitmap itemtool20Bitmap(wxArtProvider::GetBitmap(
wxT(
"menu::file_open"), wxART_TOOLBAR, wxSize(16,16)));
520wxBitmap itemtool20BitmapDisabled;
521 m_toolbar->AddTool(
ID_FILECTRL,
_(
"File"), itemtool20Bitmap, itemtool20BitmapDisabled, wxITEM_NORMAL,
_(
"Input ASN.1 files"), wxEmptyString);
524wxStaticText* itemStaticText24 =
newwxStaticText(
m_toolbar, wxID_STATIC,
_(
"Output Dir: "), wxDefaultPosition, wxDefaultSize, 0 );
525 m_toolbar->AddControl(itemStaticText24);
537wxBitmap itemtool21Bitmap(wxArtProvider::GetBitmap(
wxT(
"menu::search"), wxART_TOOLBAR, wxSize(16,16)));
538wxBitmap itemtool21BitmapDisabled;
539 m_toolbar->AddTool(
ID_MACROFLOW_FIND,
_(
"Search"), itemtool21Bitmap, itemtool21BitmapDisabled, wxITEM_NORMAL,
_(
"Search for macro in the current script and the library"), wxEmptyString);
542 m_PlusBitmap= wxArtProvider::GetBitmap(
wxT(
"menu::plus"), wxART_TOOLBAR, wxSize(16,16));
543wxBitmap itemtool22BitmapDisabled;
547wxBitmap itemtool25Bitmap(wxArtProvider::GetBitmap(
wxT(
"menu::dm_undo"), wxART_TOOLBAR, wxSize(16,16)));
548wxBitmap itemtool25BitmapDisabled;
549 m_toolbar->AddTool(
ID_MACROFLOW_UNDO,
_(
"Revert data edits"), itemtool25Bitmap, itemtool25BitmapDisabled, wxITEM_NORMAL,
_(
"Revert data edits"), wxEmptyString);
552wxBitmap itemtool23Bitmap(wxArtProvider::GetBitmap(
wxT(
"menu::dm_start"), wxART_TOOLBAR, wxSize(16,16)));
553wxBitmap itemtool23BitmapDisabled;
554 m_toolbar->AddTool(
ID_MACROFLOW_FORWARD,
_(
"Run"), itemtool23Bitmap, itemtool23BitmapDisabled, wxITEM_NORMAL,
_(
"Run script"), wxEmptyString);
555wxBitmap itemtool24Bitmap(wxArtProvider::GetBitmap(
wxT(
"menu::dm_stop"), wxART_TOOLBAR, wxSize(16,16)));
556wxBitmap itemtool24BitmapDisabled;
557 m_toolbar->AddTool(
ID_MACROFLOW_STOP,
_(
"Stop"), itemtool24Bitmap, itemtool24BitmapDisabled, wxITEM_NORMAL,
_(
"Stop script"), wxEmptyString);
559 m_LockBitmap= wxArtProvider::GetBitmap(
wxT(
"menu::lock"), wxART_TOOLBAR, wxSize(16,16));
560 m_UnlockBitmap= wxArtProvider::GetBitmap(
wxT(
"menu::unlock"), wxART_TOOLBAR, wxSize(16,16));
561wxBitmap itemtool25BitmapDisabled;
566wxStaticText* syn_text =
newwxStaticText(
m_toolbar, wxID_STATIC,
_(
"Substitution File:"), wxDefaultPosition, wxDefaultSize, 0);
572wxBitmap synBitmap(wxArtProvider::GetBitmap(
wxT(
"menu::file_open"), wxART_TOOLBAR, wxSize(16, 16)));
573wxBitmap synBitmapDisabled;
581reportsynfile->SetToolTip(
"Lookup existing word substitution files in the script");
586wxBoxSizer* syn_sizer =
newwxBoxSizer(wxHORIZONTAL);
587itemBoxSizer2->Add(syn_sizer, 0, wxGROW | wxALL, 0);
589wxStaticText* syn_text =
newwxStaticText(itemFrame1, wxID_STATIC,
_(
"Substitution File:"), wxDefaultPosition, wxDefaultSize, 0);
590syn_sizer->Add(syn_text, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
592 m_SynFileCtrl=
newwxTextCtrl(itemFrame1,
wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300, -1));
593syn_sizer->Add(
m_SynFileCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
595wxButton* syn_btn =
newwxBitmapButton(itemFrame1,
ID_MACROFLOW_OPENSYNFILE, wxArtProvider::GetBitmap(
wxT(
"menu::file_open")), wxDefaultPosition, wxDefaultSize);
596syn_btn->SetToolTip(
wxT(
"Choose a word substitution file..."));
597syn_sizer->Add(syn_btn, 0, wxALIGN_CENTER_VERTICAL | wxTOP|wxBOTTOM, 3);
599wxButton* updatesynfile =
newwxButton(itemFrame1,
ID_MACROFLOW_UPDATESYNFILE,
_(
"Update Script"), wxDefaultPosition, wxDefaultSize, 0);
600syn_sizer->Add(updatesynfile, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
602wxButton* reportsynfile =
newwxButton(itemFrame1,
ID_MACROFLOW_REPORTSYNFILE,
_(
"Report Status"), wxDefaultPosition, wxDefaultSize, 0);
603reportsynfile->SetToolTip(
"Lookup existing word substitution files in the script");
604syn_sizer->Add(reportsynfile, 0, wxALIGN_CENTER_VERTICAL | wxTOP|wxBOTTOM, 5);
614wxStatusBar* statusbar = CreateStatusBar();
615SetStatusBar(statusbar);
617wxBoxSizer* itemBoxSizer25 =
newwxBoxSizer(wxHORIZONTAL);
618itemBoxSizer2->Add(itemBoxSizer25, 1, wxGROW|wxALL, 0);
624wxBoxSizer* itemBoxSizer27 =
newwxBoxSizer(wxVERTICAL);
627wxStaticText* itemStaticText1 =
newwxStaticText(
m_CollapsibleWindow, wxID_STATIC,
_(
"Library"), wxDefaultPosition, wxDefaultSize, 0 );
628itemBoxSizer27->Add(itemStaticText1, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
631itemBoxSizer27->Add(
m_TreeCtrl, 1, wxGROW|wxALL, 5);
634 m_Notebook=
newwxAuiNotebook( itemFrame1,
ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxAUI_NB_DEFAULT_STYLE );
635itemBoxSizer25->Add(
m_Notebook, 1, wxGROW|wxALL, 5);
637wxBoxSizer* itemBoxSizer66 =
newwxBoxSizer(wxHORIZONTAL);
638itemBoxSizer2->Add(itemBoxSizer66, 0, wxGROW|wxALL, 5);
640 m_Progress=
newwxGauge( itemFrame1,
wxID_ANY, 100, wxDefaultPosition, wxSize(-1, 5), wxGA_HORIZONTAL);
642itemBoxSizer66->Add(
m_Progress, 1, wxALIGN_BOTTOM|wxALL, 0);
648wxString script = wxTheApp->argv[0];
649wxString dir = wxTheApp->argv[1];
650 if(!script.IsEmpty()) {
657 if(!dir.IsEmpty()) {
673itemBoxSizer2->SetSizeHints(itemFrame1);
680 if(library.IsEmpty())
683 const stringdoc_dir(stdp.GetDocumentsDir().ToUTF8());
689 LOG_POST(
Error<<
"Cannot create directory '"<< macro_dir <<
"'");
693 stringname =
"default_library";
697 while(
file.Exists()) {
699 str<< name <<
" ("<<
i<<
")"<<
".mql";
706 if(orig_file.
Copy(macro_file)) {
718wxFileName filename(*path_it);
719wxMenuItem *script_item =
newwxMenuItem(
m_recent_submenu,
wxID_ANY, filename.GetFullName(), wxEmptyString, wxITEM_NORMAL);
767wxString title =
_(
"New script ");
781wxFileDialog
file(
this,
wxT(
"Load macro script"),
m_DefaultDir, wxEmptyString,
_(
"All files (*.*)|*.*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
782 if(
file.ShowModal() != wxID_OK)
784wxString path =
file.GetPath();
794wxFileName filename(path);
795 if(recent_scripts) {
798 if(!filename.FileExists() && !allow_empty) {
804 if(recent_scripts) {
814macro::CMacroEngine engine;
815vector<CRef<macro::CMacroRep>> macro_list;
816 boolstatus = engine.ReadAndParseMacros(path.ToStdString(), macro_list);
820 if(!allow_empty && macro_list.empty()) {
827 m_Notebook->AddPage(page, filename.GetFullName(),
true);
832 size_ttotal = macro_list.size();
836 size_tstep = total / 100;
840 for(
auto&p : macro_list) {
842 if(
i% step == 0) {
843 Pulse(
static_cast<int>(100 *
i/ total));
862 int id=
event.GetId();
872wxWindow *win =
m_Notebook->GetCurrentPage();
880 intpage_num =
m_Notebook->GetPageIndex(win);
882 constvector<pair<CRef<macro::CMacroRep>,
bool> >& script = page->
GetScript();
886wxFileDialog
file(
this,
wxT(
"Save macro script"),
m_DefaultDir,
m_Notebook->GetPageText(page_num),
_(
"All files (*.*)|*.*"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
887 if(
file.ShowModal() != wxID_OK)
890wxString path =
file.GetPath();
894wxFileName filename(path);
901 m_Notebook->SetPageText(page_num, filename.GetFullName());
910wxWindow *win =
m_Notebook->GetCurrentPage();
916 constvector<pair<CRef<macro::CMacroRep>,
bool> >& script = page->
GetScript();
919 event.Enable(
true);
924 event.Enable(
false);
928 "<std>/etc/macro_scripts/autofix_gb.mql",
929 "<std>/etc/macro_scripts/autofix_wgs.mql",
930 "<std>/etc/macro_scripts/autofix_tsa.mql",
931 "<std>/etc/synonyms.txt",
939 switch(event.GetId())
943title =
"Save Autofix GenBank macro";
947title =
"Save Autofix WGS macro";
951title =
"Save Autofix TSA macro";
955title =
"Save Default Synonym File";
967 if(!in_path.IsEmpty()) {
968filename =
string(in_path.ToUTF8());
977wxFileDialog save_dlg(
this,
ToWxString(title),
978 m_DefaultDir, wxEmptyString,
_(
"TXT files (*.txt)|*.txt|All files (*.*)|*.*"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
980 if(save_dlg.ShowModal() == wxID_OK) {
981wxString out_path = save_dlg.GetPath();
982 if(!out_path.IsEmpty()) {
986 if(in_str.good() && out_str.good()) {
994 catch(
constexception& e) {
1011wxFileDialog file_dlg(
this,
_(
"Select Word Substitution File"), wxEmptyString, wxEmptyString,
_(
"All files (*.*)|*.*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
1012 if(file_dlg.ShowModal() == wxID_OK) {
1021 boolmodified =
false;
1024 while(pos != string::npos) {
1025 size_tright_end = pos + search.length();
1026 if(pos > 0 &&
str.c_str()[pos - 1] ==
'"'&&
str.data()[right_end] ==
'"') {
1027 stringthis_replace = replace;
1028 str=
str.substr(0, pos) + this_replace +
str.substr(right_end);
1029right_end = pos + this_replace.length();
1049 if(new_syn_file.empty()) {
1050 NcbiErrorBox(
"New word substitution file is empty");
1054macro::CMacroEngine macro_engine;
1055vector<string> syn_files = macro_engine.GetSynonymFilenames(script);
1057 if(syn_files.empty()) {
1058 NcbiInfoBox(
"No word substitution file is found in the script");
1063 if(syn_files.size() > 1) {
1064 string msg=
"Multiple word substitution files are found:";
1065 for(
const auto& it : syn_files) {
1068 msg+=
"\nWould you like to replace all of them?";
1074 else if(ret ==
eYes) {
1075 for(
const auto& syn_it : syn_files) {
1076 for(
auto& it : script) {
1077 stringmacro_str = it->GetSource();
1079it->SetSource(macro_str);
1086 NcbiInfoBox(
"Word substitution file instances were successfully replaced");
1089 NcbiErrorBox(
"Failed to update the word substitution filenames");
1102 if(syn_file.empty()) {
1125macro::CMacroEngine macro_engine;
1126vector<string> syn_files = macro_engine.GetSynonymFilenames(script);
1127 if(syn_files.empty()) {
1128 NcbiInfoBox(
"No word substitution file is found in the script");
1132 if(syn_files.size() > 1) {
1133 msg=
"Multiple word substitution files are found:";
1134 for(
const auto& it : syn_files) {
1139 msg=
"One word substitution file is found:\n";
1140 msg+= syn_files.front();
1144report->SetTitle(
wxT(
"Report existing word substitutions files"));
1146report->Show(
true);
1154wxWindow* win =
m_Notebook->GetCurrentPage();
1167 constvector<pair<CRef<macro::CMacroRep>,
bool> >& script = page->
GetScript();
1171wxFileDialog
file(
this,
wxT(
"Export script steps"),
m_DefaultDir, wxEmptyString,
_(
"Text files (*.txt)|*.txt"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
1172 if(
file.ShowModal() != wxID_OK)
1175wxString path =
file.GetPath();
1179wxFileName filename(path);
1182wxFFileOutputStream
output( path );
1183wxTextOutputStream text_out(
output);
1184 size_ttotal = script.size();
1185 for(
size_t i= 0;
i< total;
i++)
1189text_out << step <<
". ";
1190text_out << script[
i].first->GetTitle() << endl;
1192 Pulse(
static_cast<int>(100 *
i/ total));
1200wxWindow *win =
m_Notebook->GetCurrentPage();
1208 constvector<pair<CRef<macro::CMacroRep>,
bool> >& script = page->
GetScript();
1212wxString path = page->
GetPath();
1225 size_ttotal = script.size();
1226 for(
auto& it : script)
1228os << it.first->GetSource();
1230 Pulse(
static_cast<int>(100 *
i/ total));
1243wxWindow *win =
m_Notebook->GetCurrentPage();
1249 constvector<pair<CRef<macro::CMacroRep>,
bool> >& script = page->
GetScript();
1252 event.Enable(
true);
1257 event.Enable(
false);
1275 boolmodified =
false;
1288 if( event.CanVeto() && modified)
1290 if( wxMessageBox(
"You have unsaved modified scripts, continue closing?",
"Please confirm", wxICON_QUESTION | wxYES_NO) != wxYES )
1301 intsel =
event.GetSelection();
1302 if(sel == wxNOT_FOUND)
1312 boolmodified =
false;
1319 if( wxMessageBox(
"The script has been modified, continue closing?",
"Please confirm", wxICON_QUESTION | wxYES_NO) != wxYES )
1329SetStatusText(wxEmptyString);
1335 intsel =
event.GetOldSelection();
1336 if(sel == wxNOT_FOUND)
1348 intsel =
event.GetSelection();
1349 if(sel == wxNOT_FOUND)
1356wxString path = page->
GetPath();
1357SetStatusText(path);
1365wxWindow *win =
m_Notebook->GetCurrentPage();
1380wxWindow *win =
m_Notebook->GetCurrentPage();
1390 for(
auto&
label: labels)
1409wxWindow *win =
m_Notebook->GetCurrentPage();
1415 event.Enable(
true);
1419 event.Enable(
false);
1429wxWindow *win =
m_Notebook->GetCurrentPage();
1438 for(
auto&
label: labels)
1458wxWindow *win =
m_Notebook->GetCurrentPage();
1465vector<CMacroLabel*> added;
1466 if(!labels.
empty())
1473added.push_back(add);
1482added.push_back(add);
1486 for(
size_t i= 0;
i< added.size();
i++)
1499macros += it->GetSource();
1502 if(!macros.empty()) macros.pop_back();
1510wxWindow *win =
m_Notebook->GetCurrentPage();
1516 event.Enable(
true);
1520 event.Enable(
false);
1529wxWindow *win =
m_Notebook->GetCurrentPage();
1543wxWindow *win =
m_Notebook->GetCurrentPage();
1551 if(labels.
size() != 1)
1558 if(index < page->GetCount()) {
1565 if(
label->IsSkipped() && add) {
1574wxWindow *win =
m_Notebook->GetCurrentPage();
1582 if(labels.
size() == 1) {
1583 event.Enable(
true);
1588 event.Enable(
false);
1593wxWindow *win =
m_Notebook->GetCurrentPage();
1608existing.
insert(it.second->GetSource());
1614 size_ttotal = labels.
size();
1615 for(
auto&
label: labels)
1617 string source=
label.second->GetMacro()->GetSource();
1623 Pulse(
static_cast<int>(100 *
i/ total));
1639wxWindow *win =
m_Notebook->GetCurrentPage();
1650wxWindow *win =
m_Notebook->GetCurrentPage();
1661wxWindow *win =
m_Notebook->GetCurrentPage();
1669 if(labels.
size() != 1)
1677 if(dlg.ShowModal() != wxID_OK) {
1689wxWindow *win =
m_Notebook->GetCurrentPage();
1697 if(labels.
size() == 1) {
1698 event.Enable(
true);
1703 event.Enable(
false);
1739 NcbiWarningBox(
"Macro cannot be opened in the editor: "+ e.
GetMsg() +
". Please modify it manually.");
1746wxWindow* win =
m_Notebook->GetCurrentPage();
1758 if(!filename.empty())
1761wxWindow* win =
m_Notebook->GetCurrentPage();
1766 if(!orig_file.empty()) {
1789wxWindow *win =
m_Notebook->GetCurrentPage();
1796 if(scroll_to_end) {
1808wxWindow *win =
m_Notebook->GetCurrentPage();
1814 event.Enable(
true);
1818 event.Enable(
false);
1827wxWindow *win =
m_Notebook->GetCurrentPage();
1834 constvector<pair<CRef<macro::CMacroRep>,
bool> >& script = page->
GetScript();
1848 boolshown =
false;
1849 boolaborted =
false;
1851wxString last_out_file;
1852 for(
size_t i= 0;
i< num_files;
i++)
1855 if( !wxFileName::FileExists( path ) )
1858unique_ptr<CNcbiIstream> InputStream(
new CNcbiIfstream(path.fn_str(), ios::binary));
1864unique_ptr<CObjectIStream>
in;
1866InputStream.release();
1869scope->AddDefaults();
1871wxFileName out_file(
m_OutputFolder->GetDirName().GetPath(),
"");
1872wxFileName in_file(path);
1873out_file.SetFullName(in_file.GetFullName());
1875 if(out_file == in_file && !shown)
1877wxMessageBox(
wxT(
"Output file cannot be the same as input file"),
wxT(
"Warning"), wxOK | wxICON_WARNING);
1881last_out_file = out_file.GetFullPath();
1882 stringheader =
in->ReadFileHeader();
1887 if(
"Seq-submit"== header )
1892 if(!ss->GetData().IsEntrys())
1894 size_tnum_entries = ss->GetData().GetEntrys().size();
1895 NON_CONST_ITERATE(objects::CSeq_submit::TData::TEntrys, se_it, ss->SetData().SetEntrys())
1897objects::CSeq_entry_Handle seh = scope->AddTopLevelSeqEntry(**se_it);
1898 RunScript(script, page,
log, num_files, num_entries, seh, ss);
1900 out->Write(ss, ss->GetThisTypeInfo());
1902 else if(
"Seq-entry"== header )
1905objects::CSeq_entry_Handle seh = scope->AddTopLevelSeqEntry(*se);
1907 out->Write(se, se->GetThisTypeInfo());
1909 else if(
"Bioseq-set"== header )
1911objects::CBioseq_set& bioseqset = se->SetSet();
1913objects::CSeq_entry_Handle seh = scope->AddTopLevelSeqEntry(*se);
1915 out->Write(&bioseqset, bioseqset.GetThisTypeInfo());
1917 else if(
"Bioseq"== header )
1919objects::CBioseq& bioseq = se->SetSeq();
1921objects::CSeq_entry_Handle seh = scope->AddTopLevelSeqEntry(*se);
1923 out->Write(&bioseq, bioseq.GetThisTypeInfo());
1929wxRemoveFile(out_file.GetFullPath());
1931wxMessageBox(
wxT(
"Running script has been aborted"),
wxT(
"Warning"), wxOK | wxICON_WARNING);
1940 if(!
log.IsEmpty())
1944report->SetTitle(
wxT(
"Macro Script Report"));
1946report->Show(
true);
1951wxMessageBox(
wxT(
"No changes"),
wxT(
"Information"), wxOK | wxICON_INFORMATION);
1964 if(!tse || !cmdProcessor)
1968 boolaborted =
false;
1971 boolstatus =
true;
1982wxMessageBox(
wxT(
"Running script has been aborted"),
wxT(
"Warning"), wxOK | wxICON_WARNING);
2013 if(!
log.IsEmpty())
2016report->SetTitle(
wxT(
"Macro Script Report"));
2018report->Show(
true);
2021 else if(!aborted && status)
2023wxMessageBox(
wxT(
"No changes"),
wxT(
"Information"), wxOK | wxICON_INFORMATION);
2041 event.Enable(enable);
2051 size_ttotal = script.size();
2053 doubleinterval = 100. / num_files;
2054interval /= num_entries;
2057 boollookup_synfile =
true;
2058macro::CMacroEngine macroEngine(
false, lookup_synfile);
2059 boolstatus =
true;
2060 for(
automacro = script.begin(); macro != script.end() && status; ++macro)
2068macro::CMacroBioData bioData(seh, submit);
2071macroEngine.Exec(*macroRep, bioData, macro_cmd,
true);
2077macro_cmd.
Reset();
2085macro_cmd.
Reset();
2087 string msg=
"Execution of the macro has failed at '"+ macroRep->GetTitle() +
"' step:";
2091errorDlg.ShowModal();
2095 const auto& macro_stat = macroEngine.GetStatistics();
2096 size_tcounter = macro_stat.GetCounter();
2099 const auto& report = macro_stat.GetMacroReport();
2101 if(!report.GetLog().empty()) {
2102 log<< report.GetName() <<
":\n"<< report.GetLog();
2105 const auto& logs = macro_stat.GetFunctionsLog();
2106 if(!logs.empty()) {
2107 log<< report.GetName() <<
":\n";
2109 for(
const auto& it : logs) {
2110 log<< it->Print() <<
"\n";
2114 if(!report.GetErrorLog().empty()) {
2115 log<<
"\nERRORS:\n"<< report.GetErrorLog();
2118 const auto& unmatched_entries = macro_stat.GetUnmatchedTableEntries();
2119 if(!unmatched_entries.empty()) {
2120 log<<
"\nUnmatched entries:\n";
2121 log<< unmatched_entries.front().first;
2125 if(
cmd&& macro_cmd)
2126 cmd->AddCommand(*macro_cmd);
2142wxWindow *win =
m_Notebook->GetCurrentPage();
2148 constvector<pair<CRef<macro::CMacroRep>,
bool> >& script = page->
GetScript();
2158 event.Enable(
true);
2164 event.Enable(
false);
2170 if(wxTheApp && wxTheApp->GetMainLoop())
2172 if(wxUpdateUIEvent::CanUpdate(
m_toolbar))
2173 m_toolbar->UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
2174 if(!wxTheApp->GetMainLoop()->IsYielding())
2175wxTheApp->Yield(
true);
2176wxTheApp->ProcessPendingEvents();
2213wxEmptyString,
_(
"All files (*.*)|*.*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE);
2214 if(
file.ShowModal() != wxID_OK)
2222wxFileName filename(path);
2236 if(
m_Search->GetValue().IsEmpty())
2241 stringpattern =
m_Search->GetValue().ToStdString();
2247 if(pattern.empty())
2252wxWindow *win =
m_Notebook->GetCurrentPage();
2259 constvector<pair<CRef<macro::CMacroRep>,
bool> >& script = page->
GetScript();
2261 for(
auto&it : script)
2263 const string&
value= it.first->GetTitle();
2264 if(
value.empty())
2284 if(
value.empty())
2300wxMessageBox(
wxT(
"No more matches found, wrapping over"),
wxT(
"Information"), wxOK | wxICON_INFORMATION);
2302wxMessageBox(
wxT(
"No match found"),
wxT(
"Information"), wxOK | wxICON_INFORMATION);
2312 boolscript_avail =
false;
2313wxWindow *win =
m_Notebook->GetCurrentPage();
2319script_avail =
true;
2325 event.Enable(lib_avail || script_avail);
2339wxWindow *win =
m_Notebook->GetCurrentPage();
2347wxTreeItemId
id=
event.GetItem();
2363wxWindow *win =
m_Notebook->GetCurrentPage();
2370wxTreeItemId
id=
event.GetItem();
2376wxPoint pos =
m_TreeCtrl->ScreenToClient(wxGetMousePosition());
2379 if(pos.x > w - 20 && pos.y > 0 && pos.y < h) {
2393wxWindow *win =
m_Notebook->GetCurrentPage();
2406wxPoint pos =
m_TreeCtrl->ScreenToClient(wxGetMousePosition());
2409 if(pos.x > w - 20 && pos.y > 0 && pos.y < h)
2433wxWindow *win =
m_Notebook->GetCurrentPage();
2439wxTreeItemId
id=
m_TreeCtrl->GetFocusedItem();
2451wxWindow *win =
m_Notebook->GetCurrentPage();
2457wxTreeItemId
id=
m_TreeCtrl->GetFocusedItem();
2461 event.Enable(
true);
2466 event.Enable(
false);
2474wxWindow *win =
m_Notebook->GetCurrentPage();
2494wxWindow *win =
m_Notebook->GetCurrentPage();
2503 if(labels.
size() != 1)
2507 label->UpdateMacro(macro_rep);
2519wxFileDialog
file(
this,
wxT(
"Import Macro Library"),
m_DefaultDir, wxEmptyString,
_(
"All files (*.*)|*.*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
2520 if(
file.ShowModal() != wxID_OK)
2523wxString path =
file.GetPath();
2524wxFileName filename(path);
2538macro::CMacroEngine engine;
2539vector<CRef<macro::CMacroRep>> macro_list;
2540 boolstatus = engine.ReadAndParseMacros(path.ToStdString(), macro_list);
2542 if(!status || macro_list.empty())
2545wxMessageBox(
wxT(
"Error importing macro library"),
wxT(
"Error"), wxOK | wxICON_ERROR);
2550 for(
auto&p : macro_list)
2552 stringtarget = p->GetForEachString();
2553 stringtitle = p->GetTitle();
2554 stringaction,
dummy;
2561wxTreeItemId root =
m_TreeCtrl->AddRoot(wxEmptyString);
2562 for(
auto&
t: for_type_macro)
2564 stringtarget =
t.second.begin()->second.begin()->second.front()->GetForEachString();
2565wxTreeItemId parent =
m_TreeCtrl->AppendItem(root,wxString(target));
2567 m_TreeCtrl->SetItemBackgroundColour(parent, bg);
2568 for(
auto&
a:
t.second)
2570 stringtitle =
a.second.begin()->second.front()->GetTitle();
2571 stringaction,
dummy;
2573wxTreeItemId second =
m_TreeCtrl->AppendItem(parent, wxString(action));
2574 m_TreeCtrl->SetItemBackgroundColour(second, bg);
2575 for(
auto&m :
a.second)
2577 for(
auto&
n: m.second)
2579wxTreeItemId
id=
m_TreeCtrl->AppendItem(second, wxString(
n->GetTitle()));
2580 m_TreeCtrl->SetItemBackgroundColour(
id, bg);
2600wxEmptyString,
_(
"All files (*.*)|*.*"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
2601 if(
file.ShowModal() != wxID_OK)
2604wxString path =
file.GetPath();
2607wxFileName filename(path);
2615os << it.second->GetSource();
2617 Pulse(
static_cast<int>(100 *
i/ total));
2632 if(library.IsEmpty())
2644wxTreeItemId
id=
m_TreeCtrl->GetFocusedItem();
2651wxMessageDialog msgBox(
this,
wxT(
"Delete from library?"),
wxT(
"Delete"), wxYES_NO | wxICON_NONE);
2652 int result= msgBox.ShowModal();
2664os << it.second->GetSource();
2666 Pulse(
static_cast<int>(100 *
i/ total));
2682wxTreeItemId
id=
m_TreeCtrl->GetFocusedItem();
2706wxTreeItemIdValue cookie;
2707wxTreeItemId child =
m_TreeCtrl->GetFirstChild(
id, cookie);
2708 while(child.IsOk())
2715child =
m_TreeCtrl->GetNextChild(
id, cookie);
2721wxMessageDialog msgBox(
this,
wxT(
"Library has been modified, reload?"),
wxT(
"Library modified"), wxYES_NO | wxICON_NONE);
2722 int result= msgBox.ShowModal();
2723 if(
result== wxID_YES) {
2736 if(
id.IsOk() &&
m_TreeCtrl->ItemHasChildren(
id)) {
2743wxTreeItemIdValue cookie;
2744wxTreeItemId child =
m_TreeCtrl->GetFirstChild(
id, cookie);
2745 while(child.IsOk()) {
2747child =
m_TreeCtrl->GetNextChild(
id, cookie);
2755 if(
id.IsOk() &&
m_TreeCtrl->ItemHasChildren(
id)) {
2758 if(expanded_nodes.
find(
label) != expanded_nodes.
end())
2763wxTreeItemIdValue cookie;
2764wxTreeItemId child =
m_TreeCtrl->GetFirstChild(
id, cookie);
2765 while(child.IsOk()) {
2767child =
m_TreeCtrl->GetNextChild(
id, cookie);
2778wxWindow *win =
m_Notebook->GetCurrentPage();
2795wxWindow *win =
m_Notebook->GetCurrentPage();
2801 event.Enable(
true);
2805 event.Enable(
false);
2810wxMessageDialog msgBox(
this, wxEmptyString,
wxT(
"Set Default Library"), wxYES_NO | wxCANCEL | wxICON_NONE);
2811msgBox.SetYesNoCancelLabels(
_(
"&Set current library as default"),
_(
"&Reset default library"),
_(
"&Cancel"));
2812 int result= msgBox.ShowModal();
2813 if(
result== wxID_CANCEL)
2842wxPoint pos = GetPosition();
2843SetPosition(wxPoint(pos.x + 5, pos.y));
2845 if(wxTheApp && wxTheApp->GetMainLoop()) {
2846 if(!wxTheApp->GetMainLoop()->IsYielding())
2847wxTheApp->Yield(
true);
2848wxTheApp->ProcessPendingEvents();
2851SetPosition(wxPoint(pos.x - 5, pos.y));
2853 if(wxTheApp && wxTheApp->GetMainLoop()) {
2854 if(!wxTheApp->GetMainLoop()->IsYielding())
2855wxTheApp->Yield(
true);
2856wxTheApp->ProcessPendingEvents();
2864 boolmaximized = IsMaximized();
2869wxSize sz = GetSize();
2870 if(event.GetCollapsed())
EFormat
The formats are checked in the same order as declared here.
@ eBinaryASN
Binary ASN.1.
static EFormat Format(const string &path, EOnError onerror=eDefault)
Guess file format.
void SetText(const wxString &text)
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
void Write(CNcbiOstream &ostr, int priority=ePriority_Local) const
Write the local policy to a specified stream.
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
CRef< CRegistryFile > AddSite(CNcbiIstream &istr, int priority)
Add a site-specific repository.
implements special composite command, which does not call to its internal commands when run the very ...
void SetException(const string &message, const CException &error)
void OnLibraryExpandUpdate(wxUpdateUIEvent &event)
void PopulateRecentMenu()
bool Create(wxWindow *parent, wxWindowID id=15000, const wxString &caption=_("Macro Flow Editor"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(1500, 1000), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX)
void OnLibToScript(wxCommandEvent &event)
void OnPageChanging(wxAuiNotebookEvent &event)
void OnEditUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for wxID_CUT
vector< CRef< macro::CMacroRep > > m_clipboard
map< wxTreeItemId, CRef< macro::CMacroRep > > m_id_to_macro
void OnOpenClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for wxID_OPEN
void RunScriptStandalone(const vector< pair< CRef< macro::CMacroRep >, bool > > &script, CScriptPanel *page)
void OnAddUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for wxID_ADD
void OnExportMenuClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for ID_EXPORT_MENU
void OnForwardUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for wxID_FORWARD
void OnEditLibrary(wxCommandEvent &event)
wxArrayString m_InputFiles
void OnPageChanged(wxAuiNotebookEvent &event)
void OnStopUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for wxID_STOP
CRef< IGuiCoreHelper > m_gui_core_helper
void OnSaveAsClick(wxCommandEvent &event)
wxTextCtrl * m_InputFileText
void OnDeleteClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for wxID_DELETE
void OnTreectrlItemDrag(wxTreeEvent &event)
wxMenu * m_recent_submenu
void OnDeleteFromLibrary(wxCommandEvent &event)
wxWindow * m_CollapsibleWindow
void OnCutClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for wxID_CUT
void RemoveEditor(bool scroll_to_end)
void SetPositionAndSize()
void OnEditLibraryUpdate(wxUpdateUIEvent &event)
void OnPasteClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for wxID_PASTE
void OnPageClose(wxAuiNotebookEvent &event)
void OnTreectrlItemDrop(wxTreeEvent &event)
void OnUpdateSynFileUpdate(wxUpdateUIEvent &event)
void OnExportUpdate(wxUpdateUIEvent &event)
void OnIncreaseFont(wxCommandEvent &event)
void OpenEditor(CRef< macro::CMacroRep > macro_rep)
void OnRecent(wxCommandEvent &event)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void SetSynonymFile(const string &filename)
void OnSetDefaultLibrary(wxCommandEvent &event)
void OnTreectrlItemActivated(wxTreeEvent &event)
wxEVT_COMMAND_TREE_ITEM_ACTIVATED event handler for ID_TREECTRL
wxAuiNotebook * m_Notebook
void OnDecreaseFont(wxCommandEvent &event)
void OnUndoUpdate(wxUpdateUIEvent &event)
void OnTreectrlMenu(wxTreeEvent &event)
void OnSaveUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for wxID_SAVE
void OnDeleteFromLibraryUpdate(wxUpdateUIEvent &event)
void OnLibToScriptUpdate(wxUpdateUIEvent &event)
void OnAddClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ADD
void OpenSynonymFile(wxCommandEvent &event)
vector< wxTreeItemId > m_all_ids
void RunScriptInWidget(const vector< pair< CRef< macro::CMacroRep >, bool > > &script, CScriptPanel *page)
void OnInputFile(wxCommandEvent &event)
wxDirPickerCtrl * m_OutputFolder
void OnCopyClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for wxID_COPY
wxTextCtrl * m_SynFileCtrl
void Init()
Initialises member variables.
void UpdateCounter(CScriptPanel *page, size_t i, size_t counter)
void OnManualEditMacroUpdate(wxUpdateUIEvent &event)
void OnForwardClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for wxID_FORWARD
const string GetSynonymFile() const
void OnUpdateSynonymFile(wxCommandEvent &event)
void OnLibExpand(wxCommandEvent &event)
void x_PopulateSynonymFileCtrl()
void OnImportMenuClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for ID_IMPORT_MENU
void OnDuplicateUpdate(wxUpdateUIEvent &event)
objects::CSeq_entry_Handle m_undo_tse
static CMacroFlowEditor * GetInstance(wxWindow *parent, CRef< IGuiCoreHelper > gui_core_helper, wxWindowID id=15000, const wxString &caption=_("Macro Flow Editor"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(1500, 1000), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX)
virtual void SaveSettings() const
void OnExportStepsClick(wxCommandEvent &event)
map< int, string > m_id_to_path
void SaveScript(const wxString &path, const vector< pair< CRef< macro::CMacroRep >, bool > > &script)
void SaveAddMacroSizeAndPosition(int w, int h, int x, int y)
void GetExpandedNodes(wxTreeItemId id, set< string > &expanded_nodes, string label=kEmptyStr)
void OnDuplicateClick(wxCommandEvent &event)
void AddNewMacro(CRef< macro::CMacroRep > macro_rep)
void CopyDefaultLibrary()
list< string > m_opened_scripts
CMacroEditor * m_MacroEditor
void OpenScript(const wxString &path, bool recent_scripts, bool allow_empty)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CMacroFlowEditor()
Constructors.
void CreateControls()
Creates the controls and sizers.
void OnCollapsiblePane(wxCollapsiblePaneEvent &event)
static bool ShowToolTips()
Should we show tooltips?
void OnSaveAsUpdate(wxUpdateUIEvent &event)
void OnFindClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for wxID_FIND
void OnSkipStepUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for ID_SKIP_STEP
wxString GetSettingsPath() const
IUndoManager * m_UndoManager
void OnNewClick(wxCommandEvent &event)
@begin CMacroFlowEditor event handler declarations
CScriptPanel::TVecMacroRep TVecMacroRep
CScriptPanel * x_GetCurrentPage() const
void UpdateEditedMacro(CRef< macro::CMacroRep > macro_rep)
void OnLibCollapse(wxCommandEvent &event)
virtual void SetRegistryPath(const string ®_path)
void OnManualEditMacro(wxCommandEvent &event)
void OnPasteUpdate(wxUpdateUIEvent &event)
void OnExitClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for wxID_EXIT
void OnStopClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for wxID_STOP
wxCollapsiblePane * m_CollapsiblePanel
virtual void LoadSettings()
void DeleteNode(wxTreeItemId &id)
void OnSaveClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for wxID_SAVE
void OnClose(wxCloseEvent &event)
~CMacroFlowEditor()
Destructor.
void OnSkipStepClick(wxCommandEvent &event)
wxEVT_COMMAND_MENU_SELECTED event handler for ID_SKIP_STEP
void SetExpandedNodes(wxTreeItemId id, const set< string > &expanded_nodes, string label=kEmptyStr)
void OnReportSynFileStatus(wxCommandEvent &event)
vector< bool > m_clipboard_skipped
bool RunScript(const vector< pair< CRef< macro::CMacroRep >, bool > > &script, CScriptPanel *page, wxString &log, size_t num_files, size_t num_entries, objects::CSeq_entry_Handle seh, CConstRef< objects::CSeq_submit > submit=CConstRef< objects::CSeq_submit >(NULL), CRef< CCmdComposite > cmd=CRef< CCmdComposite >(NULL))
void OnAppendClick(wxCommandEvent &event)
void OnUndo(wxCommandEvent &event)
static CMacroFlowEditor * m_Instance
void OnFindUpdate(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for wxID_FIND
void OnSaveCopies(wxCommandEvent &event)
void ImportLibrary(const wxString &path, bool report)
void OnLockDrag(wxCommandEvent &event)
static wxColour GetLabelColour(const string &str)
CRef< macro::CMacroRep > GetMacro()
class CRegistryReadView provides a nested hierarchical view at a particular key.
int GetInt(const string &key, int default_val=0) const
access a named key at this level, with no recursion
bool GetBool(const string &key, bool default_val=false) const
string GetString(const string &key, const string &default_val=kEmptyStr) const
void GetStringList(const string &key, list< string > &val) const
void Set(const string &key, int val)
access a named key at this level, with no recursion
void SetPath(const wxString &path)
void SetSynonymFile(const string &filename)
size_t GetIndex(CMacroLabel *label)
void SetModified(bool modified)
void SelectItem(size_t item)
const map< size_t, CMacroLabel * > & GetSelectedMacros()
CMacroLabel * AddMacro(CRef< macro::CMacroRep > macro)
static const string sm_Multiple
const string & GetSynonymFile() const
vector< pair< CRef< macro::CMacroRep >, bool > > GetScript()
bool UpdateMacroSources(const TVecMacroRep &script)
void UpdateCounter(size_t i, size_t counter)
void LookupSynonymFiles()
CMacroLabel * InsertMacro(CRef< macro::CMacroRep > macro, size_t index)
static wxString ResolvePath(const wxString &path, const wxString &rel_name)
Utility function to hide the platform specifics of locating our standard directories and files.
static wxString ResolvePathExisting(const wxString &path, const wxString &delim=wxT(","))
Utility function to hide the platform specifics of locating our standard directories.
CwxSplittingArtProvider - an adapter for old-style image aliases.
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
objects::CSeq_entry_Handle GetTopSeqEntry()
CConstRef< objects::CSeq_submit > GetSeqSubmit()
ICommandProccessor * GetCmdProcessor()
virtual bool RequestExclusiveEdit(wxWindow *window, const string &descr)=0
virtual bool ReleaseExclusiveEdit(wxWindow *window)=0
virtual void Undo(wxWindow *window=0)=0
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
virtual void RegisterFileAlias(const wxArtID &anId, const wxArtClient &aClient, const wxSize &aSize, const wxString &aName, long aType=wxBITMAP_TYPE_ANY, int anIndex=-1)
int AddDirectory(wxString aDirName)
IMPLEMENT_CLASS(CFloatingFrame, CFloatingFrameBaseClass) const static long kFloatFrameStyle
CFloatingFrame.
std::ofstream out("events_result.xml")
main entry point for tests
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static SQLCHAR output[256]
static const char * str(char *buf, int n)
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
@ eTakeOwnership
An object can take ownership of another.
#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.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
virtual bool Copy(const string &new_path, TCopyFlags flags=fCF_Default, size_t buf_size=0) const
Copy a file.
virtual bool Remove(TRemoveFlags flags=eRecursive) const
Remove a directory entry.
virtual bool Exists(void) const
Check if directory "dirname" exists.
static string ConcatPathEx(const string &first, const string &second)
Concatenate two parts of the path for any OS.
bool IsFile(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a file.
bool Create(TCreateFlags flags=fCreate_Default) const
Create the directory using "dirname" passed in the constructor.
virtual bool Exists(void) const
Check existence of file.
virtual void Execute()
Do the editing action.
virtual void Unexecute()
Undo (opposite to Execute())
EDialogReturnValue NcbiInfoBox(const string &message, const string &title="Info")
specialized Message Box function for reporting general information messages
void NcbiWarningBox(const string &message, const string &title="Warning")
specialized Message Box function for reporting non-critical errors
void NcbiErrorBox(const string &message, const string &title="Error")
specialized Message Box function for reporting critical errors
EDialogReturnValue NcbiMessageBox(const string &message, TDialogType type=eDialog_Ok, EDialogIcon icon=eIcon_Exclamation, const string &title="Error", EDialogTextMode text_mode=eRaw)
@ eSerial_AsnText
ASN.1 text.
@ eSerial_AsnBinary
ASN.1 binary.
pair< TObjectPtr, TTypeInfo > ObjectInfo(C &obj)
static CObjectOStream * Open(ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)
Create serial object writer and attach it to an output stream.
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void NcbiStreamCopyThrow(CNcbiOstream &os, CNcbiIstream &is)
Same as NcbiStreamCopy() but throws an CCoreException when copy fails.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
static string & ToLower(string &str)
Convert string to lower case â string& version.
static const char label[]
EDialogReturnValue
enumerated return values for dialog boxes, starting from 1 to undermine attempts to cast it "bool"
The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format
static bool s_ReplaceInPlaceBetweenQuotes(string &str, const string &search, const string &replace)
static const char * kFramePosX
static const char * sSaveLocalCopies[]
static const char * kFrameHeight
static const char * kHideLibrary
static const char * kOpenedScripts
static const char * kExclusiveEditDescr
static const char * kAddMacroPosX
static const char * kAddMacroWidth
static const char * kDefaultLibraryLocation
static const char * kDefaultLibrary
static const char * kAddMacroPosY
static const char * kFramePosY
static const char * kFrameWidth
static const char * kAddMacroHeight
#define ID_MACROFLOW_UNDO
#define ID_MACROFLOW_LIB_TO_SCRIPT
#define ID_MACROFLOW_UPDATESYNFILE
#define ID_MACROFLOW_REPORTSYNFILE
#define ID_MACROFLOW_STOP
#define ID_MACROFLOW_ZOOM_OUT
#define ID_MACROFLOW_SAVEAUTOFIXWGS
#define ID_MACROFLOW_LIB_EXPAND
#define ID_COLLAPSIBLE_PANE
#define ID_MACROFLOW_APPEND
#define ID_MACROFLOW_OPENSYNFILE
#define ID_MACROFLOW_FIND
#define ID_MACROFLOW_OPEN
#define ID_MACROFLOW_SAVE_AS
#define ID_MACROFLOW_LIB_COLLAPSE
#define ID_MACROFLOW_SAVEAUTOFIXGB
#define ID_MACROFLOW_LOCK_DRAG
#define ID_MACROFLOW_DELETE
#define ID_MACROFLOW_EXPORT_STEPS
#define ID_MACROFLOW_SAVESYN
#define ID_MACROFLOW_COPY
#define ID_MACROFLOW_PASTE
#define ID_MACROFLOW_ZOOM_IN
#define ID_MACROFLOW_FORWARD
#define ID_MACROFLOW_SAVEAUTOFIXTSA
#define ID_MACROFLOW_DEL_FROM_LIB
#define ID_MACROFLOW_SAVE
#define ID_MANUALEDITMACRO
#define ID_MACROFLOW_DUPLICATE
const TYPE & Get(const CNamedParameterList *param)
void SaveScriptFromLibrary(const string ¯o)
Save macro obtained from the library.
void ReportUsage(const wxString &dialog_name, const string &action_name)
Report events in the macro_flow_editor and in the macro_editor.
void ReportMacroExecution()
Report when a macro is executed.
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
const CharType(& source)[N]
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
std::istream & in(std::istream &in_, double &x_)
ViewerWindowBase::OnEditMenu ViewerWindowBase::OnJustification EVT_MENU(MID_SHOW_GEOM_VLTNS, ViewerWindowBase::OnShowGeomVltns) EVT_MENU(MID_FIND_PATTERN
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
void OpenFileBrowser(const wxString &path)
wxString GetAbsolutePath(const wxString &localpath)
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)
wxRect GetScreenRect(const wxWindow &win)
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