Remove more wxT() macros from samples
Also use wxString instead of wxChar* strings. Closes https://github.com/wxWidgets/wxWidgets/pull/950
This commit is contained in:
committed by
Vadim Zeitlin
parent
480047ee9a
commit
b70ed2d8c8
@@ -149,9 +149,9 @@ Edit::Edit (wxWindow *parent, wxWindowID id,
|
||||
StyleSetFont (wxSTC_STYLE_DEFAULT, font);
|
||||
StyleSetForeground (wxSTC_STYLE_DEFAULT, *wxBLACK);
|
||||
StyleSetBackground (wxSTC_STYLE_DEFAULT, *wxWHITE);
|
||||
StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY")));
|
||||
StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour ("DARK GREY"));
|
||||
StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE);
|
||||
StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY")));
|
||||
StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour ("DARK GREY"));
|
||||
InitializePrefs (DEFAULT_LANGUAGE);
|
||||
|
||||
// set visibility
|
||||
@@ -160,19 +160,19 @@ Edit::Edit (wxWindow *parent, wxWindowID id,
|
||||
SetYCaretPolicy (wxSTC_CARET_EVEN|wxSTC_VISIBLE_STRICT|wxSTC_CARET_SLOP, 1);
|
||||
|
||||
// markers
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("BLACK"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("BLACK"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("WHITE"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("WHITE"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK"));
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, "BLACK", "BLACK");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, "BLACK", "BLACK");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, "BLACK", "BLACK");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, "BLACK", "WHITE");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, "BLACK", "WHITE");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, "BLACK", "BLACK");
|
||||
MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, "BLACK", "BLACK");
|
||||
|
||||
// annotations
|
||||
AnnotationSetVisible(wxSTC_ANNOTATION_BOXED);
|
||||
|
||||
// miscellaneous
|
||||
m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, wxT("_999999"));
|
||||
m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, "_999999");
|
||||
m_FoldingMargin = 16;
|
||||
CmdKeyClear (wxSTC_KEY_TAB, 0); // this is done by the menu accelerator key
|
||||
SetLayoutCache (wxSTC_CACHE_PAGE);
|
||||
@@ -501,8 +501,8 @@ wxString Edit::DeterminePrefs (const wxString &filename) {
|
||||
while (!filepattern.empty()) {
|
||||
wxString cur = filepattern.BeforeFirst (';');
|
||||
if ((cur == filename) ||
|
||||
(cur == (filename.BeforeLast ('.') + wxT(".*"))) ||
|
||||
(cur == (wxT("*.") + filename.AfterLast ('.')))) {
|
||||
(cur == (filename.BeforeLast ('.') + ".*")) ||
|
||||
(cur == ("*." + filename.AfterLast ('.')))) {
|
||||
return curInfo->name;
|
||||
}
|
||||
filepattern = filepattern.AfterFirst (';');
|
||||
@@ -536,7 +536,7 @@ bool Edit::InitializePrefs (const wxString &name) {
|
||||
|
||||
// set margin for line numbers
|
||||
SetMarginType (m_LineNrID, wxSTC_MARGIN_NUMBER);
|
||||
StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY")));
|
||||
StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour ("DARK GREY"));
|
||||
StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE);
|
||||
SetMarginWidth (m_LineNrID, 0); // start out not visible
|
||||
|
||||
@@ -554,8 +554,8 @@ bool Edit::InitializePrefs (const wxString &name) {
|
||||
}
|
||||
|
||||
// set common styles
|
||||
StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour (wxT("DARK GREY")));
|
||||
StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY")));
|
||||
StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour ("DARK GREY"));
|
||||
StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour ("DARK GREY"));
|
||||
|
||||
// initialize settings
|
||||
if (g_CommonPrefs.syntaxEnable) {
|
||||
@@ -567,10 +567,10 @@ bool Edit::InitializePrefs (const wxString &name) {
|
||||
.Family(wxFONTFAMILY_MODERN)
|
||||
.FaceName(curType.fontname));
|
||||
StyleSetFont (Nr, font);
|
||||
if (curType.foreground) {
|
||||
if (curType.foreground.length()) {
|
||||
StyleSetForeground (Nr, wxColour (curType.foreground));
|
||||
}
|
||||
if (curType.background) {
|
||||
if (curType.background.length()) {
|
||||
StyleSetBackground (Nr, wxColour (curType.background));
|
||||
}
|
||||
StyleSetBold (Nr, (curType.fontstyle & mySTC_STYLE_BOLD) > 0);
|
||||
@@ -600,21 +600,21 @@ bool Edit::InitializePrefs (const wxString &name) {
|
||||
if (g_CommonPrefs.foldEnable) {
|
||||
SetMarginWidth (m_FoldingID, curInfo->folds != 0? m_FoldingMargin: 0);
|
||||
SetMarginSensitive (m_FoldingID, curInfo->folds != 0);
|
||||
SetProperty (wxT("fold"), curInfo->folds != 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.comment"),
|
||||
(curInfo->folds & mySTC_FOLD_COMMENT) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.compact"),
|
||||
(curInfo->folds & mySTC_FOLD_COMPACT) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.preprocessor"),
|
||||
(curInfo->folds & mySTC_FOLD_PREPROC) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.html"),
|
||||
(curInfo->folds & mySTC_FOLD_HTML) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.html.preprocessor"),
|
||||
(curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.comment.python"),
|
||||
(curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty (wxT("fold.quotes.python"),
|
||||
(curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? wxT("1"): wxT("0"));
|
||||
SetProperty ("fold", curInfo->folds != 0? "1": "0");
|
||||
SetProperty ("fold.comment",
|
||||
(curInfo->folds & mySTC_FOLD_COMMENT) > 0? "1": "0");
|
||||
SetProperty ("fold.compact",
|
||||
(curInfo->folds & mySTC_FOLD_COMPACT) > 0? "1": "0");
|
||||
SetProperty ("fold.preprocessor",
|
||||
(curInfo->folds & mySTC_FOLD_PREPROC) > 0? "1": "0");
|
||||
SetProperty ("fold.html",
|
||||
(curInfo->folds & mySTC_FOLD_HTML) > 0? "1": "0");
|
||||
SetProperty ("fold.html.preprocessor",
|
||||
(curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? "1": "0");
|
||||
SetProperty ("fold.comment.python",
|
||||
(curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? "1": "0");
|
||||
SetProperty ("fold.quotes.python",
|
||||
(curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? "1": "0");
|
||||
}
|
||||
SetFoldFlags (wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED |
|
||||
wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED);
|
||||
@@ -646,8 +646,8 @@ bool Edit::LoadFile ()
|
||||
#if wxUSE_FILEDLG
|
||||
// get filename
|
||||
if (!m_filename) {
|
||||
wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString,
|
||||
wxT("Any file (*)|*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
|
||||
wxFileDialog dlg (this, "Open file", wxEmptyString, wxEmptyString,
|
||||
"Any file (*)|*", wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
|
||||
if (dlg.ShowModal() != wxID_OK) return false;
|
||||
m_filename = dlg.GetPath();
|
||||
}
|
||||
@@ -683,7 +683,7 @@ bool Edit::SaveFile ()
|
||||
|
||||
// get filename
|
||||
if (!m_filename) {
|
||||
wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"),
|
||||
wxFileDialog dlg (this, "Save file", wxEmptyString, wxEmptyString, "Any file (*)|*",
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
|
||||
if (dlg.ShowModal() != wxID_OK) return false;
|
||||
m_filename = dlg.GetPath();
|
||||
@@ -757,14 +757,14 @@ EditProperties::EditProperties (Edit *edit,
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Lexer-ID: "),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (wxT("%d"), edit->GetLexer());
|
||||
text = wxString::Format ("%d", edit->GetLexer());
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
wxString EOLtype = wxEmptyString;
|
||||
switch (edit->GetEOLMode()) {
|
||||
case wxSTC_EOL_CR: {EOLtype = wxT("CR (Unix)"); break; }
|
||||
case wxSTC_EOL_CRLF: {EOLtype = wxT("CRLF (Windows)"); break; }
|
||||
case wxSTC_EOL_LF: {EOLtype = wxT("CR (Macintosh)"); break; }
|
||||
case wxSTC_EOL_CR: {EOLtype = "CR (Unix)"; break; }
|
||||
case wxSTC_EOL_CRLF: {EOLtype = "CRLF (Windows)"; break; }
|
||||
case wxSTC_EOL_LF: {EOLtype = "CR (Macintosh)"; break; }
|
||||
}
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Line endings"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
@@ -774,7 +774,7 @@ EditProperties::EditProperties (Edit *edit,
|
||||
|
||||
// text info box
|
||||
wxStaticBoxSizer *textinfos = new wxStaticBoxSizer (
|
||||
new wxStaticBox (this, wxID_ANY, _("Informations")),
|
||||
new wxStaticBox (this, wxID_ANY, _("Information")),
|
||||
wxVERTICAL);
|
||||
textinfos->Add (textinfo, 0, wxEXPAND);
|
||||
textinfos->Add (0, 6);
|
||||
@@ -784,25 +784,25 @@ EditProperties::EditProperties (Edit *edit,
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total lines"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (wxT("%d"), edit->GetLineCount());
|
||||
text = wxString::Format ("%d", edit->GetLineCount());
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total chars"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (wxT("%d"), edit->GetTextLength());
|
||||
text = wxString::Format ("%d", edit->GetTextLength());
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current line"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (wxT("%d"), edit->GetCurrentLine());
|
||||
text = wxString::Format ("%d", edit->GetCurrentLine());
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current pos"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (wxT("%d"), edit->GetCurrentPos());
|
||||
text = wxString::Format ("%d", edit->GetCurrentPos());
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
|
||||
@@ -836,7 +836,7 @@ EditProperties::EditProperties (Edit *edit,
|
||||
// EditPrint
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
EditPrint::EditPrint (Edit *edit, const wxChar *title)
|
||||
EditPrint::EditPrint (Edit *edit, const wxString& title)
|
||||
: wxPrintout(title)
|
||||
, m_edit(edit)
|
||||
{
|
||||
|
||||
@@ -162,7 +162,7 @@ class EditPrint: public wxPrintout {
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
EditPrint (Edit *edit, const wxChar *title = wxT(""));
|
||||
EditPrint (Edit *edit, const wxString& title = "");
|
||||
|
||||
//! event handlers
|
||||
bool OnPrintPage (int page) wxOVERRIDE;
|
||||
|
||||
@@ -218,159 +218,159 @@ const int g_LanguagePrefsSize = WXSIZEOF(g_LanguagePrefs);
|
||||
//! style types
|
||||
const StyleInfo g_StylePrefs [] = {
|
||||
// mySTC_TYPE_DEFAULT
|
||||
{wxT("Default"),
|
||||
wxT("BLACK"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Default",
|
||||
"BLACK", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_WORD1
|
||||
{wxT("Keyword1"),
|
||||
wxT("BLUE"), wxT("WHITE"),
|
||||
wxT(""), 10, mySTC_STYLE_BOLD, 0},
|
||||
{"Keyword1",
|
||||
"BLUE", "WHITE",
|
||||
"", 10, mySTC_STYLE_BOLD, 0},
|
||||
|
||||
// mySTC_TYPE_WORD2
|
||||
{wxT("Keyword2"),
|
||||
wxT("MIDNIGHT BLUE"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Keyword2",
|
||||
"MIDNIGHT BLUE", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_WORD3
|
||||
{wxT("Keyword3"),
|
||||
wxT("CORNFLOWER BLUE"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Keyword3",
|
||||
"CORNFLOWER BLUE", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_WORD4
|
||||
{wxT("Keyword4"),
|
||||
wxT("CYAN"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Keyword4",
|
||||
"CYAN", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_WORD5
|
||||
{wxT("Keyword5"),
|
||||
wxT("DARK GREY"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Keyword5",
|
||||
"DARK GREY", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_WORD6
|
||||
{wxT("Keyword6"),
|
||||
wxT("GREY"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Keyword6",
|
||||
"GREY", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_COMMENT
|
||||
{wxT("Comment"),
|
||||
wxT("FOREST GREEN"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Comment",
|
||||
"FOREST GREEN", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_COMMENT_DOC
|
||||
{wxT("Comment (Doc)"),
|
||||
wxT("FOREST GREEN"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Comment (Doc)",
|
||||
"FOREST GREEN", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_COMMENT_LINE
|
||||
{wxT("Comment line"),
|
||||
wxT("FOREST GREEN"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Comment line",
|
||||
"FOREST GREEN", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_COMMENT_SPECIAL
|
||||
{wxT("Special comment"),
|
||||
wxT("FOREST GREEN"), wxT("WHITE"),
|
||||
wxT(""), 10, mySTC_STYLE_ITALIC, 0},
|
||||
{"Special comment",
|
||||
"FOREST GREEN", "WHITE",
|
||||
"", 10, mySTC_STYLE_ITALIC, 0},
|
||||
|
||||
// mySTC_TYPE_CHARACTER
|
||||
{wxT("Character"),
|
||||
wxT("KHAKI"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Character",
|
||||
"KHAKI", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_CHARACTER_EOL
|
||||
{wxT("Character (EOL)"),
|
||||
wxT("KHAKI"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Character (EOL)",
|
||||
"KHAKI", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_STRING
|
||||
{wxT("String"),
|
||||
wxT("BROWN"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"String",
|
||||
"BROWN", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_STRING_EOL
|
||||
{wxT("String (EOL)"),
|
||||
wxT("BROWN"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"String (EOL)",
|
||||
"BROWN", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_DELIMITER
|
||||
{wxT("Delimiter"),
|
||||
wxT("ORANGE"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Delimiter",
|
||||
"ORANGE", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_PUNCTUATION
|
||||
{wxT("Punctuation"),
|
||||
wxT("ORANGE"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Punctuation",
|
||||
"ORANGE", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_OPERATOR
|
||||
{wxT("Operator"),
|
||||
wxT("BLACK"), wxT("WHITE"),
|
||||
wxT(""), 10, mySTC_STYLE_BOLD, 0},
|
||||
{"Operator",
|
||||
"BLACK", "WHITE",
|
||||
"", 10, mySTC_STYLE_BOLD, 0},
|
||||
|
||||
// mySTC_TYPE_BRACE
|
||||
{wxT("Label"),
|
||||
wxT("VIOLET"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Label",
|
||||
"VIOLET", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_COMMAND
|
||||
{wxT("Command"),
|
||||
wxT("BLUE"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Command",
|
||||
"BLUE", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_IDENTIFIER
|
||||
{wxT("Identifier"),
|
||||
wxT("BLACK"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Identifier",
|
||||
"BLACK", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_LABEL
|
||||
{wxT("Label"),
|
||||
wxT("VIOLET"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Label",
|
||||
"VIOLET", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_NUMBER
|
||||
{wxT("Number"),
|
||||
wxT("SIENNA"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Number",
|
||||
"SIENNA", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_PARAMETER
|
||||
{wxT("Parameter"),
|
||||
wxT("VIOLET"), wxT("WHITE"),
|
||||
wxT(""), 10, mySTC_STYLE_ITALIC, 0},
|
||||
{"Parameter",
|
||||
"VIOLET", "WHITE",
|
||||
"", 10, mySTC_STYLE_ITALIC, 0},
|
||||
|
||||
// mySTC_TYPE_REGEX
|
||||
{wxT("Regular expression"),
|
||||
wxT("ORCHID"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Regular expression",
|
||||
"ORCHID", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_UUID
|
||||
{wxT("UUID"),
|
||||
wxT("ORCHID"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"UUID",
|
||||
"ORCHID", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_VALUE
|
||||
{wxT("Value"),
|
||||
wxT("ORCHID"), wxT("WHITE"),
|
||||
wxT(""), 10, mySTC_STYLE_ITALIC, 0},
|
||||
{"Value",
|
||||
"ORCHID", "WHITE",
|
||||
"", 10, mySTC_STYLE_ITALIC, 0},
|
||||
|
||||
// mySTC_TYPE_PREPROCESSOR
|
||||
{wxT("Preprocessor"),
|
||||
wxT("GREY"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Preprocessor",
|
||||
"GREY", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_SCRIPT
|
||||
{wxT("Script"),
|
||||
wxT("DARK GREY"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Script",
|
||||
"DARK GREY", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_ERROR
|
||||
{wxT("Error"),
|
||||
wxT("RED"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0},
|
||||
{"Error",
|
||||
"RED", "WHITE",
|
||||
"", 10, 0, 0},
|
||||
|
||||
// mySTC_TYPE_UNDEFINED
|
||||
{wxT("Undefined"),
|
||||
wxT("ORANGE"), wxT("WHITE"),
|
||||
wxT(""), 10, 0, 0}
|
||||
{"Undefined",
|
||||
"ORANGE", "WHITE",
|
||||
"", 10, 0, 0}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -136,10 +136,10 @@ extern const int g_LanguagePrefsSize;
|
||||
//----------------------------------------------------------------------------
|
||||
// StyleInfo
|
||||
struct StyleInfo {
|
||||
const wxChar *name;
|
||||
const wxChar *foreground;
|
||||
const wxChar *background;
|
||||
const wxChar *fontname;
|
||||
const wxString name;
|
||||
const wxString foreground;
|
||||
const wxString background;
|
||||
const wxString fontname;
|
||||
int fontsize;
|
||||
int fontstyle;
|
||||
int lettercase;
|
||||
|
||||
@@ -54,19 +54,19 @@
|
||||
// declarations
|
||||
//============================================================================
|
||||
|
||||
#define APP_NAME wxT("STC-Test")
|
||||
#define APP_DESCR _("See http://wxguide.sourceforge.net/")
|
||||
#define APP_NAME "STC-Test"
|
||||
#define APP_DESCR "See http://wxguide.sourceforge.net/"
|
||||
|
||||
#define APP_MAINT wxT("Otto Wyss")
|
||||
#define APP_VENDOR wxT("wxWidgets")
|
||||
#define APP_COPYRIGTH wxT("(C) 2003 Otto Wyss")
|
||||
#define APP_LICENCE wxT("wxWidgets")
|
||||
#define APP_MAINT "Otto Wyss"
|
||||
#define APP_VENDOR "wxWidgets"
|
||||
#define APP_COPYRIGTH "(C) 2003 Otto Wyss"
|
||||
#define APP_LICENCE "wxWidgets"
|
||||
|
||||
#define APP_VERSION wxT("0.1.alpha")
|
||||
#define APP_VERSION "0.1.alpha"
|
||||
#define APP_BUILD __DATE__
|
||||
|
||||
#define APP_WEBSITE wxT("http://www.wxWidgets.org")
|
||||
#define APP_MAIL wxT("mailto://???")
|
||||
#define APP_WEBSITE "http://www.wxWidgets.org"
|
||||
#define APP_MAIL "mailto://???"
|
||||
|
||||
#define NONAME _("<untitled>")
|
||||
|
||||
@@ -214,7 +214,7 @@ bool App::OnInit () {
|
||||
SetVendorName (APP_VENDOR);
|
||||
g_appname = new wxString ();
|
||||
g_appname->Append (APP_VENDOR);
|
||||
g_appname->Append (wxT("-"));
|
||||
g_appname->Append ("-");
|
||||
g_appname->Append (APP_NAME);
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
@@ -301,7 +301,7 @@ AppFrame::AppFrame (const wxString &title)
|
||||
|
||||
// set icon and background
|
||||
SetTitle (*g_appname);
|
||||
SetBackgroundColour (wxT("WHITE"));
|
||||
SetBackgroundColour ("WHITE");
|
||||
|
||||
// create menu
|
||||
m_menuBar = new wxMenuBar;
|
||||
@@ -311,7 +311,7 @@ AppFrame::AppFrame (const wxString &title)
|
||||
m_edit = new Edit (this, wxID_ANY);
|
||||
m_edit->SetFocus();
|
||||
|
||||
FileOpen (wxT("stctest.cpp"));
|
||||
FileOpen ("stctest.cpp");
|
||||
}
|
||||
|
||||
AppFrame::~AppFrame () {
|
||||
@@ -341,7 +341,7 @@ void AppFrame::OnFileOpen (wxCommandEvent &WXUNUSED(event)) {
|
||||
if (!m_edit) return;
|
||||
#if wxUSE_FILEDLG
|
||||
wxString fname;
|
||||
wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"),
|
||||
wxFileDialog dlg (this, "Open file", wxEmptyString, wxEmptyString, "Any file (*)|*",
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR);
|
||||
if (dlg.ShowModal() != wxID_OK) return;
|
||||
fname = dlg.GetPath ();
|
||||
@@ -363,7 +363,7 @@ void AppFrame::OnFileSaveAs (wxCommandEvent &WXUNUSED(event)) {
|
||||
if (!m_edit) return;
|
||||
#if wxUSE_FILEDLG
|
||||
wxString filename = wxEmptyString;
|
||||
wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||
wxFileDialog dlg (this, "Save file", wxEmptyString, wxEmptyString, "Any file (*)|*", wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||
if (dlg.ShowModal() != wxID_OK) return;
|
||||
filename = dlg.GetPath();
|
||||
m_edit->SaveFile (filename);
|
||||
@@ -466,8 +466,8 @@ void AppFrame::OnContextMenu(wxContextMenuEvent& evt)
|
||||
}
|
||||
|
||||
wxMenu menu;
|
||||
menu.Append(wxID_ABOUT, wxT("&About"));
|
||||
menu.Append(wxID_EXIT, wxT("E&xit"));
|
||||
menu.Append(wxID_ABOUT, "&About");
|
||||
menu.Append(wxID_EXIT, "E&xit");
|
||||
PopupMenu(&menu, point);
|
||||
}
|
||||
|
||||
@@ -733,23 +733,23 @@ public:
|
||||
{
|
||||
SetLexerXml();
|
||||
|
||||
SetProperty(wxT("fold"), wxT("1"));
|
||||
SetProperty(wxT("fold.comment"), wxT("1"));
|
||||
SetProperty(wxT("fold.compact"), wxT("1"));
|
||||
SetProperty(wxT("fold.preprocessor"), wxT("1"));
|
||||
SetProperty(wxT("fold.html"), wxT("1"));
|
||||
SetProperty(wxT("fold.html.preprocessor"), wxT("1"));
|
||||
SetProperty("fold", "1");
|
||||
SetProperty("fold.comment", "1");
|
||||
SetProperty("fold.compact", "1");
|
||||
SetProperty("fold.preprocessor", "1");
|
||||
SetProperty("fold.html", "1");
|
||||
SetProperty("fold.html.preprocessor", "1");
|
||||
|
||||
SetMarginType(margin_id_lineno, wxSTC_MARGIN_NUMBER);
|
||||
SetMarginWidth(margin_id_lineno, 32);
|
||||
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, wxT("WHITE"), wxT("BLACK"));
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, "WHITE", "BLACK");
|
||||
MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, "WHITE", "BLACK");
|
||||
|
||||
SetMarginMask(margin_id_fold, wxSTC_MASK_FOLDERS);
|
||||
SetMarginWidth(margin_id_fold, 32);
|
||||
@@ -780,7 +780,7 @@ public:
|
||||
StyleSetForeground(wxSTC_H_DOUBLESTRING, *wxBLACK);
|
||||
StyleSetForeground(wxSTC_H_SINGLESTRING, *wxBLACK);
|
||||
StyleSetForeground(wxSTC_H_OTHER, *wxBLUE);
|
||||
StyleSetForeground(wxSTC_H_COMMENT, wxTheColourDatabase->Find(wxT("GREY")));
|
||||
StyleSetForeground(wxSTC_H_COMMENT, wxTheColourDatabase->Find("GREY"));
|
||||
StyleSetForeground(wxSTC_H_ENTITY, *wxRED);
|
||||
StyleSetBold(wxSTC_H_ENTITY, true);
|
||||
StyleSetForeground(wxSTC_H_TAGEND, *wxBLUE);
|
||||
@@ -814,7 +814,7 @@ void MinimalEditor::OnMarginClick(wxStyledTextEvent &event)
|
||||
|
||||
void MinimalEditor::OnText(wxStyledTextEvent& event)
|
||||
{
|
||||
wxLogDebug(wxT("Modified"));
|
||||
wxLogDebug("Modified");
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user