25#define _CRTDBG_MAP_ALLOC
30 #define _ASSERT(expr) ((void)0)
32 #define _ASSERTE(expr) ((void)0)
39#include <wx/filedlg.h>
40#include <wx/statusbr.h>
41#include <wx/choicdlg.h>
43#include <wx/msw/wince/tbarwce.h>
44#include <wx/msw/private.h>
46#include <wx/printdlg.h>
47#include <wx/mimetype.h>
48#include <wx/stdpaths.h>
49#include <wx/filename.h>
50#include <wx/artprov.h>
52#include <wx/clipbrd.h>
53#include <wx/display.h>
92#include "../kernel/core/version.h"
93#include "../kernel/core/utils/tools.hpp"
94#include "../kernel/core/procedure/dependency.hpp"
95#include "../kernel/core/datamanagement/database.hpp"
96#include "../kernel/core/documentation/docgen.hpp"
97#include "../kernel/core/ui/error.hpp"
98#include "../kernel/core/io/logger.hpp"
99#include "../kernel/core/ui/calltipprovider.hpp"
101#include "../common/recycler.hpp"
102#include "../common/Options.h"
103#include "../common/vcsmanager.hpp"
104#include "../common/filerevisions.hpp"
105#include "../common/ipc.hpp"
107#include "../common/http.h"
108#include "../common/compareFiles.hpp"
113#include "icons/newstart1.xpm"
114#include "icons/newcontinue1.xpm"
115#include "icons/newstop1.xpm"
116#include "icons/gtk-apply.xpm"
117#include "icons/stepnext.xpm"
118#include "icons/wraparound.xpm"
119#include "icons/breakpoint_octagon.xpm"
120#include "icons/breakpoint_octagon_crossed.xpm"
121#include "icons/breakpoint_octagon_disable.xpm"
190 if (sWinSize ==
"{}")
195 if (vArgs.size() < 4)
199 winRect.x =
StrToInt(vArgs[0].subview(2).to_string());
200 winRect.y =
StrToInt(vArgs[1].subview(2).to_string());
201 winRect.width =
StrToInt(vArgs[2].subview(2).to_string());
202 winRect.height =
StrToInt(vArgs[3].subview(2).to_string());
204 int currDisplay = wxNOT_FOUND;
208 for (
size_t i = 0; i < wxDisplay::GetCount(); i++)
210 dispdim = wxDisplay(i).GetGeometry();
212 if (dispdim.Contains(winRect.x+10, winRect.y+10))
221 if (currDisplay == wxNOT_FOUND)
227 winRect.width =
std::min(dispdim.width-winRect.x+dispdim.x, winRect.width);
228 winRect.height =
std::min(dispdim.height-winRect.y+dispdim.y, winRect.height);
232 if (winRect.width < 200 || winRect.height < 200)
262 wxString sInstanceLocation = wxStandardPaths::Get().GetDataDir();
263 sInstanceLocation.Replace(
":\\",
"~");
264 sInstanceLocation.Replace(
"\\",
"~");
267 m_singlinst =
new wxSingleInstanceChecker(
"NumeRe::" + sInstanceLocation +
"::" + wxGetUserId(), wxGetHomeDir());
283 for (
int i = 1 ; i < argc; ++i)
284 cmdLine += wxString(argv[i]) +
' ';
286 if (!cmdLine.IsEmpty())
289 cmdLine.Replace(
_T(
"("),
_T(
"\\("));
290 cmdLine.Replace(
_T(
")"),
_T(
"\\)"));
291 connection->Execute(
_T(
"[CmdLine({") + cmdLine +
_T(
"})]"));
294 connection->Disconnect();
305 std::setlocale(LC_ALL,
"C");
306 wxFileName f(wxStandardPaths::Get().GetExecutablePath());
308 wxInitAllImageHandlers();
309 wxBitmap splashImage;
310 wxSplashScreen* splash =
nullptr;
313 if (splashImage.LoadFile(f.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR)+
"icons\\splash.png", wxBITMAP_TYPE_PNG))
314 splash =
new wxSplashScreen(splashImage, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0,
nullptr, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER);
336 g_logger.
info(
"User-selected window size: " + sWinSize);
339 if (sWinSize !=
"{}")
340 NumeReMainFrame->SetSize(winRect);
342 NumeReMainFrame->Maximize();
345 NumeReMainFrame->Maximize();
348 NumeReMainFrame->Show(
true);
351 wxArrayString wxArgV;
352 for (
int i = 0; i < argc; i++)
362 NumeReMainFrame->
Ready();
374 wxArrayString DialogText;
389 NumeReMainFrame->Refresh();
390 NumeReMainFrame->Update();
440 catch (std::exception& e)
442 g_logger.
error(std::string(
"Unexpected exception: ") + e.what());
443 wxMessageBox(std::string(
"An unexpected exception was caught. If it is reproducable, consider informing us about this issue. Message: ") + e.what(),
"Exception caught");
448 wxMessageBox(
"An unexpected exception was caught. If it is reproducable, consider informing us about this issue. Code: " +
toString((
int)e.errorcode) +
", message: " +
_guilang.
get(
"ERR_NR_" +
toString((
int)e.errorcode) +
"_0_*", e.getToken(),
toString(e.getIndices()[0]),
toString(e.getIndices()[1]),
toString(e.getIndices()[2]),
toString(e.getIndices()[3])) +
", expression: " + e.getExpr() +
", token: " + e.getToken(),
"Exception caught");
453 wxMessageBox(
"An unexpected exception was caught. If it is reproducable, consider informing us about this issue. Message: " + e.GetMsg(),
"Exception caught");
481 : wxFrame((wxFrame *)nullptr, -1, title, pos, size)
484 SetMinSize(wxSize(1024, 768));
506 logWindow =
new wxLogWindow(
this,
"Debug messages");
533 g_logger.
debug(
"Creating terminal and starting kernel session.");
589#if wxUSE_DRAG_AND_DROP
662 m_filterImageFiles =
_guilang.
get(
"GUI_FILTER_IMAGEFILES") +
" (*.png, *.jpeg, *.eps, *.svg, *.gif, *.tiff)|*.png;*.jpg;*.jpeg;*.eps;*.svg;*.gif;*.tif;*.tiff";
676 g_pageSetupData =
new wxPageSetupDialogData(*
g_printData);
684 tipDataBase.
addData(
"<>/user/docs/hints.ndb");
686 tipDataBase.
addData(
"<>/docs/hints.ndb");
763 wxStandardPaths systemPaths = wxStandardPaths::Get();
764 wxString appPath = systemPaths.GetExecutablePath();
765 wxFileName fullProgramPath(appPath);
766 return fullProgramPath.GetPath();
924 wxString path = wxStandardPaths::Get().GetExecutablePath();
927 wxFileName configName(path.substr(0, path.rfind(
'\\')+1),
"numeregui.ini");
930 wxFileConfig m_config(
"numeregui", wxEmptyString, configName.GetFullPath());
934 if (configName.FileExists())
936 bool printInColor = (m_config.Read(
"Miscellaneous/PrintInColor",
"true") ==
"true");
942 mSettings[
SETTING_B_TOOLBARTEXT].active() = (m_config.Read(
"Interface/ShowToolbarText",
"false") ==
"true");
943 mSettings[
SETTING_B_PATHSONTABS].active() = (m_config.Read(
"Interface/ShowPathsOnTabs",
"false") ==
"true");
945 mSettings[
SETTING_B_SAVESESSION].active() = (m_config.Read(
"Miscellaneous/SaveSession",
"false") ==
"true");
946 mSettings[
SETTING_B_SAVEBOOKMARKS].active() = (m_config.Read(
"Miscellaneous/SaveBookmarksInSession",
"false") ==
"true");
948 mSettings[
SETTING_B_USEREVISIONS].active() = (m_config.Read(
"Miscellaneous/KeepBackups",
"true") ==
"true");
951 mSettings[
SETTING_B_LINESINSTACK].active() = (m_config.Read(
"Debugger/ShowLineNumbersInStackTrace",
"true") ==
"true");
952 mSettings[
SETTING_B_MODULESINSTACK].active() = (m_config.Read(
"Debugger/ShowModulesInStackTrace",
"true") ==
"true");
953 mSettings[
SETTING_B_PROCEDUREARGS].active() = (m_config.Read(
"Debugger/ShowProcedureArguments",
"true") ==
"true");
954 mSettings[
SETTING_B_GLOBALVARS].active() = (m_config.Read(
"Debugger/ShowGlobalVariables",
"false") ==
"true");
956 int debuggerFocusLine = 10;
957 m_config.Read(
"Debugger/FocusLine", &debuggerFocusLine, 10);
962 m_config.Read(
"Styles/EditorFont", &nativeInfo,
"Consolas 10");
963 font.SetNativeFontInfoUserDesc(nativeInfo);
967 m_config.Read(
"Miscellaneous/LaTeXRoot", &latexroot,
"C:/Program Files");
970 int terminalHistory = 300;
971 m_config.Read(
"Miscellaneous/TerminalHistory", &terminalHistory, 300);
972 if (terminalHistory >= 100 && terminalHistory <= 1000)
977 int caretBlinkTime = 500;
978 m_config.Read(
"Interface/CaretBlinkTime", &caretBlinkTime, 500);
979 if (caretBlinkTime >= 100 && caretBlinkTime <= 1000)
995 m_config.DeleteAll();
1021 std::ifstream if_session;
1022 std::vector<std::string> vSessionFile;
1024 std::string sFileName;
1029 std::string sBookmarks;
1030 bool modifiedFile =
false;
1031 if_session.open((
getProgramFolder().ToStdString()+
"\\numere.session").c_str());
1035 if (if_session.is_open())
1038 while (!if_session.eof())
1040 getline(if_session, sLine);
1043 if (!sLine.length() || sLine.front() ==
'#')
1047 if (sLine.substr(0,12) ==
"ACTIVEFILEID")
1049 activefile =
StrToInt(sLine.substr(sLine.find(
'\t')+1));
1053 vSessionFile.push_back(sLine);
1060 for (
size_t i = 0; i < vSessionFile.size(); i++)
1063 sLine = vSessionFile[i];
1066 if (sLine.front() ==
'*')
1069 modifiedFile =
true;
1072 modifiedFile =
false;
1075 sFileName = sLine.substr(0, sLine.find(
'\t'));
1078 sLine.erase(0, sLine.find(
'\t')+1);
1079 nId =
StrToInt(sLine.substr(0, sLine.find(
'\t')));
1082 sLine.erase(0, sLine.find(
'\t')+1);
1083 nLine =
StrToInt(sLine.substr(0, sLine.find(
'\t')));
1086 if (sLine.find(
'\t') != std::string::npos)
1089 sLine.erase(0, sLine.find(
'\t')+1);
1090 nSetting =
StrToInt(sLine.substr(0, sLine.find(
'\t')));
1097 sBookmarks = sLine.substr(sLine.rfind(
'\t')+1);
1104 if (sFileName ==
"<NEWFILE>")
1106 if (vSessionFile.size() != 1)
1118 if (wxFileExists(sFileName))
1122 currentEd->GotoPos(nLine);
1124 currentEd->EnsureVisible(currentEd->LineFromPosition(nLine));
1136 int nUnloadableID = nId;
1139 if (nUnloadableID < activefile)
1145 if (activefile >= (
int)
m_book->GetPageCount())
1148 m_book->SetSelection(activefile);
1181 if (event.CanVeto())
1189 if (event.CanVeto())
1224 wxRect winRect = GetScreenRect();
1230 winRect.x, winRect.y,
1231 winRect.width, winRect.height);
1272 int id =
event.GetId();
1287 wxArrayString fnames;
1297 command = (data->
tooltip).substr(0, (data->
tooltip).find(
' ')) +
" ";
1299 command = (data->
tooltip).substr(0, (data->
tooltip).find(
'(')+1);
1304 size_t dot = (data->
tooltip).find(
'.');
1305 size_t endPos = (data->
tooltip).find_first_of(
"( ", dot);
1307 if ((data->
tooltip)[endPos] ==
'(')
1310 command = (data->
tooltip).substr(dot, endPos-dot);
1314 edit->InsertText(edit->GetCurrentPos(), command);
1315 edit->GotoPos(edit->GetCurrentPos()+command.length());
1321 std::string command;
1323 command = (data->
tooltip).substr(0, (data->
tooltip).find(
' ')).ToStdString() +
" ";
1325 command = (data->
tooltip).substr(0, (data->
tooltip).find(
'(')+1).ToStdString();
1327 command = (data->
tooltip).substr(0, (data->
tooltip).find(
' ')).ToStdString();
1330 size_t dot = (data->
tooltip).find(
'.');
1331 size_t endPos = (data->
tooltip).find_first_of(
"( ", dot);
1333 if ((data->
tooltip)[endPos] ==
'(')
1336 command = (data->
tooltip).substr(dot, endPos-dot);
1346 std::string command = (data->
tooltip).substr(0, (data->
tooltip).find(
' ')).ToStdString();
1354 wxMessageBox(data->
tooltip,
"DESCRIPTION", wxICON_INFORMATION,
this);
1403 wxToolBar* t = GetToolBar();
1433 wxToolBar* t = GetToolBar();
1441 wxToolBar* t = GetToolBar();
1474 m_book->ToggleWindowStyle(wxNB_MULTILINE);
1808 wxToolBar* tb = GetToolBar();
1856 repobrowser->SetIcon(GetIcon());
1857 repobrowser->Show();
1862 std::string packageFile = wxFileSelector(
_guilang.
get(
"GUI_SELECT_PACKAGE_FOR_INSTALL"),
1864 "",
"*.nscr",
"Packages (*.nscr)|*.nscr", wxFD_OPEN,
this).ToStdString();
1866 if (packageFile.length())
1916 int tabNum =
m_book->GetSelection();
1919 if (result == wxCANCEL)
1950 size_t id =
event.GetId();
1979 int type =
event.GetChangeType();
1984 if ((type == wxFSW_EVENT_CREATE
1985 || type == wxFSW_EVENT_DELETE
1986 || type == wxFSW_EVENT_RENAME
1987 || type == wxFSW_EVENT_MODIFY) && event.GetPath().GetFullPath().find(
".revisions") == std::string::npos)
1989 m_modifiedFiles.push_back(std::make_pair(type, event.GetPath().GetFullPath()));
2008 std::vector<std::string> vFolderTree(1, sProcedurePath);
2009 std::vector<std::string> vProcedureTree;
2010 std::vector<std::string> vCurrentTree;
2011 std::string sPath = sProcedurePath;
2020 if (vCurrentTree.size())
2021 vFolderTree.insert(vFolderTree.end(), vCurrentTree.begin(), vCurrentTree.end());
2023 while (vCurrentTree.size());
2026 for (
size_t i = 0; i < vFolderTree.size(); i++)
2028 if (vFolderTree[i].substr(vFolderTree[i].length()-3) ==
"/.." || vFolderTree[i].substr(vFolderTree[i].length()-2) ==
"/.")
2031 vCurrentTree =
getFileList(vFolderTree[i] +
"/*.nprc", _option, 1);
2033 if (vCurrentTree.size())
2034 vProcedureTree.insert(vProcedureTree.end(), vCurrentTree.begin(), vCurrentTree.end());
2039 for (
size_t i = 0; i < vProcedureTree.size(); i++)
2041 if (vProcedureTree[i].substr(0, sProcedurePath.length()) == sProcedurePath)
2042 vProcedureTree[i].erase(0, sProcedurePath.length());
2044 while (vProcedureTree[i].front() ==
'/' || vProcedureTree[i].front() ==
'\\')
2045 vProcedureTree[i].erase(0, 1);
2066 wxBoxSizer* sizer =
new wxBoxSizer(wxHORIZONTAL);
2071 if (filename.GetExt() ==
"png")
2072 _panel =
new ImagePanel(frame, filename.GetFullPath(), wxBITMAP_TYPE_PNG);
2073 else if (filename.GetExt() ==
"bmp")
2074 _panel =
new ImagePanel(frame, filename.GetFullPath(), wxBITMAP_TYPE_BMP);
2075 else if (filename.GetExt() ==
"gif")
2076 _panel =
new ImagePanel(frame, filename.GetFullPath(), wxBITMAP_TYPE_GIF);
2077 else if (filename.GetExt() ==
"jpg" || filename.GetExt() ==
"jpeg")
2078 _panel =
new ImagePanel(frame, filename.GetFullPath(), wxBITMAP_TYPE_JPEG);
2079 else if (filename.GetExt() ==
"tif" || filename.GetExt() ==
"tiff")
2080 _panel =
new ImagePanel(frame, filename.GetFullPath(), wxBITMAP_TYPE_TIF);
2089 sizer->Add(_panel, 1, wxEXPAND);
2091 frame->SetSizer(sizer);
2092 frame->SetClientSize(_panel->GetSize());
2110 ShellExecuteA(NULL,
"open", filename.GetFullPath().ToStdString().c_str(),
"",
"", SW_SHOW);
2156 frame->SetSize(800,600);
2157 TableViewer* grid =
new TableViewer(frame, wxID_ANY, frame->CreateStatusBar(3),
nullptr, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS | wxBORDER_STATIC);
2158 grid->
SetData(_stringTable, tableDisplayName, sIntName);
2180 frame->SetSize(800,600);
2183 panel->
grid->
SetData(_table, tableDisplayName, sIntName);
2204 frame->SetSize(800,600);
2207 panel->
grid->
SetData(_stringTable, tableDisplayName,
"");
2228 frame->SetSize(800,600);
2231 panel->
grid->
SetData(_table, tableDisplayName,
"");
2251 if (tableDisplayName ==
"string()" || tableDisplayName.find(
"{}") != std::string::npos)
2344 int ret = dialog.ShowModal();
2346 if (ret == wxID_CANCEL)
2366 int ret = dialog.ShowModal();
2368 if (ret == wxID_CANCEL)
2388 int ret = dialog.ShowModal();
2390 if (ret == wxID_CANCEL)
2409 long style = wxCENTRE;
2422 style |= wxICON_QUESTION;
2425 style |= wxICON_INFORMATION;
2428 style |= wxICON_WARNING;
2431 style |= wxICON_ERROR;
2437 else if (ret == wxCANCEL)
2439 else if (ret == wxYES)
2457 wxArrayString choices;
2459 while (sExpression.length())
2466 int ret = dialog.ShowModal();
2468 if (ret == wxID_CANCEL)
2488 wxArrayString choices;
2490 while (sExpression.length())
2497 int ret = dialog.ShowModal();
2499 if (ret == wxID_CANCEL)
2503 wxArrayInt selections = dialog.GetSelections();
2505 sExpression.clear();
2507 for (
size_t i = 0; i < selections.size(); i++)
2509 sExpression += choices[selections[i]].ToStdString() +
"\",\"";
2512 if (sExpression.length())
2513 sExpression.erase(sExpression.length()-3);
2548 std::string sTitle = vDebugInfo[0];
2549 std::vector<std::string> vStack;
2551 vStack.insert(vStack.begin(), vDebugInfo.begin()+1, vDebugInfo.end());
2588 if (sDocFile.length())
2589 wxMessageBox(
_guilang.
get(
"GUI_DLG_LATEX_SUCCESS_MESSAGE", sDocFile),
_guilang.
get(
"GUI_DLG_LATEX_SUCCESS"), wxCENTER | wxOK,
this);
2591 wxMessageBox(
_guilang.
get(
"GUI_DLG_LATEX_ERROR_MESSAGE", sFileName),
_guilang.
get(
"GUI_DLG_LATEX_ERROR"), wxCENTER | wxOK,
this);
2609 if (!sMain.length())
2611 wxMessageBox(
_guilang.
get(
"GUI_DLG_LATEX_ERROR_MESSAGE", sFileName),
_guilang.
get(
"GUI_DLG_LATEX_ERROR"), wxCENTER | wxOK,
this);
2615 sMain +=
" -interaction=nonstopmode";
2622 sMain.substr(0, sMain.rfind(
'/')).c_str(),
2626 _guilang.
get(
"GUI_DLG_NOTEXBIN"), wxCENTER | wxOK | wxICON_ERROR,
this);
2650 (filename.GetName().ToStdString() +
" -interaction=nonstopmode").c_str(),
2651 filename.GetPath().ToStdString().c_str(),
2655 _guilang.
get(
"GUI_DLG_NOTEXBIN"), wxCENTER | wxOK | wxICON_ERROR,
this);
2673 if (wxYES != wxMessageBox(
_guilang.
get(
"GUI_DLG_DELETE_QUESTION", data->
filename.ToStdString()),
_guilang.
get(
"GUI_DLG_DELETE"), wxCENTRE | wxICON_QUESTION | wxYES_NO,
this))
2696 wxFileName target_filename = target_data->
filename;
2697 wxFileName source_filename = source_data->
filename;
2699 target_filename.SetName(source_filename.GetName());
2700 target_filename.SetExt(source_filename.GetExt());
2702 if (wxFileExists(target_filename.GetFullPath()))
2704 wxMessageBox(
_guilang.
get(
"GUI_DLG_COPY_ERROR"),
_guilang.
get(
"GUI_DLG_COPY"), wxCENTRE | wxICON_ERROR | wxOK,
this);
2708 wxCopyFile(source_filename.GetFullPath(), target_filename.GetFullPath());
2728 wxFileName target_filename = data->
filename;
2729 wxFileName source_filename = target_filename;
2730 wxTextEntryDialog textentry(
this,
_guilang.
get(
"GUI_DLG_RENAME_QUESTION"),
_guilang.
get(
"GUI_DLG_RENAME"), target_filename.GetName());
2731 int retval = textentry.ShowModal();
2733 if (retval == wxID_CANCEL)
2736 target_filename.SetName(textentry.GetValue());
2738 if (wxFileExists(target_filename.GetFullPath()))
2740 wxMessageBox(
_guilang.
get(
"GUI_DLG_RENAME_ERROR"),
_guilang.
get(
"GUI_DLG_RENAME"), wxCENTRE | wxICON_ERROR | wxOK,
this);
2746 if (manager.
hasRevisions(source_filename.GetFullPath()))
2748 std::unique_ptr<FileRevisions> revisions(manager.
getRevisions(source_filename.GetFullPath()));
2750 if (revisions.get())
2751 revisions->renameFile(source_filename.GetFullName(), target_filename.GetFullName(), manager.
getRevisionPath(target_filename.GetFullPath()));
2754 wxRenameFile(source_filename.GetFullPath(), target_filename.GetFullPath());
2772 if (fileName.length() && wxTheClipboard->Open())
2775 wxTheClipboard->SetData(
new wxTextDataObject(
"\"" + fileName +
"\""));
2776 wxTheClipboard->Close();
2793 if (fileName.length())
2794 ShellExecute(
nullptr,
nullptr, fileName.c_str(),
nullptr,
nullptr, SW_SHOWNORMAL);
2808 wxString filename = data->
filename;
2854 wxString filename = data->
filename;
2856 std::unique_ptr<FileRevisions> revisions(manager.
getRevisions(filename));
2859 if (revisions.get())
2863 wxTextEntryDialog textdialog(
this,
_guilang.
get(
"GUI_DLG_REVISIONDIALOG_PROVIDETAGCOMMENT"),
_guilang.
get(
"GUI_DLG_REVISIONDIALOG_PROVIDETAGCOMMENT_TITLE"), wxEmptyString, wxCENTER | wxOK | wxCANCEL);
2864 int ret = textdialog.ShowModal();
2869 revisions->tagRevision(revisions->getCurrentRevision(), textdialog.GetValue());
2888 if (!fileName.length())
2892 int retval = textentry.ShowModal();
2894 if (retval == wxID_CANCEL)
2897 if (textentry.GetValue().length())
2899 wxString foldername = fileName +
"\\" + textentry.GetValue();
2900 wxMkdir(foldername);
2917 if (wxYES != wxMessageBox(
_guilang.
get(
"GUI_DLG_DELETE_QUESTION", data->
filename.ToStdString()),
_guilang.
get(
"GUI_DLG_DELETE"), wxCENTRE | wxICON_QUESTION | wxYES_NO,
this))
2942 wxArrayString filestoopen;
2945 for (
size_t i = 1; i < wxArgV.size(); i++)
2947 if (wxArgV[i].find(
'.') == std::string::npos)
2950 if (wxArgV[i].find(
".exe") != std::string::npos)
2953 ext =
toLowerCase(wxArgV[i].substr(wxArgV[i].rfind(
'.')).ToStdString());
2958 if (i+1 < wxArgV.size() && wxArgV[i+1] ==
"-e")
2964 filestoopen.Add(wxArgV[i]);
2970 if (i+1 < wxArgV.size() && wxArgV[i+1] ==
"-e")
2976 filestoopen.Add(wxArgV[i]);
2986 if (i+1 < wxArgV.size() && wxArgV[i+1] ==
"-e")
2992 filestoopen.Add(wxArgV[i]);
3001 filestoopen.Add(wxArgV[i]);
3017 if (filestoopen.size())
3043 wxString noname =
_guilang.
get(
"GUI_NEWFILE_UNTITLED") +
" " + wxString::Format (
"%d",
m_fileNum);
3047 #if wxUSE_DRAG_AND_DROP
3051 edit->SetText(
"\r\n");
3054 edit->EmptyUndoBuffer();
3062 wxString filename = defaultfilename;
3070 edit->SetText(
"DIFF");
3089 wxTextEntryDialog* textentry;
3093 if (!defaultfilename.length())
3104 int retval = textentry->ShowModal();
3106 if (retval == wxID_CANCEL)
3113 filename = textentry->GetValue();
3117 filename = defaultfilename;
3120 if (filename.find(
'$') != std::string::npos)
3121 filename.erase(filename.find(
'$'),1);
3126 if (filename.find(
'~') != std::string::npos)
3128 folder = filename.substr(0, filename.rfind(
'~')+1);
3129 filename.erase(0, filename.rfind(
'~')+1);
3132 if (filename.find(
'/') != std::string::npos)
3134 if (folder.length())
3135 folder +=
"/" + filename.substr(0, filename.rfind(
'/')+1);
3137 folder = filename.substr(0, filename.rfind(
'/')+1);
3139 filename.erase(0, filename.rfind(
'/')+1);
3142 if (filename.find(
'\\') != std::string::npos)
3144 if (folder.length())
3145 folder +=
"/" + filename.substr(0, filename.rfind(
'\\')+1);
3147 folder = filename.substr(0, filename.rfind(
'\\')+1);
3149 filename.erase(0, filename.rfind(
'\\')+1);
3153 if (folder.length())
3155 while (folder.find(
'~') != std::string::npos)
3156 folder[folder.find(
'~')] =
'\\';
3157 while (folder.find(
'/') != std::string::npos)
3158 folder[folder.find(
'/')] =
'\\';
3161 if (folder ==
"main\\" && _filetype ==
FILE_NPRC)
3164 folder.insert(0,
"\\");
3171 for (
size_t i = 0; i < folder.length(); i++)
3173 if (!isalnum(folder[i]) && folder[i] !=
'_' && folder[i] !=
'\\' && folder[i] !=
':')
3178 for (
size_t i = 0; i < filename.length(); i++)
3180 if (!isalnum(filename[i]) && filename[i] !=
'_')
3186 wxString template_file, dummy, timestamp;
3190 dummy =
"tmpl_script.nlng";
3192 dummy =
"tmpl_layout.nlng";
3194 dummy =
"tmpl_plugin.nlng";
3196 dummy =
"tmpl_procedure.nlng";
3207 template_file.Replace(
"%%1%%", filename);
3208 template_file.Replace(
"%%2%%", timestamp);
3212 filename +=
".nscr";
3214 filename +=
".nlyt";
3216 filename =
"plgn_" + filename +
".nscr";
3218 filename +=
".nprc";
3226 edit->SetText(template_file);
3245 edit->EmptyUndoBuffer();
3270 edit->SetText(revisionContent);
3271 edit->EmptyUndoBuffer();
3323 wxString template_file, dummy;
3324 dummy =
"tmpl_defaultpage.nlng";
3335#if wxUSE_DRAG_AND_DROP
3341 edit->SetReadOnly(
true);
3363 if (
m_book->GetPageCount() == 0)
3373 pageNr =
m_book->GetSelection();
3376 if ((
int)
m_book->GetPageCount() <= pageNr)
3378 pageNr =
m_book->GetPageCount() - 1;
3386 if (edit->AutoCompActive())
3387 edit->AutoCompCancel();
3389 if (edit->CallTipActive())
3394 m_book->SetSelection(pageNr);
3472 while (
m_book->GetPageCount() > 1)
3492 wxExecute(
"explorer " + filename.GetPath(), wxEXEC_ASYNC,
nullptr,
nullptr);
3513 if (result == wxCANCEL)
3535 pageNr =
m_book->GetSelection();
3545 if(modifiedFileResult == wxCANCEL)
3551 if (
m_book->GetPageCount() > 0)
3556 wxFileName currentFileName;
3563 m_book->DeletePage (pageNr);
3572 wxString noname =
_guilang.
get(
"GUI_NEWFILE_UNTITLED") +
" " + wxString::Format (
"%d",
m_fileNum);
3573 m_book->SetPageText (pageNr, noname);
3575 edit->SetText(
"\r\n");
3576 edit->EmptyUndoBuffer();
3579 if(
m_book->GetPageCount() > 0)
3581 if(currentFileName.IsOk())
3583 int newSelectedPageNum =
GetPageNum(currentFileName);
3601 int cnt =
m_book->GetPageCount();
3602 std::ofstream of_session;
3604 std::string sSession =
"# numere.session: Session save file. Do not edit!\n# ACTIVEFILE\tFILEID\nACTIVEFILEID\t" +
toString(
m_book->GetSelection()) +
"\n# FILENAME\t\tFILEID\t\tCHARPOSITION\t\tSETTING\t\tBOOKMARKS\n";
3606 for (
int i = 0; i < cnt; i++)
3616 if (nReturn == wxCANCEL)
3627 +
"\t" +
toString(edit->GetCurrentPos())
3633 sSession +=
"<NEWFILE>\t" +
toString(i) +
"\t" +
toString(edit->GetCurrentPos()) +
"\n";
3639 for (
int i = 0; i < cnt; i++)
3649 if (of_session.is_open())
3651 of_session << sSession;
3678 int numPages =
m_book->GetPageCount();
3679 wxString filename = fn.GetFullName();
3681 for (
int pageNum = startingTab; pageNum < numPages; pageNum++)
3685 bool fileMatches =
false;
3687 if(compareWholePath)
3746 wxString saveMessage =
"The file ";
3750 if(fileName == wxEmptyString)
3752 int selectedTab =
m_book->GetSelection();
3753 wxString tabText =
m_book->GetPageText(selectedTab);
3755 int idx = tabText.Index(
'*');
3757 if(idx != wxNOT_FOUND)
3759 tabText.Remove(idx, 1);
3763 wxRegEx reLocationPrefix(
"\\((R|L|\\?)\\) ");
3764 reLocationPrefix.Replace(&tabText, wxEmptyString);
3771 saveMessage =
_guilang.
get(
"GUI_UNSAVEDFILE", fileName.ToStdString());
3787 saveMessage +=
" " +
_guilang.
get(
"GUI_UNSAVEDFILE_CLOSE");
3792 saveMessage +=
"Do you want to save them before the file is reloaded?";
3797 saveMessage +=
" " +
_guilang.
get(
"GUI_UNSAVEDFILE_EXECUTE");
3802 int options = wxYES_NO | wxICON_QUESTION | wxCANCEL;
3812 result = wxMessageBox (saveMessage,
_guilang.
get(
"GUI_SAVE_QUESTION"), options);
3814 if (result == wxYES)
3817 m_book->ChangeSelection(pageNr);
3825 wxString errorMessage = fileName +
" could not be saved!";
3826 wxMessageBox (errorMessage,
"File not closed",
3827 wxOK | wxICON_EXCLAMATION);
3856 wxArrayString fnames;
3863 wxFileDialog dlg (
this, _(
_guilang.
get(
"GUI_DLG_OPEN")),
"",
"", filterString, wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
3865 if (dlg.ShowModal() != wxID_OK)
3869 dlg.GetPaths (fnames);
3887 if (filename.GetExt() ==
"nscr"
3888 || filename.GetExt() ==
"nprc"
3889 || filename.GetExt() ==
"nhlp"
3890 || filename.GetExt() ==
"nlng"
3891 || filename.GetExt() ==
"nlyt"
3892 || filename.GetExt() ==
"txt"
3893 || filename.GetExt() ==
"dat"
3894 || filename.GetExt() ==
"log"
3895 || filename.GetExt() ==
"m"
3896 || filename.GetExt() ==
"cpp"
3897 || filename.GetExt() ==
"cxx"
3898 || filename.GetExt() ==
"c"
3899 || filename.GetExt() ==
"hpp"
3900 || filename.GetExt() ==
"hxx"
3901 || filename.GetExt() ==
"h"
3902 || filename.GetExt() ==
"xml"
3903 || filename.GetExt() ==
"tex"
3904 || filename.GetExt() ==
"diff")
3906 wxArrayString filesToOpen;
3907 filesToOpen.Add(filename.GetFullPath());
3911 else if (filename.GetExt() ==
"png"
3912 || filename.GetExt() ==
"jpeg"
3913 || filename.GetExt() ==
"jpg"
3914 || filename.GetExt() ==
"bmp"
3915 || filename.GetExt() ==
"gif"
3916 || filename.GetExt() ==
"tif"
3917 || filename.GetExt() ==
"tiff")
3922 else if (filename.GetExt() ==
"pdf")
3924 else if (filename.GetExt() ==
"npkp")
3928 wxString path =
"load \"" +
replacePathSeparator(filename.GetFullPath().ToStdString()) +
"\" -app -ignore";
3946 for (
size_t i = 0; i < filenameslist.size(); i++)
3965 int firstPageNr = -1;
3966 wxString fileContents = wxEmptyString;
3967 wxString fileNameNoPath;
3969 for (
size_t n = 0; n < fnames.GetCount(); n++)
3971 fileNameNoPath = wxEmptyString;
3972 wxFileName newFileName(fnames[n]);
3998 m_book->SetSelection (pageNr);
4015 g_logger.
info(
"Loading file '" + fnames[n].ToStdString() +
"'.");
4018 if (fnames[n].rfind(
".nscr") != std::string::npos)
4020 else if (fnames[n].rfind(
".nprc") != std::string::npos)
4022 else if (fnames[n].rfind(
".xml") != std::string::npos || fnames[n].rfind(
".nhlp") != std::string::npos)
4032 && (edit->GetText().IsEmpty() || edit->GetText() ==
"\r\n")) || edit->
defaultPage )
4042#if wxUSE_DRAG_AND_DROP
4073 if (firstPageNr < 0)
4079 if (firstPageNr >= 0)
4100 wxFileName fn(fileToLoad);
4101 wxFile file(fileToLoad);
4103 if (!file.IsOpened())
4108 long lng = file.Length();
4112 file.ReadAll(&fileContents, wxConvAuto(wxFONTENCODING_CP1252));
4115 fileName = fn.GetFullName();
4156 for (
size_t i = 0; i <=
PLOTPATH-2; i++)
4160 pathName = vPaths[i+2];
4192 for (
size_t i = 0; i <=
PLOTPATH-2; i++)
4196 pathName = vPaths[i+2];
4201 else if (data->
isDir)
4224 for (
size_t i = 0; i <
m_book->GetPageCount(); i++)
4231 wxToolBar* tb = GetToolBar();
4251 wxToolBar* tb = GetToolBar();
4293 wxFileDialog dlg (
this, title, vPaths[i], edit->
GetFileName().GetName(), filterString,
4294 wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxFD_CHANGE_DIR);
4301 dlg.SetFilterIndex(1);
4305 dlg.SetFilterIndex(0);
4306 else if (sExt ==
"txt")
4307 dlg.SetFilterIndex(1);
4308 else if (sExt ==
"csv")
4309 dlg.SetFilterIndex(2);
4310 else if (sExt ==
"jdx"
4313 dlg.SetFilterIndex(3);
4318 dlg.SetFilterIndex(0);
4319 else if (sExt ==
"log")
4320 dlg.SetFilterIndex(1);
4324 if (dlg.ShowModal() != wxID_OK)
4330 filename = dlg.GetPath();
4334 if (filename.find(
'.') == std::string::npos || filename.find(
'.', filename.rfind(
'\\')) == std::string::npos)
4337 filename +=
".nscr";
4339 filename +=
".nprc";
4358 wxFileName fn(filename);
4386 std::string sPath = filename.ToStdString();
4388 sPath.erase(sPath.rfind(
'/'));
4396 wxMessageBox(
_guilang.
get(
"GUI_DLG_SAVE_ERROR"),
_guilang.
get(
"GUI_DLG_SAVE"), wxCENTRE | wxOK | wxICON_ERROR,
this);
4400 edit->SetSavePoint();
4420 int currentTab =
m_book->GetSelection();
4422 for (
size_t i = 0; i <
m_book->GetPageCount(); i++)
4430 if (
SaveTab(i) && (
int)i == currentTab)
4443 if (currentTab !=
m_book->GetSelection())
4444 m_book->SetSelection(currentTab);
4470 std::ifstream file(sFileName.c_str());
4471 std::string sTargetFileName = sFileName;
4474 std::vector<std::string> vContents;
4478 if (sTargetFileName.substr(0, vPaths[i].length()) == vPaths[i])
4483 sTargetFileName =
"<loadpath>" + sTargetFileName.substr(vPaths[i].length());
4486 sTargetFileName =
"<savepath>" + sTargetFileName.substr(vPaths[i].length());
4489 sTargetFileName =
"<scriptpath>" + sTargetFileName.substr(vPaths[i].length());
4492 sTargetFileName =
"<procpath>" + sTargetFileName.substr(vPaths[i].length());
4495 sTargetFileName =
"<plotpath>" + sTargetFileName.substr(vPaths[i].length());
4506 vContents.push_back(
"<file name=\"" + sTargetFileName +
"\">");
4508 std::string currLine;
4512 std::getline(file, currLine);
4513 vContents.push_back(currLine);
4516 vContents.push_back(
"<endfile>");
4534 wxString filterString;
4539 filterString +=
"|";
4541 filterString +=
"|";
4543 filterString +=
"|";
4575 if (filterString.length())
4576 filterString +=
"|";
4578 return filterString;
4648 std::vector<std::pair<int,wxString> > modifiedFiles =
m_modifiedFiles;
4654 bool refreshProcedureLibrary =
false;
4659 pathsToRefresh.fill(
false);
4661 g_logger.
info(
"File event handler: catched " +
toString(modifiedFiles.size()) +
" file events.");
4664 for (
size_t i = 0; i < modifiedFiles.size(); i++)
4666 wxFileName filename(modifiedFiles[i].second);
4668 if (modifiedFiles[i].first == wxFSW_EVENT_DELETE
4669 || modifiedFiles[i].first == wxFSW_EVENT_CREATE
4670 || modifiedFiles[i].first == wxFSW_EVENT_RENAME)
4677 for (
size_t j =
LOADPATH; j < vPaths.size(); j++)
4688 if (sEventpath.substr(sEventpath.length()-5) ==
".nprc"
4689 || sEventpath.substr(sEventpath.length()-5) ==
".nscr")
4690 refreshProcedureLibrary =
true;
4693 else if (modifiedFiles[i].first == wxFSW_EVENT_MODIFY)
4696 if (!filename.GetExt().length() && wxFileName::DirExists(modifiedFiles[i].second))
4705 if (modifiedFiles[i].second.substr(modifiedFiles[i].second.length()-5) ==
".nprc"
4706 || modifiedFiles[i].second.substr(modifiedFiles[i].second.length()-5) ==
".nscr")
4707 refreshProcedureLibrary =
true;
4715 && (iter->second == 0 || time(0) - iter->second < 5))
4717 g_logger.
info(
"Ignored '" + modifiedFiles[i].second.ToStdString()
4718 +
"' due to last modification time difference: " +
toString((
int)(time(0) - iter->second)));
4722 g_logger.
info(
"Reloading '" + modifiedFiles[i].second.ToStdString()
4723 +
"' due to last modification time difference: " +
toString((
int)(time(0) - iter->second)));
4735 if (filename.IsDir()
4736 || !filename.IsFileReadable()
4737 || !filename.GetModificationTime().IsValid()
4738 || (wxDateTime::Now() - filename.GetModificationTime()).GetSeconds() > 2)
4748 std::unique_ptr<FileRevisions> revisions(manager.
getRevisions(modifiedFiles[i].second));
4749 g_logger.
info(
"Adding external revision to '" + modifiedFiles[i].second.ToStdString() +
"'.");
4751 if (revisions.get())
4752 revisions->addExternalRevision(modifiedFiles[i].second);
4765 for (
size_t i = 0; i < pathsToRefresh.size(); i++)
4767 if (pathsToRefresh[i])
4774 g_logger.
debug(
"All necessary file trees have been refreshed.");
4777 if (refreshProcedureLibrary)
4790 focusedEd->SetFocus();
4805 wxToolBar* tb = GetToolBar();
4863 int pageCount =
m_book->GetPageCount();
4868 wxString tabText =
m_book->GetPageText(
m_book->GetSelection());
4871 std::string sExt =
"";
4879 filename =
_guilang.
get(
"GUI_STATUSBAR_WELCOMEPAGE");
4881 if (filename.find(
'.') != std::string::npos)
4882 sExt = filename.substr(filename.rfind(
'.')+1).ToStdString();
4885 if (tabText.StartsWith(
"<"))
4887 filename =
_guilang.
get(
"GUI_STATUSBAR_UNSAVEDFILE");
4891 filetype =
_guilang.
get(
"GUI_STATUSBAR_WELCOMEPAGE_FILETYPE");
4898 filetype =
_guilang.
get(
"GUI_STATUSBAR_UNKNOWN", sExt);
4901 bool isEdReadOnly = currEd->GetReadOnly();
4903 wxString editable = isEdReadOnly ?
"Read only" :
"Read/Write";
4905 int curLine = focusEd->GetCurrentLine();
4906 int curPos = focusEd->GetColumn(focusEd->GetCurrentPos());
4908 linecol.Printf(_(
_guilang.
get(
"GUI_STATUSBAR_LINECOL")), curLine+1, curPos+1);
4910 wxString sDebuggerMode =
"";
4912 sDebuggerMode =
_guilang.
get(
"GUI_STATUSBAR_DEBUGGER_ANALYZER");
4914 sDebuggerMode =
_guilang.
get(
"GUI_STATUSBAR_DEBUGGER");
4916 sDebuggerMode =
_guilang.
get(
"GUI_STATUSBAR_ANALYZER");
4937 int tabNum =
m_book->GetSelection();
4938 wxString title =
m_book->GetPageText(tabNum);
4942 if (title.find(
"*") == std::string::npos)
4945 m_book->SetPageText(tabNum, title);
4952 if (title.find(
"*") != std::string::npos)
4954 title.RemoveLast(1);
4955 m_book->SetPageText(tabNum, title);
4963 wxMenuBar* mb = GetMenuBar();
4964 WXWidget handle = mb->GetHandle();
5034 switch(variableName)
5047 wxLogDebug(
"Failed to properly set variable. variableName = %d", variableName);
5099 for (
size_t i = 0; i < 5; i++)
5128 for (
int i = 0; i < (int)
m_book->GetPageCount(); i++)
5143 if (
m_book->GetSelection() != wxNOT_FOUND)
5163 wxMenuBar* menuBar = GetMenuBar();
5174 menuBar =
new wxMenuBar();
5175 SetMenuBar(menuBar);
5178 wxMenu* menuNewFile =
new wxMenu();
5181 menuNewFile->AppendSeparator();
5188 wxMenu* menuFile =
new wxMenu();
5190 menuFile->Append(wxID_ANY,
_guilang.
get(
"GUI_MENU_NEWFILE"), menuNewFile,
_guilang.
get(
"GUI_MENU_NEWFILE_TTP"));
5195 menuFile->AppendSeparator();
5198 menuFile->AppendSeparator();
5204 menuBar->Append(menuFile,
_guilang.
get(
"GUI_MENU_FILE"));
5207 wxMenu* menuStripSpaces =
new wxMenu();
5213 wxMenu* menuEdit =
new wxMenu();
5217 menuEdit->AppendSeparator();
5221 menuEdit->AppendSeparator();
5224 menuEdit->AppendSeparator();
5226 menuEdit->Append(wxID_ANY,
_guilang.
get(
"GUI_MENU_STRIP"), menuStripSpaces);
5230 menuBar->Append(menuEdit,
_guilang.
get(
"GUI_MENU_EDIT"));
5233 wxMenu* menuSearch =
new wxMenu();
5237 menuSearch->AppendSeparator();
5241 menuSearch->AppendSeparator();
5247 menuBar->Append(menuSearch,
_guilang.
get(
"GUI_MENU_SEARCH"));
5250 wxMenu* menuView =
new wxMenu();
5255 menuView->AppendSeparator();
5259 menuView->AppendSeparator();
5266 menuBar->Append(menuView,
_guilang.
get(
"GUI_MENU_VIEW"));
5269 wxMenu* menuFormat =
new wxMenu();
5275 wxMenu* menuLaTeX =
new wxMenu();
5281 wxMenu* menuRefactoring =
new wxMenu();
5286 wxMenu* menuAnalyzer =
new wxMenu();
5293 wxMenu* menuExporter =
new wxMenu();
5298 wxMenu* menuTools =
new wxMenu();
5301 menuTools->AppendSeparator();
5303 menuTools->Append(wxID_ANY,
_guilang.
get(
"GUI_MENU_FORMAT"), menuFormat);
5304 menuTools->Append(wxID_ANY,
_guilang.
get(
"GUI_MENU_REFACTORING"), menuRefactoring);
5307 menuTools->AppendSeparator();
5310 menuTools->Append(wxID_ANY,
_guilang.
get(
"GUI_MENU_LATEX"), menuLaTeX);
5311 menuTools->Append(wxID_ANY,
_guilang.
get(
"GUI_MENU_EXPORT"), menuExporter);
5313 menuTools->AppendSeparator();
5314 menuTools->Append(wxID_ANY,
_guilang.
get(
"GUI_MENU_ANALYSIS"), menuAnalyzer);
5317 menuBar->Append(menuTools,
_guilang.
get(
"GUI_MENU_TOOLS"));
5320 wxMenu* menuPackages =
new wxMenu();
5323 menuPackages->AppendSeparator();
5326 menuPackages->AppendSeparator();
5328 item->Enable(
false);
5329 menuBar->Append(menuPackages,
"Packages");
5332 wxMenu *helpMenu =
new wxMenu;
5336 menuBar->Append(helpMenu,
_guilang.
get(
"GUI_MENU_HELP"));
5376 int id = GetMenuBar()->FindMenu(
"Packages");
5378 if (
id == wxNOT_FOUND)
5382 wxMenu* menuPackages = GetMenuBar()->GetMenu(
id);
5388 menuPackages->Delete(iter.first);
5399 if (mMenuMap.size())
5403 for (
auto iter = mMenuMap.begin(); iter != mMenuMap.end(); ++iter,
id++)
5412 item->Enable(
false);
5427 int style = wxTB_FLAT | wxTB_HORIZONTAL;
5435 if (GetToolBar() && GetToolBar()->GetWindowStyle() == style)
5438 wxToolBar* t = GetToolBar();
5440 SetToolBar(
nullptr);
5441 t = CreateToolBar(style);
5444 wxMenu* menuNewFile =
new wxMenu();
5446 menuNewFile->AppendSeparator();
5473 wxBitmap bmIndent(stepnext_xpm);
5477 wxBitmap bmWrapAround(wraparound_xpm);
5481 wxBitmap bmStart(newstart1_xpm);
5484 wxBitmap bmStop(newstop1_xpm);
5489 wxBitmap bmStartDebugger(newcontinue1_xpm);
5493 wxBitmap bmAddBreakpoint(breakpoint_xpm);
5497 wxBitmap bmRemoveBreakpoint(breakpoint_octagon_disable_xpm);
5501 wxBitmap bmClearBreakpoint(breakpoint_crossed_xpm);
5511 wxBitmap bmAnalyzer(gtk_apply_xpm);
5520 db.
addData(
"<>/user/docs/find.ndb");
5595 wxTopLevelWindow::SetTitle(filename +
" - NumeRe: Framework für Numerische Rechnungen (v " +
sVersion +
")");
5713 wxTextEntryDialog dialog(
this,
5716 int ret = dialog.ShowModal();
5718 if (ret == wxID_CANCEL)
5721 int line =
StrToInt(dialog.GetValue().ToStdString())-1;
5723 if (line < 0 || line >= focusEd->GetLineCount())
5727 focusEd->GotoLine(line);
5728 focusEd->SetFocus();
5769 wxWindow* focus = wxWindow::FindFocus();
5776 for (
size_t i = 0; i <
m_book->GetPageCount(); i++)
5811static std::vector<std::string>
tokenize(std::string sKeyList)
5813 std::vector<std::string> vKeyList;
5815 while (sKeyList.length())
5817 vKeyList.push_back(sKeyList.substr(0, sKeyList.find(
' ')));
5818 sKeyList.erase(0, sKeyList.find(
' '));
5820 while (sKeyList.front() ==
' ')
5821 sKeyList.erase(0,1);
5871 wxTreeItemId currentNode;
5872 std::vector<std::string> vDirList;
5876 for (
size_t i = 0; i < vKeyList.size(); i++)
5881 idxFolderOpen, -1, dir);
5884 for (
size_t j = 0; j < vDirList.size(); j++)
5889 m_functionTree->AppendItem(currentNode, vDirList[j].substr(0, vDirList[j].find(
' ')), idxCommands, -1, data);
5898 for (
size_t i = 0; i < vKeyList.size(); i++)
5903 idxFolderOpen, -1, dir);
5906 for (
size_t j = 0; j < vDirList.size(); j++)
5911 m_functionTree->AppendItem(currentNode, vDirList[j].substr(0, vDirList[j].find(
')')+1), idxFunctions, -1, data);
5920 for (
size_t i = 0; i < vKeyList.size(); i++)
5925 idxFolderOpen, -1, dir);
5927 std::string sPrefix = vKeyList[i] ==
"data" ?
"TABLE()" :
"STRINGVAR";
5929 for (
size_t j = 0; j < vDirList.size(); j++)
5934 m_functionTree->AppendItem(currentNode, sPrefix +
"." + vDirList[j].substr(0, vDirList[j].find(
" ")), idxMethods, -1, data);
5943 for (
size_t i = 0; i < vKeyList.size(); i++)
5948 idxFolderOpen, -1, dir);
5951 for (
size_t j = 0; j < vDirList.size(); j++)
5956 m_functionTree->AppendItem(currentNode, vDirList[j].substr(0, vDirList[j].find(
" = ")), idxConstants, -1, data);
5975 size_t nClosingParens = sTooltiptext.find(
')');
5976 std::string sTooltip = sTooltiptext;
5978 if (sTooltiptext.front() ==
'.')
5980 nClosingParens = sTooltip.find(
" ");
5981 sTooltip.replace(nClosingParens, sTooltip.find_first_not_of(
' ', nClosingParens)-nClosingParens,
" -> ");
5983 else if (sTooltiptext.find(
' ') < nClosingParens && sTooltiptext.find(
' ') < sTooltiptext.find(
'('))
5985 nClosingParens = sTooltiptext.find(
' ')-1;
5986 sTooltip.replace(nClosingParens+1, sTooltip.find_first_not_of(
' ', nClosingParens+1)-nClosingParens-1,
" ");
5989 sTooltip.replace(nClosingParens+1, sTooltip.find_first_not_of(
' ', nClosingParens+1)-nClosingParens-1,
" -> ");
6004 wxPrintData* printdata =
new wxPrintData();
6005 printdata->SetPaperId(wxPAPER_A4);
6006 printdata->SetBin(wxPRINTBIN_AUTO);
6007 printdata->SetOrientation(wxPORTRAIT);
6008 printdata->SetQuality(wxPRINT_QUALITY_HIGH);
6009 printdata->SetPrinterName(wxEmptyString);
6030 wxTreeItemId clickedItem =
event.GetItem();
6033 wxString editableExt =
".dat;.txt;.nscr;.nprc;.dx;.jcm;.jdx;.csv;.log;.tex;.xml;.nhlp;.npkp;.cpp;.cxx;.c;.hpp;.hxx;.h;.m;.nlyt;";
6034 wxString loadableExt =
".dat;.txt;.dx;.jcm;.jdx;.xls;.xlsx;.ods;.ndat;.labx;.ibw;.csv;";
6035 wxString showableImgExt =
".png;.jpeg;.jpg;.gif;.bmp;";
6043 if (!data || data->
isDir)
6050 popupMenu.AppendSeparator();
6052 popupMenu.AppendSeparator();
6054 wxPoint p =
event.GetPoint();
6059 fname_ext = fname_ext.substr(fname_ext.rfind(
'.')).Lower() +
";";
6061 if (loadableExt.find(fname_ext) != std::string::npos)
6066 else if (fname_ext ==
".nscr;")
6068 else if (fname_ext ==
".nprc;")
6071 if (editableExt.find(fname_ext) != std::string::npos)
6074 if (showableImgExt.find(fname_ext) != std::string::npos)
6079 popupMenu.AppendSeparator();
6084 popupMenu.AppendSeparator();
6086 popupMenu.AppendSeparator();
6095 wxPoint p =
event.GetPoint();
6100 wxTreeItemId clickedItem =
event.GetItem();
6114 popupMenu.AppendSeparator();
6118 wxPoint p =
event.GetPoint();
6138 wxTreeItemId item =
event.GetItem();
6150 wxTreeItemId rootItem =
m_fileTree->GetRootItem();
6152 if (item != rootItem)
6156 wxFileName pathname = data->
filename;
6162 else if (data->
filename.find(
'.') == std::string::npos || data->
isDir)
6173 wxTreeItemId item =
event.GetItem();
6181 edit->InsertText(edit->GetCurrentPos(), (data->
tooltip).substr(0, (data->
tooltip).find(
' ')+1));
6182 edit->GotoPos(edit->GetCurrentPos()+(data->
tooltip).find(
' ')+1);
6186 edit->InsertText(edit->GetCurrentPos(), (data->
tooltip).substr(0, (data->
tooltip).find(
'(')+1));
6187 edit->GotoPos(edit->GetCurrentPos()+(data->
tooltip).find(
'(')+1);
6191 size_t dot = (data->
tooltip).find(
'.');
6192 size_t endPos = (data->
tooltip).find_first_of(
"( ", dot);
6194 if ((data->
tooltip)[endPos] ==
'(')
6197 edit->InsertText(edit->GetCurrentPos(), (data->
tooltip).substr(dot, endPos-dot));
6198 edit->GotoPos(edit->GetCurrentPos()+endPos-dot);
6202 edit->InsertText(edit->GetCurrentPos(), (data->
tooltip).substr(0, (data->
tooltip).find(
' ')));
6203 edit->GotoPos(edit->GetCurrentPos()+(data->
tooltip).find(
' '));
6222 wxTreeItemId item =
event.GetItem();
6231 event.SetToolTip(data->
tooltip);
6235 wxTreeItemId item =
event.GetItem();
6239 if (!data || data->
isDir)
6245 wxFileName pathname = data->
filename;
6248 if (pathname.GetExt() ==
"nprc")
6256 std::unique_ptr<FileRevisions> revisions(manager.
getRevisions(pathname.GetFullPath()));
6258 if (revisions.get())
6259 tooltip +=
" (" + revisions->getCurrentRevision() +
")";
6263 tooltip.append(80u,
'-');
6270 if (pathname.GetExt() ==
"ndat")
6275 std::unique_ptr<FileRevisions> revisions(manager.
getRevisions(pathname.GetFullPath()));
6277 if (revisions.get())
6278 tooltip +=
"\n(" + revisions->getCurrentRevision() +
")";
6282 event.SetToolTip(tooltip);
6299 wxTreeItemId item =
event.GetItem();
6305 wxString token = data->
tooltip;
6309 size_t dot = token.find(
'.');
6310 size_t endPos = token.find_first_of(
"( ", dot);
6312 if (token[endPos] ==
'(')
6315 token = token.substr(dot, endPos-dot);
6319 token.erase(token.find(
' '));
6321 if (token.find(
'(') != std::string::npos)
6322 token.erase(token.find(
'(')+1);
6327 wxTextDataObject _dataObject(token);
6328 wxDropSource dragSource(
this);
6329 dragSource.SetData(_dataObject);
6330 dragSource.DoDragDrop(wxDrag_AllowMove);
6334 wxTreeItemId item =
event.GetItem();
6338 if (!data || data->
isDir)
6341 wxFileName pathname = data->
filename;
6342 wxString dragableExtensions =
";nscr;nprc;ndat;nlyt;txt;dat;log;tex;csv;xls;xlsx;ods;jdx;jcm;dx;labx;ibw;png;jpg;jpeg;gif;bmp;eps;svg;m;cpp;cxx;c;hpp;hxx;h;";
6344 if (dragableExtensions.find(
";" + pathname.GetExt().Lower() +
";") != std::string::npos)
6346 wxFileDataObject _dataObject;
6347 _dataObject.AddFile(pathname.GetFullPath());
6348 wxDropSource dragSource(
this);
6349 dragSource.SetData(_dataObject);
6350 dragSource.DoDragDrop(wxDrag_AllowMove);
6369 const unsigned int nMAXLINE = 70;
6371 wxString sReturn = sLine;
6373 while (sReturn.find(
"\\$") != std::string::npos)
6374 sReturn.erase(sReturn.find(
"\\$"),1);
6376 unsigned int nDescStart = sReturn.find(
"- ");
6377 unsigned int nIndentPos = 4;
6378 unsigned int nLastLineBreak = 0;
6379 sReturn.replace(nDescStart, 2,
"\n ");
6380 nLastLineBreak = nDescStart;
6382 for (
unsigned int i = nDescStart; i < sReturn.length(); i++)
6384 if (sReturn[i] ==
'\n')
6387 if ((i == nMAXLINE && !nLastLineBreak)
6388 || (nLastLineBreak && i - nLastLineBreak == nMAXLINE))
6390 for (
int j = i; j >= 0; j--)
6392 if (sReturn[j] ==
' ')
6395 sReturn.insert(j+1, nIndentPos,
' ');
6399 else if (sReturn[j] ==
'-' && j != (
int)i)
6403 (sReturn[j-1] ==
' '
6404 || sReturn[j-1] ==
'('
6405 || sReturn[j+1] ==
')'
6406 || sReturn[j-1] ==
'['
6407 || (sReturn[j+1] >=
'0' && sReturn[j+1] <=
'9')
6408 || sReturn[j+1] ==
','
6409 || (sReturn[j+1] ==
'"' && sReturn[j-1] ==
'"')
6413 sReturn.insert(j+1,
"\n");
6414 sReturn.insert(j+2, nIndentPos,
' ');
6415 nLastLineBreak = j+1;
6418 else if (sReturn[j] ==
',' && j != (
int)i && sReturn[j+1] !=
' ')
6420 sReturn.insert(j+1,
"\n");
6421 sReturn.insert(j+2, nIndentPos,
' ');
6422 nLastLineBreak = j+1;
6445 return "\n" +
getFileInfo(filename.GetFullPath().ToStdString());
6463 g_logger.
info(
"Loading files from '" + fromPath.ToStdString() +
"' into file tree.");
6464 wxDir currentDir(fromPath);
6466 currentDir.Traverse(_traverser);
6482 wxEventType type =
event.GetEventType();
6483 wxString findString =
event.GetFindString();
6484 long flags =
event.GetFlags();
6486 int pos = edit->GetCurrentPos();
6488 if ((type == wxEVT_COMMAND_FIND) ||
6489 (type == wxEVT_COMMAND_FIND_NEXT))
6491 pos =
FindString(findString, pos, flags,
true);
6495 wxMessageBox(
_guilang.
get(
"GUI_SEARCH_END", findString.ToStdString()),
6496 _guilang.
get(
"GUI_SEARCH_END_HEAD"), wxOK | wxICON_EXCLAMATION,
this);
6499 else if (type == wxEVT_COMMAND_FIND_REPLACE)
6501 if ((flags & wxFR_MATCHCASE && edit->GetSelectedText() != findString)
6502 || (!(flags & wxFR_MATCHCASE) &&
toLowerCase(edit->GetSelectedText().ToStdString()) !=
toLowerCase(findString.ToStdString())))
6508 pos = edit->GetSelectionStart();
6509 wxString replaceString =
event.GetReplaceString();
6510 edit->ReplaceSelection(replaceString);
6511 edit->EnsureCaretVisible();
6512 edit->SetSelection(pos, pos + replaceString.length());
6514 else if (type == wxEVT_COMMAND_FIND_REPLACE_ALL)
6516 wxString replaceString =
event.GetReplaceString();
6517 if (findString == replaceString)
6524 wxMessageBox(
_guilang.
get(
"GUI_REPLACE_END",
toString(count), findString.ToStdString(), replaceString.ToStdString()),
_guilang.
get(
"GUI_REPLACE_END_HEAD"), wxOK,
this);
6527 else if (type == wxEVT_COMMAND_FIND_CLOSE)
6529 if (wxDynamicCast(event.GetEventObject(), wxDialog))
6531 ((wxDialog*)event.GetEventObject())->Destroy();
6555 if (findString.IsEmpty())
6559 if ((flags & wxFR_MATCHCASE) != 0)
6561 stc_flags |= wxSTC_FIND_MATCHCASE;
6563 if ((flags & wxFR_WHOLEWORD) != 0)
6565 stc_flags |= wxSTC_FIND_WHOLEWORD;
6568 int pos = start_pos == -1 ? edit->GetCurrentPos() : start_pos;
6570 if ((flags & wxFR_DOWN) != 0)
6572 edit->SetTargetStart(wxMax(0, pos));
6573 edit->SetTargetEnd(wxMax(0, edit->GetTextLength()));
6577 if (labs(edit->GetTargetEnd() - edit->GetTargetStart()) ==
long(findString.length()))
6579 pos -= findString.length() + 1;
6582 edit->SetTargetStart(wxMax(0, pos));
6583 edit->SetTargetEnd(0);
6586 edit->SetSearchFlags(stc_flags);
6587 pos = edit->SearchInTarget(findString);
6593 edit->GotoPos(pos+findString.length());
6594 edit->SetSelection(pos, pos + findString.length());
6596 edit->EnsureCaretVisible();
6601 if ((flags & wxFR_DOWN) && start_pos)
6602 return FindString(findString, 0, flags, highlight);
6603 else if (!(flags & wxFR_DOWN) && start_pos != edit->GetLastPosition())
6604 return FindString(findString, edit->GetLastPosition(), flags, highlight);
6628 if (findString.IsEmpty() || (findString == replaceString))
6631 int cursor_pos = edit->GetCurrentPos();
6635 flags &= flags & ~wxFR_WRAPAROUND;
6637 edit->BeginUndoAction();
6638 if (edit->GetSelectedText() == findString)
6641 edit->ReplaceSelection(replaceString);
6644 int pos =
FindString(findString, -1, flags,
true);
6649 edit->ReplaceSelection(replaceString);
6650 pos =
FindString(findString, -1, flags,
true);
6654 edit->GotoPos(wxMin(cursor_pos, edit->GetLength()));
6655 edit->EndUndoAction();
6671 wxSize scr = wxGetDisplaySize();
6674 wxRect rect = GetRect();
6677 rect.width = wxMin (rect.width, (scr.x - rect.x));
6678 rect.height = wxMin (rect.height, (scr.x - rect.y));
6712 if (num != wxNOT_FOUND)
6739 wxString fileContents;
6740 wxString fileNameNoPath;
6747 for (
size_t j = 0; j <
m_book->GetPageCount(); j++)
6754 g_logger.
info(
"Reloading '" + fname.ToStdString() +
"' to editor.");
6760 if (edit->IsModified() && !force)
6763 int answer = wxMessageBox(
_guilang.
get(
"GUI_DLG_FILEMODIFIED_QUESTION", fname.ToStdString()),
_guilang.
get(
"GUI_DLG_FILEMODIFIED"), wxYES_NO | wxICON_QUESTION,
this);
6765 if (answer == wxYES)
6776 int pos = edit->GetCurrentPos();
6835 if (type ==
WT_ALL || type == iter->second)
6839 wxWindow* w = iter->first;
6875 wxWindowList& winlist = GetChildren();
6877 for (
size_t win = 0; win < winlist.GetCount(); win++)
6921 if(fnames.Count() > 0)
6956 if (!sFileName.length())
6962 if (command.rfind(
".nprc") != std::string::npos)
6967 command.erase(command.rfind(
".nprc"));
6971 command.erase(0, vPaths[
PROCPATH].length());
6973 while (command.front() ==
'/')
6974 command.erase(0, 1);
6976 while (command.find(
'/') != std::string::npos)
6977 command[command.find(
'/')] =
'~';
6980 command =
"'" + command +
"'";
6982 command =
"$" + command +
"()";
6984 else if (command.rfind(
".nscr") != std::string::npos)
6989 command.erase(command.rfind(
".nscr"));
6992 command.erase(0, vPaths[
SCRIPTPATH].length());
6994 while (command.front() ==
'/')
6995 command.erase(0, 1);
6997 command =
"start \"" + command +
"\"";
6999 else if (command.rfind(
".nlyt") != std::string::npos)
7004 command.erase(command.rfind(
".nlyt"));
7007 command.erase(0, vPaths[
SCRIPTPATH].length());
7010 command =
"<procpath>" + command.substr(vPaths[
PROCPATH].length());
7012 while (command.front() ==
'/')
7013 command.erase(0, 1);
7015 command =
"window \"" + command +
"\"";
7018 command =
"load \"" + command +
"\" -totable";
7020 command =
"load \"" + command +
"\" -app -ignore";
7073 if (projectFile.length())
7079 if (dlg.ShowModal() == wxID_OK)
7088 if (!procedures.size())
7094 edit->AddText(
"<install>\r\n" + installinfo +
"\r\n");
7096 for (
size_t i = 0; i < procedures.size(); i++)
7098 std::vector<std::string> contents;
7104 for (
size_t j = 0; j < contents.size(); j++)
7106 edit->AddText(
"\t" + contents[j] +
"\r\n");
7109 edit->AddText(
"\r\n");
7114 wxString template_file, dummy;
7118 template_file.Replace(
"%%IDENTIFIER%%", identifier);
7123 edit->AddText(template_file +
"\r\n");
7130 if (docfile.ReadAll(&fcontents))
7131 edit->AddText(fcontents +
"\r\n");
7134 edit->AddText(
"\treturn;\r\n<endinstall>\r\n");
7135 edit->AddText(
"\r\nwarn \"" +
_guilang.
get(
"GUI_PKGDLG_INSTALLERWARNING", identifier.ToStdString()) +
"\"\r\n");
7145 if (wxYES == wxMessageBox(
_guilang.
get(
"GUI_PKGDLG_UPDATEINSTALLED", sPackageName),
7146 _guilang.
get(
"GUI_PKGDLG_UPDATEINSTALLED_HEAD"), wxYES_NO | wxICON_QUESTION,
this))
7148 std::string sPackage = installinfo.ToStdString();
7193 wxCENTER | wxICON_ERROR | wxOK);
7208 std::string file1 = wxFileSelector(
_guilang.
get(
"GUI_DLG_COMPARE_FILE_1"),
"", wxEmptyString, wxEmptyString,
7209 wxFileSelectorDefaultWildcardStr, wxFD_OPEN | wxFD_FILE_MUST_EXIST,
this).ToStdString();
7212 if (!file1.length())
7216 std::string file2 = wxFileSelector(
_guilang.
get(
"GUI_DLG_COMPARE_FILE_1"),
"", wxEmptyString, wxEmptyString,
7217 wxFileSelectorDefaultWildcardStr, wxFD_OPEN | wxFD_FILE_MUST_EXIST,
this).ToStdString();
7220 if (!file2.length())
7226 wxFileName fn1(file1);
7227 wxFileName fn2(file2);
7231 ShowRevision(fn1.GetName() +
"." + fn1.GetExt() +
"-" + fn2.GetName() +
"." + fn2.GetExt() +
".diff", diff);
7250 bool isReplaceDialog =
g_findReplace->GetWindowStyle() & wxFR_REPLACEDIALOG;
7261 int dialogFlags = showFind ? 0 : wxFR_REPLACEDIALOG;
7285 if (result == wxID_OK)
7301 for (
size_t i = 0; i <
m_book->GetPageCount(); i++)
7335 wxPrinter printer (&printDialogData);
7338 if (!printer.Print (
this, &printout,
true))
7340 if (wxPrinter::GetLastError() == wxPRINTER_ERROR)
7342 wxMessageBox (
_guilang.
get(
"GUI_PRINT_ERROR"),
_guilang.
get(
"GUI_PRINT_ERROR_HEAD"), wxOK | wxICON_WARNING);
7347 (*g_printData) = printer.GetPrintDialogData().GetPrintData();
7374 wxMessageBox (
_guilang.
get(
"GUI_PREVIEW_ERROR"),
_guilang.
get(
"GUI_PREVIEW_ERROR_HEAD"), wxOK | wxICON_WARNING);
7379 wxPreviewFrame *frame =
new wxPreviewFrame (preview,
this,
_guilang.
get(
"GUI_PREVIEW_HEAD"));
7380 frame->SetSize (rect);
7381 frame->Centre(wxBOTH);
7382 frame->Initialize();
7399 pageSetupDialog.ShowModal();
7400 (*g_printData) = pageSetupDialog.GetPageSetupData().GetPrintData();
7401 (*g_pageSetupData) = pageSetupDialog.GetPageSetupData();
7416 wxArrayString choices;
7417 choices.Add(
_guilang.
get(
"GUI_MENU_NEW_EMPTYFILE"));
7424 for (
size_t i = 0; i < choices.size(); i++)
7426 if (choices[i].find(
'\t') != std::string::npos)
7427 choices[i].erase(choices[i].find(
'\t'));
7429 if (choices[i].find(
'&') != std::string::npos)
7430 choices[i].erase(choices[i].find(
'&'), 1);
7433 wxSingleChoiceDialog dialog(
this,
_guilang.
get(
"GUI_TB_NEW_SELECT"),
"NumeRe: " +
_guilang.
get(
"GUI_TB_NEW"), choices);
7435 int ret = dialog.ShowModal();
7437 if (ret != wxID_CANCEL)
7439 switch (dialog.GetSelection())
static wxRect determineWindowSize(std::string &sWinSize)
Static helper function to determine the window size and position if necessary.
std::string removeMaskedStrings(const std::string &sString)
This function removes the escape characters from the passed string.
std::string removeQuotationMarks(const std::string &)
This function simply removes the surrounding quotation marks.
wxPageSetupData * g_pageSetupData
FindReplaceDialog * g_findReplace
static std::vector< std::string > tokenize(std::string sKeyList)
Static helper function to tokenize the whitespace-separated list of keys.
wxPrintData * g_printData
global print data, to remember settings during the session
std::string prepareStringsForDialog(const std::string &sString)
const std::string sVersion
#define OPENFILE_BLACKLIST_ADD
#define OPENFILE_BLACKLIST_REMOVE
#define wxSTC_PRINT_BLACKONWHITE
#define wxSTC_PRINT_COLOURONWHITE
std::string toLowerCase(const std::string &)
Converts uppercase to lowercase letters.
This class represents a window, which can be created by the user during run-time by using a layout sc...
This is the implementation of the DDE client of any secondary NumeRe instances.
This class is an implementation of a DDE connection between DDE::Client and DDE::Server.
This class implements the DDE server for the first (main) NumeRe instance.
void OnExecutionFinished()
This member function will inform the debugger window that the execution of the current code has ben f...
void setDebugInfo(const wxString &title, const std::vector< std::string > &vStack)
This member function is used from the main window to update the debugger window with the information ...
void updateSettings()
This member function should be called after the user modified the application settings....
void setTerminal(NumeReTerminal *term)
This class represents a dialog showing the dependencies of a selected procedure file.
void push_info(const std::string &sInfo)
Push a message to the logger, which is not dependend on the logging level and will be shown without a...
void info(const std::string &sMessage)
Convenience member function.
void warning(const std::string &sMessage)
Convenience member function.
void debug(const std::string &sMessage)
Convenience member function.
void error(const std::string &sMessage)
Convenience member function.
void setLoggingLevel(Logger::LogLevel lvl)
Change the logging level or completely disable the logger.
void write_system_information()
A helper function to write the current OS's information to the log file.
This represents the main frame of the documentation browser, which contains the tabbed layout,...
bool SetStartPage(const wxString &docId)
Public interface to set the start page.
This class handles the creation of LaTeX documentation from code files. It will detect documentation ...
std::string createDocumentation(const std::string &sFileName) const
This member function creates a LaTeX documentation from a single file and stores it....
std::string createFullDocumentation(const std::string &sFileName) const
This member function creates a LaTeX documentation from the passed file and all dependent files....
This class represents the notebook containing all editors of one main pane.
void SetTabText(size_t nTab, const wxString &text)
Set a text for the selected editor tab. Note that this function expects a filepath.
void split(size_t pageNum, bool horizontal)
Split the current editor horizontally or vertically (depending on the flag), if it is not already spl...
void SetShowPathsOrIconsOnTabs(bool showText, bool showIcons)
This member function enables/disables the relative paths or icons on the tab and refreshes the tab te...
NumeReEditor * getEditor(size_t pageNum, bool secondary=false)
Returns a pointer to the embedded editor instance. Will return the left or top editor pointer or the ...
void unsplit(size_t pageNum)
Remove the splitted view.
NumeReEditor * createEditor(const wxString &text)
Create a new editor and add it to a new tab automatically. The passed text is used for the tab name.
NumeReEditor * getCurrentEditor(bool secondary=false)
Returns a pointer to the current viewed editor in this notebook. Will return the left or top editor o...
void SetTopParent(NumeReWindow *window)
NumeReEditor * getFocusedEditor()
Returns a pointer to the current focused editor. This will automatically return the secondary editor,...
This class extends the std::vector for endlessness.
This class provides the needed functionalities for the file tree and the symbols tree.
This class implements the basic input/ output file system and provides functionalities to work with f...
std::string ValidFileName(std::string _sFileName, const std::string sExtension=".dat", bool checkExtension=true, bool doCleanPath=true) const
This member function evaluates, whether the passed filename is a valid filename. One may supply a pre...
void setTokens(std::string _sTokens)
This member function may be used to update the path placeholders of the current FileSystem instance.
int setPath(std::string _sPath, bool bMkDir, std::string _sExePath)
This member function may be used to set the preferred file path of the current FileSystem instance.
bool Remove(const wxFileName &path)
bool Add(const wxFileName &path, int events=wxFSW_EVENT_ALL)
bool SetDefaultPaths(const std::vector< std::string > &vPaths)
void set_mode_flag(int flag)
Sets a mode flag (only used to make the cursor invisble).
NumeReSyntax * getSyntax()
int GetIconIndex(wxString iconInfo)
wxImageList * GetImageList()
double getRelation() const
This class handles the internal language system and returns the language strings of the selected lang...
void addToLanguage(const std::map< std::string, std::string > &_langstrings)
This member function adds the contents of the passed language file into the internal map.
void loadStrings(bool bloadUserFiles=true)
This member function loads the language files to the internal map and replaces the named tokens with ...
std::vector< std::string > getList(const std::string &sMessageScheme) const
This member function returns a vector of language strings matching to the passed identifier containin...
std::string get(const std::string &sMessage, const std::vector< std::string > &vTokens) const
This member function returns the language string for the passed language identifier and replaces all ...
This class represents the application controller, which will create the main frame of the actual appl...
virtual bool OnExceptionInMainLoop() override
This handler should be called, if an unhandled exception propagated through the event loop....
DDE::Server * m_DDEServer
virtual bool OnInit() override
"Main program" equivalent: the program execution "starts" here. If we detect an already instance of N...
wxSingleInstanceChecker * m_singlinst
~MyApp()
Empty destructor.
virtual int OnExit() override
Called on application shut down. Will free the memory of the IPC class instances.
This class is an implementation of a database. It will handle the *.ndb data format an provides an in...
std::vector< std::string > getColumn(size_t j) const
This member function will return the whole selected column of the database as a vector<string>....
void addData(const std::string &sDataBaseFile)
This member function will use the passed database file name to update its internal contents (i....
This data container is a copy- efficient table to interchange data between Kernel and GUI.
This class represents an abstract window handled by the window manager.
void updateWindowInformation(int status, const std::string &_return)
This public member function can be used to update the stored window information in the window manager...
WindowType getType() const
const WindowSettings & getWindowSettings() const
The class of the editor window.
void sortSelection(bool ascending=true)
Sorts the lines de- or ascending.
void AddProcedureDocumentation()
This member function handles the creation of documentation blocks in front of procedure heads.
void OnTranspose()
On MenuEvent handler for the transpose functionality of the editor.
void SetEditorFont(const wxFont &font)
Changes the editor's font face.
void SetUnsaved()
Marks the editor as modified.
void ToggleSettings(int _setting)
Enables or disables an editor setting.
void OnClearBreakpoints(wxCommandEvent &event)
void ApplyAutoIndentation(int nFirstLine=0, int nLastLine=-1)
Wrapper for CodeFormatter.
void FindAndOpenProcedure(const wxString &procedurename)
Finds the procedure definition and displays it in the editor.
wxString GetFilenameString()
bool LoadFileText(wxString fileContents)
bool SaveFile(const wxString &filename)
bool InitDuplicateCode()
Displays the duplicated code dialog.
void MoveSelection(bool down=true)
void OnRemoveBreakpoint(wxCommandEvent &event)
bool getEditorSetting(EditorSettings _setting)
Returns true, if the selected setting is active.
bool Modified()
Returns whether the current file was modified after the last time saved.
void FoldAll()
Folds all fold markers.
void OnExtractFormatted()
On MenuEvent handler for the extract as formatted text functionality of the editor.
void OnFindIncludeFromMenu()
Global event handler function for finding the included script.
void toggleBookmark()
Toggles a bookmark marker on the current line.
void ApplyAutoFormat(int nFirstLine=0, int nLastLine=-1)
Wrapper for CodeFormatter.
void JumpToBookmark(bool down=true)
Jumps the cursor to the next bookmark in the current file.
void AdvCallTipCancel()
Simply closes the calltip and resets its associated variables.
void OnFindProcedureFromMenu()
Global event handler function for finding the procedure definition.
void OnExtractAsHTML()
On MenuEvent handler for the extract as HTML functionality of the editor.
void OnAddBreakpoint(wxCommandEvent &event)
void removeWhiteSpaces(int nType=RM_WS_BOTH)
Removes whitespaces depending on the passed type.
void UnfoldAll()
Unfolds all fold markers.
FileFilterType getFileType()
void ToggleCommentLine()
Toggles a line comment.
void SetFilename(wxFileName filename, bool fileIsRemote)
void OnAbstrahizeSectionFromMenu()
Global event handler for extracting the selected section.
void setBookmarks(const std::vector< int > &vBookmarks)
Set the bookmarks in the editor.
void ToggleCommentSelection()
Toggles block comments in a selection.
void AnalyseCode()
Wrapper for the static code analyzer.
void EnsureLineVisibility(int line)
Ensures that the selected line is visible and not hidden bei either a code fold or a explicit line hi...
void OnRenameSymbolsFromMenu()
Global wrapper for RenameSymbols.
void clearBookmarks()
Removes all bookmark markers from the current document.
void FocusOnLine(int linenumber, bool showMarker=true)
void UpdateSyntaxHighlighting(bool forceUpdate=false)
wxString GetFileNameAndPath()
void GotoPipe(int nStartPos=0)
Jumps to the predefined template caret position.
std::vector< int > getBookmarks()
Returns the line positions of the bookmarks.
void OnUnhideAllFromMenu()
Global event handling function to unhide all lines from the main frame's menu.
void UpdateSyntaxHighlighting(bool forceUpdate=false)
Update the syntax highlighting to represent the selected syntax colors.
void AddToHistory(const wxString &commandstring)
Add the passed string at the end of the input history.
void saveHistory()
Save the history to the corresponding file.
ProcedureLibrary & getProcedureLibrary()
void SetStatus(StatusField field, const wxString &sStatusText)
void setProcedureTree(const std::vector< std::string > &vTree)
Set the procedure tree (used for autocompleting).
The terminal class for the GUI. It's a specialisation of the GenericTerminal.
std::vector< std::string > getDocIndex()
Gets the contents of the documentation index as a vector.
NumeReKernel & getKernel()
NumeReVariables getVariableList()
This will return the variable list from the kernel to be shown in the variable viewer.
std::map< std::string, std::string > getPluginLanguageStrings()
This will return the language strings for the plugins used by the language class for filling the symb...
void cutText()
Implements copy to clip board and deleting the selection.
void EndKernelTask()
This function forces the thread to terminate so that the application may be shut down.
NumeRe::Table getTable(const std::string &sTableName)
This function will return the named table from the kernel to be shown in a GUI window.
void copyText()
Implements copy to clip board.
void pasteText()
Implements paste from clip board.
void pass_command(const std::string &command, bool isEvent)
Pass the external command to the kernel without printing it to the console.
void updatePackage(const std::string &package)
Updates an installed package with new information after the user created a package with the package c...
Settings getKernelSettings()
This will return a copy of the internal settings object of the kernel.
void CancelCalculation()
Inform the kernel to stop the current calculation. Used to handle the ESC key press.
void UpdateColors()
This member function sets the new colors to the internal pen definitions.
void clearBreakpoints(const std::string &_sFilename)
This member function removes all breakpoints from the passed file.
std::map< std::string, std::string > getMenuMap()
Returns the menu map of the installed plugins as a STL map.
NumeRe::Container< std::string > getStringTable(const std::string &sStringTableName)
This member function will return the named table containing strings.
std::string getDocumentation(const std::string &sCommand)
Gets the desired documentation article as a HTML string.
void SetParent(NumeReWindow *frame)
virtual void ProcessInput(int len, const std::string &sData) override
Processes text received from the keybord or clipboard.
void setKernelSettings(const Settings &)
This will pass the new kernel settings to the kernel.
std::map< std::string, std::string > getFunctionLanguageStrings()
This will return the language strings for the custom defined functions used by the language class for...
std::vector< std::string > getPathSettings()
Returns the standard paths as a STL vector.
bool SetFont(const wxFont &font)
This class is the actual NumeRe main frame. The application's logic is implemented here.
wxString m_filterNPRCFiles
void editTable(NumeRe::Container< std::string > _stringTable, const std::string &tableDisplayName)
This member function displays the contents of the "string()" table or a cluster and enables editing i...
void OnStatusTimer(wxTimerEvent &event)
std::vector< std::string > GetDocIndex()
This member function returns the documentation index as a vector.
void EvaluateTab()
This member function executes the contents of the editor page connected to the selected tab.
void AddToHistory(const wxString &sCommand)
This function is a wrapper for the corresponding function from the history widget and stores the pass...
void OnPrintPreview()
This member function displays the styled text of the current editor in the print preview window.
void LoadFilesToTree(wxString fromPath, FileFilterType fileType, wxTreeItemId treeid)
This member function loads the file details to the file tree.
void deleteFile()
This member function moves the selected file from the file tree directly to the Windows trash bin,...
void OnPageChange(wxAuiNotebookEvent &event)
void Test(wxCommandEvent &event)
void addToReloadBlackList(const wxString &sFilename)
This member function adds the passed file name to the list of files, which shall not be reloaded auto...
void OnShowRevisions()
This method displays the revision dialog for the selected tree item.
wxString m_filterSupportedFiles
void unregisterWindow(wxWindow *window)
Removes the passed window form the internal window list (only if it exists).
void NewFile(FileFilterType _filetype=FILE_NONSOURCE, const wxString &defaultfilename="")
void OpenFileByType(const wxFileName &filename)
This member function opens the file with the passed name in the corresponding widget (either editor,...
void insertCopiedFile()
This member function copies the selected file in the file tree to the target location in the file tre...
void Ready()
This member function tells NumeRe that it shall display the "ready" state to the user.
wxString m_filterNonsource
void OnTagCurrentRevision()
This method allows the user to tag the current active revision of a file.
std::vector< wxString > vReloadBlackList
void showTable(const wxString &tableName, const wxString &tableDisplayName)
This member function is a wrapper for an event handler of the variable viewer to display the contents...
wxTreeItemId m_copiedTreeItem
void CloseOtherTabs()
This member function closes all other editor tabs except of the current selected one.
void UpdatePackageMenu()
Updates the package menu after an installation.
void OnCopyAsPath()
The member function copies the path of the selected tree item to the clipboard, so that it can be ins...
void showConsole()
This member function unhides the terminal, if it was hidden before.
MyTipProvider * tipProvider
void CreateProcedureTree(const std::string &sProcedurePath)
This member function finds every procedure in the default search path and adds them to the syntax aut...
bool GetFileContents(wxString fileToLoad, wxString &fileContents, wxString &fileName)
wxString getTreePath(const wxTreeItemId &itemId)
This member function returns the paths connected to a specific file or directory in the file tree.
wxRect DeterminePrintSize()
void OnRemoveFolder()
This member function moves the selected directory directly to the Windows trash bin,...
wxString m_filterNumeReFiles
void PassImageList(wxImageList *imagelist)
void OnOpenInExplorer()
This member function uses the Windows shell to open the selected folder in the Windows explorer.
void UpdateTerminalNotebook()
wxString ConstructFilterString(FileFilterType filterType)
void SetIntVar(int variableName, int value)
wxString m_filterNLYTFiles
void openTable(NumeRe::Container< std::string > _stringTable, const std::string &tableDisplayName, const std::string &sIntName)
This member function displays the contents of the "string()" table or a cluster.
void FindAndOpenProcedure(const wxString &procedureName)
Wrapper for the corresponding function of the editor.
void OnTreeItemActivated(wxTreeEvent &event)
void showWindow(NumeRe::Window &window)
This public member function handles the creation of windows requested by the kernel.
void OnPluginMenuEvent(wxCommandEvent &event)
Handles events, which originate from package menu (i.e. graphical plugins).
void OnOpenSourceFile(int id)
This member function opens a file dialog to let the user choose the files to open in the editor.
void Busy()
This member function tells NumeRe that it shall display the "busy" state to the user.
void runLaTeX()
This member function creates the LaTeX documentation files and uses the Windows shell to run the XeLa...
void notifyInstallationDone()
Notifies all instances of the PackagRepoBrowser to refresh its internal list of installed packages an...
std::vector< std::string > getPathDefs()
This member function returns the standard path definitions as a vector.
void compileLaTeX()
This function runs the XeLaTeX compiler on the TeX source in the current editor (if it is a TeX sourc...
bool ShowHelp(const wxString &sDocId)
This member function displays the help page for the selected documentation ID.
wxString m_filterTeXSource
void openImage(wxFileName filename)
This member function opens the selected image in the image viewer window.
IconManager * m_iconManager
wxTreeItemId m_dragDropSourceItem
void forceHistoryPageDown()
This member function is a simple helper to force that the history displays the last line at start-up.
void OpenSourceFile(wxArrayString fnames, unsigned int nLine=0, int nOpenFileFlag=OPENFILE_NOTHING)
Opens the given list of source files in the editor.
ProcedureViewer * m_procedureViewer
void removeFromReloadBlackList(const wxString &sFilename)
This member function removes the passed file name from the list of files, which shall not be reloaded...
FileTree * m_functionTree
wxString m_filterImageFiles
void OnTreeDragDrop(wxTreeEvent &event)
This member function prepares the data to be dragged from one of the both trees.
std::map< wxWindow *, WindowType > m_openedWindows
void OnFindReplace(int id)
This member function displays the find and replace dialog.
void OnAskForNewFile()
This member function catches the new file toolbar button and asks the user for a specific file type.
void ShowRevision(const wxString &revisionName, const wxString &revisionContent)
This member function creates a new editor page and copies the passed revision contents to this page.
std::string m_UnrecoverableFiles
void setViewerFocus()
This member function focuses the last opened ImageViewer window.
int CopyEditorSettings(FileFilterType _fileType)
This member function returns the settings from the current editor for the passed FileFilterType.
void OnShowRevisionsFromTab()
This method displays the revision dialog for the selected tab item.
void InitializeProgramOptions()
This member function loads the configuration file available for the graphical user interface.
TreePanel * m_functionPanel
void showListDialog(NumeRe::Window &window)
This private member function shows a list dialog.
void prepareFunctionTree()
This member function creates the contents of the symbols tree.
std::vector< std::string > getFileForInstaller(const std::string &sLayoutFileName)
This member function obtains the contents of a file and transforms it to be used by an installer scri...
wxTreeItemId m_projectFileFolders[5]
NumeReWindow(const wxString &title, const wxPoint &pos, const wxSize &size)
NumeReEditor * GetCurrentEditor()
Public access method for accessing the currently viewed editor. Does only return a pointer to the top...
std::map< size_t, std::string > m_pluginMenuMap
void PageHasChanged(int pageNr=-1)
int ReplaceAllStrings(const wxString &findString, const wxString &replaceString, int flags=-1)
void OnTreeItemRightClick(wxTreeEvent &event)
void prepareSession()
This member function recreates the last session by reading the session file or creates a new empty se...
std::map< wxString, __time64_t > m_filesLastSaveTime
void showGraph(NumeRe::Window &window)
This private member function displays a graph.
void updateTipAtStartupSetting(bool bTipAtStartup)
This function can be used to deactivate the "Tip of the day" functionality directly from the dialog.
VariableViewer * m_varViewer
bool m_loadingFilesDuringStartup
ProportionalSplitterWindow * m_splitCommandHistory
void OnCompareFiles()
Event handler for comparing two files using the diff functionalities.
wxIcon getStandardIcon()
This public member function returns the default icon usable by different windows.
void showFileDialog(NumeRe::Window &window)
This private member function displays a file dialog.
wxTreeItemId getDragDropSourceItem()
This member function gets the drag-drop source item, if the source was the file tree.
ProportionalSplitterWindow * m_splitEditorOutput
void EvaluateCommandLine(wxArrayString &wxArgV)
This member function evaluates the command line passed to this application at startup and evaluates,...
void OnExecuteFile(const std::string &sFileName, int id)
This function executes the file in the current editor.
void UpdateVarViewer()
This member function gets the current variable list from the kernel and updates the variable viewer w...
wxString m_filterDataFiles
void toggleConsole()
This member function toggles the bottom part of the window containing the terminal and the list view ...
void OnClose(wxCloseEvent &event)
void OnTreeItemToolTip(wxTreeEvent &event)
This member function displays the tooltip requested for the item below the mouse cursor.
void OpenFilesFromList(const wxArrayString &filenameslist)
This member function opens a list of files depending on their type in the correct widget.
wxString getFileDetails(const wxFileName &filename)
This member function displays extended file informations of NDAT files, if this was enabled in the se...
bool isOnReloadBlackList(wxString sFilename)
This member function returns true, if the passed file name is currently part of the list of files,...
void OnOptions()
This member function displays the settings dialog and performs all necessary updates,...
void closeWindows(WindowType type=WT_ALL)
Close all windows of the selected WindowType or simply use WT_ALL to close all terminal-closable floa...
void OnIdle(wxIdleEvent &event)
void OnFileEventTimer(wxTimerEvent &event)
This member function handles the events from the file event timer.
void OnCalculateDependencies()
This member function runs the dependency calculating process in the procedure library.
void evaluateDebugInfo(const std::vector< std::string > &vDebugInfo)
This function will pass the obtained debugging information to the debug viewer. If this object does n...
int * SelectIntVar(int variableName)
wxString m_filterExecutableFiles
wxSplitterWindow * m_splitProjectEditor
int GetPageNum(wxFileName fn, bool compareWholePath=true, int startingTab=0)
void OpenContainingFolder()
This member function uses the Windows shell to open the containing folder of the selected tab in the ...
OptionsDialog * m_optionsDialog
wxTreeItemId m_clickedTreeItem
NumeReStatusbar * m_statusBar
void renameFile()
This member function renames the selected file in the file tree with a new name provided by the user ...
void DefaultPage()
This member function creates a new editor page and copies the contents of the default page template t...
void toggleFiletree()
This member function toggles the left sidebar of the window containing both trees.
std::map< int, wxMenuItem * > m_menuItems
void pass_command(const wxString &command, bool isEvent=false)
This member function is a wrapper for the corresponding terminal function to pass a command to the ke...
ViewerFrame * m_currentView
void OnSplitterDoubleClick(wxSplitterEvent &event)
void OnSaveSourceFile(int id)
This member function saves the file in the current editor.
void showSelectionDialog(NumeRe::Window &window)
This private member function shows a selection dialog.
int GetIntVar(int variableName)
wxFindReplaceData m_findData
void toggleHistory()
This member function toggles the rightmost part of the lower window section containing the history an...
void OnPrintPage()
This member function prints the styled text of the current editor.
void ToolbarStatusUpdate()
NumeReHistory * m_history
void OnFindEvent(wxFindDialogEvent &event)
void createLaTeXFile()
This member function uses the parsed contents from the current editor to create a new LaTeX file from...
wxString m_filterAllFiles
wxString getTreeFolderPath(const wxTreeItemId &itemId)
This member function returns the paths connected to a specific directory in the file tree.
NumeReTerminal * m_terminal
void CloseFile(int pageNr=-1, bool askforsave=true)
Closes a given editor, based on its index in the editor notebook.
DebugViewer * m_debugViewer
void setEditorFocus()
This member function focuses the editor widget.
void showDirDialog(NumeRe::Window &window)
This private member function displays a directory dialog.
wxPrintData * setDefaultPrinterSettings()
This member function sets the default printer settings.
int HandleModifiedFile(int pageNr, ModifiedFileAction fileAction)
Handle user interaction when closing or reloading an editor.
void openPDF(wxFileName filename)
This member function opens a PDF document using the windows shell.
void gotoLine()
This member function opens a text entry dialog, where the user can enter the target line number,...
wxTimer * m_fileEventTimer
void OnPrintSetup()
This member function displays the printing page setup dialog.
void refreshFunctionTree()
This member function is a simple wrapper for refreshing the contents of the function tree.
void reloadFileIfOpen(const wxString &fname, bool force=false)
Reloads a file if it is open in any editor.
wxString getProgramFolder()
This member function returns the application's root path.
void UpdateWindowTitle(const wxString &filename)
This member function updates the application's window title using the current opened file's name.
void OnMenuEvent(wxCommandEvent &event)
void OnCreatePackage(const wxString &projectFile)
This member function launches the package creator dialog and creates the install file,...
void showMessageBox(NumeRe::Window &window)
This private member function displays a message box.
int FindString(const wxString &findString, int start_pos=-1, int flags=-1, bool highlight=TRUE)
void registerWindow(wxWindow *window, WindowType type)
Registers a new window in the internal map.
bool SaveAll(bool refreshLibrary)
Saves all currently opened files to the harddisk.
wxArrayString OpenFile(FileFilterType filterType)
void OnAbout()
This member function displays the "About" dialog.
void OnHelp()
This member function displays the help root page.
wxString GetDocContent(wxString docid)
This member function returns the HTML string containing the documentation for the selected topic/doc ...
void OnFileSystemEvent(wxFileSystemWatcherEvent &event)
This member function handles all events, which result from changes in the file system.
bool SaveTab(int tab)
Saves the file in the selected editor tab.
bool SaveCurrentFile(bool saveas)
Saves the current opened file.
void OnCreateNewFolder()
This member function creates a new folder below the currently selected folder. The name is supplied b...
wxString m_filterNSCRFiles
wxTermContainer * m_termContainer
void showTextEntry(NumeRe::Window &window)
This private member function displays a text entry dialog.
wxString addLinebreaks(const wxString &sLine)
This member function adds line break characters to the passed string to stick below a line length of ...
std::vector< std::pair< int, wxString > > m_modifiedFiles
void UpdateLocationIfOpen(const wxFileName &fname, const wxFileName &newFName)
Updates the editor's and notebook's filename location, if it already opened and not modified.
void CloseTab(bool force)
std::string prepareTooltip(const std::string &sTooltiptext)
This member function prepares the tooltip shown by the symbols tree.
void openHTML(wxString HTMLcontent)
This member function opens a HTML document (a documentation article) in the documentation viewer.
This class represents the settings dialog in memory.
This class implements an interface of the internal Settings object adapted to be usable from the GUI.
static wxFont toFont(const std::string &sFontDescr)
int GetPrintStyle() const
wxFont GetEditorFont() const
void SetEditorFont(wxFont font)
void readColoursFromConfig(wxFileConfig *_config)
Legacy syntax style import function from file configuration.
bool GetSaveSession() const
void SetDebuggerFocusLine(int nLine)
void readAnalyzerOptionsFromConfig(wxFileConfig *_config)
Legacy analyzer import function from file configuration.
int GetTerminalHistorySize() const
bool GetShowToolbarText() const
SyntaxStyles GetSyntaxStyle(size_t i) const
Return the selected syntax style by constructing it from the style string.
bool GetSaveBookmarksInSession() const
bool GetFoldDuringLoading() const
int GetCaretBlinkTime() const
void SetTerminalHistorySize(int size)
void SetLaTeXRoot(const wxString &root)
bool GetKeepBackupFile() const
void SetPrintStyle(int style)
void SetCaretBlinkTime(int nTime)
wxString GetLaTeXRoot() const
This class represents a dialog for creating a package from a set of procedures.
wxArrayString getProcedures()
This member function will create a string array containing the procedure files, which are currently p...
void loadProjectFile(const wxString &filename)
Loads a NumeRe package project file to memory and updates the UI correspondingly.
wxString getPackageIdentifier()
This member function returns the package identifier, which is constructed from the name and only cont...
void setMainFile(const wxString &mainfile)
This function can be used to insert the current mainfile to the dialog. Used by the main window,...
wxString getInstallInfo()
This member function will create the install information section of the package based upon the setted...
bool includeDocs()
This member function returns whether the user selected the "include docs" property.
wxString getPackageName()
This member function returns the name of the package, as been set by the user.
wxString getDocFile()
Returns the user-chosen documentation file.
This class represents a simple browser for the package repository with an install and uninstall capab...
This class manages all already read and possibly pre-parsed procedure files for easier and faster acc...
void setCurrentEditor(NumeReEditor *editor)
This class represents a splitter window, which can controlled using a floating point proportion inste...
void SetCharHeigth(int _charheight)
Change the character height in pixels.
virtual bool SplitVertically(wxWindow *window1, wxWindow *window2, float proportion=0)
Split this window vertically using the selected porportion.
float GetSplitPercentage()
Return the current splitting proportion.
virtual bool SplitHorizontally(wxWindow *window1, wxWindow *window2, float proportion=0)
Split this window horizontally using the selected porportion.
void SetSashPositionFloat(float proportion)
Set the sash position using a floating point proportion.
int recycle(const char *pszPath, bool bDelete=false)
This class represents the dialog listing the file revisions of the current selected file.
This class manages the setting values of the internal (kernel) settings of this application.
std::map< std::string, SettingsValue > & getSettings()
Returns a reference to the internal map of setting values.
bool showHints() const
Returns, whether the tip-of-the-day shall be displayed to the user at application start-up.
bool showExtendedFileInfo() const
Returns, whether the file tree or the terminal file explorer shall display extended file information ...
SettingsValue & getSetting(const std::string &value)
Returns a reference to the setting value, which corresponds to the passed string. Throws an exception...
void copySettings(const Settings &_settings)
This member function is an alias for the assignment operator overload.
bool useCustomLangFiles() const
Returns, whether user language files shall be used to override internal language strings.
bool useDebugger() const
Returns, whether the debugger is currently active.
bool isEnabled(const std::string &option) const
Returns true, if the setting with boolean value type is enabled, false otherwise. If the setting does...
bool & active()
Returns a reference to a boolean value type setting.
size_t & value()
Returns a reference to an unsigned int value type setting.
std::string & stringval()
Returns a reference to a std::string value type setting.
This class is the immutable (const) version of a string view. It can be constructed from a MutableStr...
Common exception class for all exceptions thrown in NumeRe.
std::string getToken() const
Returns the error token containing additional information about the error.
const int * getIndices() const
Returns a pointer to the internal array of 4 error indices.
A table panel with editing functionalities. Creates APPLY and CANCEL buttons and provides their event...
Generic table panel, which also contains all meta UI elements.
void SetTerminal(NumeReTerminal *term)
This class is an adaption of the wxGrid class to present the tabular data in NumeRe's memory and enab...
void SetData(NumeRe::Container< std::string > &_stringTable, const std::string &sName, const std::string &sIntName)
This member function is the data setter for string and cluster tables.
void AddWindows(wxWindow *searchbar, wxWindow *tree)
This class specializes the generic search control to interact with a wxTreeCtrl.
void UpdateVariables(const std::vector< std::string > &vVarList, size_t nNumerics, size_t nStrings, size_t nTables, size_t nClusters, size_t nArguments=0, size_t nGlobals=0)
This member function is used to update the variable list, which is displayed by this control.
bool hasRevisions(const wxString ¤tFile)
This method detects, whether the selected file has revisions.
wxString getRevisionPath(const wxString ¤tFilePath)
This method returns the path, where the revisions are stored.
FileRevisions * getRevisions(const wxString ¤tFile)
This method returns the file revisions as pointer.
This class generalizes a set of basic floating window functionalities like being closable by pressing...
Error class of the parser.
void SetTerminal(NumeReTerminal *terminal)
void SetTerminalHistory(int newSize)
Changes the size of the terminal history buffer.
void SetCaretBlinkTime(int newTime)
Changes the blinking duration of the terminal caret.
std::string compareFiles(const std::string &file1, const std::string &file2)
Compares two files linewise and in binary mode. The differences are returned as a unified diff.
WindowType
This enumeration defines all terminal- closable window types.
@ ID_MENU_TOGGLE_COMMENT_SELECTION
@ ID_MENU_NEW_FOLDER_IN_TREE
@ ID_MENU_BOOKMARK_CLEARMENU
@ ID_MENU_TOGGLE_FILETREE
@ ID_MENU_TOGGLE_NOTEBOOK_MULTIROW
@ ID_MENU_OPEN_FILE_FROM_TREE
@ ID_MENU_BOOKMARK_TOGGLE
@ ID_MENU_INSTALLPLUGINFROMFILE
@ ID_MENU_SORT_SELECTION_DESC
@ ID_MENU_SAVE_SOURCE_REMOTE
@ ID_MENU_RENAME_FILE_IN_TREE
@ ID_MENU_TOGGLE_DEBUGGER
@ ID_MENU_ADDEDITORBREAKPOINT
@ ID_MENU_BOOKMARK_PREVIOUS
@ ID_MENU_REMOVEEDITORBREAKPOINT
@ ID_MENU_SORT_SELECTION_ASC
@ ID_MENU_COPY_FILE_FROM_TREE
@ ID_MENU_STRIP_SPACES_BOTH
@ ID_MENU_CREATE_LATEX_FILE
@ ID_MENU_INSERT_IN_CONSOLE_FROM_TREE
@ ID_MENU_CREATE_DOCUMENTATION
@ ID_MENU_DELETE_FILE_FROM_TREE
@ ID_MENU_CLEAREDITORBREAKPOINTS
@ ID_MENU_SHOW_DESCRIPTION
@ ID_MENU_TRANSPOSESELECTION
@ ID_MENU_EXPORT_FORMATTED
@ ID_MENU_REMOVE_FOLDER_FROM_TREE
@ ID_MENU_OPEN_IN_EXPLORER
@ EVENTID_PLUGIN_MENU_END
@ ID_MENU_STRIP_SPACES_BACK
@ ID_MENU_FIND_DUPLICATES
@ ID_MENU_OPEN_SOURCE_LOCAL
@ ID_MENU_INSERT_IN_EDITOR_FROM_TREE
@ EVENTID_PLUGIN_MENU_START
@ ID_MENU_OPEN_SOURCE_REMOTE
@ ID_MENU_SHOW_DEPENDENCY_REPORT
@ ID_MENU_INSERT_FILE_INTO_TREE
@ ID_MENU_TAG_CURRENT_REVISION
@ ID_MENU_ABSTRAHIZE_SECTION
@ ID_MENU_EDIT_FILE_FROM_TREE
@ ID_MENU_TOGGLE_COMMENT_LINE
@ ID_MENU_SAVE_SOURCE_LOCAL
@ ID_MENU_STRIP_SPACES_FRONT
@ ID_MENU_SHOW_REVISIONS_FROM_TAB
@ ID_MENU_OPEN_FILE_FROM_TREE_TO_TABLE
@ ID_MENU_OPEN_IMAGE_FROM_TREE
std::string replacePathSeparator(const std::string &)
This function replaces the Windows style path sparators to UNIX style.
bool fileExists(const string &)
This function checks, whether the file with the passed file name exists.
static Matrix selection(const MatFuncData &funcData, const MatFuncErrorInfo &errorInfo)
Extracts a selection from a matrix iterating through two matrices simultaneously.
static const char STATUS[]
static const char UBUNTU_VERSION_STYLE[]
CallTip FindProcedureDefinition(const std::string &pathname, const std::string &procedurename)
Search the procedure definition in a global file.
CallTip addLinebreaks(CallTip _cTip, size_t maxLineLength)
Adds the necessary linebreaks to the documentation part of the CallTip to fit inside the desired maxi...
CONSTCD11 std::enable_if<!std::chrono::treat_as_floating_point< T >::value, T >::type trunc(T t) NOEXCEPT
#define PACKAGE_REPO_BROWSER_TITLE
int StrToInt(const std::string &)
Converts a string into an integer.
#define SETTING_B_TOOLBARTEXT
#define SETTING_B_SAVEBOOKMARKS
#define SETTING_B_ICONSONTABS
#define SETTING_V_POS_SASH_T
#define SETTING_B_USEREVISIONS
#define SETTING_B_FORMATBEFORESAVING
#define SETTING_V_POS_SASH_V
#define SETTING_B_SAVESASHS
#define SETTING_B_PROCEDUREARGS
#define SETTING_B_PATHSONTABS
#define SETTING_B_HIGHLIGHTLOCALS
#define SETTING_B_USETABS
#define SETTING_B_SAVEWINDOWSIZE
#define SETTING_B_LINESINSTACK
#define SETTING_B_AUTOSAVEEXECUTION
#define SETTING_S_TERMINALFONT
#define SETTING_S_WINDOWSIZE
#define SETTING_B_GLOBALVARS
#define SETTING_B_MODULESINSTACK
#define SETTING_B_SAVESESSION
#define SETTING_B_DEBUGGER
#define SETTING_B_FOLDLOADEDFILE
#define SETTING_B_SHOWHINTS
#define SETTING_B_PRINTLINENUMBERS
#define SETTING_V_POS_SASH_H
This structure contains the data for a single calltip, which might be shown in the editor or the term...
std::string sDocumentation
This structure combines a vector of declared variables including their values and respective sizes wi...
std::vector< std::string > vVariables
std::string toString(int)
Converts an integer to a string without the Settings bloat.
bool ShowTip(wxWindow *parent, wxTipProvider *tipProvider, const wxArrayString &text, bool showAtStartUp)