gpt4 book ai didi

c++ - wxStyledTextCtrl (Scintilla) 中的缩进和智能缩进

转载 作者:行者123 更新时间:2023-11-28 01:56:51 27 4
gpt4 key购买 nike

有人知道如何使用 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 的这个问题。

最佳答案

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 有任何相似之处。所包含的词法分析器都没有拼写检查器。

关于c++ - wxStyledTextCtrl (Scintilla) 中的缩进和智能缩进,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40883561/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com