20#include "../../kernel/core/ui/language.hpp"
21#include "../../kernel/core/utils/stringtools.hpp"
22#include "../editor/editor.h"
38 ProcedureViewerData(
int nID,
const wxString& procDef,
const wxString& flags,
const wxString& retVal =
"") : ID(nID), procedureDefinition(procDef), procedureFlags(flags), procedureReturnVal(retVal) {}
54 if (viewer->
vData[item1].ID < viewer->
vData[item2].ID)
56 else if (viewer->
vData[item1].ID == viewer->
vData[item2].ID)
60 if (viewer->
vData[item1].procedureFlags < viewer->
vData[item2].procedureFlags)
62 else if (viewer->
vData[item1].procedureFlags == viewer->
vData[item2].procedureFlags)
66 if (viewer->
vData[item1].procedureReturnVal < viewer->
vData[item2].procedureReturnVal)
68 else if (viewer->
vData[item1].procedureReturnVal == viewer->
vData[item2].procedureReturnVal)
110 SetItem(0, 3,
_guilang.
get(
"GUI_PROCEDUREVIEWER_EMPTY"));
114 SetItemFont(0, GetFont().MakeItalic());
115 SetItemTextColour(0, wxColour(128, 128, 128));
126 vData = std::vector<ProcedureViewerData>();
128 AppendColumn(
"Flags");
129 AppendColumn(
"Returns");
130 AppendColumn(
_guilang.
get(
"GUI_PROCEDUREVIEWER_SIGNATURE"));
140 if (sString.find_first_not_of(
' ') != std::string::npos)
142 sString.erase(0, sString.find_first_not_of(
' '));
144 if (sString.find_last_not_of(
' ') != std::string::npos)
145 sString.erase(sString.find_last_not_of(
' ')+1);
188 for (
size_t i = 0; i < vProcedures.size(); i++)
191 procdef = vProcedures[i];
196 if (procdef.find(
"::") != std::string::npos)
198 flags = procdef.substr(procdef.find(
"::")+2);
199 procdef.erase(procdef.find(
"::"));
201 if (flags.find(
"\n") != std::string::npos)
202 flags.erase(flags.find(
"\n"));
204 if (flags.find(
"->") != std::string::npos)
206 returns = flags.substr(flags.find(
"->")+2);
207 flags.erase(flags.find(
"->"));
214 if (procdef.find(
"\n") != std::string::npos)
215 procdef.erase(procdef.find(
"\n"));
217 if (procdef.find(
"->") != std::string::npos)
219 returns = procdef.substr(procdef.find(
"->")+2);
220 procdef.erase(procdef.find(
"->"));
235 SetItem(i, 1, flags);
236 SetItem(i, 2, returns);
237 SetItem(i, 3, procdef);
244 if (flags.find(
"local") == std::string::npos)
245 SetItemFont(i, GetFont().MakeBold());
257 if (vProcedures.size())
259 SetColumnWidth(0, wxLIST_AUTOSIZE);
260 SetColumnWidth(1, wxLIST_AUTOSIZE);
262 if (GetColumnWidth(1) < 50)
263 SetColumnWidth(1, 50);
265 SetColumnWidth(2, wxLIST_AUTOSIZE);
267 if (GetColumnWidth(2) < 55)
268 SetColumnWidth(2, 55);
270 SetColumnWidth(3, wxLIST_AUTOSIZE);
272 if (GetColumnWidth(3) < 250)
273 SetColumnWidth(3, 250);
277 SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER);
278 SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER);
279 SetColumnWidth(2, wxLIST_AUTOSIZE_USEHEADER);
280 SetColumnWidth(3, wxLIST_AUTOSIZE);
299 if (!
vData[event.GetData()].procedureDefinition.length())
302 wxString sProcDef =
vData[
event.GetData()].procedureDefinition.substr(0,
vData[event.GetData()].procedureDefinition.find(
'('));
std::string toLowerCase(const std::string &)
Converts uppercase to lowercase letters.
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 ...
The class of the editor window.
void registerProcedureViewer(ProcedureViewer *viewer)
Registers the passed procedure viewer.
void FindAndOpenProcedure(const wxString &procedurename)
Finds the procedure definition and displays it in the editor.
std::vector< wxString > getProceduresInFile()
Wrapper for the search controller.
void updateProcedureList(const std::vector< wxString > &vProcedures)
void stripSpaces(wxString &sString)
void OnItemClick(wxListEvent &event)
void OnColumnClick(wxListEvent &event)
void setCurrentEditor(NumeReEditor *editor)
std::vector< ProcedureViewerData > vData
ProcedureViewer(wxWindow *parent)
NumeReEditor * m_currentEd
void getProcedureListFromEditor()
int wxCALLBACK ProcedureViewerCompare(wxIntPtr item1, wxIntPtr item2, wxIntPtr parent)
wxString procedureReturnVal
wxString procedureDefinition
ProcedureViewerData(int nID, const wxString &procDef, const wxString &flags, const wxString &retVal="")
std::string toString(int)
Converts an integer to a string without the Settings bloat.