5#include <wx/fileconf.h>
11#include "../kernel/core/settings.hpp"
12#include "../kernel/core/utils/stringtools.hpp"
16#define wxSTC_PRINT_BLACKONWHITE 2
19#define wxSTC_PRINT_COLOURONWHITE 3
45 wxArrayString channels = wxStringTokenize(colorstring,
":");
46 return wxColour(
StrToInt(channels[0].ToStdString()),
StrToInt(channels[1].ToStdString()),
StrToInt(channels[2].ToStdString()));
60 unsigned char channel_r =
StrToInt(colorstring.substr(0,3).ToStdString());
61 unsigned char channel_g =
StrToInt(colorstring.substr(3,3).ToStdString());
62 unsigned char channel_b =
StrToInt(colorstring.substr(6,3).ToStdString());
63 return wxColour(channel_r, channel_g, channel_b);
77 wxArrayString styles = wxStringTokenize(styleDef,
"-");
82 bold = styles[2][0] ==
'1';
99 if (styleDef.length() < 21)
105 if (styleDef[18] ==
'1')
108 if (styleDef[19] ==
'1')
111 if (styleDef[20] ==
'1')
114 if (styleDef.length() > 21)
116 if (styleDef[21] ==
'0')
137 style +=
bold ?
"1" :
"0";
161 if (styleDef.find(
':') != std::string::npos)
188 font.SetEncoding(wxFONTENCODING_CP1252);
348 static wxFont
toFont(
const std::string& sFontDescr)
351 font.SetNativeFontInfoUserDesc(sFontDescr);
357 font.SetEncoding(wxFONTENCODING_CP1252);
358 return font.GetNativeFontInfoUserDesc().ToStdString();
#define wxSTC_PRINT_BLACKONWHITE
#define wxSTC_PRINT_COLOURONWHITE
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.
bool GetShowModulesInStackTrace() const
static wxFont toFont(const std::string &sFontDescr)
void SetShowModulesInStackTrace(bool show)
std::string analyzerOptsToString(AnalyzerOptions opt) const
Convert the static code analyzer enumeration values into the new settings strings.
void SetSyntaxStyle(size_t i, const SyntaxStyles &styles)
Update a selected syntax style by converting the passed SyntaxStyles object into a style string and s...
size_t GetIdByIdentifier(const wxString &identifier) const
This member function returns the ID of a syntax style by passing the style identifier as a string.
bool GetHighlightLocalVariables() const
int GetPrintStyle() const
wxFont GetEditorFont() const
void SetEditorFont(wxFont font)
bool GetShowGlobalVariables() const
Styles
An enumeration of all available syntax styles.
bool GetShowProcedureArguments() const
void readColoursFromConfig(wxFileConfig *_config)
Legacy syntax style import function from file configuration.
void SetShowGlobalVariables(bool show)
void SetShowToolbarText(bool useText)
bool GetFormatBeforeSaving() const
void SetKeepBackupFile(bool keepFile)
bool GetLineNumberPrinting() const
int GetAnalyzerOption(AnalyzerOptions opt) const
Return the value of the selected static code analyzer option.
void SetHighlightLocalVariables(bool highlight)
bool GetSaveSession() const
void SetDebuggerFocusLine(int nLine)
AnalyzerOptions
An enumeration of all available static analyzer options.
void SetShowLinesInStackTrace(bool show)
void readAnalyzerOptionsFromConfig(wxFileConfig *_config)
Legacy analyzer import function from file configuration.
int GetTerminalHistorySize() const
void SetShowPathOnTabs(bool useText)
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)
int GetDebuggerFocusLine() const
void SetFormatBeforeSaving(bool formatBeforeSave)
SyntaxStyles GetDefaultSyntaxStyle(size_t i) const
Return the default syntax style as defined by the programmers.
void SetLaTeXRoot(const wxString &root)
bool GetKeepBackupFile() const
void SetSaveSession(bool saveSession)
bool GetShowPathOnTabs() const
void SetPrintStyle(int style)
bool GetShowLinesInStackTrace() const
void SetFoldDuringLoading(bool fold)
void SetLineNumberPrinting(bool printLineNumbers)
void SetCaretBlinkTime(int nTime)
wxArrayString GetStyleIdentifier() const
This member function returns an array of the style enumeration identifiers converted to a string.
wxString GetLaTeXRoot() const
void SetAnalyzerOption(AnalyzerOptions opt, int nVal)
Change a static code analyzer setting.
void SetSaveBookmarksInSession(bool save)
void SetShowProcedureArguments(bool show)
static std::string toString(wxFont font)
std::string syntaxStylesToString(Styles style) const
Convert the syntax style enumeration values into the new settings strings.
This class manages the setting values of the internal (kernel) settings of this application.
std::map< std::string, SettingsValue > m_settings
void save(const std::string &_sWhere, bool bMkBackUp=false)
Saves the setting values to the corresponding config file. Does only save the setting values,...
int StrToInt(const std::string &)
Converts a string into an integer.
#define SETTING_B_TOOLBARTEXT
#define SETTING_B_SAVEBOOKMARKS
#define SETTING_B_USEREVISIONS
#define SETTING_B_FORMATBEFORESAVING
#define SETTING_S_EDITORFONT
#define SETTING_S_LATEXROOT
#define SETTING_V_FOCUSEDLINE
#define SETTING_B_PROCEDUREARGS
#define SETTING_B_PATHSONTABS
#define SETTING_B_HIGHLIGHTLOCALS
#define SETTING_B_LINESINSTACK
#define SETTING_V_BUFFERSIZE
#define SETTING_B_GLOBALVARS
#define SETTING_B_MODULESINSTACK
#define SETTING_B_PRINTINCOLOR
#define SETTING_B_SAVESESSION
#define SETTING_B_FOLDLOADEDFILE
#define SETTING_B_PRINTLINENUMBERS
#define SETTING_V_CARETBLINKTIME
This structure contains the necessary data to completely define a style for a distinctive syntax elem...
wxColour StrToColorNew(const wxString &colorstring) const
Convert a colorstring (r:g:b) into an actual color instance.
void importOld(const wxString &styleDef)
Imports an old syntax style string (rrrgggbbbrrrgggbbbBIUD) and converts it into actual usable variab...
std::string to_string() const
Transforms the internal data into a string style representation according the following scheme: r:g:b...
SyntaxStyles()
Default constructor. Creates a "style- less" style.
void importNew(const wxString &styleDef)
Imports a new syntax style string (r:g:b-r:g:b-BIUD) and converts it into actual usable variables.
SyntaxStyles(const wxString &styleDef)
Generic constructor. Creates an instance of this class by importing a style string in new or old fash...
wxColour StrToColorOld(const wxString &colorstring) const
Convert a colorstring of the old representation (rrrgggbbb) into an actual color instance.
std::string toString(int)
Converts an integer to a string without the Settings bloat.