2003-09-18 01:05:52 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2006-02-10 06:59:52 -05:00
|
|
|
// File: contrib/samples/stc/prefs.cpp
|
2003-09-18 01:05:52 -04:00
|
|
|
// Purpose: STC test Preferences initialization
|
|
|
|
// Maintainer: Wyo
|
|
|
|
// Created: 2003-09-01
|
|
|
|
// Copyright: (c) wxGuide
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2006-02-10 06:59:52 -05:00
|
|
|
// For compilers that support precompilation, includes "wx/wx.h".
|
2005-09-16 14:25:44 -04:00
|
|
|
#include "wx/wxprec.h"
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
// for all others, include the necessary headers (this file is usually all you
|
2004-05-25 07:20:37 -04:00
|
|
|
// need because it includes almost all 'standard' wxWidgets headers)
|
2003-09-18 01:05:52 -04:00
|
|
|
#ifndef WX_PRECOMP
|
2005-09-16 14:25:44 -04:00
|
|
|
#include "wx/wx.h"
|
2003-09-18 01:05:52 -04:00
|
|
|
#endif
|
|
|
|
|
2004-05-25 07:20:37 -04:00
|
|
|
//! wxWidgets headers
|
2003-09-18 01:05:52 -04:00
|
|
|
|
2004-05-25 07:20:37 -04:00
|
|
|
//! wxWidgets/contrib headers
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
//! application headers
|
|
|
|
#include "defsext.h" // Additional definitions
|
|
|
|
#include "prefs.h" // Preferences
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
// declarations
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//! language types
|
|
|
|
const CommonInfo g_CommonPrefs = {
|
|
|
|
// editor functionality prefs
|
|
|
|
true, // syntaxEnable
|
|
|
|
true, // foldEnable
|
|
|
|
true, // indentEnable
|
|
|
|
// display defaults prefs
|
|
|
|
false, // overTypeInitial
|
|
|
|
false, // readOnlyInitial
|
|
|
|
false, // wrapModeInitial
|
|
|
|
false, // displayEOLEnable
|
|
|
|
false, // IndentGuideEnable
|
|
|
|
true, // lineNumberEnable
|
|
|
|
false, // longLineOnEnable
|
|
|
|
false, // whiteSpaceEnable
|
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// keywordlists
|
|
|
|
// C++
|
2008-02-12 17:53:30 -05:00
|
|
|
const char* CppWordlist1 =
|
2008-01-09 09:35:11 -05:00
|
|
|
"asm auto bool break case catch char class const const_cast "
|
|
|
|
"continue default delete do double dynamic_cast else enum explicit "
|
|
|
|
"export extern false float for friend goto if inline int long "
|
|
|
|
"mutable namespace new operator private protected public register "
|
|
|
|
"reinterpret_cast return short signed sizeof static static_cast "
|
|
|
|
"struct switch template this throw true try typedef typeid "
|
|
|
|
"typename union unsigned using virtual void volatile wchar_t "
|
|
|
|
"while";
|
2008-02-12 17:53:30 -05:00
|
|
|
const char* CppWordlist2 =
|
2008-01-09 09:35:11 -05:00
|
|
|
"file";
|
2008-02-12 17:53:30 -05:00
|
|
|
const char* CppWordlist3 =
|
2008-01-09 09:35:11 -05:00
|
|
|
"a addindex addtogroup anchor arg attention author b brief bug c "
|
|
|
|
"class code date def defgroup deprecated dontinclude e em endcode "
|
|
|
|
"endhtmlonly endif endlatexonly endlink endverbatim enum example "
|
|
|
|
"exception f$ f[ f] file fn hideinitializer htmlinclude "
|
|
|
|
"htmlonly if image include ingroup internal invariant interface "
|
|
|
|
"latexonly li line link mainpage name namespace nosubgrouping note "
|
|
|
|
"overload p page par param post pre ref relates remarks return "
|
|
|
|
"retval sa section see showinitializer since skip skipline struct "
|
|
|
|
"subsection test throw todo typedef union until var verbatim "
|
|
|
|
"verbinclude version warning weakgroup $ @ \"\" & < > # { }";
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// Python
|
2008-02-12 17:53:30 -05:00
|
|
|
const char* PythonWordlist1 =
|
2008-01-09 09:35:11 -05:00
|
|
|
"and assert break class continue def del elif else except exec "
|
|
|
|
"finally for from global if import in is lambda None not or pass "
|
|
|
|
"print raise return try while yield";
|
2008-02-12 17:53:30 -05:00
|
|
|
const char* PythonWordlist2 =
|
2008-01-09 09:35:11 -05:00
|
|
|
"ACCELERATORS ALT AUTO3STATE AUTOCHECKBOX AUTORADIOBUTTON BEGIN "
|
|
|
|
"BITMAP BLOCK BUTTON CAPTION CHARACTERISTICS CHECKBOX CLASS "
|
|
|
|
"COMBOBOX CONTROL CTEXT CURSOR DEFPUSHBUTTON DIALOG DIALOGEX "
|
|
|
|
"DISCARDABLE EDITTEXT END EXSTYLE FONT GROUPBOX ICON LANGUAGE "
|
|
|
|
"LISTBOX LTEXT MENU MENUEX MENUITEM MESSAGETABLE POPUP PUSHBUTTON "
|
|
|
|
"RADIOBUTTON RCDATA RTEXT SCROLLBAR SEPARATOR SHIFT STATE3 "
|
|
|
|
"STRINGTABLE STYLE TEXTINCLUDE VALUE VERSION VERSIONINFO VIRTKEY";
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//! languages
|
|
|
|
const LanguageInfo g_LanguagePrefs [] = {
|
|
|
|
// C++
|
2008-01-09 09:35:11 -05:00
|
|
|
{"C++",
|
|
|
|
"*.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hh;*.hpp;*.hxx;*.sma",
|
2003-09-18 01:05:52 -04:00
|
|
|
wxSTC_LEX_CPP,
|
|
|
|
{{mySTC_TYPE_DEFAULT, NULL},
|
|
|
|
{mySTC_TYPE_COMMENT, NULL},
|
|
|
|
{mySTC_TYPE_COMMENT_LINE, NULL},
|
|
|
|
{mySTC_TYPE_COMMENT_DOC, NULL},
|
|
|
|
{mySTC_TYPE_NUMBER, NULL},
|
|
|
|
{mySTC_TYPE_WORD1, CppWordlist1}, // KEYWORDS
|
|
|
|
{mySTC_TYPE_STRING, NULL},
|
|
|
|
{mySTC_TYPE_CHARACTER, NULL},
|
|
|
|
{mySTC_TYPE_UUID, NULL},
|
|
|
|
{mySTC_TYPE_PREPROCESSOR, NULL},
|
|
|
|
{mySTC_TYPE_OPERATOR, NULL},
|
|
|
|
{mySTC_TYPE_IDENTIFIER, NULL},
|
|
|
|
{mySTC_TYPE_STRING_EOL, NULL},
|
|
|
|
{mySTC_TYPE_DEFAULT, NULL}, // VERBATIM
|
|
|
|
{mySTC_TYPE_REGEX, NULL},
|
|
|
|
{mySTC_TYPE_COMMENT_SPECIAL, NULL}, // DOXY
|
|
|
|
{mySTC_TYPE_WORD2, CppWordlist2}, // EXTRA WORDS
|
|
|
|
{mySTC_TYPE_WORD3, CppWordlist3}, // DOXY KEYWORDS
|
|
|
|
{mySTC_TYPE_ERROR, NULL}, // KEYWORDS ERROR
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL}},
|
|
|
|
mySTC_FOLD_COMMENT | mySTC_FOLD_COMPACT | mySTC_FOLD_PREPROC},
|
|
|
|
// Python
|
2008-01-09 09:35:11 -05:00
|
|
|
{"Python",
|
|
|
|
"*.py;*.pyw",
|
2003-09-18 01:05:52 -04:00
|
|
|
wxSTC_LEX_PYTHON,
|
|
|
|
{{mySTC_TYPE_DEFAULT, NULL},
|
|
|
|
{mySTC_TYPE_COMMENT_LINE, NULL},
|
|
|
|
{mySTC_TYPE_NUMBER, NULL},
|
|
|
|
{mySTC_TYPE_STRING, NULL},
|
|
|
|
{mySTC_TYPE_CHARACTER, NULL},
|
|
|
|
{mySTC_TYPE_WORD1, PythonWordlist1}, // KEYWORDS
|
|
|
|
{mySTC_TYPE_DEFAULT, NULL}, // TRIPLE
|
|
|
|
{mySTC_TYPE_DEFAULT, NULL}, // TRIPLEDOUBLE
|
|
|
|
{mySTC_TYPE_DEFAULT, NULL}, // CLASSNAME
|
|
|
|
{mySTC_TYPE_DEFAULT, PythonWordlist2}, // DEFNAME
|
|
|
|
{mySTC_TYPE_OPERATOR, NULL},
|
|
|
|
{mySTC_TYPE_IDENTIFIER, NULL},
|
|
|
|
{mySTC_TYPE_DEFAULT, NULL}, // COMMENT_BLOCK
|
|
|
|
{mySTC_TYPE_STRING_EOL, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL}},
|
|
|
|
mySTC_FOLD_COMMENTPY | mySTC_FOLD_QUOTESPY},
|
|
|
|
// * (any)
|
2008-01-09 09:35:11 -05:00
|
|
|
{wxTRANSLATE(DEFAULT_LANGUAGE),
|
|
|
|
"*.*",
|
2003-09-18 01:05:52 -04:00
|
|
|
wxSTC_LEX_PROPERTIES,
|
|
|
|
{{mySTC_TYPE_DEFAULT, NULL},
|
|
|
|
{mySTC_TYPE_DEFAULT, NULL},
|
|
|
|
{mySTC_TYPE_DEFAULT, NULL},
|
|
|
|
{mySTC_TYPE_DEFAULT, NULL},
|
|
|
|
{mySTC_TYPE_DEFAULT, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL},
|
|
|
|
{-1, NULL}},
|
|
|
|
0},
|
|
|
|
};
|
|
|
|
|
|
|
|
const int g_LanguagePrefsSize = WXSIZEOF(g_LanguagePrefs);
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//! style types
|
|
|
|
const StyleInfo g_StylePrefs [] = {
|
|
|
|
// mySTC_TYPE_DEFAULT
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Default",
|
|
|
|
"BLACK", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_WORD1
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Keyword1",
|
|
|
|
"BLUE", "WHITE",
|
|
|
|
"", 10, mySTC_STYLE_BOLD, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_WORD2
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Keyword2",
|
|
|
|
"MIDNIGHT BLUE", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_WORD3
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Keyword3",
|
|
|
|
"CORNFLOWER BLUE", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_WORD4
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Keyword4",
|
|
|
|
"CYAN", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_WORD5
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Keyword5",
|
|
|
|
"DARK GREY", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_WORD6
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Keyword6",
|
|
|
|
"GREY", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_COMMENT
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Comment",
|
|
|
|
"FOREST GREEN", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_COMMENT_DOC
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Comment (Doc)",
|
|
|
|
"FOREST GREEN", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_COMMENT_LINE
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Comment line",
|
|
|
|
"FOREST GREEN", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_COMMENT_SPECIAL
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Special comment",
|
|
|
|
"FOREST GREEN", "WHITE",
|
|
|
|
"", 10, mySTC_STYLE_ITALIC, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_CHARACTER
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Character",
|
|
|
|
"KHAKI", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_CHARACTER_EOL
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Character (EOL)",
|
|
|
|
"KHAKI", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_STRING
|
2018-09-28 21:45:15 -04:00
|
|
|
{"String",
|
|
|
|
"BROWN", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_STRING_EOL
|
2018-09-28 21:45:15 -04:00
|
|
|
{"String (EOL)",
|
|
|
|
"BROWN", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_DELIMITER
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Delimiter",
|
|
|
|
"ORANGE", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_PUNCTUATION
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Punctuation",
|
|
|
|
"ORANGE", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_OPERATOR
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Operator",
|
|
|
|
"BLACK", "WHITE",
|
|
|
|
"", 10, mySTC_STYLE_BOLD, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_BRACE
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Label",
|
|
|
|
"VIOLET", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_COMMAND
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Command",
|
|
|
|
"BLUE", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_IDENTIFIER
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Identifier",
|
|
|
|
"BLACK", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_LABEL
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Label",
|
|
|
|
"VIOLET", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_NUMBER
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Number",
|
|
|
|
"SIENNA", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_PARAMETER
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Parameter",
|
|
|
|
"VIOLET", "WHITE",
|
|
|
|
"", 10, mySTC_STYLE_ITALIC, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_REGEX
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Regular expression",
|
|
|
|
"ORCHID", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_UUID
|
2018-09-28 21:45:15 -04:00
|
|
|
{"UUID",
|
|
|
|
"ORCHID", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_VALUE
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Value",
|
|
|
|
"ORCHID", "WHITE",
|
|
|
|
"", 10, mySTC_STYLE_ITALIC, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_PREPROCESSOR
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Preprocessor",
|
|
|
|
"GREY", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_SCRIPT
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Script",
|
|
|
|
"DARK GREY", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_ERROR
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Error",
|
|
|
|
"RED", "WHITE",
|
|
|
|
"", 10, 0, 0},
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
// mySTC_TYPE_UNDEFINED
|
2018-09-28 21:45:15 -04:00
|
|
|
{"Undefined",
|
|
|
|
"ORANGE", "WHITE",
|
|
|
|
"", 10, 0, 0}
|
2003-09-18 01:05:52 -04:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const int g_StylePrefsSize = WXSIZEOF(g_StylePrefs);
|