【问题标题】:Indentation and smart indent in wxStyledTextCtrl (Scintilla)wxStyledTextCtrl (Scintilla) 中的缩进和智能缩进
【发布时间】:2016-11-30 08:30:43
【问题描述】:

有谁知道如何在 C++ 中使用 wxStyledTextCtrl 获得智能缩进?

我一直在尝试以下各种变体,但没有明显成功:

_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");

注意:Indentation and smart indent in ScintillaNET 涵盖了 .NET 的这个问题。

【问题讨论】:

  • stc 样本对您有用吗?你的 wx 版本和操作系统/工具包是什么?

标签: c++ wxwidgets scintilla wxstyledtextctrl


【解决方案1】:

SetProperty 方法用于为词法分析器添加其他设置。它通常用于与代码折叠相关的设置。它不用于设置控件本身的属性。要设置 wxStyledTextCtrl 的属性,您可能需要使用 standard methods。例如,我猜测以下几行:

_textEd->SetProperty(wxT("indentation.indentwidth"), wxT("4"));
_textEd->SetProperty(wxT("indentation.tabwidth"), wxT("4"));

可能是这样的:

_textEd->SetIndent(4);
_textEd->SetTabWidth(4);

对于 '_textEd->SetProperty(wxT("indentation.smartindenttype"), wxT("indentation:simple"));',我不知道 smartindenttype 是什么。这可能是添加到 scintilla.net 的扩展吗?如果您可以描述该设置在 .net 中的作用,我或许可以帮助通过其他方法调用完成同样的事情。

同样,我不认为 '_textEd->SetProperty("spell.mistake.indicator", "style:squigglelow");' 行与 wxStyledTextCtrl 有任何类似之处。包含的词法分析器都没有拼写检查器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-07
    • 2010-11-22
    • 2021-07-11
    • 2013-08-21
    • 2019-11-12
    • 2011-12-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多