60 "class C_class : public A_class" 77 "#define SOME_DEFINITION\n" 78 "#define SOME_DEFINITION_2\n\n");
92 m_Parser(np->GetParser()),
104 XRCCTRL(*
this,
"chkNoSemantic",
wxCheckBox)->SetValue(!cfg->
ReadBool(
_T(
"/semantic_keywords"),
false));
105 XRCCTRL(*
this,
"chkAutoAddParentheses",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/auto_add_parentheses"),
true));
106 XRCCTRL(*
this,
"chkDetectImpl",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/detect_implementation"),
false));
107 XRCCTRL(*
this,
"chkAddDoxgenComment",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/add_doxgen_comment"),
false));
108 XRCCTRL(*
this,
"chkEnableHeaders",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/enable_headers"),
true));
109 XRCCTRL(*
this,
"spnMaxMatches",
wxSpinCtrl)->SetValue(cfg->
ReadInt(
_T(
"/max_matches"), 16384));
111 XRCCTRL(*
this,
"sldCCDelay",
wxSlider)->SetValue(cfg->
ReadInt(
_T(
"/cc_delay"), 300) / 100);
112 UpdateCCDelayLabel();
113 XRCCTRL(*
this,
"chkKL_1",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/lexer_keywords_set1"),
true));
114 XRCCTRL(*
this,
"chkKL_2",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/lexer_keywords_set2"),
true));
115 XRCCTRL(*
this,
"chkKL_3",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/lexer_keywords_set3"),
false));
116 XRCCTRL(*
this,
"chkKL_4",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/lexer_keywords_set4"),
false));
117 XRCCTRL(*
this,
"chkKL_5",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/lexer_keywords_set5"),
false));
118 XRCCTRL(*
this,
"chkKL_6",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/lexer_keywords_set6"),
false));
119 XRCCTRL(*
this,
"chkKL_7",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/lexer_keywords_set7"),
false));
120 XRCCTRL(*
this,
"chkKL_8",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/lexer_keywords_set8"),
false));
121 XRCCTRL(*
this,
"chkKL_9",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/lexer_keywords_set9"),
false));
125 XRCCTRL(*
this,
"spnThreadsNum",
wxSpinCtrl)->SetValue(cfg->
ReadInt(
_T(
"/max_threads"), 1));
126 XRCCTRL(*
this,
"spnThreadsNum",
wxSpinCtrl)->Enable(
false);
127 XRCCTRL(*
this,
"spnParsersNum",
wxSpinCtrl)->SetValue(cfg->
ReadInt(
_T(
"/max_parsers"), 5));
131 XRCCTRL(*
this,
"txtCCFileExtHeader",
wxTextCtrl)->SetValue(cfg->
Read(
_T(
"/header_ext"),
_T(
"h,hpp,hxx,hh,h++,tcc,xpm")));
132 XRCCTRL(*
this,
"chkCCFileExtEmpty",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/empty_ext"),
true));
133 XRCCTRL(*
this,
"txtCCFileExtSource",
wxTextCtrl)->SetValue(cfg->
Read(
_T(
"/source_ext"),
_T(
"c,cpp,cxx,cc,c++")));
136 #if wxCHECK_VERSION(3, 0, 0) 139 XRCCTRL(*
this,
"chkNoSB",
wxCheckBox)->Disable();
140 XRCCTRL(*
this,
"chkInheritance",
wxCheckBox)->Disable();
141 XRCCTRL(*
this,
"chkExpandNS",
wxCheckBox)->Disable();
142 XRCCTRL(*
this,
"chkFloatCB",
wxCheckBox)->Disable();
143 XRCCTRL(*
this,
"chkTreeMembers",
wxCheckBox)->Disable();
145 XRCCTRL(*
this,
"chkNoSB",
wxCheckBox)->SetValue(!cfg->
ReadBool(
_T(
"/use_symbols_browser"),
true));
146 #endif // wxCHECK_VERSION 147 XRCCTRL(*
this,
"chkFloatCB",
wxCheckBox)->SetValue(cfg->
ReadBool(
_T(
"/as_floating_window"),
false));
153 spinScopeLength->Enable(scopeFilter->
GetValue());
155 XRCCTRL(*
this,
"spnChoiceFunctionLength",
wxSpinCtrl)->SetValue(cfg->
ReadInt(
_T(
"/toolbar_function_length"), 660));
162 XRCCTRL(*
this,
"chkUseSmartSense",
wxCheckBox)->SetValue(!m_Parser.Options().useSmartSense);
163 XRCCTRL(*
this,
"chkWhileTyping",
wxCheckBox)->SetValue(m_Parser.Options().whileTyping);
166 XRCCTRL(*
this,
"chkLocals",
wxCheckBox)->SetValue(m_Parser.Options().followLocalIncludes);
167 XRCCTRL(*
this,
"chkGlobals",
wxCheckBox)->SetValue(m_Parser.Options().followGlobalIncludes);
168 XRCCTRL(*
this,
"chkPreprocessor",
wxCheckBox)->SetValue(m_Parser.Options().wantPreprocessor);
169 XRCCTRL(*
this,
"chkComplexMacros",
wxCheckBox)->SetValue(m_Parser.Options().parseComplexMacros);
170 XRCCTRL(*
this,
"chkPlatformCheck",
wxCheckBox)->SetValue(m_Parser.Options().platformCheck);
172 XRCCTRL(*
this,
"rdoOneParserPerWorkspace",
wxRadioButton)->SetValue( m_NativeParser->IsParserPerWorkspace());
173 XRCCTRL(*
this,
"rdoOneParserPerProject",
wxRadioButton)->SetValue(!m_NativeParser->IsParserPerWorkspace());
176 XRCCTRL(*
this,
"chkInheritance",
wxCheckBox)->SetValue(m_Parser.ClassBrowserOptions().showInheritance);
177 XRCCTRL(*
this,
"chkExpandNS",
wxCheckBox)->SetValue(m_Parser.ClassBrowserOptions().expandNS);
178 XRCCTRL(*
this,
"chkTreeMembers",
wxCheckBox)->SetValue(m_Parser.ClassBrowserOptions().treeMembers);
181 XRCCTRL(*
this,
"chkDocumentation",
wxCheckBox)->SetValue(m_Documentation->IsEnabled());
184 XRCCTRL(*
this,
"btnDocBgColor",
wxButton)->SetBackgroundColour(colours->
GetColour(
wxT(
"cc_docs_back")));
185 XRCCTRL(*
this,
"btnDocTextColor",
wxButton)->SetBackgroundColour(colours->
GetColour(
wxT(
"cc_docs_fore")));
186 XRCCTRL(*
this,
"btnDocLinkColor",
wxButton)->SetBackgroundColour(colours->
GetColour(
wxT(
"cc_docs_link")));
205 cfg->
Write(
_T(
"/semantic_keywords"), (
bool)!XRCCTRL(*
this,
"chkNoSemantic",
wxCheckBox)->GetValue());
206 cfg->
Write(
_T(
"/use_SmartSense"), (
bool) XRCCTRL(*
this,
"chkUseSmartSense",
wxCheckBox)->GetValue());
207 cfg->
Write(
_T(
"/while_typing"), (
bool) XRCCTRL(*
this,
"chkWhileTyping",
wxCheckBox)->GetValue());
208 cfg->
Write(
_T(
"/auto_add_parentheses"), (
bool) XRCCTRL(*
this,
"chkAutoAddParentheses",
wxCheckBox)->GetValue());
209 cfg->
Write(
_T(
"/detect_implementation"),(
bool) XRCCTRL(*
this,
"chkDetectImpl",
wxCheckBox)->GetValue());
210 cfg->
Write(
_T(
"/add_doxgen_comment"), (
bool) XRCCTRL(*
this,
"chkAddDoxgenComment",
wxCheckBox)->GetValue());
211 cfg->
Write(
_T(
"/enable_headers"), (
bool) XRCCTRL(*
this,
"chkEnableHeaders",
wxCheckBox)->GetValue());
212 cfg->
Write(
_T(
"/max_matches"), (
int) XRCCTRL(*
this,
"spnMaxMatches",
wxSpinCtrl)->GetValue());
213 cfg->
Write(
_T(
"/fillup_chars"), XRCCTRL(*
this,
"txtFillupChars",
wxTextCtrl)->GetValue());
214 cfg->
Write(
_T(
"/cc_delay"), (
int) XRCCTRL(*
this,
"sldCCDelay",
wxSlider)->GetValue() * 100);
215 cfg->
Write(
_T(
"/lexer_keywords_set1"), (
bool) XRCCTRL(*
this,
"chkKL_1",
wxCheckBox)->GetValue());
216 cfg->
Write(
_T(
"/lexer_keywords_set2"), (
bool) XRCCTRL(*
this,
"chkKL_2",
wxCheckBox)->GetValue());
217 cfg->
Write(
_T(
"/lexer_keywords_set3"), (
bool) XRCCTRL(*
this,
"chkKL_3",
wxCheckBox)->GetValue());
218 cfg->
Write(
_T(
"/lexer_keywords_set4"), (
bool) XRCCTRL(*
this,
"chkKL_4",
wxCheckBox)->GetValue());
219 cfg->
Write(
_T(
"/lexer_keywords_set5"), (
bool) XRCCTRL(*
this,
"chkKL_5",
wxCheckBox)->GetValue());
220 cfg->
Write(
_T(
"/lexer_keywords_set6"), (
bool) XRCCTRL(*
this,
"chkKL_6",
wxCheckBox)->GetValue());
221 cfg->
Write(
_T(
"/lexer_keywords_set7"), (
bool) XRCCTRL(*
this,
"chkKL_7",
wxCheckBox)->GetValue());
222 cfg->
Write(
_T(
"/lexer_keywords_set8"), (
bool) XRCCTRL(*
this,
"chkKL_8",
wxCheckBox)->GetValue());
223 cfg->
Write(
_T(
"/lexer_keywords_set9"), (
bool) XRCCTRL(*
this,
"chkKL_9",
wxCheckBox)->GetValue());
226 cfg->
Write(
_T(
"/parser_follow_local_includes"), (
bool) XRCCTRL(*
this,
"chkLocals",
wxCheckBox)->GetValue());
227 cfg->
Write(
_T(
"/parser_follow_global_includes"), (
bool) XRCCTRL(*
this,
"chkGlobals",
wxCheckBox)->GetValue());
228 cfg->
Write(
_T(
"/want_preprocessor"), (
bool) XRCCTRL(*
this,
"chkPreprocessor",
wxCheckBox)->GetValue());
229 cfg->
Write(
_T(
"/parse_complex_macros"), (
bool) XRCCTRL(*
this,
"chkComplexMacros",
wxCheckBox)->GetValue());
230 cfg->
Write(
_T(
"/platform_check"), (
bool) XRCCTRL(*
this,
"chkPlatformCheck",
wxCheckBox)->GetValue());
232 cfg->
Write(
_T(
"/max_threads"), (
int) XRCCTRL(*
this,
"spnThreadsNum",
wxSpinCtrl)->GetValue());
233 cfg->
Write(
_T(
"/parser_per_workspace"), (
bool) XRCCTRL(*
this,
"rdoOneParserPerWorkspace",
wxRadioButton)->GetValue());
234 cfg->
Write(
_T(
"/max_parsers"), (
int) XRCCTRL(*
this,
"spnParsersNum",
wxSpinCtrl)->GetValue());
237 cfg->
Write(
_T(
"/header_ext"), XRCCTRL(*
this,
"txtCCFileExtHeader",
wxTextCtrl)->GetValue());
238 cfg->
Write(
_T(
"/empty_ext"), (
bool) XRCCTRL(*
this,
"chkCCFileExtEmpty",
wxCheckBox)->GetValue());
239 cfg->
Write(
_T(
"/source_ext"), XRCCTRL(*
this,
"txtCCFileExtSource",
wxTextCtrl)->GetValue());
241 #if !wxCHECK_VERSION(3, 0, 0) 243 cfg->
Write(
_T(
"/use_symbols_browser"), (
bool)!XRCCTRL(*
this,
"chkNoSB",
wxCheckBox)->GetValue());
244 cfg->
Write(
_T(
"/browser_show_inheritance"), (
bool) XRCCTRL(*
this,
"chkInheritance",
wxCheckBox)->GetValue());
245 cfg->
Write(
_T(
"/browser_expand_ns"), (
bool) XRCCTRL(*
this,
"chkExpandNS",
wxCheckBox)->GetValue());
246 cfg->
Write(
_T(
"/as_floating_window"), (
bool) XRCCTRL(*
this,
"chkFloatCB",
wxCheckBox)->GetValue());
247 cfg->
Write(
_T(
"/browser_tree_members"), (
bool) XRCCTRL(*
this,
"chkTreeMembers",
wxCheckBox)->GetValue());
248 #endif // wxCHECK_VERSION 251 cfg->
Write(
_T(
"/scope_filter"), (
bool) XRCCTRL(*
this,
"chkScopeFilter",
wxCheckBox)->GetValue());
252 cfg->
Write(
_T(
"/toolbar_scope_length"), (
int)XRCCTRL(*
this,
"spnChoiceScopeLength",
wxSpinCtrl)->GetValue());
253 cfg->
Write(
_T(
"/toolbar_function_length"), (
int)XRCCTRL(*
this,
"spnChoiceFunctionLength",
wxSpinCtrl)->GetValue());
256 cfg->
Write(
_T(
"/use_documentation_helper"), (
bool) XRCCTRL(*
this,
"chkDocumentation",
wxCheckBox)->GetValue());
257 cfg->
Write(
_T(
"/documentation_helper_background_color"), (
wxColour) XRCCTRL(*
this,
"btnDocBgColor",
wxButton)->GetBackgroundColour());
258 cfg->
Write(
_T(
"/documentation_helper_text_color"), (
wxColour) XRCCTRL(*
this,
"btnDocTextColor",
wxButton)->GetBackgroundColour());
259 cfg->
Write(
_T(
"/documentation_helper_link_color"), (
wxColour) XRCCTRL(*
this,
"btnDocLinkColor",
wxButton)->GetBackgroundColour());
291 wxColor colour = XRCCTRL(*
this,
"btnDocBgColor",
wxButton)->GetBackgroundColour();
293 colour = XRCCTRL(*
this,
"btnDocTextColor",
wxButton)->GetBackgroundColour();
295 colour = XRCCTRL(*
this,
"btnDocLinkColor",
wxButton)->GetBackgroundColour();
308 wxWindow* sender = FindWindowById(event.GetId());
309 data.
SetColour(sender->GetBackgroundColour());
316 sender->SetBackgroundColour(colour);
329 bool en = ccmcfg->
ReadBool(
_T(
"/code_completion"),
true);
330 bool aap = XRCCTRL(*
this,
"chkAutoAddParentheses",
wxCheckBox)->GetValue();
333 XRCCTRL(*
this,
"chkUseSmartSense",
wxCheckBox)->Enable(en);
334 XRCCTRL(*
this,
"chkWhileTyping",
wxCheckBox)->Enable(en);
335 XRCCTRL(*
this,
"chkAutoAddParentheses",
wxCheckBox)->Enable(en);
336 XRCCTRL(*
this,
"chkDetectImpl",
wxCheckBox)->Enable(en && aap);
337 XRCCTRL(*
this,
"chkAddDoxgenComment",
wxCheckBox)->Enable(en);
338 XRCCTRL(*
this,
"chkEnableHeaders",
wxCheckBox)->Enable(en);
339 XRCCTRL(*
this,
"chkNoSemantic",
wxCheckBox)->Enable(en);
340 XRCCTRL(*
this,
"lblMaxMatches",
wxStaticText)->Enable(en);
341 XRCCTRL(*
this,
"spnMaxMatches",
wxSpinCtrl)->Enable(en);
342 XRCCTRL(*
this,
"lblFillupChars",
wxStaticText)->Enable(en);
343 XRCCTRL(*
this,
"txtFillupChars",
wxTextCtrl)->Enable(en);
344 XRCCTRL(*
this,
"sldCCDelay",
wxSlider)->Enable(en);
347 XRCCTRL(*
this,
"chkKL_1",
wxCheckBox)->Enable(en);
348 XRCCTRL(*
this,
"chkKL_2",
wxCheckBox)->Enable(en);
349 XRCCTRL(*
this,
"chkKL_3",
wxCheckBox)->Enable(en);
350 XRCCTRL(*
this,
"chkKL_4",
wxCheckBox)->Enable(en);
351 XRCCTRL(*
this,
"chkKL_5",
wxCheckBox)->Enable(en);
352 XRCCTRL(*
this,
"chkKL_6",
wxCheckBox)->Enable(en);
353 XRCCTRL(*
this,
"chkKL_7",
wxCheckBox)->Enable(en);
354 XRCCTRL(*
this,
"chkKL_8",
wxCheckBox)->Enable(en);
355 XRCCTRL(*
this,
"chkKL_9",
wxCheckBox)->Enable(en);
358 XRCCTRL(*
this,
"chkLocals",
wxCheckBox)->Enable(en);
359 XRCCTRL(*
this,
"chkGlobals",
wxCheckBox)->Enable(en);
360 XRCCTRL(*
this,
"chkPreprocessor",
wxCheckBox)->Enable(en);
361 XRCCTRL(*
this,
"chkComplexMacros",
wxCheckBox)->Enable(en);
362 XRCCTRL(*
this,
"chkPlatformCheck",
wxCheckBox)->Enable(en);
364 en = XRCCTRL(*
this,
"rdoOneParserPerWorkspace",
wxRadioButton)->GetValue();
365 XRCCTRL(*
this,
"lblParsersNum",
wxStaticText)->Enable(!en);
366 XRCCTRL(*
this,
"spnParsersNum",
wxSpinCtrl)->Enable(!en);
370 en = ccmcfg->
ReadBool(
_T(
"/code_completion"),
true);
371 XRCCTRL(*
this,
"txtCCFileExtHeader",
wxTextCtrl)->Enable(en);
372 XRCCTRL(*
this,
"chkCCFileExtEmpty",
wxCheckBox)->Enable(en);
373 XRCCTRL(*
this,
"txtCCFileExtSource",
wxTextCtrl)->Enable(en);
376 #if !wxCHECK_VERSION(3, 0, 0) 377 en = !XRCCTRL(*
this,
"chkNoSB",
wxCheckBox)->GetValue();
378 XRCCTRL(*
this,
"chkInheritance",
wxCheckBox)->Enable(en);
379 XRCCTRL(*
this,
"chkExpandNS",
wxCheckBox)->Enable(en);
380 XRCCTRL(*
this,
"chkFloatCB",
wxCheckBox)->Enable(en);
381 XRCCTRL(*
this,
"chkTreeMembers",
wxCheckBox)->Enable(en);
382 #endif // !wxCHECK_VERSION 389 en = XRCCTRL(*
this,
"chkDocumentation",
wxCheckBox)->GetValue();
390 XRCCTRL(*
this,
"btnDocBgColor",
wxButton)->Enable(en);
391 XRCCTRL(*
this,
"btnDocTextColor",
wxButton)->Enable(en);
392 XRCCTRL(*
this,
"btnDocLinkColor",
wxButton)->Enable(en);
397 int position = XRCCTRL(*
this,
"sldCCDelay",
wxSlider)->GetValue();
400 lbl.
Printf(
_(
"%d.%d sec"), position / 10, position % 10);
402 lbl.
Printf(
_(
"%d ms"), position * 100);
403 XRCCTRL(*
this,
"lblDelay",
wxStaticText)->SetLabel(lbl);
415 if (
cbMessageBox(
_(
"This setup will replace the token with an empty string.\n" 416 "This will *remove* the token and probably break CC for some cases.\n" 417 "Do you really want to *remove* that token?"),
426 cbMessageBox(
_(
"Replacement token cannot contain search token.\n" 427 "This would cause an infinite loop otherwise."),
432 wxRegEx re(
_T(
"[A-Za-z_]+[0-9]*[A-Za-z_]*"));
435 cbMessageBox(
_(
"Search token can only contain alphanumeric characters and underscores."),
442 if (
cbMessageBox(
_(
"You are replacing a token with a string that contains\n" 443 "characters other than alphanumeric and underscores.\n" 444 "This could make parsing the file impossible.\n" virtual BrowserOptions & ClassBrowserOptions()
bool whileTyping
use real AI(scope sequence match) or not(plain text match)
virtual void WriteOptions()
write Parse options to configure file
bool useSmartSense
handle preprocessor directive in Tokenizer class
void OnUpdateUI(wxUpdateUIEvent &event)
ConfigManager * GetConfigManager(const wxString &name_space) const
int ReadInt(const wxString &name, int defaultVal=0)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
virtual void OnApply()
Called when the user chooses to apply the configuration.
bool ReadBool(const wxString &name, bool defaultVal=false)
bool storeDocumentation
this will check for the platform of the project/target when adding include folders to the parser ...
DocumentationHelper * m_Documentation
bool showInheritance
whether the base class or derive class information is shown as a child node default: false ...
bool Matches(const wxString &text, int flags=0) const
void SetEnabled(bool enabled)
void UpdateCCDelayLabel()
virtual ParserOptions & Options()
NativeParser * m_NativeParser
wxPanel * LoadPanel(wxWindow *parent, const wxString &name)
Code completion plugin has those features: show tool-tip when the mouse hover over the variables/func...
bool expandNS
whether a namespaces node is auto-expand auto-expand means the child of the namespace is automaticall...
bool Contains(const wxString &str) const
void Write(const wxString &name, const wxString &value, bool ignoreEmpty=false)
void RereadOptions(ConfigManager *cfg)
wxColour GetColour(const wxString &id) const
void OnChooseColour(wxCommandEvent &event)
wxString Read(const wxString &key, const wxString &defaultVal=wxEmptyString)
bool wantPreprocessor
case sensitive in MarkItemsByAI
virtual void SetValue(const wxString &text)
const wxString & _(const wxString &string)
wxString & Trim(bool fromRight=true)
int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
Call global cbMessageBox with m_parentDialog as parent window when no parent window specified...
bool followGlobalIncludes
parse XXX.h in directive #include "XXX.h"
void RereadParserOptions()
when user changes the CC option, we should re-read the option
NativeParser class is just like a manager class to control Parser objects.
ColourManager * GetColourManager() const
DLLIMPORT void PlaceWindow(wxTopLevelWindow *w, cbPlaceDialogMode mode=pdlBest, bool enforce=false)
bool treeMembers
show members in the bottom tree.
CodeCompletion * m_CodeCompletion
bool parseComplexMacros
reparse the active editor while editing
void SetColour(const wxString &id, const wxColour &colour)
static wxXmlResource * Get()
bool ValidateReplacementToken(wxString &from, wxString &to)
void RereadOptions()
read CC's options, mostly happens the user change some setting and press APPLY
virtual bool GetValue() const
wxColourData & GetColourData()
virtual void ReadOptions()
read Parser options from configure file
int Printf(const wxString &pszFormat,...)
void WriteOptions(ConfigManager *cfg)
void SetColour(const wxColour &colour)
virtual void SetValue(bool state)