]> git.saurik.com Git - wxWidgets.git/blob - samples/stc/prefs.cpp
Fix fatal bug in wxGetWindowFromHWND() for radio buttons.
[wxWidgets.git] / samples / stc / prefs.cpp
1 //////////////////////////////////////////////////////////////////////////////
2 // File: contrib/samples/stc/prefs.cpp
3 // Purpose: STC test Preferences initialization
4 // Maintainer: Wyo
5 // Created: 2003-09-01
6 // RCS-ID: $Id$
7 // Copyright: (c) wxGuide
8 // Licence: wxWindows licence
9 //////////////////////////////////////////////////////////////////////////////
10
11 //----------------------------------------------------------------------------
12 // headers
13 //----------------------------------------------------------------------------
14
15 // For compilers that support precompilation, includes "wx/wx.h".
16 #include "wx/wxprec.h"
17
18 #ifdef __BORLANDC__
19 #pragma hdrstop
20 #endif
21
22 // for all others, include the necessary headers (this file is usually all you
23 // need because it includes almost all 'standard' wxWidgets headers)
24 #ifndef WX_PRECOMP
25 #include "wx/wx.h"
26 #endif
27
28 //! wxWidgets headers
29
30 //! wxWidgets/contrib headers
31
32 //! application headers
33 #include "defsext.h" // Additional definitions
34 #include "prefs.h" // Preferences
35
36
37 //============================================================================
38 // declarations
39 //============================================================================
40
41 //----------------------------------------------------------------------------
42 //! language types
43 const CommonInfo g_CommonPrefs = {
44 // editor functionality prefs
45 true, // syntaxEnable
46 true, // foldEnable
47 true, // indentEnable
48 // display defaults prefs
49 false, // overTypeInitial
50 false, // readOnlyInitial
51 false, // wrapModeInitial
52 false, // displayEOLEnable
53 false, // IndentGuideEnable
54 true, // lineNumberEnable
55 false, // longLineOnEnable
56 false, // whiteSpaceEnable
57 };
58
59 //----------------------------------------------------------------------------
60 // keywordlists
61 // C++
62 const char* CppWordlist1 =
63 "asm auto bool break case catch char class const const_cast "
64 "continue default delete do double dynamic_cast else enum explicit "
65 "export extern false float for friend goto if inline int long "
66 "mutable namespace new operator private protected public register "
67 "reinterpret_cast return short signed sizeof static static_cast "
68 "struct switch template this throw true try typedef typeid "
69 "typename union unsigned using virtual void volatile wchar_t "
70 "while";
71 const char* CppWordlist2 =
72 "file";
73 const char* CppWordlist3 =
74 "a addindex addtogroup anchor arg attention author b brief bug c "
75 "class code date def defgroup deprecated dontinclude e em endcode "
76 "endhtmlonly endif endlatexonly endlink endverbatim enum example "
77 "exception f$ f[ f] file fn hideinitializer htmlinclude "
78 "htmlonly if image include ingroup internal invariant interface "
79 "latexonly li line link mainpage name namespace nosubgrouping note "
80 "overload p page par param post pre ref relates remarks return "
81 "retval sa section see showinitializer since skip skipline struct "
82 "subsection test throw todo typedef union until var verbatim "
83 "verbinclude version warning weakgroup $ @ \"\" & < > # { }";
84
85 // Python
86 const char* PythonWordlist1 =
87 "and assert break class continue def del elif else except exec "
88 "finally for from global if import in is lambda None not or pass "
89 "print raise return try while yield";
90 const char* PythonWordlist2 =
91 "ACCELERATORS ALT AUTO3STATE AUTOCHECKBOX AUTORADIOBUTTON BEGIN "
92 "BITMAP BLOCK BUTTON CAPTION CHARACTERISTICS CHECKBOX CLASS "
93 "COMBOBOX CONTROL CTEXT CURSOR DEFPUSHBUTTON DIALOG DIALOGEX "
94 "DISCARDABLE EDITTEXT END EXSTYLE FONT GROUPBOX ICON LANGUAGE "
95 "LISTBOX LTEXT MENU MENUEX MENUITEM MESSAGETABLE POPUP PUSHBUTTON "
96 "RADIOBUTTON RCDATA RTEXT SCROLLBAR SEPARATOR SHIFT STATE3 "
97 "STRINGTABLE STYLE TEXTINCLUDE VALUE VERSION VERSIONINFO VIRTKEY";
98
99
100 //----------------------------------------------------------------------------
101 //! languages
102 const LanguageInfo g_LanguagePrefs [] = {
103 // C++
104 {"C++",
105 "*.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hh;*.hpp;*.hxx;*.sma",
106 wxSTC_LEX_CPP,
107 {{mySTC_TYPE_DEFAULT, NULL},
108 {mySTC_TYPE_COMMENT, NULL},
109 {mySTC_TYPE_COMMENT_LINE, NULL},
110 {mySTC_TYPE_COMMENT_DOC, NULL},
111 {mySTC_TYPE_NUMBER, NULL},
112 {mySTC_TYPE_WORD1, CppWordlist1}, // KEYWORDS
113 {mySTC_TYPE_STRING, NULL},
114 {mySTC_TYPE_CHARACTER, NULL},
115 {mySTC_TYPE_UUID, NULL},
116 {mySTC_TYPE_PREPROCESSOR, NULL},
117 {mySTC_TYPE_OPERATOR, NULL},
118 {mySTC_TYPE_IDENTIFIER, NULL},
119 {mySTC_TYPE_STRING_EOL, NULL},
120 {mySTC_TYPE_DEFAULT, NULL}, // VERBATIM
121 {mySTC_TYPE_REGEX, NULL},
122 {mySTC_TYPE_COMMENT_SPECIAL, NULL}, // DOXY
123 {mySTC_TYPE_WORD2, CppWordlist2}, // EXTRA WORDS
124 {mySTC_TYPE_WORD3, CppWordlist3}, // DOXY KEYWORDS
125 {mySTC_TYPE_ERROR, NULL}, // KEYWORDS ERROR
126 {-1, NULL},
127 {-1, NULL},
128 {-1, NULL},
129 {-1, NULL},
130 {-1, NULL},
131 {-1, NULL},
132 {-1, NULL},
133 {-1, NULL},
134 {-1, NULL},
135 {-1, NULL},
136 {-1, NULL},
137 {-1, NULL},
138 {-1, NULL}},
139 mySTC_FOLD_COMMENT | mySTC_FOLD_COMPACT | mySTC_FOLD_PREPROC},
140 // Python
141 {"Python",
142 "*.py;*.pyw",
143 wxSTC_LEX_PYTHON,
144 {{mySTC_TYPE_DEFAULT, NULL},
145 {mySTC_TYPE_COMMENT_LINE, NULL},
146 {mySTC_TYPE_NUMBER, NULL},
147 {mySTC_TYPE_STRING, NULL},
148 {mySTC_TYPE_CHARACTER, NULL},
149 {mySTC_TYPE_WORD1, PythonWordlist1}, // KEYWORDS
150 {mySTC_TYPE_DEFAULT, NULL}, // TRIPLE
151 {mySTC_TYPE_DEFAULT, NULL}, // TRIPLEDOUBLE
152 {mySTC_TYPE_DEFAULT, NULL}, // CLASSNAME
153 {mySTC_TYPE_DEFAULT, PythonWordlist2}, // DEFNAME
154 {mySTC_TYPE_OPERATOR, NULL},
155 {mySTC_TYPE_IDENTIFIER, NULL},
156 {mySTC_TYPE_DEFAULT, NULL}, // COMMENT_BLOCK
157 {mySTC_TYPE_STRING_EOL, NULL},
158 {-1, NULL},
159 {-1, NULL},
160 {-1, NULL},
161 {-1, NULL},
162 {-1, NULL},
163 {-1, NULL},
164 {-1, NULL},
165 {-1, NULL},
166 {-1, NULL},
167 {-1, NULL},
168 {-1, NULL},
169 {-1, NULL},
170 {-1, NULL},
171 {-1, NULL},
172 {-1, NULL},
173 {-1, NULL},
174 {-1, NULL},
175 {-1, NULL}},
176 mySTC_FOLD_COMMENTPY | mySTC_FOLD_QUOTESPY},
177 // * (any)
178 {wxTRANSLATE(DEFAULT_LANGUAGE),
179 "*.*",
180 wxSTC_LEX_PROPERTIES,
181 {{mySTC_TYPE_DEFAULT, NULL},
182 {mySTC_TYPE_DEFAULT, NULL},
183 {mySTC_TYPE_DEFAULT, NULL},
184 {mySTC_TYPE_DEFAULT, NULL},
185 {mySTC_TYPE_DEFAULT, NULL},
186 {-1, NULL},
187 {-1, NULL},
188 {-1, NULL},
189 {-1, NULL},
190 {-1, NULL},
191 {-1, NULL},
192 {-1, NULL},
193 {-1, NULL},
194 {-1, NULL},
195 {-1, NULL},
196 {-1, NULL},
197 {-1, NULL},
198 {-1, NULL},
199 {-1, NULL},
200 {-1, NULL},
201 {-1, NULL},
202 {-1, NULL},
203 {-1, NULL},
204 {-1, NULL},
205 {-1, NULL},
206 {-1, NULL},
207 {-1, NULL},
208 {-1, NULL},
209 {-1, NULL},
210 {-1, NULL},
211 {-1, NULL},
212 {-1, NULL}},
213 0},
214 };
215
216 const int g_LanguagePrefsSize = WXSIZEOF(g_LanguagePrefs);
217
218 //----------------------------------------------------------------------------
219 //! style types
220 const StyleInfo g_StylePrefs [] = {
221 // mySTC_TYPE_DEFAULT
222 {wxT("Default"),
223 wxT("BLACK"), wxT("WHITE"),
224 wxT(""), 10, 0, 0},
225
226 // mySTC_TYPE_WORD1
227 {wxT("Keyword1"),
228 wxT("BLUE"), wxT("WHITE"),
229 wxT(""), 10, mySTC_STYLE_BOLD, 0},
230
231 // mySTC_TYPE_WORD2
232 {wxT("Keyword2"),
233 wxT("MIDNIGHT BLUE"), wxT("WHITE"),
234 wxT(""), 10, 0, 0},
235
236 // mySTC_TYPE_WORD3
237 {wxT("Keyword3"),
238 wxT("CORNFLOWER BLUE"), wxT("WHITE"),
239 wxT(""), 10, 0, 0},
240
241 // mySTC_TYPE_WORD4
242 {wxT("Keyword4"),
243 wxT("CYAN"), wxT("WHITE"),
244 wxT(""), 10, 0, 0},
245
246 // mySTC_TYPE_WORD5
247 {wxT("Keyword5"),
248 wxT("DARK GREY"), wxT("WHITE"),
249 wxT(""), 10, 0, 0},
250
251 // mySTC_TYPE_WORD6
252 {wxT("Keyword6"),
253 wxT("GREY"), wxT("WHITE"),
254 wxT(""), 10, 0, 0},
255
256 // mySTC_TYPE_COMMENT
257 {wxT("Comment"),
258 wxT("FOREST GREEN"), wxT("WHITE"),
259 wxT(""), 10, 0, 0},
260
261 // mySTC_TYPE_COMMENT_DOC
262 {wxT("Comment (Doc)"),
263 wxT("FOREST GREEN"), wxT("WHITE"),
264 wxT(""), 10, 0, 0},
265
266 // mySTC_TYPE_COMMENT_LINE
267 {wxT("Comment line"),
268 wxT("FOREST GREEN"), wxT("WHITE"),
269 wxT(""), 10, 0, 0},
270
271 // mySTC_TYPE_COMMENT_SPECIAL
272 {wxT("Special comment"),
273 wxT("FOREST GREEN"), wxT("WHITE"),
274 wxT(""), 10, mySTC_STYLE_ITALIC, 0},
275
276 // mySTC_TYPE_CHARACTER
277 {wxT("Character"),
278 wxT("KHAKI"), wxT("WHITE"),
279 wxT(""), 10, 0, 0},
280
281 // mySTC_TYPE_CHARACTER_EOL
282 {wxT("Character (EOL)"),
283 wxT("KHAKI"), wxT("WHITE"),
284 wxT(""), 10, 0, 0},
285
286 // mySTC_TYPE_STRING
287 {wxT("String"),
288 wxT("BROWN"), wxT("WHITE"),
289 wxT(""), 10, 0, 0},
290
291 // mySTC_TYPE_STRING_EOL
292 {wxT("String (EOL)"),
293 wxT("BROWN"), wxT("WHITE"),
294 wxT(""), 10, 0, 0},
295
296 // mySTC_TYPE_DELIMITER
297 {wxT("Delimiter"),
298 wxT("ORANGE"), wxT("WHITE"),
299 wxT(""), 10, 0, 0},
300
301 // mySTC_TYPE_PUNCTUATION
302 {wxT("Punctuation"),
303 wxT("ORANGE"), wxT("WHITE"),
304 wxT(""), 10, 0, 0},
305
306 // mySTC_TYPE_OPERATOR
307 {wxT("Operator"),
308 wxT("BLACK"), wxT("WHITE"),
309 wxT(""), 10, mySTC_STYLE_BOLD, 0},
310
311 // mySTC_TYPE_BRACE
312 {wxT("Label"),
313 wxT("VIOLET"), wxT("WHITE"),
314 wxT(""), 10, 0, 0},
315
316 // mySTC_TYPE_COMMAND
317 {wxT("Command"),
318 wxT("BLUE"), wxT("WHITE"),
319 wxT(""), 10, 0, 0},
320
321 // mySTC_TYPE_IDENTIFIER
322 {wxT("Identifier"),
323 wxT("BLACK"), wxT("WHITE"),
324 wxT(""), 10, 0, 0},
325
326 // mySTC_TYPE_LABEL
327 {wxT("Label"),
328 wxT("VIOLET"), wxT("WHITE"),
329 wxT(""), 10, 0, 0},
330
331 // mySTC_TYPE_NUMBER
332 {wxT("Number"),
333 wxT("SIENNA"), wxT("WHITE"),
334 wxT(""), 10, 0, 0},
335
336 // mySTC_TYPE_PARAMETER
337 {wxT("Parameter"),
338 wxT("VIOLET"), wxT("WHITE"),
339 wxT(""), 10, mySTC_STYLE_ITALIC, 0},
340
341 // mySTC_TYPE_REGEX
342 {wxT("Regular expression"),
343 wxT("ORCHID"), wxT("WHITE"),
344 wxT(""), 10, 0, 0},
345
346 // mySTC_TYPE_UUID
347 {wxT("UUID"),
348 wxT("ORCHID"), wxT("WHITE"),
349 wxT(""), 10, 0, 0},
350
351 // mySTC_TYPE_VALUE
352 {wxT("Value"),
353 wxT("ORCHID"), wxT("WHITE"),
354 wxT(""), 10, mySTC_STYLE_ITALIC, 0},
355
356 // mySTC_TYPE_PREPROCESSOR
357 {wxT("Preprocessor"),
358 wxT("GREY"), wxT("WHITE"),
359 wxT(""), 10, 0, 0},
360
361 // mySTC_TYPE_SCRIPT
362 {wxT("Script"),
363 wxT("DARK GREY"), wxT("WHITE"),
364 wxT(""), 10, 0, 0},
365
366 // mySTC_TYPE_ERROR
367 {wxT("Error"),
368 wxT("RED"), wxT("WHITE"),
369 wxT(""), 10, 0, 0},
370
371 // mySTC_TYPE_UNDEFINED
372 {wxT("Undefined"),
373 wxT("ORANGE"), wxT("WHITE"),
374 wxT(""), 10, 0, 0}
375
376 };
377
378 const int g_StylePrefsSize = WXSIZEOF(g_StylePrefs);