Reputation: 1353
Does anyone know how to get smart indentation working with the wxStyledTextCtrl in C++?
I have been trying various variations on the following without apparent success:
_textEd->SetProperty(wxT("indentation.smartindenttype"), wxT("indentation:simple"));
_textEd->SetProperty(wxT("indentation.indentwidth"), wxT("4"));
_textEd->SetProperty(wxT("indentation.tabwidth"), wxT("4"));
_textEd->SetProperty("spell.mistake.indicator", "style:squigglelow");
Note: Indentation and smart indent in ScintillaNET covers this issue for .NET.
Upvotes: 0
Views: 306
Reputation: 3554
The SetProperty method is used to add additional settings for a lexer. It's usually used for settings related to code folding. It's not used to set properties for the control itself. For setting properties of the wxStyledTextCtrl, you probably want to use the standard methods. For example, I guess the lines:
_textEd->SetProperty(wxT("indentation.indentwidth"), wxT("4"));
_textEd->SetProperty(wxT("indentation.tabwidth"), wxT("4"));
would probably be something like:
_textEd->SetIndent(4);
_textEd->SetTabWidth(4);
For '_textEd->SetProperty(wxT("indentation.smartindenttype"), wxT("indentation:simple"));', I have no clue what smartindenttype is. Is that maybe an extension that was added to scintilla.net? If you can describe what that setting does in .net, I might be able to help accomplish the same thing with other method calls.
Similarly, I don't think the line '_textEd->SetProperty("spell.mistake.indicator", "style:squigglelow");' has any analogue with wxStyledTextCtrl. None of the included lexers have a spell checker.
Upvotes: 2