NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
#include "winlayout.hpp"
#include "../utils/tinyxml2.h"
#include "../io/styledtextfile.hpp"
#include "../../kernel.hpp"
#include "../procedure/includer.hpp"
#include <stack>
#include <memory>
Go to the source code of this file.
Functions | |
std::string | removeQuotationMarks (const std::string &sString) |
This function simply removes the surrounding quotation marks. More... | |
static std::string | parseNumOpt (const std::string &sCmd, size_t pos) |
This static function parses a numerical argument. More... | |
static std::string | parseStringOpt (const std::string &sCmd, size_t pos) |
This static function parses a string option. More... | |
static std::string | parseEventOpt (const std::string &sCmd, size_t pos, const std::string &sFolderName) |
This static function parses a event argument. More... | |
static void | evaluateExpression (std::string &sExpr) |
This static function evaluates the expression part of each window layout command. More... | |
static void | parseLayoutCommand (const std::string &sLayoutCommand, tinyxml2::XMLElement *layoutElement, const std::string &sFolderName) |
This static function parses a single layout command into a usable XML element. More... | |
static std::string | parseLayoutScript (std::string &sLayoutScript, tinyxml2::XMLDocument *layout) |
This static function parses a layout script into a xml data container usable by the GUI. Returns the name of the onopen event handler, if any. More... | |
static int | getItemId (const std::string &sCmd) |
This static function returns the item id from the user command string. It is also handled if the user erroneously uses "id" instead "item". More... | |
static NumeRe::WindowInformation | getWindow (const std::string &sExpr) |
This static function returns the window information describing the window with the selected ID. More... | |
static void | getParametersFromWindow (CommandLineParser &cmdParser, const std::string &sExpr) |
This static function handles property reads from windows. More... | |
static void | setParametersInWindow (CommandLineParser &cmdParser, const std::string &sExpr) |
This static function handles property writes in windows. More... | |
void | windowCommand (CommandLineParser &cmdParser) |
This function is the actual implementation of the window command. More... | |
static std::string | getProcedureFileName (std::string sProc) |
Converts a full-qualified procedure name into the corresponding file name. More... | |
std::vector< std::string > | getEventProcedures (const std::string &sLayoutFile) |
Examines a window layout file and searches for all event handler procedures. Returns their corresponding filenames as a vector. Might contain duplicates. More... | |
void | dialogCommand (CommandLineParser &cmdParser) |
This function is the actual implementation of the dialog command. More... | |
void dialogCommand | ( | CommandLineParser & | cmdParser | ) |
This function is the actual implementation of the dialog
command.
cmdParser | CommandLineParser& |
Definition at line 770 of file winlayout.cpp.
References NumeRe::WindowManager::createWindow(), NumeRe::CTRL_CANCELBUTTON, NumeRe::CTRL_FILEDIALOG, NumeRe::CTRL_FOLDERDIALOG, NumeRe::CTRL_ICONERROR, NumeRe::CTRL_ICONINFORMATION, NumeRe::CTRL_ICONQUESTION, NumeRe::CTRL_ICONWARNING, NumeRe::CTRL_LISTDIALOG, NumeRe::CTRL_MESSAGEBOX, NumeRe::CTRL_NONE, NumeRe::CTRL_OKBUTTON, NumeRe::CTRL_SELECTIONDIALOG, NumeRe::CTRL_TEXTENTRY, NumeRe::CTRL_YESNOBUTTON, NumeRe::StringParser::evalAndFormat(), findParameter(), getArgAtPos(), CommandLineParser::getCommandLine(), CommandLineParser::getExpr(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), getNextArgument(), CommandLineParser::getParameterList(), CommandLineParser::getParameterValueAsString(), NumeReKernel::getStringParser(), NumeRe::WindowManager::getWindowInformationModal(), NumeReKernel::getWindowManager(), NumeRe::StringParser::isStringExpression(), SyntaxError::NO_DEFAULTVALUE_FOR_DIALOG, removeQuotationMarks(), replacePathSeparator(), CommandLineParser::setReturnValue(), NumeRe::WindowInformation::sReturn, FileSystem::ValidFolderName(), and NumeRe::WINDOW_MODAL.
Referenced by cmd_dialog().
|
static |
This static function evaluates the expression part of each window layout command.
sExpr | std::string& |
Definition at line 117 of file winlayout.cpp.
References FunctionDefinitionManager::call(), MemoryManager::containsTablesOrClusters(), mu::ParserBase::Eval(), NumeRe::StringParser::evalAndFormat(), SyntaxError::FUNCTION_ERROR, getDataElements(), NumeReKernel::getDefinitions(), NumeReKernel::getInstance(), NumeReKernel::getMemoryManager(), NumeReKernel::getParser(), NumeReKernel::getSettings(), NumeReKernel::getStringParser(), NumeRe::StringParser::isStringExpression(), mu::ParserBase::SetExpr(), NumeRe::StringParser::STRING_SUCCESS, and toString().
Referenced by parseLayoutCommand().
std::vector< std::string > getEventProcedures | ( | const std::string & | sLayoutFile | ) |
Examines a window layout file and searches for all event handler procedures. Returns their corresponding filenames as a vector. Might contain duplicates.
sLayoutFile | const std::string& |
Definition at line 723 of file winlayout.cpp.
References findParameter(), StyledTextFile::getLinesCount(), getProcedureFileName(), StyledTextFile::getStrippedLine(), and parseEventOpt().
Referenced by PackageDialog::findLayoutDependencies(), and DocumentationGenerator::followBranch().
|
static |
This static function returns the item id from the user command string. It is also handled if the user erroneously uses "id" instead "item".
sCmd | const std::string& |
Definition at line 407 of file winlayout.cpp.
References ARGEXTRACT_ASINT, ARGEXTRACT_PARSED, ARGEXTRACT_STRIPPED, findParameter(), getArgAtPos(), and StrToInt().
Referenced by getParametersFromWindow(), and setParametersInWindow().
|
static |
This static function handles property reads from windows.
cmdParser | CommandLineParser& |
sExpr | const std::string& |
Definition at line 450 of file winlayout.cpp.
References Indices::col, findParameter(), getArgAtPos(), CommandLineParser::getCommandLine(), NumeReKernel::getInstance(), NumeRe::Window::getItemColor(), getItemId(), NumeRe::Window::getItemLabel(), NumeRe::Window::getItemState(), NumeRe::Window::getItemValue(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterList(), NumeRe::Window::getPropValue(), CommandLineParser::getTargetTable(), getWindow(), MemoryManager::importTable(), SyntaxError::INVALID_WINDOW_ID, NumeRe::WindowInformation::nStatus, Indices::row, CommandLineParser::setReturnValue(), NumeRe::STATUS_RUNNING, NumeRe::WinItemValue::stringValue, NumeRe::WinItemValue::tableValue, NumeRe::WinItemValue::type, and NumeRe::WindowInformation::window.
Referenced by windowCommand().
|
static |
Converts a full-qualified procedure name into the corresponding file name.
sProc | std::string |
Definition at line 690 of file winlayout.cpp.
References NumeReKernel::getInstance(), NumeReKernel::getProcedureInterpreter(), and FileSystem::ValidFileName().
Referenced by getEventProcedures().
|
static |
This static function returns the window information describing the window with the selected ID.
sExpr | const std::string& |
Definition at line 427 of file winlayout.cpp.
References getDataElements(), NumeReKernel::getInstance(), NumeReKernel::getParser(), NumeRe::WindowManager::getWindowInformation(), NumeReKernel::getWindowManager(), intCast(), and mu::ParserBase::SetExpr().
Referenced by getParametersFromWindow(), NumeReKernel::numberOfNumbersPerLine(), setParametersInWindow(), and windowCommand().
|
static |
This static function parses a event argument.
sCmd | const std::string& |
pos | size_t |
sFolderName | const std::string& |
Definition at line 79 of file winlayout.cpp.
References getArgAtPos(), NumeReKernel::getInstance(), Settings::getProcPath(), NumeReKernel::getSettings(), and replaceAll().
Referenced by getEventProcedures(), parseLayoutCommand(), and parseLayoutScript().
|
static |
This static function parses a single layout command into a usable XML element.
sLayoutCommand | const std::string& |
layoutElement | tinyxml2::XMLElement* |
sFolderName | const std::string& |
Definition at line 169 of file winlayout.cpp.
References evaluateExpression(), findParameter(), getArgAtPos(), min, parseEventOpt(), parseNumOpt(), parseStringOpt(), replaceAll(), tinyxml2::XMLElement::SetAttribute(), tinyxml2::XMLElement::SetText(), and StripSpaces().
Referenced by parseLayoutScript().
|
static |
This static function parses a layout script into a xml data container usable by the GUI. Returns the name of the onopen event handler, if any.
sLayoutScript | std::string& |
layout | tinyxml2::XMLDocument* |
Definition at line 233 of file winlayout.cpp.
References SyntaxError::CANNOT_READ_FILE, SymDefManager::createSymbol(), findCommand(), findParameter(), tinyxml2::XMLNode::FirstChild(), getArgAtPos(), NumeReKernel::getInstance(), StyledTextFile::getLinesCount(), NumeReKernel::getScript(), StyledTextFile::getStrippedLine(), tinyxml2::XMLNode::InsertEndChild(), tinyxml2::XMLNode::InsertFirstChild(), SyntaxError::invalid_position, Includer::is_including_syntax(), min, tinyxml2::XMLDocument::NewElement(), Match::nPos, parseEventOpt(), parseLayoutCommand(), parseNumOpt(), parseStringOpt(), replaceAll(), SymDefManager::resolveSymbols(), tinyxml2::XMLElement::SetAttribute(), tinyxml2::XMLElement::SetText(), Match::sString, StripSpaces(), and FileSystem::ValidFileName().
Referenced by windowCommand().
|
static |
This static function parses a numerical argument.
sCmd | const std::string& |
pos | size_t |
Definition at line 40 of file winlayout.cpp.
References ARGEXTRACT_PARSED, ARGEXTRACT_STRIPPED, and getArgAtPos().
Referenced by parseLayoutCommand(), parseLayoutScript(), and setParametersInWindow().
|
static |
This static function parses a string option.
sCmd | const std::string& |
pos | size_t |
Definition at line 55 of file winlayout.cpp.
References ARGEXTRACT_PARSED, getArgAtPos(), and StripSpaces().
Referenced by parseLayoutCommand(), and parseLayoutScript().
std::string removeQuotationMarks | ( | const std::string & | sString | ) |
This function simply removes the surrounding quotation marks.
sString | const std::string& |
Definition at line 79 of file stringfunctions.hpp.
Referenced by dialogCommand(), and windowCommand().
|
static |
This static function handles property writes in windows.
cmdParser | CommandLineParser& |
sExpr | const std::string& |
Definition at line 505 of file winlayout.cpp.
References ARGEXTRACT_PARSED, Indices::col, MemoryManager::containsTables(), MemoryManager::extractTable(), findParameter(), getArgAtPos(), CommandLineParser::getCommandLine(), DataAccessParser::getDataObject(), DataAccessParser::getIndices(), NumeReKernel::getInstance(), getItemId(), NumeReKernel::getMemoryManager(), CommandLineParser::getParameterList(), CommandLineParser::getParameterValueAsString(), getWindow(), SyntaxError::INVALID_WINDOW_ID, NumeRe::WindowInformation::nStatus, parseNumOpt(), Indices::row, NumeRe::Window::setItemColor(), NumeRe::Window::setItemLabel(), NumeRe::Window::setItemState(), NumeRe::Window::setItemValue(), NumeRe::Window::setPropValue(), CommandLineParser::setReturnValue(), NumeRe::STATUS_RUNNING, NumeRe::WinItemValue::stringValue, NumeRe::WinItemValue::tableValue, toString(), and NumeRe::WindowInformation::window.
Referenced by windowCommand().
void windowCommand | ( | CommandLineParser & | cmdParser | ) |
This function is the actual implementation of the window
command.
cmdParser | CommandLineParser& |
Definition at line 572 of file winlayout.cpp.
References NumeRe::Window::closeWindow(), mu::ParserBase::CreateTempVectorVar(), NumeRe::WindowManager::createWindow(), NumeRe::Window::creationFinished(), NumeRe::StringParser::evalAndFormat(), findParameter(), getArgAtPos(), CommandLineParser::getCommandLine(), CommandLineParser::getExpr(), NumeReKernel::getInstance(), CommandLineParser::getParameterList(), getParametersFromWindow(), NumeReKernel::getParser(), NumeRe::Window::getProperties(), NumeReKernel::getStringParser(), getWindow(), NumeRe::WindowManager::getWindowInformation(), NumeRe::Window::getWindowItems(), NumeReKernel::getWindowManager(), SyntaxError::INVALID_WINDOW_ID, NumeRe::WindowInformation::nStatus, parseLayoutScript(), removeQuotationMarks(), setParametersInWindow(), CommandLineParser::setReturnValue(), NumeRe::STATUS_RUNNING, StripSpaces(), toString(), and NumeRe::WindowInformation::window.
Referenced by cmd_window().